Go to the documentation of this file.
515 bool setRandom(
double density,
bool conformant,
int iMin,
int iMax);
592 bool setRandom(
double density,
bool conformant,
int iMin,
int iMax);
649 bool setRandom(
double density,
bool conformant,
int iMin,
int iMax);
707 bool setRandom(
double density,
bool conformant,
int iMin,
int iMax);
773 bool setRandom(
double density,
bool conformant,
int iMin,
int iMax);
846 bool setRandom(
double density,
bool conformant,
int iMin,
int iMax);
937 bool setRandom(
double density,
bool conformant,
int iMin,
int iMax);
1029 bool setRandom(
double density,
bool conformant,
int iMin,
int iMax);
1109 bool setRandom(
double density,
bool conformant,
int iMin,
int iMax);
1167 bool setRandom(
double density,
bool conformant,
int iMin,
int iMax);
1228 bool setRandom(
double density,
bool conformant,
int iMin,
int iMax);
1310 bool setRandom(
double density,
bool conformant,
int iMin,
int iMax);
1386 bool setRandom(
double density,
bool conformant,
int iMin,
int iMax);
1452 bool setRandom(
double density,
bool conformant,
int iMin,
int iMax);
1517 bool setRandom(
double density,
bool conformant,
int iMin,
int iMax);
1564 bool setRandom(
double density,
bool conformant,
int iMin,
int iMax);
1918 bool setRandom(
double density,
bool conformant,
int iMin,
int iMax);
2310 std::string m_sInstanceName;
2314 std::string m_sInstanceSource;
2318 std::string m_sInstanceDescription;
2322 std::string m_sInstanceCreator;
2326 std::string m_sInstanceLicence;
2333 bool m_bProcessVariables;
2338 int m_iVariableNumber;
2343 int m_iNumberOfIntegerVariables;
2348 int m_iNumberOfBinaryVariables;
2353 int m_iNumberOfSemiContinuousVariables;
2358 int m_iNumberOfSemiIntegerVariables;
2363 int m_iNumberOfStringVariables;
2368 std::string* m_msVariableNames;
2374 char* m_mcVariableTypes;
2379 double* m_mdVariableLowerBounds;
2384 double* m_mdVariableUpperBounds;
2391 bool m_bProcessObjectives;
2396 int m_iObjectiveNumber;
2401 int m_iObjectiveNumberNonlinear;
2406 std::string* m_msObjectiveNames;
2411 std::string* m_msMaxOrMins;
2416 int* m_miNumberOfObjCoef;
2421 double* m_mdObjectiveConstants;
2426 double* m_mdObjectiveWeights;
2437 bool m_bGetDenseObjectives;
2443 double** m_mmdDenseObjectiveCoefficients;
2450 bool m_bProcessConstraints;
2455 int m_iConstraintNumber;
2460 int m_iConstraintNumberNonlinear;
2465 std::string* m_msConstraintNames;
2470 double* m_mdConstraintLowerBounds;
2475 double* m_mdConstraintUpperBounds;
2481 double* m_mdConstraintConstants;
2487 char* m_mcConstraintTypes;
2495 bool m_bProcessLinearConstraintCoefficients;
2501 int m_iLinearConstraintCoefficientNumber;
2507 bool m_bColumnMajor;
2514 SparseMatrix* m_linearConstraintCoefficientsInColumnMajor;
2521 SparseMatrix* m_linearConstraintCoefficientsInRowMajor;
2528 int m_iNumberOfQuadraticRowIndexes;
2533 bool m_bQuadraticRowIndexesProcessed;
2538 int *m_miQuadRowIndexes;
2543 bool m_bProcessQuadraticTerms;
2549 int m_iQuadraticTermNumber;
2559 bool m_bQTermsAdded;
2567 int m_iNumberOfNonlinearExpressionTreeIndexes;
2573 bool m_bNonlinearExpressionTreeIndexesProcessed;
2580 int *m_miNonlinearExpressionTreeIndexes;
2587 int m_iNumberOfNonlinearExpressionTreeModIndexes;
2593 bool m_bNonlinearExpressionTreeModIndexesProcessed;
2599 int *m_miNonlinearExpressionTreeModIndexes;
2606 bool m_binitForAlgDiff;
2612 unsigned int m_iNumberOfNonlinearVariables;
2617 bool m_bProcessNonlinearExpressions;
2622 int m_iNonlinearExpressionNumber;
2628 int* m_miNonlinearExpressionIndexes;
2633 bool m_bProcessExpressionTrees;
2638 bool m_bProcessExpressionTreesMod;
2644 double *m_mdConstraintFunctionValues;
2650 double *m_mdObjectiveFunctionValues;
2655 int m_iJacValueSize;
2670 double *m_mdJacValue;
2676 int *m_miJacNumConTerms;
2687 int m_iHighestTaylorCoeffOrder;
2697 std::map<int, ScalarExpressionTree*> m_mapExpressionTrees;
2703 std::map<int, int> m_mapOSADFunRangeIndex;
2713 std::map<int, MatrixExpressionTree*> m_mapMatrixExpressionTrees;
2724 bool m_bLagrangianExpTreeCreated;
2735 bool m_bLagrangianSparseHessianCreated;
2740 std::map<int, int> m_mapAllNonlinearVariablesIndex;
2746 int *m_miNonLinearVarsReverseMap;
2752 bool m_bAllNonlinearVariablesIndex;
2761 std::map<int, ScalarExpressionTree*> m_mapExpressionTreesMod ;
2768 bool m_bOSADFunIsCreated;
2774 bool m_bCppADTapesBuilt;
2780 bool m_bCppADMustReTape;
2785 bool m_bDuplicateExpressionTreesMap;
2790 bool m_bNonLinearStructuresInitialized;
2795 bool m_bSparseJacobianCalculated;
2802 std::map<int, std::vector<OSnLNode*> > m_mapExpressionTreesInPostfix ;
2808 int m_iHighestOrderEvaluated;
2814 double **m_mmdObjGradient;
2821 std::vector<double> m_vdX;
2826 std::vector<double> m_vdYval;
2832 std::vector<bool> m_vbLagHessNonz;
2837 std::vector<double> m_vdYjacval;
2842 std::vector<double> m_vdw;
2847 std::vector<double> m_vdLambda;
2852 std::vector<double> m_vdDomainUnitVec;
2857 std::vector<double> m_vdRangeUnitVec;
2864 bool m_bProcessMatrices;
2869 int m_iMatrixNumber;
2886 int* m_miMatrixNumberOfColumns;
2891 int* m_miMatrixNumberOfRows;
2896 std::string* m_msMatrixNames;
2956 int m_iMatrixVarNumber;
2961 int m_iMatrixObjNumber;
2966 int m_iMatrixConNumber;
2971 int m_iMatrixExpressionNumber;
2978 bool m_bProcessTimeDomain;
2983 bool m_bProcessTimeStages;
2988 bool m_bProcessTimeInterval;
2993 bool m_bFiniteTimeStages;
2998 int m_iNumberOfTimeStages;
3003 std::string m_sTimeDomainFormat;
3008 std::string* m_msTimeDomainStageNames;
3016 int* m_miTimeDomainStageVariableNumber;
3021 int** m_mmiTimeDomainStageVarList;
3026 int* m_miTimeDomainStageConstraintNumber;
3031 int** m_mmiTimeDomainStageConList;
3036 int* m_miTimeDomainStageObjectiveNumber;
3041 int** m_mmiTimeDomainStageObjList;
3050 bool processVariables();
3058 bool processObjectives();
3066 bool processConstraints();
3074 bool processLinearConstraintCoefficients();
3082 bool processMatrices();
3947 bool addVariable(
int index, std::string name,
double lowerBound,
double upperBound,
char type);
3968 bool setVariables(
int number, std::string* names,
double* lowerBounds,
3969 double* upperBounds,
char* types);
3997 bool addObjective(
int index, std::string name, std::string maxOrMin,
double constant,
double weight,
SparseVector* objectiveCoefficients);
4014 bool setObjectives(
int number, std::string *names, std::string *maxOrMins,
double *constants,
double *weights,
SparseVector **objectitiveCoefficients);
4037 bool addConstraint(
int index, std::string name,
double lowerBound,
double upperBound,
double constant);
4052 bool setConstraints(
int number, std::string* names,
double* lowerBounds,
double* upperBounds,
double* constants);
4073 double* values,
int valuesBegin,
int valuesEnd,
4074 int* indexes,
int indexesBegin,
int indexesEnd,
4075 int* starts,
int startsBegin,
int startsEnd);
4096 double* values,
int valuesBegin,
int valuesEnd,
4097 int* indexes,
int indexesBegin,
int indexesEnd,
4098 int* starts,
int startsBegin,
int startsEnd);
4127 int* rowIndexes,
int* varOneIndexes,
int* varTwoIndexes,
4128 double* coefficients,
int begin,
int end);
4145 int* rowIndexes,
int* varOneIndexes,
int* varTwoIndexes,
double* coefficients);
4188 bool addMatrix(
int index, std::string name,
int numberOfRows,
int numberOfColumns,
4190 unsigned int inumberOfChildren,
MatrixNode **m_mChildren);
4228 std::string name,
int numberOfOtherIndexes = 0,
int* otherIndexes = NULL);
4257 std::string name,
int numberOfComponents,
int* components,
4258 int numberOfOtherIndexes = 0,
int* otherIndexes = NULL);
4287 std::string name,
int referenceIdx,
int numberOfOtherIndexes = 0,
int* otherIndexes = NULL);
4315 std::string name, std::string semidefiniteness,
int numberOfOtherIndexes = 0,
int* otherIndexes = NULL);
4344 std::string name,
int distortionMatrixIdx,
double normFactor,
int axisDirection,
4345 int numberOfOtherIndexes = 0,
int* otherIndexes = NULL);
4375 std::string name,
int distortionMatrixIdx,
double normFactor,
int firstAxisDirection,
4376 int secondAxisDirection,
int numberOfOtherIndexes = 0,
int* otherIndexes = NULL);
4405 std::string name,
int distortionMatrixIdx,
double normFactor,
int axisDirection,
double pNorm,
4406 int numberOfOtherIndexes = 0,
int* otherIndexes = NULL);
4439 std::string name,
int maxDegree,
int numberOfUB,
double* ub,
int numberOfLB,
double* lb,
4440 int numberOfOtherIndexes = 0,
int* otherIndexes = NULL);
4502 bool new_x,
int highestOrder);
4535 bool new_x,
int highestOrder);
4568 double *conLambda,
bool new_x,
int highestOrder);
4587 int idx,
bool new_x,
int highestOrder);
4619 bool new_x,
int highestOrder);
4637 int objIdx,
bool new_x,
int highestOrder);
4672 bool new_x,
int highestOrder);
4752 CppAD::ADFun<double> *Fad;
4777 std::vector<double>
forwardAD(
int p, std::vector<double> vdX);
4789 std::vector<double>
reverseAD(
int p, std::vector<double> vdlambda);
4825 bool new_x,
int highestOrder);
bool IsEqual(Nl *that)
A function to check for the equality of two objects.
TimeDomainStage()
The TimeDomainStage class constructor.
MatrixExpressionTree * getMatrixExpressionTree(int rowIdx)
Get the matrix expression tree for a given row index.
The in-memory representation of the <instanceData> element.
ENUM_NL_EXPR_SHAPE shape
shape holds the shape of the nonlinear expression (linear/quadratic/convex/general) (see further up i...
int numberOfVariables
numberOfVariables gives the number of variables contained in this stage
int getNumberOfElementConstructors(int n)
The in-memory representation of a rotated quadratic cone.
The CopositiveMatricesCone Class.
bool IsEqual(Variable *that)
A function to check for the equality of two objects.
virtual std::string getConeInXML()
Write a NonnegativeCone object in XML format.
QuadraticCoefficients()
The QuadraticCoefficients class constructor.
bool deepCopyFrom(NonnegativeCone *that)
A function to make a deep copy of an instance of this class.
~MatrixVar()
The MatrixVar class destructor.
int * getNonlinearExpressionTreeModIndexes()
Get all the nonlinear expression tree indexes, i.e., indexes of rows (objectives or constraints) that...
QuadraticTerm ** qTerm
qTerm is a pointer to an array of QuadraticTerm object pointers
void duplicateExpressionTreesMap()
duplicate the map of expression trees.
~IntersectionCone()
The IntersectionCone class destructor.
bool IsEqual(ProductCone *that)
A function to check for the equality of two objects.
a data structure for holding quadratic terms
~Cones()
The Cones class destructor.
virtual std::string getConeName()
int lbConeIdx
lbConeIdx gives a cone that must contain matrixVar - lbMatrix
int numberOfMatrices
numberOfMatrices is the number of <nl> elements in the <matrices> element.
int getLinearConstraintCoefficientNumber()
Get number of specified (usually nonzero) linear constraint coefficient values.
The in-memory representation of the <matrixConstraints> element.
int idx
idx holds the row index of the nonlinear expression
int idx
cones are referenced by an (automatically created) index
int constantMatrixIdx
constantMatrixIdx gives a constant added to the matrixObj
bool matrixHasBlocks(int n)
OrthantCone()
default constructor.
~TimeDomainStageVar()
The TimeDomainStageVar class destructor.
std::vector< ExprNode * > getNonlinearExpressionTreeModInPostfix(int rowIdx)
Get the postfix tokens for a given row index for the modified Expression Tree (quadratic terms added)...
std::string name
an optional name to this matrixVar
~MatrixCon()
The MatrixCon class destructor.
bool setTimeDomainStageVariablesOrdered(int numberOfStages, int *numberOfVariables, int *startIdx)
This sets the variables associated with each time domain stage in temporal order.
MatrixObj()
The MatrixVar class constructor.
bool bVariablesModified
bVariablesModified is true if the variables data has been modified.
bool bObjectivesModified
bObjectivesModified is true if the objective function data has been modified.
int idx
idx gives the index of this variable
Variables * variables
variables is a pointer to a Variables object
std::string getInstanceDescription()
Get instance description.
~DualCone()
The DualCone class destructor.
MatrixObj ** matrixObj
matrixObj is an array of pointers to the <matrixObj> children
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
bool initForAlgDiff()
This should be called by nonlinear solvers using callback functions.
The in-memory representation of a quadratic cone.
int numberOfOtherIndexes
Multidimensional tensors can also form cones (the Kronecker product, for instance,...
SparseHessianMatrix * getLagrangianHessianSparsityPattern()
std::vector< ExprNode * > getMatrixExpressionTreeInPostfix(int rowIdx)
Get the postfix tokens for a given row index.
int numberOfVariables
numberOfVariables is the number of variables in the instance
The in-memory representation of the <matrixVariables> element.
bool IsEqual(Constraints *that)
A function to check for the equality of two objects.
ScalarExpressionTree * getLagrangianExpTree()
ScalarExpressionTree * getNonlinearExpressionTree(int rowIdx)
Get the expression tree for a given row index.
bool setTimeDomainStageObjectivesOrdered(int numberOfStages, int *numberOfObjectives, int *startIdx)
This sets the objectives associated with each time domain stage in temporal order.
bool IsEqual(OSInstance *that)
A function to check for the equality of two objects.
OSInstance()
The OSInstance class constructor.
bool deepCopyFrom(PolyhedralCone *that)
A function to make a deep copy of an instance of this class.
char * getConstraintTypes()
Get constraint types.
int getNumberOfMatrixExpressions()
Get the number of matrix-valued expressions.
The in-memory representation of the objective function <coef> element.
ENUM_MATRIX_SYMMETRY getMatrixSymmetry(int n)
Get the matrix symmetry.
bool deepCopyFrom(CopositiveMatricesCone *that)
A function to make a deep copy of an instance of this class.
ENUM_MATRIX_TYPE
An enum to track the many different types of values that a matrix can contain Note that these types a...
The in-memory representation of the <con> element.
double coef
coef is the coefficient of the quadratic term
int idx
idx gives the index of this constraint
ENUM_MATRIX_TYPE getMatrixType(int n)
Get the matrix type.
bool getLinearConstraintCoefficientMajor()
Get whether the constraint coefficients is in column major (true) or row major (false).
int getNumberOfValuesForMatrix(int n)
Get the number of (nonzero) values in the matrix.
int idx
cones are referenced by an (automatically created) index
std::map< int, MatrixExpressionTree * > getAllMatrixExpressionTrees()
The in-memory representation of an intersection cone.
virtual std::string getConeName()
virtual std::string getConeInXML()
Write a QuadraticCone object in XML format.
int numberOfColumns
numberOfColumns gives the number of columns of this matrix
bool setTimeDomainStages(int number, std::string *names)
This sets the number (and optionally names) of the time stages.
TimeDomainStageVar ** var
var is a pointer to an array of TimeDomainStageVar object pointers
The in-memory representation of the <stage> element.
bool IsEqual(PolarCone *that)
A function to check for the equality of two objects.
~Matrices()
The Matrices class destructor.
~Objectives()
The Objectives class destructor.
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
int referenceMatrixIdx
Polyhedral cones use a reference to a previously defined matrix for the extreme rays.
double lb
lb corresponds to the optional attribute that holds the variable lower bound.
int numberOfColumns
numberOfColumns gives the number of columns of this matrix
~MatrixExpression()
The MatrixExpression class destructor.
CompletelyPositiveMatricesCone()
default constructor.
std::string name
an optional name to this matrixObj
The in-memory representation of the <timeDomain> element.
TimeDomain * timeDomain
timeDomain is a pointer to a TimeDomain object
bool IsEqual(QuadraticCone *that)
A function to check for the equality of two objects.
bool matrixHasTransformations(int n)
int getVariableNumber()
Get number of variables.
TimeDomainStages()
The Stages class constructor.
MatrixExpressionTree * matrixExpressionTree
matrixExpressionTree contains the root of the MatrixExpressionTree
std::vector< ExprNode * > getNonlinearExpressionTreeInPostfix(int rowIdx)
Get the postfix tokens for a given row index.
double getTimeDomainIntervalHorizon()
Get the horizon for the time domain interval.
virtual std::string getConeInXML()
Write a SemidefiniteCone object in XML format.
virtual std::string getConeInXML()
Write a CopositiveMatricesCone object in XML format.
int numberOfOtherIndexes
Multidimensional tensors can also form cones (the Kronecker product, for instance,...
The in-memory representation of an OSiL instance..
The in-memory representation of the <variables> child of the <stage> element.
MatrixExpression ** getMatrixExpressions()
Get the pointers to the roots of all matrix expression trees.
MatrixCon ** matrixCon
matrixCon is an array of pointers to the <matrixCon> children
Variables()
The Variables class constructor.
a sparse matrix data structure for matrices that can hold nonconstant values and have block structure...
double ** getDenseObjectiveCoefficients()
getDenseObjectiveCoefficients.
MatrixVar ** matrixVar
matrixVar is an array of pointers to the <matrixVar> children
IntVector * start
a pointer to the start of each row or column stored in sparse format
TimeDomainStageObjectives()
The TimeDomainStageObjectives class constructor.
The in-memory representation of the <constraints> element.
double * ub
For each dimension of the cone, give the upper and lower bounds The upper bound can be only zero or +...
The in-memory representation of the <matrices> element.
~QuadraticCoefficients()
The QuadraticCoefficients class destructor.
int ** getTimeDomainStageConList()
Get the list of constraints in each stage.
double calculateFunctionValue(int idx, double *x, bool new_x)
Calculate the function value for function (constraint or objective) indexed by idx.
int templateMatrixIdx
templateMatrixIdx refers to a matrix that describes the locations in this matrixVar that are allowed ...
std::vector< ExprNode * > getMatrixExpressionTreeInPrefix(int rowIdx)
Get the prefix tokens for a given row index.
int idx
cones are referenced by an (automatically created) index
bool getSparseJacobianFromColumnMajor()
int numberOfColumns
numberOfColumns gives the number of columns of this matrix
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
MatrixVariables * matrixVariables
a pointer to the matrixVariables object
std::string * getObjectiveMaxOrMins()
Get objective maxOrMins.
SparseHessianMatrix * calculateHessian(double *x, int idx, bool new_x)
Calculate the Hessian of a constraint or objective function.
char * getVariableTypes()
Get variable initial values.
The NonnegativeCone Class.
MatrixVariables()
The MatrixVariables class constructor.
std::string name
The cone can have a name for easier identification.
int idx
idx is the index of the row in which the quadratic term appears
bool createOSADFun(std::vector< double > vdX)
Create the a CppAD Function object: this is a function where the domain is the set of variables for t...
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
MatrixProgramming()
The MatrixProgramming class constructor.
int conReferenceMatrixIdx
conReferenceMatrixIdx allows some or all of the components of this matrixCon to be copied from constr...
bool addVariable(int index, std::string name, double lowerBound, double upperBound, char type)
add a variable.
bool deepCopyFrom(QuadraticCone *that)
A function to make a deep copy of an instance of this class.
int getNumberOfSemiIntegerVariables()
getNumberOfSemiIntegerVariables
The in-memory representation of the <matrixProgramming> element.
virtual std::string getConeName()
std::map< int, ScalarExpressionTree * > getAllNonlinearExpressionTrees()
SparseJacobianMatrix * calculateAllConstraintFunctionGradients(double *x, double *objLambda, double *conLambda, bool new_x, int highestOrder)
Calculate the gradient of all constraint functions.
int numberOfOtherIndexes
Multidimensional tensors can also form cones (the Kronecker product, for instance,...
int coneType
The type of the cone (one of the values in ENUM_CONE_TYPE)
Cones * cones
cones is a pointer to a Cones object
bool addQTermsToExpressionTree()
This method adds quadratic terms into the array of expression trees.
bool IsEqual(MatrixProgramming *that)
A function to check for the equality of two objects.
int startIdx
startdIdx gives the number of the first objective contained in this stage
a sparse matrix data structure
bool deepCopyFrom(Cones *that)
A function to make a deep copy of an instance of this class.
bool IsEqual(NonpositiveCone *that)
A function to check for the equality of two objects.
~TimeDomainStageConstraints()
The TimeDomainStageConstraints class destructor.
double start
start is the start of the planning period in the <interval> element.
int * getTimeDomainStageNumberOfVariables()
Get the number of variables contained in each time stage.
bool copyLinearConstraintCoefficients(int numberOfValues, bool isColumnMajor, double *values, int valuesBegin, int valuesEnd, int *indexes, int indexesBegin, int indexesEnd, int *starts, int startsBegin, int startsEnd)
copy linear constraint coefficients: perform a deep copy of the sparse matrix
bool setTimeDomain(std::string format)
This sets the format of the time domain ("stages"/"interval"/"none")
int lbMatrixIdx
lbMatrixIdx gives a lower bound for this matrixVar
~Constraints()
The Constraints class destructor.
std::string getNonlinearExpressionTreeInInfix(int rowIdx)
Get the infix representation for a given row (or objective function) index.
~MatrixConstraints()
The MatrixConstraints class destructor.
~MatrixExpressions()
The MatrixExpressions class destructor.
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
int getNumberOfSemiContinuousVariables()
getNumberOfSemiContinuousVariables
The CompletelyPositiveMatricesCone Class.
IntVector * rowIdx
a pointer of row indices if the problem is stored by column
SparseMatrix * getLinearConstraintCoefficientsInColumnMajor()
Get linear constraint coefficients in column major.
bool IsEqual(CompletelyPositiveMatricesCone *that)
A function to check for the equality of two objects.
bool deepCopyFrom(MatrixProgramming *that)
A function to make a deep copy of an instance of this class.
int startIdx
startdIdx gives the number of the first constraint contained in this stage
ScalarExpressionTree * getNonlinearExpressionTreeMod(int rowIdx)
Get the expression tree for a given row index for the modified expression trees (quadratic terms adde...
double horizon
horizon is the end of the planning period in the <interval> element.
QuadraticTerm()
The QuadraticTerm class constructor.
GeneralSparseMatrix * getMatrixCoefficientsInColumnMajor(int n)
Get the (nonzero) elements of the matrix in column major form.
TimeDomainStageObj()
The TimeDomainStageObj class constructor.
double ub
ub is the upper bound on the constraint
int idx
cones are referenced by an (automatically created) index
QuadraticTerms * getQuadraticTerms()
Get all the quadratic terms in the instance.
virtual std::string getConeInXML()
Write a CompletelyPositiveMatricesCone object in XML format.
Objective ** obj
coef is pointer to an array of ObjCoef object pointers
a double vector data structure
int getNumberOfNonlinearConstraints()
The OSnLMNode Class for nonlinear expressions involving matrices.
int ubConeIdx
ubConeIdx gives a cone that must contain ubMatrix - matrixCon
bool IsEqual(IntersectionCone *that)
A function to check for the equality of two objects.
int * getTimeDomainStageNumberOfConstraints()
Get the number of constraints contained in each time stage.
MatrixVar()
The MatrixVar class constructor.
~MatrixProgramming()
The MatrixProgramming class destructor.
double constant
constant is the constant term added to the objective function, 0 by default
int numberOfRows
Every cone has (at least) two dimensions; no distinction is made between vector cones and matrix cone...
bool setInstanceName(std::string name)
set the instance name.
TimeDomainStageConstraints * constraints
constraints is a pointer to a TimeDomainConstraints object
int startIdx
startdIdx gives the number of the first variable contained in this stage
int numberOfOtherIndexes
Multidimensional tensors can also form cones (the Kronecker product, for instance,...
virtual std::string getConeName()
int idx
idx gives the index of this variable
int orderConeIdx
orderConeIdx gives a cone that expresses preferences during the optimization x is (weakly) preferred ...
bool IsEqual(Objective *that)
A function to check for the equality of two objects.
~OrthantCone()
default destructor.
double * getConstraintConstants()
Get constraint constants.
bool deepCopyFrom(DualCone *that)
A function to make a deep copy of an instance of this class.
double ub
ub corresponds to the optional attribute that holds the variable upper bound.
int numberOfOtherIndexes
Multidimensional tensors can also form cones (the Kronecker product, for instance,...
The in-memory representation of the variables element.
MatrixCon()
The MatrixCon class constructor.
bool setNumberOfQuadraticTerms(int nq)
set the number of quadratic terms
bool m_bDeleteExpressionTree
if m_bDeleteExpressionTree is true during garbage collection, we should delete the osExpression tree ...
int getNumberOfNonlinearExpressions()
Get number of nonlinear expressions.
int * getTimeDomainStageNumberOfObjectives()
Get the number of objectives contained in each time stage.
~MatrixObj()
The MatrixVar class destructor.
int idx
cones are referenced by an (automatically created) index
int referenceConeIdx
Dual cones use a reference to another, previously defined cone.
bool deepCopyFrom(PolarCone *that)
A function to make a deep copy of an instance of this class.
std::string getInstanceLicence()
Get instance licence.
int coneType
The type of the cone (one of the values in ENUM_CONE_TYPE)
virtual std::string getConeName()
double * getConstraintUpperBounds()
Get constraint upper bounds.
bool setTimeDomainStageObjectivesUnordered(int numberOfStages, int *numberOfObjectives, int **varIndex)
This sets the objectives associated with each time domain stage in arbitrary order.
The in-memory representation of the <nl> element.
bool getIterateResults(double *x, double *objLambda, double *conLambda, bool new_x, int highestOrder)
end revised AD code
TimeDomainStageCon ** con
con is a pointer to an array of TimeDomainStageCon object pointers
TimeDomainStageObj ** obj
obj is a pointer to an array of TimeDomainStageObj object pointers
virtual std::string getConeInXML()
Write a NonpositiveCone object in XML format.
bool deepCopyFrom(RotatedQuadraticCone *that)
A function to make a deep copy of an instance of this class.
double * getVariableLowerBounds()
Get variable lower bounds.
bool setVariableNumber(int number)
set the number of variables.
~TimeDomainStageObjectives()
The TimeDomainStageObjectives class destructor.
int numberOfStages
numberOfStages is the number of stages in the <stages> element.
Objectives * objectives
objectives is a pointer to a Objectives object
a sparse matrix data structure for matrices that can hold nonconstant values
bool setQuadraticTermsInNonlinearExpressions(int number, int *rowIndexes, int *varOneIndexes, int *varTwoIndexes, double *coefficients)
set quadratic terms in nonlinearExpressions
int coneType
The type of the cone (one of the values in ENUM_CONE_TYPE)
std::string name
the name of the objective function
virtual std::string getConeName()
int idxTwo
idxTwo is the index of the second variable in the quadratic term
The in-memory representation of the <matrixObj> element.
double normScaleFactor
quadratic cones normally are of the form x0 >= x1^2 + x2^2 + ...
double * getObjectiveConstants()
Get objective constants.
TimeDomainStages * stages
stages is a pointer to a Stages object
TimeDomainStageVar()
The TimeDomainStageVar class constructor.
double constant
constant is a value that is added to the constraint
int iNumberOfStartElements
iNumberOfStartElements counts the number of elements in the <start> section of <linearConstraintCoeff...
~SemidefiniteCone()
The SemidefiniteCone class destructor.
bool deepCopyFrom(OrthantCone *that)
A function to make a deep copy of an instance of this class.
int lbMatrixIdx
lbMatrixIdx gives a lower bound for this matrixCon
The in-memory representation of the <matrixCon> element.
NonlinearExpressions()
The NonlinearExpressions class constructor.
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
std::string * getObjectiveNames()
Get objective names.
bool IsEqual(OrthantCone *that)
A function to check for the equality of two objects.
int axisDirection
The index of the first component can be changed Since there are possibly many dimensions,...
virtual std::string getConeName()
QuadraticCoefficients * quadraticCoefficients
quadraticCoefficients is a pointer to a QuadraticCoefficients object
bool getZeroOrderResults(double *x, double *objLambda, double *conLambda)
Calculate function values.
bool m_bDeleteExpressionTree
m_bDeleteExpressionTree is true, if in garbage collection, we should delete the osExpression tree obj...
InstanceData * instanceData
A pointer to an InstanceData object.
bool setObjectiveNumber(int number)
set the number of objectives.
bool bConstraintsModified
bConstraintsModified is true if the constraints data has been modified.
virtual std::string getConeInXML()
Write a ProductCone object in XML format.
int numberOfRows
numberOfRows gives the number of rows of this matrix
int ubMatrixIdx
ubMatrixIdx gives an upper bound for this matrixVar
int numberOfCones
numberOfCones is the number of <nl> elements in the <cones> element.
The in-memory representation of a polyhedral cone.
Constraint ** con
con is pointer to an array of Constraint object pointers
a data structure to represent a matrix object (derived from MatrixType)
Matrices * matrices
matrices is a pointer to a Matrices object
std::map< int, MatrixExpressionTree * > getAllMatrixExpressionTreesMod()
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
bool addQTermsToExressionTree()
char varType
an optional variable type (C, B, I, D, J, S).
int getNumberOfRowsForMatrix(int n)
Get the number of rows in the matrix.
virtual std::string getConeName()
bool setQuadraticCoefficients(int number, int *rowIndexes, int *varOneIndexes, int *varTwoIndexes, double *coefficients, int begin, int end)
set quadratic coefficients into the QuadraticCoefficients->qTerm data structure
LinearConstraintCoefficients()
The LinearConstraintCoefficients class constructor.
~QuadraticCone()
The QuadraticCone class destructor.
The in-memory representation of the element.
std::string getMatrixExpressionTreeInInfix(int rowIdx)
Get the infix representation for a given row (or objective function) index.
double value
value is the value of the objective function coefficient corresponding to the variable with index idx
bool matrixHasBase(int n)
Several tools to parse the constructor list of a matrix.
an integer Vector data structure
int getNumberOfNonlinearObjectives()
~Variables()
The Variables class destructor.
int numberOfValues
numberOfValues is the number of nonzero elements stored in the <linearConstraintCoefficients> element
TimeDomainStageObjectives * objectives
objectives is a pointer to a TimeDomainObjectives object
The in-memory representation of the <qTerm> element.
int numberOfNonlinearExpressions
numberOfNonlinearExpressions is the number of <nl> elements in the <nonlinearExpressions> element.
int * getObjectiveCoefficientNumbers()
Get objective coefficient number.
int getObjectiveNumber()
Get number of objectives.
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
int templateMatrixIdx
templateMatrixIdx refers to a matrix that describes the locations in this matrixObj that are allowed ...
The in-memory representation of a generic cone Specific cone types are derived from this generic clas...
std::string maxOrMin
declare the objective function to be a max or a min
bool IsEqual(MatrixVariables *that)
A function to check for the equality of two objects.
int numberOfRows
Every cone has (at least) two dimensions; no distinction is made between vector cones and matrix cone...
int getNumberOfTransformationConstructors(int n)
~TimeDomainStageCon()
The TimeDomainStageCon class destructor.
MatrixExpressions()
The MatrixExpressions class constructor.
int idx
idx holds the row index of the nonlinear expression
bool IsEqual(QuadraticTerm *that)
A function to check for the equality of two objects.
NonpositiveCone()
default constructor.
bool getSecondOrderResults(double *x, double *objLambda, double *conLambda)
Calculate second derivatives.
int numberOfMatrixCon
numberOfMatrixCon gives the number of <matrixCon> children
bool addMatrix(int index, std::string name, int numberOfRows, int numberOfColumns, ENUM_MATRIX_SYMMETRY symmetry, ENUM_MATRIX_TYPE matrixType, unsigned int inumberOfChildren, MatrixNode **m_mChildren)
add a matrix.
~NonnegativeCone()
default destructor.
~TimeDomainStage()
The TimeDomainStage class destructor.
Nl ** nl
nl is pointer to an array of Nl object pointers
bool IsEqual(MatrixExpressions *that)
A function to check for the equality of two objects.
~PolyhedralCone()
The PolyhedralCone class destructor.
bool IsEqual(RotatedQuadraticCone *that)
A function to check for the equality of two objects.
int numberOfObjectives
numberOfObjectives is the number of objective functions in the instance
int getNumberOfNonlinearExpressionTreeIndexes()
Get the number of unique nonlinear expression tree indexes.
The in-memory representation of a SparseHessianMatrix..
~Constraint()
The Constraint class destructor.
~CopositiveMatricesCone()
default destructor.
int numberOfConstraints
numberOfConstraints is the number of constraints in the instance
int idx
cones are referenced by an (automatically created) index
int ubMatrixIdx
ubMatrixIdx gives an upper bound for this matrixCon
int getNumberOfMatrixConstraints()
Get the number of matrix constraints.
ENUM_NL_EXPR_SHAPE shape
shape holds the shape of the nonlinear expression (linear/quadratic/convex/general) (see further up i...
DualCone()
The DualCone class constructor.
bool IsEqual(MatrixExpression *that)
A function to check for the equality of two objects.
~Objective()
The Objective class destructor.
double * calculateObjectiveFunctionGradient(double *x, double *objLambda, double *conLambda, int objIdx, bool new_x, int highestOrder)
Calculate the gradient of the objective function indexed by objIdx.
std::string printModel()
Print the infix representation of the problem.
The in-memory representation of the <objectives> element.
QuadraticCone()
The QuadraticCone class constructor.
bool setObjectives(int number, std::string *names, std::string *maxOrMins, double *constants, double *weights, SparseVector **objectitiveCoefficients)
set all the objectives related elements.
bool matrixHasElements(int n)
int numberOfMatrixVar
numberOfMatrixVar gives the number of <matrixVar> children
Objective()
The Objective class constructor.
bool setInstanceCreator(std::string fileCreator)
set the instance creator.
double normScaleFactor
rotated quadratic cones normally are of the form x0x1 >= x2^2 + x3^2 + ...
The in-memory representation of the <objectives> child of the <stage> element.
Used to hold the instance in memory.
~InstanceData()
The InstanceData class destructor.
std::string getInstanceSource()
Get instance source.
std::string name
name corresponds to the optional attribute that holds the name of the stage; the default value is emp...
int objReferenceMatrixIdx
objReferenceMatrixIdx allows some or all of the components of this matrixObj to be copied from object...
bool setInstanceDescription(std::string description)
set the instance description.
TimeDomain()
The TimeDomain class constructor.
int numberOfRows
Every cone has (at least) two dimensions; no distinction is made between vector cones and matrix cone...
bool setTimeDomainStageVariablesUnordered(int numberOfStages, int *numberOfVariables, int **varIndex)
This sets the variables associated with each time domain stage in srbitrary order.
bool deepCopyFrom(Cone *that)
A function to make a deep copy of an instance of this class.
MatrixConstraints()
The MatrixConstraints class constructor.
int getNumberOfNonlinearExpressionTreeModIndexes()
Get the number of unique nonlinear expression tree indexes after modifying the expression tree to con...
MatrixObjectives()
The MatrixObjectives class constructor.
bool getSparseJacobianFromRowMajor()
std::vector< double > reverseAD(int p, std::vector< double > vdlambda)
Perform an AD reverse sweep.
virtual std::string getConeName()
bool initializeNonLinearStructures()
Initialize the data structures for the nonlinear API.
Constraints()
The Constraints class constructor.
int varReferenceMatrixIdx
varReferenceMatrixIdx allows some or all of the components of this matrix variable to be copied from ...
int getNumberOfStringVariables()
getNumberOfStringVariables
ObjCoef ** coef
coef is pointer to an array of ObjCoef object pointers
std::string getInstanceCreator()
Get instance fileCreator.
bool setInstanceLicence(std::string licence)
set the instance licence.
DoubleVector * value
a pointer to the array of nonzero values being stored
SparseHessianMatrix * calculateLagrangianHessian(double *x, double *objLambda, double *conLambda, bool new_x, int highestOrder)
Calculate the Hessian of the Lagrangian Expression Tree This method will build the CppAD expression t...
TimeDomainStageVariables()
The TimeDomainStageVariables class constructor.
bool setConstraintNumber(int number)
set the number of constraints.
bool IsEqual(Cones *that)
A function to check for the equality of two objects.
int numberOfOtherIndexes
Multidimensional tensors can also form cones (the Kronecker product, for instance,...
Cones()
The Cones class constructor.
a generic class from which we derive matrix constructors (BaseMatrix, MatrixElements,...
double getTimeDomainIntervalStart()
Get the start for the time domain interval.
double * getConstraintLowerBounds()
Get constraint lower bounds.
bool IsEqual(NonnegativeCone *that)
A function to check for the equality of two objects.
bool IsEqual(Constraint *that)
A function to check for the equality of two objects.
char type
type corresponds to the attribute that holds the variable type: C (Continuous), B (binary),...
virtual std::string getConeName()
bool setVariables(int number, std::string *names, double *lowerBounds, double *upperBounds, char *types)
set all the variable related elements.
int getNumberOfIntegerVariables()
getNumberOfIntegerVariables
bool setConstraints(int number, std::string *names, double *lowerBounds, double *upperBounds, double *constants)
set all the constraint related elements.
int numberOfRows
Every cone has (at least) two dimensions; no distinction is made between vector cones and matrix cone...
int numberOfObjCoef
numberOfObjCoef is the number of variables with a nonzero objective function coefficient
bool IsEqual(PolyhedralCone *that)
A function to check for the equality of two objects.
int ubConeIdx
ubConeIdx gives a cone that must contain ubMatrix - matrixVar
std::string * getTimeDomainStageNames()
Get the names of the stages (NULL or empty string ("") if a stage has not been given a name.
SparseVector ** getObjectiveCoefficients()
Get objective coefficients.
Constraints * constraints
constraints is a pointer to a Constraints object
TimeDomainStage ** stage
stage is pointer to an array of stage object pointers
virtual std::string getConeName()
int coneType
The type of the cone (one of the values in ENUM_CONE_TYPE)
SemidefiniteCone()
The SemidefiniteCone class constructor.
Cone ** cone
cone is pointer to an array of Cone object pointers
bool bUseExpTreeForFunEval
bUseExpTreeForFunEval is set to true if you wish to use the OS Expression Tree for function evaluatio...
double ** calculateAllObjectiveFunctionGradients(double *x, double *objLambda, double *conLambda, bool new_x, int highestOrder)
Calculate the gradient of all objective functions.
bool setNonlinearExpressions(int nexpr, Nl **root)
set nonlinear expressions
bool setInstanceSource(std::string source)
set the instance source.
bool getFirstOrderResults(double *x, double *objLambda, double *conLambda)
Calculate first derivatives.
TimeDomainStageConstraints()
The TimeDomainStageConstraints class constructor.
int ** getTimeDomainStageVarList()
Get the list of variables in each stage.
int * getQuadraticRowIndexes()
Get the indexes of rows which have a quadratic term.
bool IsEqual(NonlinearExpressions *that)
A function to check for the equality of two objects.
bool IsEqual(Variables *that)
A function to check for the equality of two objects.
a sparse vector data structure
Variable ** var
Here we define a pointer to an array of var pointers.
Variable()
The Variable class constructor.
int numberOfRows
numberOfRows gives the number of rows of this matrix
The in-memory representation of the <matrixVar> element.
The in-memory representation of the <expr> element, which is like a nonlinear expression,...
bool setLinearConstraintCoefficients(int numberOfValues, bool isColumnMajor, double *values, int valuesBegin, int valuesEnd, int *indexes, int indexesBegin, int indexesEnd, int *starts, int startsBegin, int startsEnd)
set linear constraint coefficients
std::vector< double > forwardAD(int p, std::vector< double > vdX)
Perform an AD forward sweep.
std::string getTimeDomainFormat()
Get the format of the time domain ("stages"/"interval")
InstanceData()
The InstanceData class constructor.
ENUM_CONE_TYPE coneType
The type of the cone.
The in-memory representation of the <obj> element.
~TimeDomain()
The TimeDomain class destructor.
int getMatrixNumber()
Get the number of matrices.
bool IsEqual(CopositiveMatricesCone *that)
A function to check for the equality of two objects.
~TimeDomainStages()
The Stages class destructor.
std::string * getConstraintNames()
Get constraint names.
MatrixConstraints * matrixConstraints
a pointer to the matrixConstraints object
IntersectionCone()
The IntersectionCone class constructor.
GeneralFileHeader * instanceHeader
the instanceHeader is implemented as a general file header object to allow sharing of classes between...
int templateMatrixIdx
templateMatrixIdx refers to a matrix that describes the locations in this matrixVar that are allowed ...
virtual std::string getConeName()
~MatrixObjectives()
The MatrixObjectives class destructor.
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
int coneType
The type of the cone (one of the values in ENUM_CONE_TYPE)
CopositiveMatricesCone()
default constructor.
TimeDomainStageCon()
The TimeDomainStageCon class constructor.
TimeDomainInterval()
The Interval class constructor.
std::string getMatrixName(int n)
Get the name of the matrix.
~OSInstance()
The OSInstance class destructor.
~ObjCoef()
The ObjCoef class destructor.
The in-memory representation of a dual cone.
bool initObjGradients()
This should be called by initForAlgDiff()
virtual std::string getConeName()
IntVector * components
the list of components contributing to the intersection each component contains a reference to a prev...
std::vector< ExprNode * > getMatrixExpressionTreeModInPostfix(int rowIdx)
Get the postfix tokens for a given row index for the modified Expression Tree (quadratic terms added)...
The in-memory representation of the variable element.
The in-memory representation of a product cone.
ObjCoef()
The ObjCoef class constructor.
NonnegativeCone()
default constructor.
~ProductCone()
The ProductCone class destructor.
RotatedQuadraticCone()
The RotatedQuadraticCone class constructor.
bool setTimeDomainStageConstraintsUnordered(int numberOfStages, int *numberOfConstraints, int **conIndex)
This sets the constraints associated with each time domain stage in srbitrary order.
Nl ** getNonlinearExpressions()
Get the pointers to the roots of all expression trees.
OSMatrix * getMatrix(int n)
Get the list of constructors of the matrix.
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
Cone()
The Cone class constructor.
bool IsEqual(Matrices *that)
A function to check for the equality of two objects.
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
int numberOfExpr
numberOfExpr gives the number of expressions
The in-memory representation of the <quadraticCoefficients> element.
int idxOne
idxOne is the index of the first variable in the quadratic term
bool IsEqual(SemidefiniteCone *that)
A function to check for the equality of two objects.
ProductCone()
The ProductCone class constructor.
NonlinearExpressions * nonlinearExpressions
nonlinearExpressions is a pointer to a NonlinearExpressions object
double lb
lb is the lower bound on the constraint
The in-memory representation of a cone of semidefinite matrices.
int idx
cones are referenced by an (automatically created) index
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
int getNumberOfMatrixObjectives()
Get the number of matrix objectives.
Constraint()
The Constraint class constructor.
std::string semidefiniteness
we need to distinguish positive and negative semidefiniteness
bool IsEqual(Cone *that)
A function to check for the equality of two objects.
virtual std::string getConeInXML()
Write a PolyhedralCone object in XML format.
virtual std::string getConeInXML()
Write a RotatedQuadraticCone object in XML format.
bool bAMatrixModified
bAMatrixModified is true if the A matrix data has been modified.
~LinearConstraintCoefficients()
The LinearConstraintCoefficients class destructor.
virtual ~Cone()
The Cone class destructor.
MatrixExpression()
The MatrixExpression class constructor.
bool addCone(int index, int numberOfRows, int numberOfColumns, ENUM_CONE_TYPE coneType, std::string name, int numberOfOtherIndexes=0, int *otherIndexes=NULL)
add a cone.
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
The in-memory representation of the <stages> element.
bool addConstraint(int index, std::string name, double lowerBound, double upperBound, double constant)
add a constraint.
int * getNonlinearExpressionTreeIndexes()
Get all the nonlinear expression tree indexes, i.e., indexes of rows (objectives or constraints) that...
bool deepCopyFrom(Matrices *that)
A function to make a deep copy of an instance of this class.
~CompletelyPositiveMatricesCone()
default destructor.
bool IsEqual(ObjCoef *that)
A function to check for the equality of two objects.
int numberOfRows
Every cone has (at least) two dimensions; no distinction is made between vector cones and matrix cone...
LinearConstraintCoefficients * linearConstraintCoefficients
linearConstraintCoefficients is a pointer to a LinearConstraintCoefficients object
PolyhedralCone()
The PolyhedralCone class constructor.
Matrices()
The Matrices class constructor.
bool deepCopyFrom(NonpositiveCone *that)
A function to make a deep copy of an instance of this class.
int getADSparsityHessian()
end revised AD code
TimeDomainStageVariables * variables
variables is a pointer to a TimeDomainVariables object
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
ScalarExpressionTree * osExpressionTree
osExpressionTree contains the root of the ScalarExpressionTree
std::string name
name corresponds to the optional attribute that holds the variable name, the default value is empty
~NonlinearExpressions()
The NonlinearExpressions class destructor.
virtual std::string getConeInXML()
Write an OrthantCone object in XML format.
bool setTimeDomainStageConstraintsOrdered(int numberOfStages, int *numberOfConstraints, int *startIdx)
This sets the constraints associated with each time domain stage in temporal order.
int getNumberOfBlocksConstructors(int n)
std::string getInstanceName()
Get instance name.
int numberOfConstraints
numberOfConstraints gives the number of constraints contained in this stage
int * getMatrixExpressionTreeIndexes()
Get all the matrix expression tree indexes, i.e.
SparseJacobianMatrix * getJacobianSparsityPattern()
int coneType
The type of the cone (one of the values in ENUM_CONE_TYPE)
The in-memory representation of the <obj> element.
The in-memory representation of the <cones> element.
int getConstraintNumber()
Get number of constraints.
int getNumberOfQuadraticTerms()
Get the number of specified (usually nonzero) qTerms in the quadratic coefficients.
int firstAxisDirection
The indices of the first two component can be changed Since there are possibly many dimensions,...
bool deepCopyFrom(SemidefiniteCone *that)
A function to make a deep copy of an instance of this class.
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
bool IsEqual(Objectives *that)
A function to check for the equality of two objects.
bool IsEqual(MatrixCon *that)
A function to check for the equality of two objects.
The in-memory representation of the <con> element.
MatrixObjectives * matrixObjectives
a pointer to the matrixObjectives object
The in-memory representation of the <matrixObjectives> element.
Objectives()
The Objectives class constructor.
int numberOfOtherIndexes
Cones can also be formed by Multidimensional tensors.
int idx
cones are referenced by an (automatically created) index
int ** getTimeDomainStageObjList()
Get the list of objectives in each stage.
int idx
idx is the index of the variable corresponding to the coefficient
~PolarCone()
The PolarCone class destructor.
std::string name
an optional name to this MatrixCon
bool IsEqual(DualCone *that)
A function to check for the equality of two objects.
int numberOfRows
Every cone has (at least) two dimensions; no distinction is made between vector cones and matrix cone...
std::vector< ExprNode * > getNonlinearExpressionTreeInPrefix(int rowIdx)
Get the prefix tokens for a given row index.
IntVector * factors
the list of "factors" contributing to the product each factor contains a reference to a previously de...
bool IsEqual(MatrixObjectives *that)
A function to check for the equality of two objects.
int coneType
The type of the cone (one of the values in ENUM_CONE_TYPE)
std::vector< ExprNode * > getNonlinearExpressionTreeModInPrefix(int rowIdx)
Get the prefix tokens for a given row index for the modified Expression Tree (quadratic terms added).
std::map< int, ScalarExpressionTree * > getAllNonlinearExpressionTreesMod()
bool deepCopyFrom(IntersectionCone *that)
A function to make a deep copy of an instance of this class.
bool isPositiveSemiDefinite
information about semidefiniteness is also tracked in a boolean variable
~NonpositiveCone()
default destructor.
bool setTimeDomainInterval(double start, double horizon)
This sets the start and end of the time interval.
The in-memory representation of a polar cone.
int numberOfObjectives
numberOfObjectives gives the number of objectives contained in this stage
int getTimeDomainStageNumber()
Get the number of stages that make up the time domain.
~QuadraticTerm()
The QuadraticTerm class destructor.
SparseMatrix * getLinearConstraintCoefficientsInRowMajor()
Get linear constraint coefficients in row major.
double * calculateAllConstraintFunctionValues(double *x, double *objLambda, double *conLambda, bool new_x, int highestOrder)
Calculate all of the constraint function values.
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
int getNumberOfColumnsForMatrix(int n)
Get the number of blocks in the matrix.
int numberOfRows
numberOfRows gives the number of rows of this matrix
bool IsEqual(MatrixVar *that)
A function to check for the equality of two objects.
int numberOfQuadraticTerms
numberOfQuadraticTerms is the number of quadratic terms in the <quadraticCoefficients> element.
bool deepCopyFrom(ProductCone *that)
A function to make a deep copy of an instance of this class.
int numberOfRows
Every cone has (at least) two dimensions; no distinction is made between vector cones and matrix cone...
~TimeDomainInterval()
The Interval class destructor.
int coneType
The type of the cone (one of the values in ENUM_CONE_TYPE)
TimeDomainInterval * interval
interval is a pointer to an Interval object
The in-memory representation of the <nonlinearExpressions> element.
bool deepCopyFrom(CompletelyPositiveMatricesCone *that)
A function to make a deep copy of an instance of this class.
double * calculateAllObjectiveFunctionValues(double *x, double *objLambda, double *conLambda, bool new_x, int highestOrder)
Calculate all of the objective function values.
int numberOfOtherIndexes
Multidimensional tensors can also form cones (the Kronecker product, for instance,...
~TimeDomainStageObj()
The TimeDomainStageObj class destructor.
The in-memory representation of the <matrixExpressions> element.
std::string * getVariableNames()
Get variable names.
bool addObjective(int index, std::string name, std::string maxOrMin, double constant, double weight, SparseVector *objectiveCoefficients)
add an objective.
bool IsEqual(LinearConstraintCoefficients *that)
A function to check for the equality of two objects.
int idx
cones are referenced by an (automatically created) index
~MatrixVariables()
The MatrixVariables class destructor.
int lbConeIdx
lbConeIdx gives a cone that must contain matrixCon - lbMatrix
Used to hold part of the instance in memory.
~TimeDomainStageVariables()
The TimeDomainStageVariables class destructor.
The in-memory representation of the <linearConstraintCoefficients> element.
double * getVariableUpperBounds()
Get variable upper bounds.
int getNumberOfMatrixExpressionTreeIndexes()
Get the number of unique matrix expression tree indexes.
The NonpositiveCone Class.
The in-memory representation of the <constraints> child of the <stage> element.
bool setConeNumber(int number)
set the number of cones
GeneralSparseMatrix * getMatrixCoefficientsInRowMajor(int n)
Get the (nonzero) elements of the matrix in row major form.
PolarCone()
The PolarCone class constructor.
int referenceConeIdx
Polar cones use a reference to another, previously defined cone.
double * getObjectiveWeights()
Get objective weights.
virtual std::string getConeInXML()=0
Write a Cone object in XML format.
std::map< int, int > getAllNonlinearVariablesIndexMap()
a sparse Jacobian matrix data structure
SparseVector * calculateConstraintFunctionGradient(double *x, double *objLambda, double *conLambda, int idx, bool new_x, int highestOrder)
Calculate the gradient of the constraint function indexed by idx.
MatrixExpressions * matrixExpressions
a pointer to the matrixExpressions object
std::string name
name is the name of the constraint
double weight
weight is the weight applied to the given objective function, 1.0 by default
~Variable()
The Variable class destructor.
MatrixProgramming * matrixProgramming
matrixProgramming is a pointer to a MatrixProgramming object
int getNumberOfMatrixVariables()
Get the number of matrix variables.
~RotatedQuadraticCone()
The RotatedQuadraticCone class destructor.
MatrixExpression ** expr
a pointer to an array of linear and nonlinear expressions that evaluate to matrices
bool IsEqual(MatrixConstraints *that)
A function to check for the equality of two objects.
OSMatrix ** matrix
matrix is a pointer to an array of OSMatrix object pointers
bool setMatrixNumber(int number)
set the number of matrices
int numberOfOtherIndexes
Multidimensional tensors can also form cones (the Kronecker product, for instance,...
bool IsEqual(InstanceData *that)
A function to check for the equality of two objects.
IntVector * colIdx
a pointer of column indices if the problem is stored by row
int numberOfMatrixObj
numberOfMatrixObj gives the number of <matrixObj> children
bool IsEqual(MatrixObj *that)
A function to check for the equality of two objects.
int numberOfRows
Every cone has (at least) two dimensions; no distinction is made between vector cones and matrix cone...
virtual std::string getConeName()
GeneralSparseMatrix * getMatrixBlockInColumnMajorForm(int n, int columnIdx, int rowIdx)
Get the (nonzero) elements of the matrix in symmetric block form.
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
int numberOfRows
Every cone has (at least) two dimensions; no distinction is made between vector cones and matrix cone...
int getNumberOfQuadraticRowIndexes()
Get the number of rows which have a quadratic term.
bool IsEqual(QuadraticCoefficients *that)
A function to check for the equality of two objects.
int getNumberOfBinaryVariables()
getNumberOfBinaryVariables
virtual std::string getConeInXML()
Write an IntersectionCone object in XML format.
This file defines the OSnLNode class along with its derived classes.