Esempio n. 1
0
 public cConstHandler(cConstraints cConsts, IPortfolioBL cPort)
 {
     m_objPortfolio    = cPort;
     m_colConstraints  = cConsts;
     m_objErrorHandler = m_objPortfolio.cErrorLog;
     m_objColHandler   = m_objPortfolio.ColHandler;
     repository        = Resolver.Resolve <IRepository>();
     setSeperatedConstraintCols();
 }//constructor
Esempio n. 2
0
        }//Double_setCollectionOfRangeConsts

        private void Double_addRangeConstsFromCollection(cConstraints cConstCol, ISecurities cSecsCol)
        {                                                         // Adds the format of constraints from collection to final variables
            for (int iConst = 0; iConst < cConstCol.Count; iConst++)
            {                                                     // Inserts equality constraint
                if (cConstCol[iConst].Maximum != double.MaxValue) // Maximal value
                {
                    Double_addSingleInequalityConstraint(cConstCol[iConst], false, true, cSecsCol);
                }
                if (cConstCol[iConst].Minimum != double.MinValue) // Minimal value
                {
                    Double_addSingleInequalityConstraint(cConstCol[iConst], true, false, cSecsCol);
                }
            } //of main for
        }     //Double_addRangeConstsFromCollection
Esempio n. 3
0
        }//Double_setCollectionOfEqualityConsts

        private void Double_addEqualityConstsFromCollection(cConstraints cConstCol, ISecurities cSecsCol, Boolean isEmpty)
        { // Adds the format of constraints from collection to final variables
            List <List <double> > colEqualitySecs = isEmpty ? m_emptyDoubleEqualitySecs : m_doubleEqualitySecs;
            List <double>         colEqualityVals = isEmpty ? m_emptyDoubleEqualityVals : m_doubleEqualityVals;

            for (int iConst = 0; iConst < cConstCol.Count; iConst++)
            {                                                                                      // Inserts equality constraint
                List <double> row = getDoubleOfConstraintSecs(cConstCol[iConst], false, cSecsCol); //c1

                if (row != null)
                {
                    colEqualitySecs.Add(row);
                }
                else
                {
                    continue;                                    // Skips constraint (in event failed to find corresponding securities
                }
                colEqualityVals.Add(cConstCol[iConst].Equality); //b1
            }
        }//Double_addEqualityConstsFromCollection