- Main Page
- Namespaces
- Classes
- Files
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# OSInstance Class Reference

The in-memory representation of an OSiL instance.. More...

`#include <OSInstance.h>`

Collaboration diagram for OSInstance:

[legend]
List of all members.

## Public Member Functions
| OSInstance ()
| The OSInstance class constructor.
| ~OSInstance ()
| The OSInstance class destructor.
bool | IsEqual (OSInstance *that)
| A function to check for the equality of two objects.
std::string | getInstanceName ()
| Get instance name.
std::string | getInstanceSource ()
| Get instance source.
std::string | getInstanceDescription ()
| Get instance description.
int | getVariableNumber ()
| Get variable number.
std::string * | getVariableNames ()
| Get variable names.
char * | getVariableTypes ()
| Get variable types.
int | getNumberOfIntegerVariables ()
| getNumberOfIntegerVariables
int | getNumberOfBinaryVariables ()
| getNumberOfBinaryVariables
int | getNumberOfSemiContinuousVariables ()
| getNumberOfSemiContinuousVariables
int | getNumberOfSemiIntegerVariables ()
| getNumberOfSemiIntegerVariables
int | getNumberOfStringVariables ()
| getNumberOfStringVariables
double * | getVariableLowerBounds ()
| Get variable lower bounds.
double * | getVariableUpperBounds ()
| Get variable upper bounds.
int | getObjectiveNumber ()
| Get objective number.
std::string * | getObjectiveNames ()
| Get objective names.
std::string * | getObjectiveMaxOrMins ()
| Get objective maxOrMins.
int * | getObjectiveCoefficientNumbers ()
| Get objective coefficient number.
double * | getObjectiveConstants ()
| Get objective constants.
double * | getObjectiveWeights ()
| Get objective weights.
SparseVector ** | getObjectiveCoefficients ()
| Get objective coefficients.
double ** | getDenseObjectiveCoefficients ()
| getDenseObjectiveCoefficients.
int | getConstraintNumber ()
| Get constraint number.
std::string * | getConstraintNames ()
| Get constraint names.
double * | getConstraintLowerBounds ()
| Get constraint lower bounds.
double * | getConstraintUpperBounds ()
| Get constraint upper bounds.
char * | getConstraintTypes ()
| Get constraint types.
int | getLinearConstraintCoefficientNumber ()
| Get number of specified (usually nonzero) linear constraint coefficient values.
bool | getLinearConstraintCoefficientMajor ()
| Get whether the constraint coefficients is in column major (true) or row major (false).
SparseMatrix * | getLinearConstraintCoefficientsInColumnMajor ()
| Get linear constraint coefficients in column major.
SparseMatrix * | getLinearConstraintCoefficientsInRowMajor ()
| Get linear constraint coefficients in row major.
int | getNumberOfQuadraticTerms ()
| Get the number of specified (usually nonzero) qTerms in the quadratic coefficients.
QuadraticTerms * | getQuadraticTerms ()
| Get all the quadratic terms in the instance.
int * | getQuadraticRowIndexes ()
| Get the indexes of rows which have a quadratic term.
int | getNumberOfQuadraticRowIndexes ()
| Get the number of rows which have a quadratic term.
int | getNumberOfNonlinearExpressions ()
| Get number of nonlinear expressions.
OSExpressionTree * | getNonlinearExpressionTree (int rowIdx)
| Get the expression tree for a given row index.
OSExpressionTree * | getNonlinearExpressionTreeMod (int rowIdx)
| Get the expression tree for a given row index for the modified expression trees (quadratic terms added).
std::vector< OSnLNode * > | getNonlinearExpressionTreeInPostfix (int rowIdx)
| Get the postfix tokens for a given row index.
std::vector< OSnLNode * > | getNonlinearExpressionTreeModInPostfix (int rowIdx)
| Get the postfix tokens for a given row index for the modified Expression Tree (quadratic terms added).
std::vector< OSnLNode * > | getNonlinearExpressionTreeInPrefix (int rowIdx)
| Get the prefix tokens for a given row index.
std::string | getNonlinearExpressionTreeInInfix (int rowIdx)
| Get the infix representation for a given row (or objective function) index.
std::string | printModel ()
| Print the infix representation of the problem.
std::string | printModel (int rowIdx)
| Print the infix representation of the row (which could be an an objective function row) indexed by rowIdx.
std::vector< OSnLNode * > | getNonlinearExpressionTreeModInPrefix (int rowIdx)
| Get the prefix tokens for a given row index for the modified Expression Tree (quadratic terms added).
int | getNumberOfNonlinearObjectives ()
int | getNumberOfNonlinearConstraints ()
std::map< int, OSExpressionTree * > | getAllNonlinearExpressionTrees ()
std::map< int, OSExpressionTree * > | getAllNonlinearExpressionTreesMod ()
int * | getNonlinearExpressionTreeIndexes ()
| Get all the nonlinear expression tree indexes, i.e.
int | getNumberOfNonlinearExpressionTreeIndexes ()
| Get the number of unique Nonlinear expression tree indexes.
int * | getNonlinearExpressionTreeModIndexes ()
| Get all the nonlinear expression tree indexes, i.e.
int | getNumberOfNonlinearExpressionTreeModIndexes ()
| Get the number of unique Nonlinear expression tree indexes after modifying the expression tree to contain quadratic terms.
std::string | getTimeDomainFormat ()
| Get the format of the time domain ("stages"/"interval").
int | getTimeDomainStageNumber ()
| Get the number of stages that make up the time domain.
std::string * | getTimeDomainStageNames ()
| Get the names of the stages (NULL or empty string ("") if a stage has not been given a name.
int * | getTimeDomainStageNumberOfVariables ()
| Get the number of variables contained in each time stage.
int * | getTimeDomainStageNumberOfConstraints ()
| Get the number of constraints contained in each time stage.
int * | getTimeDomainStageNumberOfObjectives ()
| Get the number of objectives contained in each time stage.
int ** | getTimeDomainStageVarList ()
| Get the list of variables in each stage.
int ** | getTimeDomainStageConList ()
| Get the list of constraints in each stage.
int ** | getTimeDomainStageObjList ()
| Get the list of objectives in each stage.
double | getTimeDomainIntervalStart ()
| Get the start for the time domain interval.
double | getTimeDomainIntervalHorizon ()
| Get the horizon for the time domain interval.
bool | setInstanceSource (std::string source)
| set the instance source.
bool | setInstanceDescription (std::string description)
| set the instance description.
bool | setInstanceName (std::string name)
| set the instance name.
bool | setVariableNumber (int number)
| set the variable number.
bool | addVariable (int index, std::string name, double lowerBound, double upperBound, char type)
| add a variable.
bool | setVariables (int number, std::string *names, double *lowerBounds, double *upperBounds, char *types)
| set all the variable related elements.
bool | setObjectiveNumber (int number)
| set the objective number.
bool | addObjective (int index, std::string name, std::string maxOrMin, double constant, double weight, SparseVector *objectiveCoefficients)
| add an objective.
bool | setObjectives (int number, std::string *names, std::string *maxOrMins, double *constants, double *weights, SparseVector **objectitiveCoefficients)
| set all the objectives related elements.
bool | setConstraintNumber (int number)
| set the constraint number.
bool | addConstraint (int index, std::string name, double lowerBound, double upperBound, double constant)
| add a constraint.
bool | setConstraints (int number, std::string *names, double *lowerBounds, double *upperBounds, double *constants)
| set all the constraint related elements.
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
bool | setQuadraticTerms (int number, int *rowIndexes, int *varOneIndexes, int *varTwoIndexes, double *coefficients, int begin, int end)
| set quadratic terms
bool | setQuadraticTermsInNonlinearExpressions (int number, int *rowIndexes, int *varOneIndexes, int *varTwoIndexes, double *coefficients)
| set quadratic terms in nonlinearExpressions
bool | initializeNonLinearStructures ()
| Initialize the data structures for the nonlinear API.
double | calculateFunctionValue (int idx, double *x, bool new_x)
| Calculate the function value for function (constraint or objective) indexed by idx.
double * | calculateAllConstraintFunctionValues (double *x, double *objLambda, double *conLambda, bool new_x, int highestOrder)
| Calculate all of the constraint function values.
double * | calculateAllConstraintFunctionValues (double *x, bool new_x)
| Calculate all of the constraint function values, we are overloading this function and this version of the method will not use any AD and will evaluate function values from the OS Expression Tree.
double * | calculateAllObjectiveFunctionValues (double *x, double *objLambda, double *conLambda, bool new_x, int highestOrder)
| Calculate all of the objective function values.
double * | calculateAllObjectiveFunctionValues (double *x, bool new_x)
| Calculate all of the objective function values, we are overloading this function and this version of the method will not use any AD and will evaluate function values from the OS Expression Tree.
SparseJacobianMatrix * | calculateAllConstraintFunctionGradients (double *x, double *objLambda, double *conLambda, bool new_x, int highestOrder)
| Calculate the gradient of all constraint functions.
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.
SparseVector * | calculateConstraintFunctionGradient (double *x, int idx, bool new_x)
| Calculate the gradient of the constraint function indexed by idx this function is overloaded.
double ** | calculateAllObjectiveFunctionGradients (double *x, double *objLambda, double *conLambda, bool new_x, int highestOrder)
| Calculate the gradient of all objective functions.
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.
double * | calculateObjectiveFunctionGradient (double *x, int objIdx, bool new_x)
| Calculate the gradient of the objective function indexed by objIdx this function is overloaded.
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 tree for only the first iteration Use this method on if the value of x does not affect the operations sequence.
SparseHessianMatrix * | calculateHessian (double *x, int idx, bool new_x)
| Calculate the Hessian of a constraint or objective function.
bool | getSparseJacobianFromColumnMajor ()
bool | getSparseJacobianFromRowMajor ()
OSExpressionTree * | getLagrangianExpTree ()
std::map< int, int > | getAllNonlinearVariablesIndexMap ()
SparseHessianMatrix * | getLagrangianHessianSparsityPattern ()
bool | addQTermsToExressionTree ()
SparseJacobianMatrix * | getJacobianSparsityPattern ()
void | duplicateExpressionTreesMap ()
| duplicate the map of expression trees.
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 the problem and the range is the objective function plus constraints.
std::vector< double > | forwardAD (int p, std::vector< double > vdX)
| Perform an AD forward sweep.
std::vector< double > | reverseAD (int p, std::vector< double > vdlambda)
| Perform an AD reverse sweep.
int | getADSparsityHessian ()
| Call the AD routine to fill in m_vbLagHessNonz and determine the nonzeros.
bool | getIterateResults (double *x, double *objLambda, double *conLambda, bool new_x, int highestOrder)
| Get the information for each iteration.
bool | getZeroOrderResults (double *x, double *objLambda, double *conLambda)
| Calculate function values.
bool | getFirstOrderResults (double *x, double *objLambda, double *conLambda)
| Calculate first derivatives.
bool | getSecondOrderResults (double *x, double *objLambda, double *conLambda)
| Calculate second derivatives.
bool | initForAlgDiff ()
| This should be called by nonlinear solvers using callback functions.
bool | initObjGradients ()
| This should be called by initForAlgDiff().
bool | setTimeDomain (std::string format)
| This sets the format of the time domain ("stages"/"interval"/"none").
bool | setTimeDomainStages (int number, std::string *names)
| This sets the number (and optionally names) of the time stages.
bool | setTimeDomainStageVariablesOrdered (int numberOfStages, int *numberOfVariables, int *startIdx)
| This sets the variables associated with each time domain stage in temporal order.
bool | setTimeDomainStageVariablesUnordered (int numberOfStages, int *numberOfVariables, int **varIndex)
| This sets the variables associated with each time domain stage in srbitrary order.
bool | setTimeDomainStageConstraintsOrdered (int numberOfStages, int *numberOfConstraints, int *startIdx)
| This sets the constraints associated with each time domain stage in temporal order.
bool | setTimeDomainStageConstraintsUnordered (int numberOfStages, int *numberOfConstraints, int **conIndex)
| This sets the constraints associated with each time domain stage in srbitrary order.
bool | setTimeDomainStageObjectivesOrdered (int numberOfStages, int *numberOfObjectives, int *startIdx)
| This sets the objectives associated with each time domain stage in temporal order.
bool | setTimeDomainStageObjectivesUnordered (int numberOfStages, int *numberOfObjectives, int **varIndex)
| This sets the objectives associated with each time domain stage in arbitrary order.
bool | setTimeDomainInterval (double start, double horizon)
| This sets the start and end of the time interval.
| OSInstance ()
| The OSInstance class constructor.
| ~OSInstance ()
| The OSInstance class destructor.
std::string | getInstanceName ()
| Get instance name.
std::string | getInstanceSource ()
| Get instance source.
std::string | getInstanceDescription ()
| Get instance description.
int | getVariableNumber ()
| Get variable number.
std::string * | getVariableNames ()
| Get variable names.
char * | getVariableTypes ()
| Get variable types.
int | getNumberOfIntegerVariables ()
| getNumberOfIntegerVariables
int | getNumberOfBinaryVariables ()
| getNumberOfBinaryVariables
double * | getVariableLowerBounds ()
| Get variable lower bounds.
double * | getVariableUpperBounds ()
| Get variable upper bounds.
int | getObjectiveNumber ()
| Get objective number.
std::string * | getObjectiveNames ()
| Get objective names.
std::string * | getObjectiveMaxOrMins ()
| Get objective maxOrMins.
int * | getObjectiveCoefficientNumbers ()
| Get objective coefficient number.
double * | getObjectiveConstants ()
| Get objective constants.
double * | getObjectiveWeights ()
| Get objective weights.
SparseVector ** | getObjectiveCoefficients ()
| Get objective coefficients.
double ** | getDenseObjectiveCoefficients ()
| getDenseObjectiveCoefficients.
int | getConstraintNumber ()
| Get constraint number.
std::string * | getConstraintNames ()
| Get constraint names.
double * | getConstraintLowerBounds ()
| Get constraint lower bounds.
double * | getConstraintUpperBounds ()
| Get constraint upper bounds.
char * | getConstraintTypes ()
| Get constraint types.
int | getLinearConstraintCoefficientNumber ()
| Get number of specified (usually nonzero) linear constraint coefficient values.
bool | getLinearConstraintCoefficientMajor ()
| Get whether the constraint coefficients is in column major (true) or row major (false).
SparseMatrix * | getLinearConstraintCoefficientsInColumnMajor ()
| Get linear constraint coefficients in column major.
SparseMatrix * | getLinearConstraintCoefficientsInRowMajor ()
| Get linear constraint coefficients in row major.
int | getNumberOfQuadraticTerms ()
| Get the number of specified (usually nonzero) qTerms in the quadratic coefficients.
QuadraticTerms * | getQuadraticTerms ()
| Get all the quadratic terms in the instance.
int * | getQuadraticRowIndexes ()
| Get the indexes of rows which have a quadratic term.
int | getNumberOfQuadraticRowIndexes ()
| Get the number of rows which have a quadratic term.
int | getNumberOfNonlinearExpressions ()
| Get number of nonlinear expressions.
OSExpressionTree * | getNonlinearExpressionTree (int rowIdx)
| Get the expression tree for a given row index.
OSExpressionTree * | getNonlinearExpressionTreeMod (int rowIdx)
| Get the expression tree for a given row index for the modified expression trees (quadratic terms added).
std::vector< OSnLNode * > | getNonlinearExpressionTreeInPostfix (int rowIdx)
| Get the postfix tokens for a given row index.
std::vector< OSnLNode * > | getNonlinearExpressionTreeModInPostfix (int rowIdx)
| Get the postfix tokens for a given row index for the modified Expression Tree (quadratic terms added).
std::vector< OSnLNode * > | getNonlinearExpressionTreeInPrefix (int rowIdx)
| Get the prefix tokens for a given row index.
std::vector< OSnLNode * > | getNonlinearExpressionTreeModInPrefix (int rowIdx)
| Get the prefix tokens for a given row index for the modified Expression Tree (quadratic terms added).
int | getNumberOfNonlinearObjectives ()
int | getNumberOfNonlinearConstraints ()
std::map< int, OSExpressionTree * > | getAllNonlinearExpressionTrees ()
std::map< int, OSExpressionTree * > | getAllNonlinearExpressionTreesMod ()
int * | getNonlinearExpressionTreeIndexes ()
| Get all the nonlinear expression tree indexes, i.e.
int | getNumberOfNonlinearExpressionTreeIndexes ()
| Get the number of unique Nonlinear expression tree indexes.
int * | getNonlinearExpressionTreeModIndexes ()
| Get all the nonlinear expression tree indexes, i.e.
int | getNumberOfNonlinearExpressionTreeModIndexes ()
| Get the number of unique Nonlinear expression tree indexes after modifying the expression tree to contain quadratic terms.
std::string | getTimeDomainFormat ()
| Get the format of the time domain ("stages"/"interval").
int | getTimeDomainStageNumber ()
| Get the number of stages that make up the time domain.
std::string * | getTimeDomainStageNames ()
| Get the names of the stages (NULL or empty string ("") if a stage has not been given a name.
int * | getTimeDomainStageNumberOfVariables ()
| Get the number of variables contained in each time stage.
int * | getTimeDomainStageNumberOfConstraints ()
| Get the number of constraints contained in each time stage.
int * | getTimeDomainStageNumberOfObjectives ()
| Get the number of objectives contained in each time stage.
int ** | getTimeDomainStageVarList ()
| Get the list of variables in each stage.
int ** | getTimeDomainStageConList ()
| Get the list of constraints in each stage.
int ** | getTimeDomainStageObjList ()
| Get the list of objectives in each stage.
double | getTimeDomainIntervalStart ()
| Get the start for the time domain interval.
double | getTimeDomainIntervalHorizon ()
| Get the horizon for the time domain interval.
bool | setInstanceSource (std::string source)
| set the instance source.
bool | setInstanceDescription (std::string description)
| set the instance description.
bool | setInstanceName (std::string name)
| set the instance name.
bool | setVariableNumber (int number)
| set the variable number.
bool | addVariable (int index, std::string name, double lowerBound, double upperBound, char type)
| add a variable.
bool | setVariables (int number, std::string *names, double *lowerBounds, double *upperBounds, char *types)
| set all the variable related elements.
bool | setObjectiveNumber (int number)
| set the objective number.
bool | addObjective (int index, std::string name, std::string maxOrMin, double constant, double weight, SparseVector *objectiveCoefficients)
| add an objective.
bool | setObjectives (int number, std::string *names, std::string *maxOrMins, double *constants, double *weights, SparseVector **objectitiveCoefficients)
| set all the objectives related elements.
bool | setConstraintNumber (int number)
| set the constraint number.
bool | addConstraint (int index, std::string name, double lowerBound, double upperBound, double constant)
| add a constraint.
bool | setConstraints (int number, std::string *names, double *lowerBounds, double *upperBounds, double *constants)
| set all the constraint related elements.
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
bool | setQuadraticTerms (int number, int *rowIndexes, int *varOneIndexes, int *varTwoIndexes, double *coefficients, int begin, int end)
| set quadratic terms
bool | setQuadraticTermsInNonlinearExpressions (int number, int *rowIndexes, int *varOneIndexes, int *varTwoIndexes, double *coefficients)
| set quadratic terms in nonlinearExpressions
bool | initializeNonLinearStructures ()
| Initialize the data structures for the nonlinear API.
double | calculateFunctionValue (int idx, double *x, bool new_x)
| Calculate the function value for function (constraint or objective) indexed by idx.
double * | calculateAllConstraintFunctionValues (double *x, double *objLambda, double *conLambda, bool new_x, int highestOrder)
| Calculate all of the constraint function values.
double * | calculateAllConstraintFunctionValues (double *x, bool new_x)
| Calculate all of the constraint function values, we are overloading this function and this version of the method will not use any AD and will evaluate function values from the OS Expression Tree.
double * | calculateAllObjectiveFunctionValues (double *x, double *objLambda, double *conLambda, bool new_x, int highestOrder)
| Calculate all of the objective function values.
double * | calculateAllObjectiveFunctionValues (double *x, bool new_x)
| Calculate all of the objective function values, we are overloading this function and this version of the method will not use any AD and will evaluate function values from the OS Expression Tree.
SparseJacobianMatrix * | calculateAllConstraintFunctionGradients (double *x, double *objLambda, double *conLambda, bool new_x, int highestOrder)
| Calculate the gradient of all constraint functions.
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.
SparseVector * | calculateConstraintFunctionGradient (double *x, int idx, bool new_x)
| Calculate the gradient of the constraint function indexed by idx this function is overloaded.
double ** | calculateAllObjectiveFunctionGradients (double *x, double *objLambda, double *conLambda, bool new_x, int highestOrder)
| Calculate the gradient of all objective functions.
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.
double * | calculateObjectiveFunctionGradient (double *x, int objIdx, bool new_x)
| Calculate the gradient of the objective function indexed by objIdx this function is overloaded.
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 tree for only the first iteration Use this method on if the value of x does not affect the operations sequence.
SparseHessianMatrix * | calculateHessian (double *x, int idx, bool new_x)
| Calculate the Hessian of a constraint or objective function.
bool | getSparseJacobianFromColumnMajor ()
bool | getSparseJacobianFromRowMajor ()
OSExpressionTree * | getLagrangianExpTree ()
std::map< int, int > | getAllNonlinearVariablesIndexMap ()
SparseHessianMatrix * | getLagrangianHessianSparsityPattern ()
bool | addQTermsToExressionTree ()
SparseJacobianMatrix * | getJacobianSparsityPattern ()
void | duplicateExpressionTreesMap ()
| duplicate the map of expression trees.
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 the problem and the range is the objective function plus constraints.
std::vector< double > | forwardAD (int p, std::vector< double > vdX)
| Perform an AD forward sweep.
std::vector< double > | reverseAD (int p, std::vector< double > vdlambda)
| Perform an AD reverse sweep.
int | getADSparsityHessian ()
| Call the AD routine to fill in m_vbLagHessNonz and determine the nonzeros.
bool | getIterateResults (double *x, double *objLambda, double *conLambda, bool new_x, int highestOrder)
| Get the information for each iteration.
bool | getZeroOrderResults (double *x, double *objLambda, double *conLambda)
| Calculate function values.
bool | getFirstOrderResults (double *x, double *objLambda, double *conLambda)
| Calculate first derivatives.
bool | getSecondOrderResults (double *x, double *objLambda, double *conLambda)
| Calculate second derivatives.
bool | initForAlgDiff ()
| This should be called by nonlinear solvers using callback functions.
bool | initObjGradients ()
| This should be called by initForAlgDiff().
bool | setTimeDomain (std::string format)
| This sets the format of the time domain ("stages"/"interval"/"none").
bool | setTimeDomainStages (int number, std::string *names)
| This sets the number (and optionally names) of the time stages.
bool | setTimeDomainStageVariablesOrdered (int numberOfStages, int *numberOfVariables, int *startIdx)
| This sets the variables associated with each time domain stage in temporal order.
bool | setTimeDomainStageVariablesUnordered (int numberOfStages, int *numberOfVariables, int **varIndex)
| This sets the variables associated with each time domain stage in srbitrary order.
bool | setTimeDomainStageConstraintsOrdered (int numberOfStages, int *numberOfConstraints, int *startIdx)
| This sets the constraints associated with each time domain stage in temporal order.
bool | setTimeDomainStageConstraintsUnordered (int numberOfStages, int *numberOfConstraints, int **conIndex)
| This sets the constraints associated with each time domain stage in srbitrary order.
bool | setTimeDomainStageObjectivesOrdered (int numberOfStages, int *numberOfObjectives, int *startIdx)
| This sets the objectives associated with each time domain stage in temporal order.
bool | setTimeDomainStageObjectivesUnordered (int numberOfStages, int *numberOfObjectives, int **varIndex)
| This sets the objectives associated with each time domain stage in arbitrary order.
bool | setTimeDomainInterval (double start, double horizon)
| This sets the start and end of the time interval.
## Public Attributes
GeneralFileHeader * | instanceHeader
| the instanceHeader is implemented as a general file header object to allow sharing of classes between schemas
InstanceData * | instanceData
| A pointer to an InstanceData object.
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.
bool | bConstraintsModified
| bConstraintsModified is true if the constraints data has been modified.
bool | bAMatrixModified
| bAMatrixModified is true if the A matrix data has been modified.
bool | bUseExpTreeForFunEval
| bUseExpTreeForFunEval is set to true if you wish to use the OS Expression Tree for function evaluations instead of AD -- false by default.
InstanceHeader * | instanceHeader
| A pointer to an InstanceHeader object.
InstanceData * | instanceData
| A pointer to an InstanceData object.
## Private Member Functions
bool | processVariables ()
| process variables.
bool | processObjectives ()
| process objectives.
bool | processConstraints ()
| process constraints.
bool | processLinearConstraintCoefficients ()
| process linear constraint coefficients.
bool | processVariables ()
| process variables.
bool | processObjectives ()
| process objectives.
bool | processConstraints ()
| process constraints.
bool | processLinearConstraintCoefficients ()
| process linear constraint coefficients.
## Private Attributes
std::string | m_sInstanceName
| m_sInstanceName holds the instance name.
std::string | m_sInstanceSource
| m_sInstanceSource holds the instance source.
std::string | m_sInstanceDescription
| m_sInstanceDescription holds the instance description.
bool | m_bProcessVariables
| m_bProcessVariables holds whether the variables are processed.
int | m_iVariableNumber
| m_iVariableNumber holds the variable number.
int | m_iNumberOfIntegerVariables
| m_iNumberOfIntegerVariables holds the number of integer variables.
int | m_iNumberOfBinaryVariables
| m_iNumberOfBinaryVariables holds the number of binary variables.
int | m_iNumberOfSemiContinuousVariables
| m_iNumberOfSemiContinuousVariables holds the number of semi-continuous variables.
int | m_iNumberOfSemiIntegerVariables
| m_iNumberOfSemiIntegerVariables holds the number of semi-integer variables.
int | m_iNumberOfStringVariables
| m_iNumberOfStringVariables holds the number of string-valued variables.
int | m_iNumberOfQuadraticRowIndexes
| m_iNumberOfQuadraticRowIndexes holds the number of distinct rows and objectives with quadratic terms.
bool | m_bQuadraticRowIndexesProcessed
| m_bQuadraticRowIndexesProcessed is true if getQuadraticRowIndexes() has been called.
int * | m_miQuadRowIndexes
| m_miQuadRowIndexes is an integer pointer to the distinct rows indexes with a quadratic term.
int | m_iNumberOfNonlinearExpressionTreeIndexes
| m_iNumberOfNonlinearExpressionTreeIndexes holds the number of distinct rows and objectives with nonlinear terms.
bool | m_bNonlinearExpressionTreeIndexesProcessed
| m_bNonlinearExpressionTreeIndexesProcessed is true if getNonlinearExpressionTreeIndexes has been called.
int * | m_miNonlinearExpressionTreeIndexes
| m_miNonlinearExpressionTreeIndexes is an integer pointer to the distinct rows indexes in the nonlinear expression tree map.
int | m_iNumberOfNonlinearExpressionTreeModIndexes
| m_iNumberOfNonlinearExpressionTreeModIndexes holds the number of distinct rows and objectives with nonlinear terms including quadratic terms added to the nonlinear expression trees.
bool | m_bNonlinearExpressionTreeModIndexesProcessed
| m_bNonlinearExpressionTreeModIndexesProcessed is true if getNonlinearExpressionTreeModIndexes has been called.
int * | m_miNonlinearExpressionTreeModIndexes
| m_miNonlinearExpressionTreeModIndexes is an integer pointer to the distinct rows indexes in the modified expression tree map.
std::string * | m_msVariableNames
| m_msVariableNames holds an array of variable names.
char * | m_mcVariableTypes
| m_mcVariableTypes holds a char array of variable types (default = 'C').
double * | m_mdVariableLowerBounds
| m_mdVariableLowerBounds holds a double array of variable lower bounds (default = 0.0).
double * | m_mdVariableUpperBounds
| m_mdVariableUpperBounds holds a double array of variable upper bounds (default = INF).
bool | m_bProcessObjectives
| m_bProcessObjectives holds whether the objectives are processed.
int | m_iObjectiveNumber
| m_iObjectiveNumber is the number of objective functions.
int | m_iObjectiveNumberNonlinear
| m_iObjectiveNumber is the number of objective functions with a nonlinear term.
std::string * | m_msObjectiveNames
| m_msObjectiveNames holds an array of objective names.
std::string * | m_msMaxOrMins
| m_msMaxOrMins holds a std::string array of objective maxOrMins ("max" or "min").
int * | m_miNumberOfObjCoef
| m_miNumberOfObjCoef holds an integer array of number of objective coefficients (default = 0.0).
double * | m_mdObjectiveConstants
| m_mdObjectiveConstants holds an array of objective constants (default = 0.0).
double * | m_mdObjectiveWeights
| m_mdObjectiveWeights holds an array of objective weights (default = 1.0).
SparseVector ** | m_mObjectiveCoefficients
| m_mObjectiveCoefficients holds an array of objective coefficients, one set of objective coefficients for each objective.
bool | m_bGetDenseObjectives
| m_bGetDenseObjectives holds whether the dense objective functions are processed.
double ** | m_mmdDenseObjectiveCoefficients
| m_mmdDenseObjectiveCoefficients holds an array of pointers, each pointer points to a vector of dense objective function coefficients
bool | m_bProcessConstraints
| m_bProcessConstraints holds whether the constraints are processed.
int | m_iConstraintNumber
| m_iConstraintNumber is the number of constraints.
int | m_iConstraintNumberNonlinear
| m_iConstraintNumberNonlinear is the number of constraints that have a nonlinear term.
std::string * | m_msConstraintNames
| m_msConstraintNames holds an array of constraint names.
double * | m_mdConstraintLowerBounds
| m_mdConstraintLowerBounds holds an array of constraint lower bounds (default = -INF).
double * | m_mdConstraintUpperBounds
| m_mdConstraintUpperBounds holds an array of constraint upper bounds (default = INF).
double * | m_mdConstraintConstants
| m_mdConstraintConstants holds an array of constraint constants (default = 0.0).
char * | m_mcConstraintTypes
| m_mcConstraintTypes holds a char array of constraint types (R for range; L for <=; G for >=; E for =; U for unconstrained)
bool | m_bProcessLinearConstraintCoefficients
| m_bProcessLinearConstraintCoefficients holds whether the linear constraint coefficients are processed.
int | m_iLinearConstraintCoefficientNumber
| m_iLinearConstraintCoefficientNumber holds the number of specified (usually nonzero) linear constraint coefficient values.
bool | m_bColumnMajor
| m_bColumnMajor holds whether the linear constraint coefficients are stored in column major.
bool | m_binitForAlgDiff
| m_binitForAlgDiff is true if initForAlgDiff() has been called.
SparseMatrix * | m_linearConstraintCoefficientsInColumnMajor
| m_linearConstraintCoefficientsInColumnMajor holds the standard 3 array data structure for linear constraint coefficients (starts, indexes and values) in column major.
SparseMatrix * | m_linearConstraintCoefficientsInRowMajor
| m_linearConstraintCoefficientsInRowMajor holds the standard 3 array data structure for linear constraint coefficients (starts, indexes and values) in row major.
bool | m_bProcessQuadraticTerms
| m_bProcessQuadraticTerms holds whether the quadratic terms are processed.
int | m_iQuadraticTermNumber
| m_iQuadraticTermNumber holds the number of specified (usually nonzero) qTerms in the quadratic coefficients.
double * | m_mdConstraintFunctionValues
| m_mdConstraintFunctionValues holds a double array of constraint function values -- the size of the array is equal to getConstraintNumber().
double * | m_mdObjectiveFunctionValues
| m_mdObjectiveFunctionValues holds a double array of objective function values -- the size of the array is equal to getObjectiveNumber().
int | m_iJacValueSize
| m_iJacValueSize is the number of nonzero partial derivates in the Jacobian.
int * | m_miJacStart
| m_miJacStart holds a int array of starts for the Jacobian matrix in sparse form (row major).
int * | m_miJacIndex
| m_miJacIndex holds a int array of variable indices for the Jacobian matrix in sparse form (row major).
double * | m_mdJacValue
| m_mdJacValue holds a double array of partial derivatives for the Jacobian matrix in sparse form (row major).
int * | m_miJacNumConTerms
| m_miJacNumConTerms holds a int array of the number of constant terms (gradient does not change) for the Jacobian matrix in sparse form (row major).
SparseJacobianMatrix * | m_sparseJacMatrix
| m_sparseJacMatrix is the Jacobian matrix stored in sparse matrix format
int | m_iHighestTaylorCoeffOrder
| m_iHighestTaylorCoeffOrder is the order of highest calculated Taylor coefficient
QuadraticTerms * | m_quadraticTerms
| m_quadraticTerms the data structure for all the quadratic terms in the instance.
bool | m_bQTermsAdded
| m_bQTermsAdded is true if we add the quadratic terms to the expression tree
unsigned int | m_iNumberOfNonlinearVariables
| m_iNumberOfNonlinearVariables is the number of variables that appear in a nonlinear expression.
bool | m_bProcessNonlinearExpressions
| m_bProcessNonlinearExpressions holds whether the nonlinear expressions are processed.
int | m_iNonlinearExpressionNumber
| m_iNonlinearExpressionNumber holds the number of nonlinear expressions.
int * | m_miNonlinearExpressionIndexes
| m_miNonlinearExpressionIndexes holds an integer array of nonlinear expression indexes, negative indexes correspond to objectives.
bool | m_bProcessExpressionTrees
| m_bProcessExpressionTrees is true if the expression trees have been processed.
bool | m_bProcessExpressionTreesMod
| m_bProcessExpressionTreesMod is true if the modified expression trees have been processed.
std::map< int, OSExpressionTree * > | m_mapExpressionTrees
| m_mapExpressionTrees holds a hash map of expression tree pointers, with the key being the row index and value being the expression tree representing the nonlinear expression of that row.
std::map< int, int > | m_mapOSADFunRangeIndex
OSExpressionTree * | m_LagrangianExpTree
| m_LagrangianExpTree is an OSExpressionTree object that is the expression tree for the Lagrangian function.
bool | m_bLagrangianExpTreeCreated
| m_bLagrangianHessionCreated is true if a Lagrangian function for the Hessian has been created
SparseHessianMatrix * | m_LagrangianSparseHessian
| m_LagrangianSparseHessian is the Hessian Matrix of the Lagrangian function in sparse format
bool | m_bLagrangianSparseHessianCreated
| m_bLagrangianSparseHessianCreated is true if the sparse Hessian Matrix for the Lagrangian was created
std::map< int, int > | m_mapAllNonlinearVariablesIndex
| m_mapAllNonlinearVariablesIndexMap is a map of the variables in the Lagrangian function
int * | m_miNonLinearVarsReverseMap
| m_miNonLinearVarsReverseMap maps the nonlinear variable number back into the original variable space
bool | m_bAllNonlinearVariablesIndex
| m_bAllNonlinearVariablesIndexMap is true if the map of the variables in the Lagrangian function has been constructed
std::map< int, OSExpressionTree * > | m_mapExpressionTreesMod
| m_mapExpressionTreesMod holds a map of expression trees, with the key being the row index and value being the expression tree representing a modification of the nonlinear expression of that row.
bool | m_bOSADFunIsCreated
| m_bOSADFunIsCreated is true if we have created the OSInstanc OSAD Function
bool | m_bCppADTapesBuilt
| is true if a CppAD Expresion Tree has been built for each row and objective with a nonlinear expression.
bool | m_bCppADMustReTape
| is true if a CppAD Expresion Tree has an expression that can change depending on the value of the input, e.g.
bool | m_bDuplicateExpressionTreesMap
| m_bDuplicateExpressionTreeMap is true if m_mapExpressionTrees was duplicated.
bool | m_bNonLinearStructuresInitialized
| m_bNonLinearStructuresInitialized is true if initializeNonLinearStructures( ) has been called.
bool | m_bSparseJacobianCalculated
| m_bSparseJacobianCalculated is true if getJacobianSparsityPattern() has been called.
std::map< int, std::vector< OSnLNode * > > | m_mapExpressionTreesInPostfix
| m_mapExpressionTreesInPostfix holds a hash map of expression trees in postfix format, with the key being the row index and value being the expression tree representing the nonlinear expression of that row.
int | m_iHighestOrderEvaluated
| m_iHighestOrderEvaluated is the highest order derivative of the current iterate
double ** | m_mmdObjGradient
| m_mdObjGradient holds an array of pointers, each pointer points to gradient of each objective function
std::vector< double > | m_vdX
| m_vdX is a vector of primal variables at each iteration
std::vector< double > | m_vdYval
| m_vdYval is a vector of function values
std::vector< bool > | m_vbLagHessNonz
| m_vbLagHessNonz is a boolean vector holding the nonzero pattern of the Lagrangian of the Hessian
std::vector< double > | m_vdYjacval
| m_vdYval is a vector equal to a column or row of the Jacobian
std::vector< double > | m_vdw
| m_vdYval is a vector of derivatives -- output from a reverse sweep
std::vector< double > | m_vdLambda
| m_vdYval is a vector of Lagrange multipliers
std::vector< double > | m_vdDomainUnitVec
| m_vdDomainUnitVec is a unit vector in the domain space
std::vector< double > | m_vdRangeUnitVec
| m_vdRangeUnitVec is a unit vector in the range space
bool | m_bProcessTimeDomain
| m_bProcessTimeDomain holds whether the time domain has been processed.
bool | m_bProcessTimeStages
| m_bProcessTimeStages holds whether the time stages have been processed.
bool | m_bProcessTimeInterval
| m_bProcessTimeInterval holds whether a time interval has been processed.
bool | m_bFiniteTimeStages
| m_bFiniteTimeStages holds whether the time domain has the form of finite (discrete) stages.
int | m_iNumberOfTimeStages
| m_iNumberOfTimeStages holds the number of discrete stages
std::string | m_sTimeDomainFormat
| m_sTimeDomainFormat holds the format ("stages"/"interval") of the time domain.
std::string * | m_msTimeDomainStageNames
| m_msTimeDomainStageNames holds the names of the time stages.
int * | m_miTimeDomainStageVariableNumber
| m_miTimeDomainStageVariableNumber holds the number of variables in each stage.
int ** | m_mmiTimeDomainStageVarList
| m_mmiTimeDomainStageVarList holds the list of variables in each stage.
int * | m_miTimeDomainStageConstraintNumber
| m_miTimeDomainStageConstraintNumber holds the number of constraints in each stage.
int ** | m_mmiTimeDomainStageConList
| m_mmiTimeDomainStageConList holds the list of constraints in each stage.
int * | m_miTimeDomainStageObjectiveNumber
| m_miTimeDomainStageObjectiveNumber holds the number of objectives in each stage.
int ** | m_mmiTimeDomainStageObjList
| m_mmiTimeDomainStageObjList holds the list of objectives in each stage.
int * | m_miQuadRowIndexes
| m_miQuadRowIndexes is an integer pointer to the distinct rows indexes with a quadratic term.
int * | m_miNonlinearExpressionTreeIndexes
| m_miNonlinearExpressionTreeIndexes is an integer pointer to the distinct rows indexes in the nonlinear expression tree map.
int * | m_miNonlinearExpressionTreeModIndexes
| m_miNonlinearExpressionTreeModIndexes is an integer pointer to the distinct rows indexes in the modified expression tree map.
std::string * | m_msVariableNames
| m_msVariableNames holds an array of variable names.
char * | m_mcVariableTypes
| m_mcVariableTypes holds a char array of variable types (default = 'C').
double * | m_mdVariableLowerBounds
| m_mdVariableLowerBounds holds a double array of variable lower bounds (default = 0.0).
double * | m_mdVariableUpperBounds
| m_mdVariableUpperBounds holds a double array of variable upper bounds (default = INF).
std::string * | m_msObjectiveNames
| m_msObjectiveNames holds an array of objective names.
std::string * | m_msMaxOrMins
| m_msMaxOrMins holds a std::string array of objective maxOrMins ("max" or "min").
int * | m_miNumberOfObjCoef
| m_miNumberOfObjCoef holds an integer array of number of objective coefficients (default = 0.0).
double * | m_mdObjectiveConstants
| m_mdObjectiveConstants holds an array of objective constants (default = 0.0).
double * | m_mdObjectiveWeights
| m_mdObjectiveWeights holds an array of objective weights (default = 1.0).
SparseVector ** | m_mObjectiveCoefficients
| m_mObjectiveCoefficients holds an array of objective coefficients, one set of objective coefficients for each objective.
double ** | m_mmdDenseObjectiveCoefficients
| m_mmdDenseObjectiveCoefficients holds an array of pointers, each pointer points to a vector of dense objective function coefficients
std::string * | m_msConstraintNames
| m_msConstraintNames holds an array of constraint names.
double * | m_mdConstraintLowerBounds
| m_mdConstraintLowerBounds holds an array of constraint lower bounds (default = -INF).
double * | m_mdConstraintUpperBounds
| m_mdConstraintUpperBounds holds an array of constraint upper bounds (default = INF).
double * | m_mdConstraintConstants
| m_mdConstraintConstants holds an array of constraint constants (default = 0.0).
char * | m_mcConstraintTypes
| m_mcConstraintTypes holds a char array of constraint types (R for range; L for <=; G for >=; E for =; U for unconstrained)
SparseMatrix * | m_linearConstraintCoefficientsInColumnMajor
| m_linearConstraintCoefficientsInColumnMajor holds the standard 3 array data structure for linear constraint coefficients (starts, indexes and values) in column major.
SparseMatrix * | m_linearConstraintCoefficientsInRowMajor
| m_linearConstraintCoefficientsInRowMajor holds the standard 3 array data structure for linear constraint coefficients (starts, indexes and values) in row major.
double * | m_mdConstraintFunctionValues
| m_mdConstraintFunctionValues holds a double array of constraint function values -- the size of the array is equal to getConstraintNumber().
double * | m_mdObjectiveFunctionValues
| m_mdObjectiveFunctionValues holds a double array of objective function values -- the size of the array is equal to getObjectiveNumber().
int * | m_miJacStart
| m_miJacStart holds a int array of starts for the Jacobian matrix in sparse form (row major).
int * | m_miJacIndex
| m_miJacIndex holds a int array of variable indices for the Jacobian matrix in sparse form (row major).
double * | m_mdJacValue
| m_mdJacValue holds a double array of partial derivatives for the Jacobian matrix in sparse form (row major).
int * | m_miJacNumConTerms
| m_miJacNumConTerms holds a int array of the number of constant terms (gradient does not change) for the Jacobian matrix in sparse form (row major).
SparseJacobianMatrix * | m_sparseJacMatrix
| m_sparseJacMatrix is the Jacobian matrix stored in sparse matrix format
QuadraticTerms * | m_quadraticTerms
| m_quadraticTerms the data structure for all the quadratic terms in the instance.
int * | m_miNonlinearExpressionIndexes
| m_miNonlinearExpressionIndexes holds an integer array of nonlinear expression indexes, negative indexes correspond to objectives.
std::map< int, OSExpressionTree * > | m_mapExpressionTrees
| m_mapExpressionTrees holds a hash map of expression tree pointers, with the key being the row index and value being the expression tree representing the nonlinear expression of that row.
std::map< int, int > | m_mapOSADFunRangeIndex
OSExpressionTree * | m_LagrangianExpTree
| m_LagrangianExpTree is an OSExpressionTree object that is the expression tree for the Lagrangian function.
SparseHessianMatrix * | m_LagrangianSparseHessian
| m_LagrangianSparseHessian is the Hessian Matrix of the Lagrangian function in sparse format
std::map< int, int > | m_mapAllNonlinearVariablesIndex
| m_mapAllNonlinearVariablesIndexMap is a map of the variables in the Lagrangian function
int * | m_miNonLinearVarsReverseMap
| m_miNonLinearVarsReverseMap maps the nonlinear variable number back into the original variable space
std::map< int, OSExpressionTree * > | m_mapExpressionTreesMod
| m_mapExpressionTreesMod holds a map of expression trees, with the key being the row index and value being the expression tree representing a modification of the nonlinear expression of that row.
std::map< int, std::vector< OSnLNode * > > | m_mapExpressionTreesInPostfix
| m_mapExpressionTrees holds a hash map of expression trees in postfix format, with the key being the row index and value being the expression tree representing the nonlinear expression of that row.
double ** | m_mmdObjGradient
| m_mdObjGradient holds an array of pointers, each pointer points to gradient of each objective function
std::vector< double > | m_vdX
| m_vdX is a vector of primal variables at each iteration
std::vector< double > | m_vdYval
| m_vdYval is a vector of function values
std::vector< bool > | m_vbLagHessNonz
| m_vbLagHessNonz is a boolean vector holding the nonzero pattern of the Lagrangian of the Hessian
std::vector< double > | m_vdYjacval
| m_vdYval is a vector equal to a column or row of the Jacobian
std::vector< double > | m_vdw
| m_vdYval is a vector of derivatives -- output from a reverse sweep
std::vector< double > | m_vdLambda
| m_vdYval is a vector of Lagrange multipliers
std::vector< double > | m_vdDomainUnitVec
| m_vdDomainUnitVec is a unit vector in the domain space
std::vector< double > | m_vdRangeUnitVec
| m_vdRangeUnitVec is a unit vector in the range space
std::string * | m_msTimeDomainStageNames
| m_msTimeDomainStageNames holds the names of the time stages.
int * | m_miTimeDomainStageVariableNumber
| m_miTimeDomainStageVariableNumber holds the number of variables in each stage.
int ** | m_mmiTimeDomainStageVarList
| m_mmiTimeDomainStageVarList holds the list of variables in each stage.
int * | m_miTimeDomainStageConstraintNumber
| m_miTimeDomainStageConstraintNumber holds the number of constraints in each stage.
int ** | m_mmiTimeDomainStageConList
| m_mmiTimeDomainStageConList holds the list of constraints in each stage.
int * | m_miTimeDomainStageObjectiveNumber
| m_miTimeDomainStageObjectiveNumber holds the number of objectives in each stage.
int ** | m_mmiTimeDomainStageObjList
| m_mmiTimeDomainStageObjList holds the list of objectives in each stage.

## Detailed Description

The in-memory representation of an OSiL instance..

Remarks:

1. Elements become objects of class type (the ComplexType is the class)

2. The attributes, children of the element, and text correspond to members of the class. (Note text does not have a name and becomes .value)

3. Model groups such as choice and sequence and all correspond to arrays

1. anything specific to XML such as base64, multi, incr do not go into classes
2. The root OSnLNode of each <nl> element is called ExpressionTree
3. Root is not called osil it is called osinstance

The OSInstance class is composed of two objects: an InstanceHeader object and and InstanceData object

Definition at line 804 of file OSInstance.h.

## Constructor & Destructor Documentation

OSInstance::OSInstance | ( |  | ) |

The OSInstance class constructor.

Definition at line 38 of file OSInstance.cpp.

References instanceData, and instanceHeader.

OSInstance::~OSInstance | ( |  | ) |

The OSInstance class destructor.

Definition at line 148 of file OSInstance.cpp.

References DEBUG, instanceData, m_bGetDenseObjectives, m_binitForAlgDiff, m_bProcessConstraints, m_bProcessObjectives, m_bProcessVariables, m_linearConstraintCoefficientsInColumnMajor, m_linearConstraintCoefficientsInRowMajor, m_mcConstraintTypes, m_mcVariableTypes, m_mdConstraintConstants, m_mdConstraintLowerBounds, m_mdConstraintUpperBounds, m_mdObjectiveConstants, m_mdObjectiveWeights, m_mdVariableLowerBounds, m_mdVariableUpperBounds, m_miNonLinearVarsReverseMap, m_miNumberOfObjCoef, m_mmdDenseObjectiveCoefficients, m_mmdObjGradient, m_mObjectiveCoefficients, m_msConstraintNames, m_msMaxOrMins, m_msObjectiveNames, m_msVariableNames, Objectives::numberOfObjectives, and InstanceData::objectives.

OSInstance::OSInstance | ( |  | ) |

The OSInstance class constructor.

OSInstance::~OSInstance | ( |  | ) |

The OSInstance class destructor.

## Member Function Documentation

bool OSInstance::IsEqual | ( | OSInstance * | that | ) |

A function to check for the equality of two objects.

Definition at line 4859 of file OSInstance.cpp.

Referenced by main().

bool OSInstance::processVariables | ( |  | ) | `[private]`

process variables.

Returns:
  true if the variables are processed.

Exceptions:

  | Exception | if the elements in variables are logically inconsistent.

Definition at line 1028 of file OSInstance.cpp.

References bVariablesModified, ENUM_VARTYPE_BINARY, ENUM_VARTYPE_CONTINUOUS, ENUM_VARTYPE_INTEGER, ENUM_VARTYPE_SEMICONTINUOUS, ENUM_VARTYPE_SEMIINTEGER, ENUM_VARTYPE_STRING, ErrorClass::errormsg, getVariableNumber(), instanceData, Variable::lb, m_bProcessVariables, m_iNumberOfBinaryVariables, m_iNumberOfIntegerVariables, m_iNumberOfSemiContinuousVariables, m_iNumberOfSemiIntegerVariables, m_iNumberOfStringVariables, m_mcVariableTypes, m_mdVariableLowerBounds, m_mdVariableUpperBounds, m_msVariableNames, Variable::name, returnVarType(), Variable::type, Variable::ub, Variables::var, and InstanceData::variables.

Referenced by getNumberOfBinaryVariables(), getNumberOfIntegerVariables(), getNumberOfSemiContinuousVariables(), getNumberOfSemiIntegerVariables(), getNumberOfStringVariables(), getVariableLowerBounds(), getVariableNames(), getVariableTypes(), getVariableUpperBounds(), initializeNonLinearStructures(), and printModel().

bool OSInstance::processObjectives | ( |  | ) | `[private]`

process objectives.

Returns:
  true if the objectives are processed.

Exceptions:

  | Exception | if the elements in objectives are logically inconsistent.

Definition at line 1163 of file OSInstance.cpp.

References bObjectivesModified, Objective::coef, Objective::constant, ErrorClass::errormsg, getObjectiveNumber(), ObjCoef::idx, instanceData, m_bProcessObjectives, m_mdObjectiveConstants, m_mdObjectiveWeights, m_miNumberOfObjCoef, m_mObjectiveCoefficients, m_msMaxOrMins, m_msObjectiveNames, Objective::maxOrMin, Objective::name, SparseVector::number, Objective::numberOfObjCoef, Objectives::obj, InstanceData::objectives, ObjCoef::value, SparseVector::values, and Objective::weight.

Referenced by getObjectiveCoefficientNumbers(), getObjectiveCoefficients(), getObjectiveConstants(), getObjectiveMaxOrMins(), getObjectiveNames(), getObjectiveWeights(), initializeNonLinearStructures(), and printModel().

bool OSInstance::processConstraints | ( |  | ) | `[private]`

process constraints.

Returns:
  true if the constraints are processed.

Exceptions:

  | Exception | if the elements in constraints are logically inconsistent.

Definition at line 1287 of file OSInstance.cpp.

References bConstraintsModified, Constraints::con, Constraint::constant, InstanceData::constraints, ErrorClass::errormsg, getConstraintNumber(), instanceData, Constraint::lb, m_bProcessConstraints, m_mcConstraintTypes, m_mdConstraintConstants, m_mdConstraintLowerBounds, m_mdConstraintUpperBounds, m_msConstraintNames, Constraint::name, OSDBL_MAX, and Constraint::ub.

Referenced by getConstraintLowerBounds(), getConstraintNames(), getConstraintTypes(), getConstraintUpperBounds(), initializeNonLinearStructures(), and printModel().

bool OSInstance::processLinearConstraintCoefficients | ( |  | ) | `[private]`

process linear constraint coefficients.

Returns:
  true if the linear constraint coefficients are processed.

Exceptions:

  | Exception | if the elements in linear constraint coefficients are logically inconsistent.

Definition at line 1376 of file OSInstance.cpp.

References bAMatrixModified, SparseMatrix::bDeleteArrays, LinearConstraintCoefficients::colIdx, InstanceData::constraints, DoubleVector::el, IntVector::el, ErrorClass::errormsg, getLinearConstraintCoefficientNumber(), SparseMatrix::indexes, instanceData, SparseMatrix::isColumnMajor, InstanceData::linearConstraintCoefficients, m_bColumnMajor, m_bProcessLinearConstraintCoefficients, m_linearConstraintCoefficientsInColumnMajor, m_linearConstraintCoefficientsInRowMajor, Constraints::numberOfConstraints, Variables::numberOfVariables, LinearConstraintCoefficients::rowIdx, LinearConstraintCoefficients::start, SparseMatrix::starts, SparseMatrix::startSize, LinearConstraintCoefficients::value, SparseMatrix::values, SparseMatrix::valueSize, and InstanceData::variables.

Referenced by getLinearConstraintCoefficientMajor(), getLinearConstraintCoefficientsInColumnMajor(), and getLinearConstraintCoefficientsInRowMajor().

string OSInstance::getInstanceName | ( |  | ) |

Get instance name.

Returns:
  instance name. Null or empty std::string ("") if there is no instance name.

Definition at line 992 of file OSInstance.cpp.

References instanceHeader, m_sInstanceName, and GeneralFileHeader::name.

Referenced by LindoSolver::dataEchoCheck(), KnitroSolver::dataEchoCheck(), IpoptSolver::dataEchoCheck(), CoinSolver::dataEchoCheck(), BonminSolver::dataEchoCheck(), IpoptProblem::finalize_solution(), main(), LindoSolver::optimize(), KnitroSolver::solve(), CouenneSolver::solve(), CoinSolver::solve(), BonminSolver::solve(), CouenneSolver::writeResult(), and BonminSolver::writeResult().

string OSInstance::getInstanceSource | ( |  | ) |

Get instance source.

Returns:
  instance source. Null or empty std::string ("") if there is no instance source.

Definition at line 1001 of file OSInstance.cpp.

References instanceHeader, m_sInstanceSource, and GeneralFileHeader::source.

Referenced by LindoSolver::dataEchoCheck(), KnitroSolver::dataEchoCheck(), IpoptSolver::dataEchoCheck(), CoinSolver::dataEchoCheck(), and BonminSolver::dataEchoCheck().

string OSInstance::getInstanceDescription | ( |  | ) |

Get instance description.

Returns:
  instance description. Null or empty std::string ("") if there is no instance description.

Definition at line 1010 of file OSInstance.cpp.

References GeneralFileHeader::description, instanceHeader, and m_sInstanceDescription.

Referenced by LindoSolver::dataEchoCheck(), KnitroSolver::dataEchoCheck(), IpoptSolver::dataEchoCheck(), CoinSolver::dataEchoCheck(), and BonminSolver::dataEchoCheck().

int OSInstance::getVariableNumber | ( |  | ) |

Get variable number.

Returns:
  variable number.

Definition at line 1019 of file OSInstance.cpp.

References instanceData, m_iVariableNumber, Variables::numberOfVariables, and InstanceData::variables.

Referenced by LindoSolver::buildSolverInstance(), CouenneSolver::buildSolverInstance(), CoinSolver::buildSolverInstance(), LindoSolver::dataEchoCheck(), KnitroSolver::dataEchoCheck(), IpoptSolver::dataEchoCheck(), CoinSolver::dataEchoCheck(), BonminSolver::dataEchoCheck(), IpoptProblem::finalize_solution(), LindoSolver::generateLindoModel(), IpoptProblem::get_nlp_info(), BonminProblem::get_nlp_info(), IpoptProblem::get_starting_point(), BonminProblem::get_starting_point(), BonminProblem::get_variables_types(), OS_DipInterface::getBlockVarIndexes(), getDenseObjectiveCoefficients(), getLinearConstraintCoefficientsInColumnMajor(), OSRouteSolver::getSeparationInstance(), getSparseJacobianFromColumnMajor(), OS_DipInterface::getVariableNumber(), OS_tm::initialize_core(), KnitroProblem::loadProblemIntoKnitro(), main(), LindoSolver::optimize(), OSDipBlockBearcatSolver::OSDipBlockBearcatSolver(), OSDipBlockCoinSolver::OSDipBlockCoinSolver(), OSDipBlockSlpSolver::OSDipBlockSlpSolver(), printModel(), LindoSolver::processVariables(), processVariables(), OS_DipInterface::readOSiL(), CoinSolver::setCoinPackedMatrix(), CoinSolver::setSolverOptions(), KnitroSolver::solve(), CouenneSolver::solve(), CoinSolver::solve(), BonminSolver::solve(), OS_lp::unpack_module_data(), OSnl2osil::walkTree(), CouenneSolver::writeResult(), and BonminSolver::writeResult().

string * OSInstance::getVariableNames | ( |  | ) |

Get variable names.

Returns:
  a std::string array of variable names, null if no variable names.

Exceptions:

  | Exception | if the elements in variables are logically inconsistent.

Definition at line 1108 of file OSInstance.cpp.

References m_msVariableNames, and processVariables().

Referenced by LindoSolver::dataEchoCheck(), KnitroSolver::dataEchoCheck(), IpoptSolver::dataEchoCheck(), CoinSolver::dataEchoCheck(), BonminSolver::dataEchoCheck(), OS_DipInterface::generateInitialMaster(), OS_DipInterface::getBlockOSInstances(), OSRouteSolver::getSeparationInstance(), OS_DipInterface::getVariableNames(), OSgams2osil::parseGamsInstructions(), and LindoSolver::processVariables().

char * OSInstance::getVariableTypes | ( |  | ) |

Get variable types.

- C for Continuous
- B for Binary
- I for Integer
- S for String

Returns:
  a char array of variable types.

Exceptions:

  | Exception | if the elements in variables are logically inconsistent.

Definition at line 1113 of file OSInstance.cpp.

References m_mcVariableTypes, and processVariables().

Referenced by CouenneSolver::buildSolverInstance(), CoinSolver::buildSolverInstance(), LindoSolver::dataEchoCheck(), KnitroSolver::dataEchoCheck(), IpoptSolver::dataEchoCheck(), CoinSolver::dataEchoCheck(), BonminSolver::dataEchoCheck(), BonminProblem::get_variables_types(), OS_DipInterface::getBlockOSInstances(), OS_DipInterface::getIntegerColumns(), OS_tm::initialize_core(), and LindoSolver::processVariables().

int OSInstance::getNumberOfIntegerVariables | ( |  | ) |

getNumberOfIntegerVariables

Returns:
  an integer which is the number of I variables.

Definition at line 1123 of file OSInstance.cpp.

References m_iNumberOfIntegerVariables, and processVariables().

Referenced by buildSolver(), CoinSolver::buildSolverInstance(), IpoptProblem::get_nlp_info(), OS_DipInterface::getNumberOfIntegerVariables(), main(), LindoSolver::optimize(), CouenneSolver::solve(), CoinSolver::solve(), BonminSolver::solve(), and CoinSolver::writeResult().

int OSInstance::getNumberOfBinaryVariables | ( |  | ) |

getNumberOfBinaryVariables

Returns:
  an integer which is the number of B variables.

Definition at line 1118 of file OSInstance.cpp.

References m_iNumberOfBinaryVariables, and processVariables().

Referenced by buildSolver(), CoinSolver::buildSolverInstance(), IpoptProblem::get_nlp_info(), OS_DipInterface::getNumberOfBinaryVariables(), main(), LindoSolver::optimize(), CouenneSolver::solve(), CoinSolver::solve(), BonminSolver::solve(), and CoinSolver::writeResult().

int OSInstance::getNumberOfSemiContinuousVariables | ( |  | ) |

getNumberOfSemiContinuousVariables

Returns:
  an integer which is the number of D variables.

Definition at line 1128 of file OSInstance.cpp.

References m_iNumberOfSemiContinuousVariables, and processVariables().

Referenced by CoinSolver::buildSolverInstance().

int OSInstance::getNumberOfSemiIntegerVariables | ( |  | ) |

getNumberOfSemiIntegerVariables

Returns:
  an integer which is the number of J variables.

Definition at line 1133 of file OSInstance.cpp.

References m_iNumberOfSemiIntegerVariables, and processVariables().

Referenced by CoinSolver::buildSolverInstance().

int OSInstance::getNumberOfStringVariables | ( |  | ) |

getNumberOfStringVariables

Returns:
  an integer which is the number of S variables.

Definition at line 1138 of file OSInstance.cpp.

References m_iNumberOfStringVariables, and processVariables().

Referenced by CoinSolver::buildSolverInstance().

double * OSInstance::getVariableLowerBounds | ( |  | ) |

Get variable lower bounds.

Returns:
  a double array of variable lower bounds.

Exceptions:

  | Exception | if the elements in variables are logically inconsistent.

Definition at line 1143 of file OSInstance.cpp.

References m_mdVariableLowerBounds, and processVariables().

Referenced by CouenneSolver::buildSolverInstance(), CoinSolver::buildSolverInstance(), LindoSolver::dataEchoCheck(), KnitroSolver::dataEchoCheck(), IpoptSolver::dataEchoCheck(), CoinSolver::dataEchoCheck(), BonminSolver::dataEchoCheck(), IpoptProblem::get_bounds_info(), BonminProblem::get_bounds_info(), OS_DipInterface::getBlockOSInstances(), OS_DipInterface::getColLower(), OSRouteSolver::getSeparationInstance(), OS_tm::initialize_core(), KnitroProblem::loadProblemIntoKnitro(), and LindoSolver::processVariables().

double * OSInstance::getVariableUpperBounds | ( |  | ) |

Get variable upper bounds.

Returns:
  a double array of variable upper bounds.

Exceptions:

  | Exception | if the elements in variables are logically inconsistent.

Definition at line 1148 of file OSInstance.cpp.

References m_mdVariableUpperBounds, and processVariables().

Referenced by CouenneSolver::buildSolverInstance(), CoinSolver::buildSolverInstance(), LindoSolver::dataEchoCheck(), KnitroSolver::dataEchoCheck(), IpoptSolver::dataEchoCheck(), CoinSolver::dataEchoCheck(), BonminSolver::dataEchoCheck(), IpoptProblem::get_bounds_info(), BonminProblem::get_bounds_info(), OS_DipInterface::getBlockOSInstances(), OS_DipInterface::getColUpper(), OSRouteSolver::getSeparationInstance(), OS_tm::initialize_core(), KnitroProblem::loadProblemIntoKnitro(), and LindoSolver::processVariables().

int OSInstance::getObjectiveNumber | ( |  | ) |

Get objective number.

Returns:
  objective number.

Definition at line 1154 of file OSInstance.cpp.

References instanceData, m_iObjectiveNumber, Objectives::numberOfObjectives, and InstanceData::objectives.

Referenced by CouenneSolver::buildSolverInstance(), CoinSolver::buildSolverInstance(), calculateAllObjectiveFunctionValues(), calculateFunctionValue(), calculateHessian(), IpoptProblem::eval_f(), BonminProblem::eval_f(), IpoptProblem::eval_grad_f(), BonminProblem::eval_grad_f(), IpoptProblem::finalize_solution(), getDenseObjectiveCoefficients(), KnitroProblem::loadProblemIntoKnitro(), main(), LindoSolver::optimize(), printModel(), processObjectives(), IpoptSolver::setSolverOptions(), CouenneSolver::writeResult(), and BonminSolver::writeResult().

string * OSInstance::getObjectiveNames | ( |  | ) |

Get objective names.

Returns:
  a std::string array of objective names. Null if no objective names.

Exceptions:

  | Exception | if the elements in objectives are logically inconsistent.

Definition at line 1216 of file OSInstance.cpp.

References m_msObjectiveNames, and processObjectives().

string * OSInstance::getObjectiveMaxOrMins | ( |  | ) |

Get objective maxOrMins.

One maxOrMin for each objective.

Returns:
  a std::string array of objective maxOrMins ("max" or "min"), null if no objectives.

Exceptions:

  | Exception | if the elements in objectives are logically inconsistent.

Definition at line 1221 of file OSInstance.cpp.

References m_msMaxOrMins, and processObjectives().

Referenced by CouenneSolver::buildSolverInstance(), CoinSolver::buildSolverInstance(), LindoSolver::dataEchoCheck(), KnitroSolver::dataEchoCheck(), IpoptSolver::dataEchoCheck(), CoinSolver::dataEchoCheck(), BonminSolver::dataEchoCheck(), LindoSolver::generateLindoModel(), OS_DipInterface::getBlockOSInstances(), OS_DipInterface::getObjectiveMaxOrMins(), and OS_tm::initialize_core().

int * OSInstance::getObjectiveCoefficientNumbers | ( |  | ) |

Get objective coefficient number.

One number for each objective.

Returns:
  an integer array of size of which is equal to number of objectives, each element of the array is the number of nonzero coefficients in that objective function, null if no objectives.

Exceptions:

  | Exception | if the elements in objectives are logically inconsistent.

Definition at line 1226 of file OSInstance.cpp.

References m_miNumberOfObjCoef, and processObjectives().

double * OSInstance::getObjectiveConstants | ( |  | ) |

Get objective constants.

One constant for each objective.

Returns:
  a double array of objective constants, null if no objectives.

Exceptions:

  | Exception | if the elements in objectives are logically inconsistent.

Definition at line 1231 of file OSInstance.cpp.

References m_mdObjectiveConstants, and processObjectives().

Referenced by CouenneSolver::buildSolverInstance(), LindoSolver::generateLindoModel(), OS_DipInterface::getObjectiveConstants(), and CoinSolver::setSolverOptions().

double * OSInstance::getObjectiveWeights | ( |  | ) |

Get objective weights.

One weight for each objective.

Returns:
  a double array of objective weights, null if no objectives.

Exceptions:

  | Exception | if the elements in objectives are logically inconsistent.

Definition at line 1236 of file OSInstance.cpp.

References m_mdObjectiveWeights, and processObjectives().

Referenced by OS_DipInterface::getObjectiveWeights().

SparseVector ** OSInstance::getObjectiveCoefficients | ( |  | ) |

Get objective coefficients.

One set of objective coefficients for each objective.

See also:
  org.optimizationservices.oscommon.datastructure.SparseVector

Returns:
  an array of objective coefficients, null if objective coefficients. Each member of the array is of type ObjectiveCoefficients. The ObjectiveCoefficients class contains two arrays: variableIndexes is an integer array and values is a double array of coefficient values.

Exceptions:

  | Exception | if the elements in objectives are logically inconsistent.

Definition at line 1241 of file OSInstance.cpp.

References m_mObjectiveCoefficients, and processObjectives().

Referenced by CouenneSolver::buildSolverInstance(), calculateFunctionValue(), and getDenseObjectiveCoefficients().

double ** OSInstance::getDenseObjectiveCoefficients | ( |  | ) |

getDenseObjectiveCoefficients.

Returns:
  an vector of pointers, each pointer points to a dense vector of ObjectiveCoefficients.

Definition at line 1247 of file OSInstance.cpp.

References bObjectivesModified, getObjectiveCoefficients(), getObjectiveNumber(), getVariableNumber(), SparseVector::indexes, instanceData, m_bGetDenseObjectives, m_mmdDenseObjectiveCoefficients, SparseVector::number, Objectives::obj, InstanceData::objectives, and SparseVector::values.

Referenced by CoinSolver::buildSolverInstance(), LindoSolver::dataEchoCheck(), KnitroSolver::dataEchoCheck(), IpoptSolver::dataEchoCheck(), CoinSolver::dataEchoCheck(), BonminSolver::dataEchoCheck(), LindoSolver::generateLindoModel(), OS_DipInterface::getBlockOSInstances(), OS_DipInterface::getObjectiveFunctionCoeff(), OSRouteSolver::getSeparationInstance(), OS_tm::initialize_core(), and initializeNonLinearStructures().

int OSInstance::getConstraintNumber | ( |  | ) |

Get constraint number.

Returns:
  constraint number.

Definition at line 1278 of file OSInstance.cpp.

References InstanceData::constraints, instanceData, m_iConstraintNumber, and Constraints::numberOfConstraints.

Referenced by CouenneSolver::buildSolverInstance(), calculateAllConstraintFunctionValues(), calculateFunctionValue(), calculateHessian(), LindoSolver::dataEchoCheck(), KnitroSolver::dataEchoCheck(), IpoptSolver::dataEchoCheck(), CoinSolver::dataEchoCheck(), BonminSolver::dataEchoCheck(), IpoptProblem::finalize_solution(), LindoSolver::generateLindoModel(), IpoptProblem::get_nlp_info(), BonminProblem::get_nlp_info(), OS_DipInterface::getConstraintNumber(), OS_DipInterface::getCoreConstraintIndexes(), getLinearConstraintCoefficientNumber(), getLinearConstraintCoefficientsInRowMajor(), OSRouteSolver::getSeparationInstance(), getSparseJacobianFromColumnMajor(), getSparseJacobianFromRowMajor(), OS_tm::initialize_core(), KnitroProblem::loadProblemIntoKnitro(), main(), LindoSolver::optimize(), printModel(), LindoSolver::processConstraints(), processConstraints(), OS_DipInterface::readOSiL(), CoinSolver::setCoinPackedMatrix(), KnitroSolver::solve(), CouenneSolver::solve(), CoinSolver::solve(), BonminSolver::solve(), OSColGenApp::solveRestrictedMasterRelaxation(), CouenneSolver::writeResult(), CoinSolver::writeResult(), and BonminSolver::writeResult().

string * OSInstance::getConstraintNames | ( |  | ) |

Get constraint names.

Returns:
  a std::string array of constraint names, null if no constraint names.

Exceptions:

  | Exception | if the elements in constraints are logically inconsistent.

Definition at line 1344 of file OSInstance.cpp.

References m_msConstraintNames, and processConstraints().

Referenced by OSgams2osil::createOSInstance(), LindoSolver::dataEchoCheck(), KnitroSolver::dataEchoCheck(), IpoptSolver::dataEchoCheck(), CoinSolver::dataEchoCheck(), BonminSolver::dataEchoCheck(), OS_DipInterface::getConstraintNames(), OSRouteSolver::getSeparationInstance(), printModel(), and LindoSolver::processConstraints().

double * OSInstance::getConstraintLowerBounds | ( |  | ) |

Get constraint lower bounds.

Returns:
  a double array of constraint lower bounds, null if no constraints.

Exceptions:

  | Exception | if the elements in constraints are logically inconsistent.

Definition at line 1350 of file OSInstance.cpp.

References m_mdConstraintLowerBounds, and processConstraints().

Referenced by CouenneSolver::buildSolverInstance(), CoinSolver::buildSolverInstance(), LindoSolver::dataEchoCheck(), KnitroSolver::dataEchoCheck(), IpoptSolver::dataEchoCheck(), CoinSolver::dataEchoCheck(), BonminSolver::dataEchoCheck(), IpoptProblem::get_bounds_info(), BonminProblem::get_bounds_info(), OS_DipInterface::getBlockOSInstances(), OS_DipInterface::getRowLower(), OSRouteSolver::getSeparationInstance(), OS_tm::initialize_core(), KnitroProblem::loadProblemIntoKnitro(), and LindoSolver::processConstraints().

double * OSInstance::getConstraintUpperBounds | ( |  | ) |

Get constraint upper bounds.

Returns:
  a double array of constraint upper bounds, null if constraints.

Exceptions:

  | Exception | if the elements in constraints are logically inconsistent.

Definition at line 1360 of file OSInstance.cpp.

References m_mdConstraintUpperBounds, and processConstraints().

Referenced by CouenneSolver::buildSolverInstance(), CoinSolver::buildSolverInstance(), LindoSolver::dataEchoCheck(), KnitroSolver::dataEchoCheck(), IpoptSolver::dataEchoCheck(), CoinSolver::dataEchoCheck(), BonminSolver::dataEchoCheck(), IpoptProblem::get_bounds_info(), BonminProblem::get_bounds_info(), OS_DipInterface::getBlockOSInstances(), OS_DipInterface::getRowUpper(), OSRouteSolver::getSeparationInstance(), OS_tm::initialize_core(), KnitroProblem::loadProblemIntoKnitro(), and LindoSolver::processConstraints().

char * OSInstance::getConstraintTypes | ( |  | ) |

Get constraint types.

- R for range constraint lb <= constraint <= ub
- L for less than constraint -INF <= con <= ub or con <= ub
- G for greater than constraint lb <= con <= INF or con >= lb
- E for equal to constraint lb <= con <= ub where lb = ub or con = lb/ub
- U for unconstrained constraint -INF <= con <= INF

Returns:
  a char array of constraint types, null if constraints.

Exceptions:

  | Exception | if the elements in constraints are logically inconsistent.

Definition at line 1355 of file OSInstance.cpp.

References m_mcConstraintTypes, and processConstraints().

Referenced by LindoSolver::processConstraints().

int OSInstance::getLinearConstraintCoefficientNumber | ( |  | ) |

Get number of specified (usually nonzero) linear constraint coefficient values.

Returns:
  number of specified (usually nonzero) linear constraint coefficient values.

Definition at line 1366 of file OSInstance.cpp.

References getConstraintNumber(), instanceData, InstanceData::linearConstraintCoefficients, m_iLinearConstraintCoefficientNumber, and LinearConstraintCoefficients::numberOfValues.

Referenced by CoinSolver::buildSolverInstance(), LindoSolver::dataEchoCheck(), KnitroSolver::dataEchoCheck(), IpoptSolver::dataEchoCheck(), BonminSolver::dataEchoCheck(), LindoSolver::generateLindoModel(), OSRouteSolver::getSeparationInstance(), OS_tm::initialize_core(), processLinearConstraintCoefficients(), OS_DipInterface::readOSiL(), and CoinSolver::setCoinPackedMatrix().

bool OSInstance::getLinearConstraintCoefficientMajor | ( |  | ) |

Get whether the constraint coefficients is in column major (true) or row major (false).

Returns:
  whether the constraint coefficients is in column major (true) or row major (false).

Exceptions:

  | Exception | if the elements in linear constraint coefficients are logically inconsistent.

Definition at line 1430 of file OSInstance.cpp.

References m_bColumnMajor, and processLinearConstraintCoefficients().

Referenced by getJacobianSparsityPattern(), OS_tm::initialize_core(), and CoinSolver::setCoinPackedMatrix().

SparseMatrix * OSInstance::getLinearConstraintCoefficientsInColumnMajor | ( |  | ) |

Get linear constraint coefficients in column major.

Returns:
  a sparse matrix reprsentation of linear constraint coefficients in column major, null if no linear constraint coefficients.

Exceptions:

  | Exception | if the elements in linear constraint coefficients are logically inconsistent.

See also:
  org.optimizationservices.oscommon.datastructure.SparseMatrix

Definition at line 1435 of file OSInstance.cpp.

References MathUtil::convertLinearConstraintCoefficientMatrixToTheOtherMajor(), getVariableNumber(), SparseMatrix::indexes, m_bColumnMajor, m_linearConstraintCoefficientsInColumnMajor, m_linearConstraintCoefficientsInRowMajor, processLinearConstraintCoefficients(), SparseMatrix::starts, SparseMatrix::startSize, SparseMatrix::values, and SparseMatrix::valueSize.

Referenced by LindoSolver::dataEchoCheck(), KnitroSolver::dataEchoCheck(), IpoptSolver::dataEchoCheck(), BonminSolver::dataEchoCheck(), LindoSolver::generateLindoModel(), OS_DipInterface::getBlockConstraintIndexes(), OS_DipInterface::getBlockOSInstances(), OSRouteSolver::getSeparationInstance(), OS_tm::initialize_core(), OS_DipInterface::readOSiL(), and CoinSolver::setCoinPackedMatrix().

SparseMatrix * OSInstance::getLinearConstraintCoefficientsInRowMajor | ( |  | ) |

Get linear constraint coefficients in row major.

Returns:
  a sparse matrix reprsentation of linear constraint coefficients in row major, null if no linear constraint coefficients.

Exceptions:

  | Exception | if the elements in linear constraint coefficients are logically inconsistent.

See also:
  org.optimizationservices.oscommon.datastructure.SparseMatrix

Definition at line 1453 of file OSInstance.cpp.

References MathUtil::convertLinearConstraintCoefficientMatrixToTheOtherMajor(), getConstraintNumber(), SparseMatrix::indexes, m_bColumnMajor, m_linearConstraintCoefficientsInColumnMajor, m_linearConstraintCoefficientsInRowMajor, processLinearConstraintCoefficients(), SparseMatrix::starts, SparseMatrix::startSize, SparseMatrix::values, and SparseMatrix::valueSize.

Referenced by CouenneSolver::buildSolverInstance(), OS_DipInterface::getRow(), OSRouteSolver::getSeparationInstance(), OS_tm::initialize_core(), printModel(), OS_DipInterface::readOSiL(), and CoinSolver::setCoinPackedMatrix().

int OSInstance::getNumberOfQuadraticTerms | ( |  | ) |

Get the number of specified (usually nonzero) qTerms in the quadratic coefficients.

Returns:
  qTerm number.

Definition at line 1471 of file OSInstance.cpp.

References instanceData, m_iQuadraticTermNumber, QuadraticCoefficients::numberOfQuadraticTerms, and InstanceData::quadraticCoefficients.

Referenced by buildSolver(), LindoSolver::buildSolverInstance(), CoinSolver::buildSolverInstance(), LindoSolver::dataEchoCheck(), KnitroSolver::dataEchoCheck(), IpoptSolver::dataEchoCheck(), BonminSolver::dataEchoCheck(), IpoptProblem::get_nlp_info(), BonminProblem::get_nlp_info(), getQuadraticRowIndexes(), getQuadraticTerms(), initializeNonLinearStructures(), main(), LindoSolver::processQuadraticTerms(), and IpoptSolver::setSolverOptions().

QuadraticTerms * OSInstance::getQuadraticTerms | ( |  | ) |

Get all the quadratic terms in the instance.

Returns:
  the QuadraticTerms data structure for all quadratic terms in the instance, null if no quadratic terms. The QuadraticTerms contains four arrays: rowIndexes, varOneIndexes, varTwoIndexes, coefficients.

Exceptions:

  | Exception | if the elements in quadratic coefficients are logically inconsistent.

See also:
  org.optimizationservices.oscommon.datastructure.QuadraticTerms

Definition at line 1480 of file OSInstance.cpp.

References QuadraticTerm::coef, QuadraticTerms::coefficients, ErrorClass::errormsg, getNumberOfQuadraticTerms(), QuadraticTerm::idx, QuadraticTerm::idxOne, QuadraticTerm::idxTwo, instanceData, m_bProcessQuadraticTerms, m_quadraticTerms, QuadraticCoefficients::qTerm, InstanceData::quadraticCoefficients, QuadraticTerms::rowIndexes, QuadraticTerms::varOneIndexes, and QuadraticTerms::varTwoIndexes.

Referenced by addQTermsToExressionTree(), LindoSolver::dataEchoCheck(), KnitroSolver::dataEchoCheck(), IpoptSolver::dataEchoCheck(), BonminSolver::dataEchoCheck(), getQuadraticRowIndexes(), and LindoSolver::processQuadraticTerms().

int * OSInstance::getQuadraticRowIndexes | ( |  | ) |

Get the indexes of rows which have a quadratic term.

Returns:
  an integer pointer to the row indexes of rows with quadratic terms, objectives functions have index < 0 NULL if there are no quadratic terms.

Definition at line 1515 of file OSInstance.cpp.

References ErrorClass::errormsg, getNumberOfQuadraticTerms(), getQuadraticTerms(), m_bQuadraticRowIndexesProcessed, m_iNumberOfQuadraticRowIndexes, m_miQuadRowIndexes, and QuadraticTerms::rowIndexes.

Referenced by getNumberOfQuadraticRowIndexes().

int OSInstance::getNumberOfQuadraticRowIndexes | ( |  | ) |

Get the number of rows which have a quadratic term.

Returns:
  an integer which is the number of distinct rows (including obj) with quadratic terms,

Definition at line 1510 of file OSInstance.cpp.

References getQuadraticRowIndexes(), m_bQuadraticRowIndexesProcessed, and m_iNumberOfQuadraticRowIndexes.

int OSInstance::getNumberOfNonlinearExpressions | ( |  | ) |

Get number of nonlinear expressions.

Returns:
  the number of nonlinear expressions.

Definition at line 1546 of file OSInstance.cpp.

References instanceData, m_iNonlinearExpressionNumber, InstanceData::nonlinearExpressions, and NonlinearExpressions::numberOfNonlinearExpressions.

Referenced by buildSolver(), LindoSolver::buildSolverInstance(), CoinSolver::buildSolverInstance(), IpoptProblem::get_nlp_info(), BonminProblem::get_nlp_info(), and main().

OSExpressionTree * OSInstance::getNonlinearExpressionTree | ( | int | rowIdx | ) |

Get the expression tree for a given row index.

Returns:
  an expression tree

define an iterator for the expression trees map allExpTrees

for(pos = m_mapExpressionTrees.begin(); pos != m_mapExpressionTrees.end(); ++pos){

Definition at line 1621 of file OSInstance.cpp.

References getAllNonlinearExpressionTrees(), m_bProcessExpressionTrees, and m_mapExpressionTrees.

Referenced by CouenneSolver::buildSolverInstance(), getNonlinearExpressionTreeInPostfix(), getNonlinearExpressionTreeInPrefix(), and main().

OSExpressionTree * OSInstance::getNonlinearExpressionTreeMod | ( | int | rowIdx | ) |

Get the expression tree for a given row index for the modified expression trees (quadratic terms added).

Returns:
  an expression tree

define an iterator for the expression trees map allExpTrees

for(pos = m_mapExpressionTrees.begin(); pos != m_mapExpressionTrees.end(); ++pos){

Definition at line 1637 of file OSInstance.cpp.

References getAllNonlinearExpressionTreesMod(), m_bProcessExpressionTreesMod, and m_mapExpressionTreesMod.

Referenced by getNonlinearExpressionTreeModInPostfix(), and getNonlinearExpressionTreeModInPrefix().

std::vector< OSnLNode * > OSInstance::getNonlinearExpressionTreeInPostfix | ( | int | rowIdx | ) |

Get the postfix tokens for a given row index.

Returns:
  a vector of pointers to OSnLNodes in postfix, if rowIdx does not index a row with a nonlinear term throw an exception

Definition at line 1653 of file OSInstance.cpp.

References ErrorClass::errormsg, getAllNonlinearExpressionTrees(), getNonlinearExpressionTree(), OSnLNode::getPostfixFromExpressionTree(), m_bProcessExpressionTrees, m_mapExpressionTrees, and OSExpressionTree::m_treeRoot.

Referenced by getNonlinearExpressionTreeInInfix().

std::vector< OSnLNode * > OSInstance::getNonlinearExpressionTreeModInPostfix | ( | int | rowIdx | ) |

Get the postfix tokens for a given row index for the modified Expression Tree (quadratic terms added).

Returns:
  a vector of pointers to OSnLNodes in postfix, if rowIdx does not index a row with a nonlinear term throw an exception

Definition at line 2150 of file OSInstance.cpp.

References ErrorClass::errormsg, getAllNonlinearExpressionTreesMod(), getNonlinearExpressionTreeMod(), OSnLNode::getPostfixFromExpressionTree(), m_bProcessExpressionTreesMod, m_mapExpressionTreesMod, and OSExpressionTree::m_treeRoot.

std::vector< OSnLNode * > OSInstance::getNonlinearExpressionTreeInPrefix | ( | int | rowIdx | ) |

Get the prefix tokens for a given row index.

Returns:
  a vector of pointers to OSnLNodes in prefix, if rowIdx does not index a row with a nonlinear term throw an exception

Definition at line 2171 of file OSInstance.cpp.

References ErrorClass::errormsg, getAllNonlinearExpressionTrees(), getNonlinearExpressionTree(), OSnLNode::getPrefixFromExpressionTree(), m_bProcessExpressionTrees, m_mapExpressionTrees, and OSExpressionTree::m_treeRoot.

std::string OSInstance::getNonlinearExpressionTreeInInfix | ( | int | rowIdx | ) |

Get the infix representation for a given row (or objective function) index.

Parameters:

  | rowIdx | is the index of the row we want to express in infix.

Returns:
  a string representation of the tree, if rowIdx does not index a row with a nonlinear term throw an exception

Definition at line 1672 of file OSInstance.cpp.

References OSnLNodeVariable::coef, ErrorClass::errormsg, getAllNonlinearExpressionTrees(), getNonlinearExpressionTreeInPostfix(), OSnLNode::getTokenName(), OSnLNodeVariable::idx, initForAlgDiff(), OSnLNode::inodeInt, OSnLNode::inumberOfChildren, m_binitForAlgDiff, m_bProcessExpressionTrees, m_mapExpressionTrees, OS_ABS, OS_COS, OS_DIVIDE, os_dtoa_format(), OS_E, OS_ERF, OS_EXP, OS_IF, OS_LN, OS_MAX, OS_MIN, OS_MINUS, OS_NEGATE, OS_NUMBER, OS_PI, OS_PLUS, OS_POWER, OS_PRODUCT, OS_SIN, OS_SQRT, OS_SQUARE, OS_SUM, OS_TIMES, OS_VARIABLE, and OSnLNodeNumber::value.

Referenced by printModel().

std::string OSInstance::printModel | ( |  | ) |

Print the infix representation of the problem.

Returns:
  a string with the infix representation

Definition at line 1994 of file OSInstance.cpp.

References bVariablesModified, getConstraintNumber(), getObjectiveNumber(), getVariableNumber(), initForAlgDiff(), m_bProcessVariables, m_mcVariableTypes, m_mdVariableLowerBounds, m_mdVariableUpperBounds, os_dtoa_format(), and processVariables().

Referenced by OSRouteSolver::getSeparationInstance(), main(), OSDipBlockSlpSolver::solve(), OSDipBlockCoinSolver::solve(), and OSColGenApp::solveRestrictedMasterRelaxation().

std::string OSInstance::printModel | ( | int | rowIdx | ) |

Print the infix representation of the row (which could be an an objective function row) indexed by rowIdx.

Parameters:

  | rowIdx | is the index of the row we want to express in infix.

Returns:
  a string with the infix representation

Definition at line 2060 of file OSInstance.cpp.

References bConstraintsModified, bObjectivesModified, getConstraintNames(), getLinearConstraintCoefficientsInRowMajor(), getNonlinearExpressionTreeInInfix(), SparseVector::indexes, SparseMatrix::indexes, initForAlgDiff(), m_bProcessConstraints, m_bProcessObjectives, m_bSparseJacobianCalculated, m_linearConstraintCoefficientsInRowMajor, m_mapExpressionTreesMod, m_mdConstraintLowerBounds, m_mdConstraintUpperBounds, m_miNumberOfObjCoef, m_mObjectiveCoefficients, os_dtoa_format(), OSDBL_MAX, processConstraints(), processObjectives(), SparseMatrix::starts, and SparseMatrix::values.

std::vector< OSnLNode * > OSInstance::getNonlinearExpressionTreeModInPrefix | ( | int | rowIdx | ) |

Get the prefix tokens for a given row index for the modified Expression Tree (quadratic terms added).

Returns:
  a vector of pointers to OSnLNodes in prefix, if rowIdx does not index a row with a nonlinear term throw an exception

Definition at line 2191 of file OSInstance.cpp.

References ErrorClass::errormsg, getAllNonlinearExpressionTreesMod(), getNonlinearExpressionTreeMod(), OSnLNode::getPrefixFromExpressionTree(), m_bProcessExpressionTreesMod, m_mapExpressionTreesMod, and OSExpressionTree::m_treeRoot.

int OSInstance::getNumberOfNonlinearObjectives | ( |  | ) |

Returns:
  the number of Objectives with a nonlinear term

Definition at line 1615 of file OSInstance.cpp.

References getAllNonlinearExpressionTrees(), m_bProcessExpressionTrees, and m_iObjectiveNumberNonlinear.

Referenced by addQTermsToExressionTree(), LindoSolver::optimize(), and LindoSolver::processNonlinearExpressions().

int OSInstance::getNumberOfNonlinearConstraints | ( |  | ) |

Returns:
  the number of Constraints with a nonlinear term

Definition at line 1609 of file OSInstance.cpp.

References getAllNonlinearExpressionTrees(), m_bProcessExpressionTrees, and m_iConstraintNumberNonlinear.

Referenced by LindoSolver::optimize(), and LindoSolver::processNonlinearExpressions().

std::map< int, OSExpressionTree * > OSInstance::getAllNonlinearExpressionTrees | ( |  | ) |

Returns:
  a map: the key is the row index and the value is the corresponding expression tree

Definition at line 2211 of file OSInstance.cpp.

References OSExpressionTree::bDestroyNlNodes, Nl::idx, instanceData, Nl::m_bDeleteExpressionTree, m_bProcessExpressionTrees, m_iConstraintNumberNonlinear, m_iObjectiveNumberNonlinear, m_mapExpressionTrees, OSnLNode::m_mChildren, OSExpressionTree::m_treeRoot, NonlinearExpressions::nl, InstanceData::nonlinearExpressions, NonlinearExpressions::numberOfNonlinearExpressions, and Nl::osExpressionTree.

Referenced by duplicateExpressionTreesMap(), getNonlinearExpressionTree(), getNonlinearExpressionTreeIndexes(), getNonlinearExpressionTreeInInfix(), getNonlinearExpressionTreeInPostfix(), getNonlinearExpressionTreeInPrefix(), getNumberOfNonlinearConstraints(), getNumberOfNonlinearObjectives(), and initializeNonLinearStructures().

std::map< int, OSExpressionTree * > OSInstance::getAllNonlinearExpressionTreesMod | ( |  | ) |

Returns:
  a map: the key is the row index and the value is the corresponding expression tree

Definition at line 2273 of file OSInstance.cpp.

References initializeNonLinearStructures(), m_bNonLinearStructuresInitialized, m_bProcessExpressionTreesMod, and m_mapExpressionTreesMod.

Referenced by getNonlinearExpressionTreeMod(), getNonlinearExpressionTreeModIndexes(), getNonlinearExpressionTreeModInPostfix(), getNonlinearExpressionTreeModInPrefix(), and LindoSolver::processNonlinearExpressions().

int * OSInstance::getNonlinearExpressionTreeIndexes | ( |  | ) |

Get all the nonlinear expression tree indexes, i.e.

indexes of rows (objectives or constraints) that contain nonlinear expressions.

Returns:
  a pointer to an integer array of nonlinear expression tree indexes.

Definition at line 1560 of file OSInstance.cpp.

References ErrorClass::errormsg, getAllNonlinearExpressionTrees(), m_bNonlinearExpressionTreeIndexesProcessed, m_iNumberOfNonlinearExpressionTreeIndexes, and m_miNonlinearExpressionTreeIndexes.

Referenced by getNumberOfNonlinearExpressionTreeIndexes().

int OSInstance::getNumberOfNonlinearExpressionTreeIndexes | ( |  | ) |

Get the number of unique Nonlinear expression tree indexes.

Returns:
  the number of unique nonlinear expression tree indexes.

Definition at line 1555 of file OSInstance.cpp.

References getNonlinearExpressionTreeIndexes(), m_bNonlinearExpressionTreeIndexesProcessed, and m_iNumberOfNonlinearExpressionTreeIndexes.

int * OSInstance::getNonlinearExpressionTreeModIndexes | ( |  | ) |

Get all the nonlinear expression tree indexes, i.e.

indexes of rows (objetives or constraints) that contain nonlinear expressions after modifying the expression tree to contain quadratic terms.

Returns:
  a pointer to an integer array of nonlinear expression tree indexes (including quadratic terms).

Definition at line 1587 of file OSInstance.cpp.

References ErrorClass::errormsg, getAllNonlinearExpressionTreesMod(), m_bNonlinearExpressionTreeModIndexesProcessed, m_iNumberOfNonlinearExpressionTreeModIndexes, and m_miNonlinearExpressionTreeModIndexes.

Referenced by BonminProblem::get_constraints_linearity(), getNumberOfNonlinearExpressionTreeModIndexes(), and main().

int OSInstance::getNumberOfNonlinearExpressionTreeModIndexes | ( |  | ) |

Get the number of unique Nonlinear expression tree indexes after modifying the expression tree to contain quadratic terms.

Returns:
  the number of unique nonlinear expression tree indexes (including quadratic terms).

Definition at line 1582 of file OSInstance.cpp.

References getNonlinearExpressionTreeModIndexes(), m_bNonlinearExpressionTreeModIndexesProcessed, and m_iNumberOfNonlinearExpressionTreeModIndexes.

Referenced by BonminProblem::get_constraints_linearity(), and main().

std::string OSInstance::getTimeDomainFormat | ( |  | ) |

Get the format of the time domain ("stages"/"interval").

Returns:
  the format of the time domain.

Definition at line 2282 of file OSInstance.cpp.

References instanceData, TimeDomain::interval, TimeDomain::stages, and InstanceData::timeDomain.

int OSInstance::getTimeDomainStageNumber | ( |  | ) |

Get the number of stages that make up the time domain.

Returns:
  the number of time stages.

Definition at line 2292 of file OSInstance.cpp.

References instanceData, TimeDomain::interval, TimeDomainStages::numberOfStages, TimeDomain::stages, and InstanceData::timeDomain.

std::string * OSInstance::getTimeDomainStageNames | ( |  | ) |

Get the names of the stages (NULL or empty string ("") if a stage has not been given a name.

Returns:
  the names of time stages.

Definition at line 2302 of file OSInstance.cpp.

References instanceData, TimeDomain::interval, m_msTimeDomainStageNames, TimeDomainStage::name, TimeDomainStages::numberOfStages, TimeDomainStages::stage, TimeDomain::stages, and InstanceData::timeDomain.

int * OSInstance::getTimeDomainStageNumberOfVariables | ( |  | ) |

Get the number of variables contained in each time stage.

Returns:
  a vector of size numberOfStages.

Definition at line 2319 of file OSInstance.cpp.

References instanceData, TimeDomain::interval, m_miTimeDomainStageVariableNumber, TimeDomainStages::numberOfStages, TimeDomainStageVariables::numberOfVariables, TimeDomainStages::stage, TimeDomain::stages, InstanceData::timeDomain, and TimeDomainStage::variables.

int * OSInstance::getTimeDomainStageNumberOfConstraints | ( |  | ) |

Get the number of constraints contained in each time stage.

Returns:
  a vector of size numberOfStages.

Definition at line 2336 of file OSInstance.cpp.

References TimeDomainStage::constraints, instanceData, TimeDomain::interval, m_miTimeDomainStageConstraintNumber, TimeDomainStageConstraints::numberOfConstraints, TimeDomainStages::numberOfStages, TimeDomainStages::stage, TimeDomain::stages, and InstanceData::timeDomain.

int * OSInstance::getTimeDomainStageNumberOfObjectives | ( |  | ) |

Get the number of objectives contained in each time stage.

Returns:
  a vector of size numberOfStages.

Definition at line 2353 of file OSInstance.cpp.

References instanceData, TimeDomain::interval, m_miTimeDomainStageObjectiveNumber, TimeDomainStageObjectives::numberOfObjectives, TimeDomainStages::numberOfStages, TimeDomainStage::objectives, TimeDomainStages::stage, TimeDomain::stages, and InstanceData::timeDomain.

int ** OSInstance::getTimeDomainStageVarList | ( |  | ) |

Get the list of variables in each stage.

Returns:
  one array of integers for each stage.

Definition at line 2370 of file OSInstance.cpp.

References TimeDomainStageVar::idx, instanceData, TimeDomain::interval, m_iNumberOfTimeStages, m_miTimeDomainStageVariableNumber, m_mmiTimeDomainStageVarList, TimeDomainStages::numberOfStages, TimeDomainStages::stage, TimeDomain::stages, TimeDomainStageVariables::startIdx, InstanceData::timeDomain, TimeDomainStageVariables::var, and TimeDomainStage::variables.

int ** OSInstance::getTimeDomainStageConList | ( |  | ) |

Get the list of constraints in each stage.

Returns:
  one array of integers for each stage.

Definition at line 2406 of file OSInstance.cpp.

References TimeDomainStageConstraints::con, TimeDomainStage::constraints, TimeDomainStageCon::idx, instanceData, TimeDomain::interval, m_iNumberOfTimeStages, m_miTimeDomainStageConstraintNumber, m_mmiTimeDomainStageConList, TimeDomainStages::numberOfStages, TimeDomainStages::stage, TimeDomain::stages, TimeDomainStageConstraints::startIdx, and InstanceData::timeDomain.

int ** OSInstance::getTimeDomainStageObjList | ( |  | ) |

Get the list of objectives in each stage.

Returns:
  one array of integers for each stage.

Definition at line 2442 of file OSInstance.cpp.

References TimeDomainStageObj::idx, instanceData, TimeDomain::interval, m_iNumberOfTimeStages, m_miTimeDomainStageObjectiveNumber, m_mmiTimeDomainStageObjList, TimeDomainStages::numberOfStages, TimeDomainStageObjectives::obj, TimeDomainStage::objectives, TimeDomainStages::stage, TimeDomain::stages, TimeDomainStageObjectives::startIdx, and InstanceData::timeDomain.

double OSInstance::getTimeDomainIntervalStart | ( |  | ) |

Get the start for the time domain interval.

Returns:
  start end of the time interval.

Definition at line 2476 of file OSInstance.cpp.

References instanceData, TimeDomain::interval, TimeDomain::stages, TimeDomainInterval::start, and InstanceData::timeDomain.

double OSInstance::getTimeDomainIntervalHorizon | ( |  | ) |

Get the horizon for the time domain interval.

Returns:
  the end of the time interval.

Definition at line 2486 of file OSInstance.cpp.

References TimeDomainInterval::horizon, instanceData, TimeDomain::interval, TimeDomain::stages, and InstanceData::timeDomain.

bool OSInstance::setInstanceSource | ( | std::string | source | ) |

set the instance source.

Parameters:

  | source | holds the instance source.

Returns:
  whether the instance source is set successfully.

Referenced by main().

bool OSInstance::setInstanceDescription | ( | std::string | description | ) |

set the instance description.

Parameters:

  | description | holds the instance description.

Returns:
  whether the instance description is set successfully.

Referenced by OSMatlab::createOSInstance(), OSnl2osil::createOSInstance(), OSgams2osil::createOSInstance(), OSRouteSolver::getSeparationInstance(), and main().

bool OSInstance::setInstanceName | ( | std::string | name | ) |

set the instance name.

Parameters:

  | name | holds the instance name.

Returns:
  whether the instance name is set successfully.

Referenced by OSMatlab::createOSInstance(), and OSmps2osil::createOSInstance().

bool OSInstance::setVariableNumber | ( | int | number | ) |

set the variable number.

Parameters:

  | number | holds the variable number.

Returns:
  whether the variable number is set successfully.

Definition at line 2518 of file OSInstance.cpp.

References instanceData, Variables::numberOfVariables, Variables::var, and InstanceData::variables.

Referenced by OSMatlab::createOSInstance(), OSnl2osil::createOSInstance(), OSmps2osil::createOSInstance(), OSgams2osil::createOSInstance(), OS_DipInterface::getBlockOSInstances(), OSRouteSolver::getSeparationInstance(), and main().

bool OSInstance::addVariable | ( | int | index,
|  | std::string | name,
|  | double | lowerBound,
|  | double | upperBound,
|  | char | type |
| ) |  |  |

add a variable.

In order to use the add method, the setVariableNumber must first be called so that the variable number is known ahead of time to assign appropriate memory. If a variable with the given variable index already exists, the old variable will be replaced.

Parameters:

  | index | holds the variable index. It is required.
  | name | holds the variable name; use null or empty std::string ("") if no variable name.
  | lowerBound | holds the variable lower bound; use Double.NEGATIVE_INFINITY if no lower bound.
  | upperBound | holds the variable upper bound; use Double.POSITIVE_INFINITY if no upper bound.
  | type | holds the variable type character, B for Binary, I for Integer, S for String, C or any other char for Continuous)
  | init | holds the double variable initial value; use Double.NaN if no initial value -- deprecated
  | initString | holds the std::string variable initial value; use null or empty std::string ("") if no initial std::string value -- deprecated

Returns:
  whether the variable is added successfully.

Referenced by OSMatlab::createOSInstance(), OSnl2osil::createOSInstance(), OSmps2osil::createOSInstance(), OSRouteSolver::getSeparationInstance(), and main().

bool OSInstance::setVariables | ( | int | number,
|  | std::string * | names,
|  | double * | lowerBounds,
|  | double * | upperBounds,
|  | char * | types |
| ) |  |  |

set all the variable related elements.

All the previous variable-related elements will be deleted.

Parameters:

  | number | holds the number of variables. It is required.
  | names | holds a std::string array of variable names; use null if no variable names.
  | lowerBounds | holds a double array of variable lower bounds; use null if all lower bounds are 0; use Double.NEGATIVE_INFINITY if no lower bound for a specific variable in the array.
  | upperBounds | holds a double array of variable upper bounds; use null if no upper bounds; use Double.POSITIVE_INFINITY if no upper bound for a specific variable in the array.
  | types | holds a char array of variable types; use null if all variables are continuous; for a specfic variable in the array use B for Binary, I for Integer, S for String, C or any other char for Continuous,)
  | inits | holds a double array of varible initial values; use null if no initial values. -- deprecated
  | initsString | holds a std::string array of varible initial values; use null if no initial std::string values. -- deprecated

Returns:
  whether the variables are set successfully.

Referenced by OSgams2osil::createOSInstance(), and OS_DipInterface::getBlockOSInstances().

bool OSInstance::setObjectiveNumber | ( | int | number | ) |

set the objective number.

Parameters:

  | number | holds the objective number.

Returns:
  whether the objective number is set successfully.

Definition at line 2599 of file OSInstance.cpp.

References instanceData, Objectives::numberOfObjectives, Objectives::obj, and InstanceData::objectives.

Referenced by OSMatlab::createOSInstance(), OSnl2osil::createOSInstance(), OSmps2osil::createOSInstance(), OSgams2osil::createOSInstance(), OS_DipInterface::getBlockOSInstances(), OSRouteSolver::getSeparationInstance(), and main().

bool OSInstance::addObjective | ( | int | index,
|  | std::string | name,
|  | std::string | maxOrMin,
|  | double | constant,
|  | double | weight,
|  | SparseVector * | objectiveCoefficients |
| ) |  |  |

add an objective.

In order to use the add method, the setObjectiveNumber must first be called so that the objective number is known ahead of time to assign appropriate memory. If a objective with the given objective index already exists, the old objective will be replaced. Objective index will start from -1, -2, -3, ... down, with -1 corresponding to the first objective.

Parameters:

  | index | holds the objective index. Remember the first objective index is -1, second -2, ...
  | name | holds the objective name; use null or empty std::string ("") if no objective name.
  | maxOrMin | holds the objective sense or direction; it can only take two values: "max" or "min".
  | constant | holds the objective constant; use 0.0 if no objective constant.
  | weight | holds the objective weight; use 1.0 if no objective weight.
  | objectiveCoefficients | holds the objective coefficients (null if no objective coefficients) in a sparse representation that holds two arrays: index array and a value array.

Returns:
  whether the objective is added successfully.

Referenced by OSMatlab::createOSInstance(), OSnl2osil::createOSInstance(), OSmps2osil::createOSInstance(), OSgams2osil::createOSInstance(), OS_DipInterface::getBlockOSInstances(), OSRouteSolver::getSeparationInstance(), and main().

bool OSInstance::setObjectives | ( | int | number,
|  | std::string * | names,
|  | std::string * | maxOrMins,
|  | double * | constants,
|  | double * | weights,
|  | SparseVector ** | objectitiveCoefficients |
| ) |  |  |

set all the objectives related elements.

All the previous objective-related elements will be deleted.

Parameters:

  | number | holds the number of objectives. It is required.
  | names | holds a std::string array of objective names; use null if no objective names.
  | maxOrMins | holds a std::string array of objective objective senses or directions: "max" or "min"; use null if all objectives are "min".
  | constants | holds a double array of objective constants; use null if all objective constants are 0.0.
  | weights | holds a double array of objective weights; use null if all objective weights are 1.0.
  | objectitiveCoefficients | holds an array of objective coefficients, (null if no objective have any coefficeints) For each objective, the coefficients are stored in a sparse representation that holds two arrays: index array and a value array. If for a specific objective, there are no objecitve coefficients, use null for the corresponding array member.

Returns:
  whether the objectives are set successfully.

bool OSInstance::setConstraintNumber | ( | int | number | ) |

set the constraint number.

Parameters:

  | number | holds the constraint number.

Returns:
  whether the constraint number is set successfully.

Definition at line 2692 of file OSInstance.cpp.

References Constraints::con, InstanceData::constraints, instanceData, and Constraints::numberOfConstraints.

Referenced by LindoSolver::buildSolverInstance(), OSMatlab::createOSInstance(), OSmps2osil::createOSInstance(), OSgams2osil::createOSInstance(), OS_DipInterface::getBlockOSInstances(), OSRouteSolver::getSeparationInstance(), and main().

bool OSInstance::addConstraint | ( | int | index,
|  | std::string | name,
|  | double | lowerBound,
|  | double | upperBound,
|  | double | constant |
| ) |  |  |

add a constraint.

In order to use the add method, the setConstraintNumber must first be called so that the constraint number is known ahead of time to assign appropriate memory. If a constraint with the given constraint index already exists, the old constraint will be replaced.

Parameters:

  | index | holds the constraint index. It is required.
  | name | holds the constraint name; use null or empty std::string ("") if no constraint name.
  | lowerBound | holds the constraint lower bound; use Double.NEGATIVE_INFINITY if no lower bound.
  | upperBound | holds the constraint upper bound; use Double.POSITIVE_INFINITY if no upper bound.

Returns:
  whether the constraint is added successfully.

Referenced by LindoSolver::buildSolverInstance(), OSMatlab::createOSInstance(), OSmps2osil::createOSInstance(), OSgams2osil::createOSInstance(), OSRouteSolver::getSeparationInstance(), and main().

bool OSInstance::setConstraints | ( | int | number,
|  | std::string * | names,
|  | double * | lowerBounds,
|  | double * | upperBounds,
|  | double * | constants |
| ) |  |  |

set all the constraint related elements.

All the previous constraint-related elements will be deleted.

Parameters:

  | number | holds the number of constraints. It is required.
  | names | holds a std::string array of constraint names; use null if no constraint names.
  | lowerBounds | holds a double array of constraint lower bounds; use null if no lower bounds; use Double.NEGATIVE_INFINITY if no lower bound for a specific constraint in the array.
  | upperBounds | holds a double array of constraint upper bounds; use null if no upper bounds; use Double.POSITIVE_INFINITY if no upper bound for a specific constraint in the array.

Returns:
  whether the constraints are set successfully.

Referenced by OS_DipInterface::getBlockOSInstances().

bool OSInstance::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

Parameters:

  | numberOfValues | holds the number of specified coefficient values (usually nonzero) in the coefficient matrix.
  | isColumnMajor | holds whether the coefficient matrix is stored in column major (true) or row major (false).
  | values | holds a double array coefficient values in the matrix.
  | valuesBegin | holds the begin index of the values array to copy from (usually 0).
  | valuesEnd | holds the end index of the values array to copy till (usually values.lenght - 1).
  | indexes | holds an integer array column/row indexes for each value in the values array.
  | indexesBegin | holds the begin index of the indexes array to copy from (usually 0).
  | indexesEnd | holds the end index of the indexes array to copy till (usually indexes.lenght - 1).
  | starts | holds an integer array start indexes in the matrix; the first value of starts should always be 0.
  | startsBegin | holds the begin index of the starts array to copy from (usually 0).
  | startsEnd | holds the end index of the starts array to copy till (usually starts.lenght - 1).

Returns:
  whether the linear constraint coefficients are set successfully.

Definition at line 2762 of file OSInstance.cpp.

References LinearConstraintCoefficients::colIdx, DoubleVector::el, IntVector::el, instanceData, InstanceData::linearConstraintCoefficients, LinearConstraintCoefficients::numberOfValues, LinearConstraintCoefficients::rowIdx, LinearConstraintCoefficients::start, and LinearConstraintCoefficients::value.

Referenced by OSMatlab::createOSInstance(), OSmps2osil::createOSInstance(), OSgams2osil::createOSInstance(), OS_DipInterface::getBlockOSInstances(), OSRouteSolver::getSeparationInstance(), and main().

bool OSInstance::setQuadraticTerms | ( | int | number,
|  | int * | rowIndexes,
|  | int * | varOneIndexes,
|  | int * | varTwoIndexes,
|  | double * | coefficients,
|  | int | begin,
|  | int | end |
| ) |  |  |

set quadratic terms

Parameters:

  | number | holds the number of quadratic terms.
  | rowIndexes | holds an integer array of row indexes of all the quadratic terms. A negative integer corresponds to an objective row, e.g. -1 for 1st objective and -2 for 2nd.
  | varOneIndexes | holds an integer array of the first varialbe indexes of all the quadratic terms.
  | varTwoIndexes | holds an integer array of the second varialbe indexes of all the quadratic terms.
  | coefficients | holds a double array all the quadratic term coefficients.
  | begin | holds the begin index of all the arrays to copy from (usually = 0).
  | end | holds the end index of all the arrays to copy till (usually = array length -1).

Returns:
  whether the quadratic terms are set successfully.

Definition at line 2837 of file OSInstance.cpp.

References QuadraticTerm::coef, QuadraticTerm::idx, QuadraticTerm::idxOne, QuadraticTerm::idxTwo, instanceData, QuadraticCoefficients::numberOfQuadraticTerms, QuadraticCoefficients::qTerm, and InstanceData::quadraticCoefficients.

bool OSInstance::setQuadraticTermsInNonlinearExpressions | ( | int | number,
|  | int * | rowIndexes,
|  | int * | varOneIndexes,
|  | int * | varTwoIndexes,
|  | double * | coefficients |
| ) |  |  |

set quadratic terms in nonlinearExpressions

Parameters:

  | number | holds the number of quadratic terms.
  | rowIndexes | holds an integer array of row indexes of all the quadratic terms. A negative integer corresponds to an objective row, e.g. -1 for 1st objective and -2 for 2nd.
  | varOneIndexes | holds an integer array of the first varialbe indexes of all the quadratic terms.
  | varTwoIndexes | holds an integer array of the second varialbe indexes of all the quadratic terms.
  | coefficients | holds a double array all the quadratic term coefficients.

Returns:
  whether the quadratic terms are set successfully.

Definition at line 2867 of file OSInstance.cpp.

References OSnLNodeVariable::coef, OSnLNode::createExpressionTreeFromPostfix(), OSnLNodeVariable::idx, Nl::idx, instanceData, OSExpressionTree::m_treeRoot, NonlinearExpressions::nl, InstanceData::nonlinearExpressions, NonlinearExpressions::numberOfNonlinearExpressions, and Nl::osExpressionTree.

Referenced by OSMatlab::createOSInstance().

bool OSInstance::initializeNonLinearStructures | ( |  | ) |

Initialize the data structures for the nonlinear API.

Returns:
  true if we have initialized the nonlinear data strucutres.

Definition at line 2903 of file OSInstance.cpp.

References addQTermsToExressionTree(), InstanceData::constraints, duplicateExpressionTreesMap(), getAllNonlinearExpressionTrees(), getAllNonlinearVariablesIndexMap(), getDenseObjectiveCoefficients(), getNumberOfQuadraticTerms(), instanceData, m_bDuplicateExpressionTreesMap, m_bNonLinearStructuresInitialized, m_bProcessConstraints, m_bProcessExpressionTrees, m_bProcessObjectives, m_bProcessVariables, m_iConstraintNumber, m_iObjectiveNumber, m_iVariableNumber, m_mapExpressionTreesMod, m_mdConstraintFunctionValues, m_mdObjectiveFunctionValues, Constraints::numberOfConstraints, Objectives::numberOfObjectives, Variables::numberOfVariables, InstanceData::objectives, processConstraints(), processObjectives(), processVariables(), and InstanceData::variables.

Referenced by getAllNonlinearExpressionTreesMod(), getJacobianSparsityPattern(), and LindoSolver::processNonlinearExpressions().

double OSInstance::calculateFunctionValue | ( | int | idx,
|  | double * | x,
|  | bool | new_x |
| ) |  |  |

Calculate the function value for function (constraint or objective) indexed by idx.

Parameters:

  | idx | is the index on the constraint (0, 1, 2, 3, ...) or objective function (-1, -2, -3, ...).
  | x | is a pointer (double array) to the current variable values
  | new_x | is false if any evaluation method was previously called for the current x has been evaluated for the current iterate x use a value of false if not sure

Returns:
  the function value as a double.

Definition at line 3080 of file OSInstance.cpp.

References SparseJacobianMatrix::conVals, ErrorClass::errormsg, getConstraintNumber(), getJacobianSparsityPattern(), getObjectiveCoefficients(), getObjectiveNumber(), SparseVector::indexes, SparseJacobianMatrix::indexes, initForAlgDiff(), m_binitForAlgDiff, m_bSparseJacobianCalculated, m_mapExpressionTreesMod, m_mdConstraintConstants, m_mdConstraintFunctionValues, m_mdObjectiveConstants, m_mdObjectiveFunctionValues, m_sparseJacMatrix, SparseVector::number, SparseJacobianMatrix::starts, SparseVector::values, and SparseJacobianMatrix::values.

Referenced by calculateAllConstraintFunctionValues(), calculateAllObjectiveFunctionValues(), and main().

double * OSInstance::calculateAllConstraintFunctionValues | ( | double * | x,
|  | double * | objLambda,
|  | double * | conLambda,
|  | bool | new_x,
|  | int | highestOrder |
| ) |  |  |

Calculate all of the constraint function values.

Parameters:

  | x | is a pointer (double array) to the current variable values
  | objLambda | is the Lagrange multiplier on the objective function
  | conLambda | is pointer (double array) of Lagrange multipliers on the constratins
  | new_x | is false if any evaluation method was previously called for the current x for the current iterate
  | highestOrder | is the highest order of the derivative being calculated

Returns:
  a double array of constraint function values -- the size of the array is equal to getConstraintNumber().

Definition at line 3140 of file OSInstance.cpp.

References ErrorClass::errormsg, getIterateResults(), m_iHighestOrderEvaluated, and m_mdConstraintFunctionValues.

Referenced by IpoptProblem::eval_g(), BonminProblem::eval_g(), KnitroProblem::evalFC(), getIterateResults(), and main().

double * OSInstance::calculateAllConstraintFunctionValues | ( | double * | x,
|  | bool | new_x |
| ) |  |  |

Calculate all of the constraint function values, we are overloading this function and this version of the method will not use any AD and will evaluate function values from the OS Expression Tree.

Parameters:

  | x | is a pointer (double array) to the current variable values
  | new_x | is false if any evaluation method was previously called for the current iterate

Returns:
  a double array of constraint function values -- the size of the array is equal to getConstraintNumber().

Definition at line 3153 of file OSInstance.cpp.

References calculateFunctionValue(), getConstraintNumber(), m_iHighestOrderEvaluated, and m_mdConstraintFunctionValues.

double * OSInstance::calculateAllObjectiveFunctionValues | ( | double * | x,
|  | double * | objLambda,
|  | double * | conLambda,
|  | bool | new_x,
|  | int | highestOrder |
| ) |  |  |

Calculate all of the objective function values.

Parameters:

  | x | is a pointer (double array) to the current variable values
  | objLambda | is the Lagrange multiplier on the objective function
  | conLambda | is pointer (double array) of Lagrange multipliers on the constratins
  | new_x | is false if any evaluation method was previously called for the current iterate
  | highestOrder | is the highest order of the derivative being calculated

Returns:
  a double array of objective function values -- the size of the array is equal to getObjectiveNumber().

Definition at line 3172 of file OSInstance.cpp.

References ErrorClass::errormsg, getIterateResults(), m_iHighestOrderEvaluated, and m_mdObjectiveFunctionValues.

Referenced by IpoptProblem::eval_f(), BonminProblem::eval_f(), KnitroProblem::evalFC(), IpoptProblem::finalize_solution(), getIterateResults(), main(), CouenneSolver::writeResult(), and BonminSolver::writeResult().

double * OSInstance::calculateAllObjectiveFunctionValues | ( | double * | x,
|  | bool | new_x |
| ) |  |  |

Calculate all of the objective function values, we are overloading this function and this version of the method will not use any AD and will evaluate function values from the OS Expression Tree.

Parameters:

  | x | is a pointer (double array) to the current variable values
  | new_x | is false if any evaluation method was previously called for the current iterate

Returns:
  a double array of objective function values -- the size of the array is equal to getObjectiveNumber().

Definition at line 3185 of file OSInstance.cpp.

References calculateFunctionValue(), getObjectiveNumber(), m_iHighestOrderEvaluated, and m_mdObjectiveFunctionValues.

SparseJacobianMatrix * OSInstance::calculateAllConstraintFunctionGradients | ( | double * | x,
|  | double * | objLambda,
|  | double * | conLambda,
|  | bool | new_x,
|  | int | highestOrder |
| ) |  |  |

Calculate the gradient of all constraint functions.

Parameters:

  | x | is a pointer (double array) to the current variable values
  | objLambda | is the Lagrange multiplier on the objective function
  | conLambda | is pointer (double array) of Lagrange multipliers on the constratins
  | new_x | is false if any evaluation method was previously called for the current iterate
  | highestOrder | is the highest order of the derivative being calculated

Returns:
  a pointer a SparseJacobianMatrix.

Definition at line 3204 of file OSInstance.cpp.

References ErrorClass::errormsg, getIterateResults(), m_iHighestOrderEvaluated, and m_sparseJacMatrix.

Referenced by KnitroProblem::evalGA(), and main().

SparseVector * OSInstance::calculateConstraintFunctionGradient | ( | double * | x,
|  | double * | objLambda,
|  | double * | conLambda,
|  | int | idx,
|  | bool | new_x,
|  | int | highestOrder |
| ) |  |  |

Calculate the gradient of the constraint function indexed by idx.

Parameters:

  | x | is a pointer (double array) to the current variable values
  | objLambda | is the Lagrange multiplier on the objective function
  | conLambda | is pointer (double array) of Lagrange multipliers on the constratins idx is the index of the constraint function gradient
  | new_x | is false if any evaluation method was previously called for the current iterate
  | highestOrder | is the highest order of the derivative being calculated

Returns:
  a pointer to a sparse vector of doubles.

Definition at line 3219 of file OSInstance.cpp.

References SparseVector::bDeleteArrays, InstanceData::constraints, ErrorClass::errormsg, getIterateResults(), SparseVector::indexes, instanceData, m_iHighestOrderEvaluated, m_mdJacValue, m_miJacIndex, m_miJacStart, SparseVector::number, Constraints::numberOfConstraints, and SparseVector::values.

Referenced by main().

SparseVector * OSInstance::calculateConstraintFunctionGradient | ( | double * | x,
|  | int | idx,
|  | bool | new_x |
| ) |  |  |

Calculate the gradient of the constraint function indexed by idx this function is overloaded.

Parameters:

  | x | is a pointer (double array) to the current variable values idx is the index of the constraint function gradient
  | new_x | is false if any evaluation method was previously called for the current iterate
  | highestOrder | is the highest order of the derivative being calculated

Returns:
  a pointer to a sparse vector of doubles.

Definition at line 3246 of file OSInstance.cpp.

References SparseVector::bDeleteArrays, InstanceData::constraints, ErrorClass::errormsg, getIterateResults(), SparseVector::indexes, instanceData, m_iHighestOrderEvaluated, m_mdJacValue, m_miJacIndex, m_miJacStart, SparseVector::number, Constraints::numberOfConstraints, and SparseVector::values.

double ** OSInstance::calculateAllObjectiveFunctionGradients | ( | double * | x,
|  | double * | objLambda,
|  | double * | conLambda,
|  | bool | new_x,
|  | int | highestOrder |
| ) |  |  |

Calculate the gradient of all objective functions.

Parameters:

  | x | is a pointer (double array) to the current variable values
  | objLambda | is the Lagrange multiplier on the objective function
  | conLambda | is pointer (double array) of Lagrange multipliers on the constratins
  | new_x | is false if any evaluation method was previously called for the current iterate
  | highestOrder | is the highest order of the derivative being calculated

Returns:
  an array of pointer to dense objective function gradients.

Definition at line 3271 of file OSInstance.cpp.

References calculateObjectiveFunctionGradient(), ErrorClass::errormsg, m_iHighestOrderEvaluated, m_mapExpressionTreesMod, and m_mmdObjGradient.

Referenced by KnitroProblem::evalGA().

double * OSInstance::calculateObjectiveFunctionGradient | ( | double * | x,
|  | double * | objLambda,
|  | double * | conLambda,
|  | int | objIdx,
|  | bool | new_x,
|  | int | highestOrder |
| ) |  |  |

Calculate the gradient of the objective function indexed by objIdx.

Parameters:

  | x | is a pointer (double array) to the current variable values
  | objLambda | is the Lagrange multiplier on the objective function
  | conLambda | is pointer (double array) of Lagrange multipliers on the constratins objIdx is the index of the objective function being optimized
  | new_x | is false if any evaluation method was previously called for the current iterate
  | highestOrder | is the highest order of the derivative being calculated

Returns:
  a pointer to a dense vector of doubles.

Definition at line 3291 of file OSInstance.cpp.

References createOSADFun(), ErrorClass::errormsg, forwardAD(), m_bCppADMustReTape, m_bOSADFunIsCreated, m_iHighestOrderEvaluated, m_iNumberOfNonlinearVariables, m_mapAllNonlinearVariablesIndex, m_mapExpressionTreesMod, m_miNonLinearVarsReverseMap, m_mmdDenseObjectiveCoefficients, m_mmdObjGradient, m_vdRangeUnitVec, m_vdX, m_vdYjacval, and reverseAD().

Referenced by calculateAllObjectiveFunctionGradients(), IpoptProblem::eval_grad_f(), BonminProblem::eval_grad_f(), and main().

double * OSInstance::calculateObjectiveFunctionGradient | ( | double * | x,
|  | int | objIdx,
|  | bool | new_x |
| ) |  |  |

Calculate the gradient of the objective function indexed by objIdx this function is overloaded.

Parameters:

  | x | is a pointer (double array) to the current variable values
  | objIdx | is the index of the objective function being optimized
  | new_x | is false if any evaluation method was previously called for the current iterate

Returns:
  a pointer to a dense vector of doubles.

Definition at line 3344 of file OSInstance.cpp.

References createOSADFun(), ErrorClass::errormsg, forwardAD(), m_bCppADMustReTape, m_bOSADFunIsCreated, m_iHighestOrderEvaluated, m_iNumberOfNonlinearVariables, m_mapAllNonlinearVariablesIndex, m_mapExpressionTreesMod, m_miNonLinearVarsReverseMap, m_mmdDenseObjectiveCoefficients, m_mmdObjGradient, m_vdRangeUnitVec, m_vdX, m_vdYjacval, and reverseAD().

SparseHessianMatrix * OSInstance::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 tree for only the first iteration Use this method on if the value of x does not affect the operations sequence.

Parameters:

  | x | is a pointer (double array) to the current variable values
  | objLambda | is the Lagrange multiplier on the objective function
  | conLambda | is pointer (double array) of Lagrange multipliers on the constratins
  | new_x | is false if any evaluation method was previously called for the current iterate
  | highestOrder | is the highest order of the derivative being calculated

Returns:
  a pointer a SparseHessianMatrix. Each array member corresponds to one constraint gradient.

Definition at line 3388 of file OSInstance.cpp.

References ErrorClass::errormsg, getIterateResults(), m_iHighestOrderEvaluated, and m_LagrangianSparseHessian.

Referenced by IpoptProblem::eval_h(), BonminProblem::eval_h(), KnitroProblem::evalH(), and main().

SparseHessianMatrix * OSInstance::calculateHessian | ( | double * | x,
|  | int | idx,
|  | bool | new_x |
| ) |  |  |

Calculate the Hessian of a constraint or objective function.

Parameters:

  | x | is a pointer (double array) to the current variable values
  | new_x | is false if any evaluation method was previously called for the current iterate idx is the index of the either a constraint or objective function Hessian

Returns:
  a pointer a SparseVector. Each array member corresponds to one constraint gradient.

Definition at line 3403 of file OSInstance.cpp.

References InstanceData::constraints, ErrorClass::errormsg, getConstraintNumber(), getIterateResults(), getObjectiveNumber(), instanceData, m_iHighestOrderEvaluated, m_LagrangianSparseHessian, and Constraints::numberOfConstraints.

Referenced by main().

bool OSInstance::getSparseJacobianFromColumnMajor | ( |  | ) |

Returns:
  true if successful in generating the constraints gradient.

Definition at line 3442 of file OSInstance.cpp.

References OSnLNodeVariable::coef, DoubleVector::el, IntVector::el, getConstraintNumber(), getVariableNumber(), OSnLNodeVariable::idx, instanceData, InstanceData::linearConstraintCoefficients, m_bColumnMajor, m_iJacValueSize, m_mapExpressionTreesMod, OSnLNode::m_mChildren, m_mdJacValue, m_miJacIndex, m_miJacNumConTerms, m_miJacStart, OSExpressionTree::m_treeRoot, LinearConstraintCoefficients::rowIdx, LinearConstraintCoefficients::start, and LinearConstraintCoefficients::value.

Referenced by getJacobianSparsityPattern().

bool OSInstance::getSparseJacobianFromRowMajor | ( |  | ) |

Returns:
  true if successful in generating the constraints gradient.

Definition at line 3591 of file OSInstance.cpp.

References OSnLNodeVariable::coef, LinearConstraintCoefficients::colIdx, DoubleVector::el, IntVector::el, getConstraintNumber(), OSnLNodeVariable::idx, instanceData, InstanceData::linearConstraintCoefficients, m_bColumnMajor, m_iJacValueSize, m_mapExpressionTreesMod, OSnLNode::m_mChildren, m_mdJacValue, m_miJacIndex, m_miJacNumConTerms, m_miJacStart, LinearConstraintCoefficients::start, and LinearConstraintCoefficients::value.

Referenced by getJacobianSparsityPattern().

OSExpressionTree * OSInstance::getLagrangianExpTree | ( |  | ) |

Returns:
  a pointer to the ExpressionTree for the Lagrangian function of current instance we only take the Lagrangian of the rows with nonlinear terms

Definition at line 3726 of file OSInstance.cpp.

References OSnLNodeVariable::coef, InstanceData::constraints, getJacobianSparsityPattern(), OSExpressionTree::getVariableIndiciesMap(), OSnLNodeVariable::idx, instanceData, OSnLNode::inumberOfChildren, m_bLagrangianExpTreeCreated, m_bSparseJacobianCalculated, m_LagrangianExpTree, m_mapExpressionTreesMod, OSnLNode::m_mChildren, OSExpressionTree::m_treeRoot, Constraints::numberOfConstraints, Variables::numberOfVariables, and InstanceData::variables.

std::map< int, int > OSInstance::getAllNonlinearVariablesIndexMap | ( |  | ) |

Returns:
  a pointer to a map of the indices of all of the variables that appear in the Lagrangian function

Definition at line 3778 of file OSInstance.cpp.

References DEBUG, OSExpressionTree::getVariableIndiciesMap(), m_bAllNonlinearVariablesIndex, OSExpressionTree::m_bIndexMapGenerated, m_iNumberOfNonlinearVariables, m_mapAllNonlinearVariablesIndex, m_mapExpressionTreesMod, m_miNonLinearVarsReverseMap, and OSExpressionTree::mapVarIdx.

Referenced by BonminProblem::get_variables_linearity(), initializeNonLinearStructures(), and main().

SparseHessianMatrix * OSInstance::getLagrangianHessianSparsityPattern | ( |  | ) |

Returns:
  a pointer to a SparseHessianMatrix with the nonzero structure of the Lagrangian Expression Tree

Definition at line 3815 of file OSInstance.cpp.

References SparseHessianMatrix::bDeleteArrays, createOSADFun(), getADSparsityHessian(), SparseHessianMatrix::hessColIdx, SparseHessianMatrix::hessDimension, SparseHessianMatrix::hessRowIdx, SparseHessianMatrix::hessValues, initForAlgDiff(), m_bCppADMustReTape, m_binitForAlgDiff, m_bLagrangianSparseHessianCreated, m_bOSADFunIsCreated, m_iNumberOfNonlinearVariables, m_LagrangianSparseHessian, m_mapAllNonlinearVariablesIndex, m_mapExpressionTreesMod, and m_vbLagHessNonz.

Referenced by IpoptProblem::eval_h(), BonminProblem::eval_h(), IpoptProblem::get_nlp_info(), BonminProblem::get_nlp_info(), getSecondOrderResults(), and main().

bool OSInstance::addQTermsToExressionTree | ( |  | ) |

Returns:
  true if successful in adding the qTerms to the ExpressionTree.

Definition at line 2975 of file OSInstance.cpp.

References OSnLNodeVariable::coef, QuadraticTerms::coefficients, DEBUG, getNumberOfNonlinearObjectives(), getQuadraticTerms(), OSExpressionTree::getVariableIndiciesMap(), OSnLNodeVariable::idx, instanceData, OSExpressionTree::m_bIndexMapGenerated, m_bProcessExpressionTrees, m_bQTermsAdded, m_iConstraintNumberNonlinear, m_iNonlinearExpressionNumber, m_iObjectiveNumberNonlinear, m_mapExpressionTrees, m_mapExpressionTreesMod, OSnLNode::m_mChildren, m_quadraticTerms, OSExpressionTree::m_treeRoot, OSExpressionTree::mapVarIdx, QuadraticCoefficients::numberOfQuadraticTerms, InstanceData::quadraticCoefficients, QuadraticTerms::rowIndexes, QuadraticTerms::varOneIndexes, and QuadraticTerms::varTwoIndexes.

Referenced by initializeNonLinearStructures().

SparseJacobianMatrix * OSInstance::getJacobianSparsityPattern | ( |  | ) |

Returns:
  pointer to a SparseJacobianMatrix.

Definition at line 2937 of file OSInstance.cpp.

References SparseJacobianMatrix::bDeleteArrays, SparseJacobianMatrix::conVals, ErrorClass::errormsg, getLinearConstraintCoefficientMajor(), getSparseJacobianFromColumnMajor(), getSparseJacobianFromRowMajor(), SparseJacobianMatrix::indexes, initializeNonLinearStructures(), m_bColumnMajor, m_bNonLinearStructuresInitialized, m_bSparseJacobianCalculated, m_iJacValueSize, m_mdJacValue, m_miJacIndex, m_miJacNumConTerms, m_miJacStart, m_sparseJacMatrix, SparseJacobianMatrix::starts, SparseJacobianMatrix::values, and SparseJacobianMatrix::valueSize.

Referenced by calculateFunctionValue(), IpoptProblem::eval_jac_g(), BonminProblem::eval_jac_g(), IpoptProblem::get_nlp_info(), BonminProblem::get_nlp_info(), getLagrangianExpTree(), KnitroProblem::loadProblemIntoKnitro(), and main().

void OSInstance::duplicateExpressionTreesMap | ( |  | ) |

duplicate the map of expression trees.

Definition at line 3911 of file OSInstance.cpp.

References getAllNonlinearExpressionTrees(), m_bDuplicateExpressionTreesMap, m_bProcessExpressionTrees, m_mapExpressionTrees, and m_mapExpressionTreesMod.

Referenced by initializeNonLinearStructures().

bool OSInstance::createOSADFun | ( | std::vector< double > | vdX | ) |

Create the a CppAD Function object: this is a function where the domain is the set of variables for the problem and the range is the objective function plus constraints.

Parameters:

  | vdX | is a vector of doubles holding the current primal variable values the size of x should equal instanceData->variables->numberOfVariables

Returns:
  if successfully created

Definition at line 4699 of file OSInstance.cpp.

References initForAlgDiff(), m_binitForAlgDiff, m_bOSADFunIsCreated, m_iHighestTaylorCoeffOrder, m_mapAllNonlinearVariablesIndex, m_mapExpressionTreesMod, and m_mapOSADFunRangeIndex.

Referenced by calculateObjectiveFunctionGradient(), forwardAD(), getIterateResults(), and getLagrangianHessianSparsityPattern().

std::vector< double > OSInstance::forwardAD | ( | int | p,
|  | std::vector< double > | vdX |
| ) |  |  |

Perform an AD forward sweep.

Parameters:

  | p | is the highest order Taylor coefficient
  | vdX | is a vector of doubles of the current primal variable values the size of vdX m_iNumberOfNonlinearVariables

Returns:
  a double vector equal to the dimension of the range space the result of the forward p sweep

Definition at line 4753 of file OSInstance.cpp.

References createOSADFun(), m_bOSADFunIsCreated, m_iHighestOrderEvaluated, and m_iHighestTaylorCoeffOrder.

Referenced by calculateObjectiveFunctionGradient(), and main().

std::vector< double > OSInstance::reverseAD | ( | int | p,
|  | std::vector< double > | vdlambda |
| ) |  |  |

Perform an AD reverse sweep.

Parameters:

  | p | is the order of the sweep
  | vdlambda | is a vector of doubles of the current dual (lagrange) variable values the size of lambda should equal number of objective functions plus number of constraints

Returns:
  a double vector equal to the n*p

Definition at line 4778 of file OSInstance.cpp.

References m_iHighestOrderEvaluated, and m_iHighestTaylorCoeffOrder.

Referenced by calculateObjectiveFunctionGradient(), getFirstOrderResults(), getSecondOrderResults(), and main().

int OSInstance::getADSparsityHessian | ( |  | ) |

Call the AD routine to fill in m_vbLagHessNonz and determine the nonzeros.

Returns:
  the number of nonzeros in the Hessian

Definition at line 4804 of file OSInstance.cpp.

References m_mapExpressionTreesMod, and m_vbLagHessNonz.

Referenced by getLagrangianHessianSparsityPattern().

bool OSInstance::getIterateResults | ( | double * | x,
|  | double * | objLambda,
|  | double * | conLambda,
|  | bool | new_x,
|  | int | highestOrder |
| ) |  |  |

Get the information for each iteration.

Get the functions values, Jacobian and Hessian of the Lagrangian

Parameters:

  | x | is a pointer of doubles of primal values for the current iteration
  | objLambda | is is a pointer of doubles of the current dual (Lagrange) multipliers on the objective functions
  | conLambda | is a pointer of doubles of the current dual (Lagrange) multipliers on the constraints
  | new_x | is false if any evaluation method was previously called
  | highestOrder | is the highest order derivative to be calculated

Returns:
  true if successful

Definition at line 3928 of file OSInstance.cpp.

References bUseExpTreeForFunEval, calculateAllConstraintFunctionValues(), calculateAllObjectiveFunctionValues(), createOSADFun(), ErrorClass::errormsg, getFirstOrderResults(), getSecondOrderResults(), getZeroOrderResults(), initForAlgDiff(), m_bCppADMustReTape, m_binitForAlgDiff, m_bOSADFunIsCreated, m_iHighestOrderEvaluated, m_mapAllNonlinearVariablesIndex, m_mapExpressionTreesMod, and m_vdX.

Referenced by calculateAllConstraintFunctionGradients(), calculateAllConstraintFunctionValues(), calculateAllObjectiveFunctionValues(), calculateConstraintFunctionGradient(), calculateHessian(), and calculateLagrangianHessian().

bool OSInstance::getZeroOrderResults | ( | double * | x,
|  | double * | objLambda,
|  | double * | conLambda |
| ) |  |  |

Calculate function values.

Parameters:

  | x | is a pointer of doubles of primal values for the current iteration
  | objLambda | is is a pointer of doubles of the current dual (Lagrange) multipliers on the objective functions
  | conLambda | is a pointer of doubles of the current dual (Lagrange) multipliers on the constraints

Returns:
  true if successful

Definition at line 3989 of file OSInstance.cpp.

References SparseJacobianMatrix::conVals, SparseJacobianMatrix::indexes, m_iConstraintNumber, m_iObjectiveNumber, m_iVariableNumber, m_mapExpressionTreesMod, m_mapOSADFunRangeIndex, m_mdConstraintConstants, m_mdConstraintFunctionValues, m_mdObjectiveFunctionValues, m_mmdDenseObjectiveCoefficients, m_sparseJacMatrix, m_vdX, m_vdYval, SparseJacobianMatrix::starts, and SparseJacobianMatrix::values.

Referenced by getIterateResults().

bool OSInstance::getFirstOrderResults | ( | double * | x,
|  | double * | objLambda,
|  | double * | conLambda |
| ) |  |  |

Calculate first derivatives.

Parameters:

  | x | is a pointer of doubles of primal values for the current iteration
  | objLambda | is is a pointer of doubles of the current dual (Lagrange) multipliers on the objective functions
  | conLambda | is a pointer of doubles of the current dual (Lagrange) multipliers on the constraints

Returns:
  true if successful

if the number of columns exceeds the number of rows we will get the Jacobian by row, however, if the number of rows exceeds the number of columns we get the Jacobian by column

Definition at line 4038 of file OSInstance.cpp.

References SparseJacobianMatrix::indexes, m_iConstraintNumber, m_iNumberOfNonlinearVariables, m_iObjectiveNumberNonlinear, m_mapAllNonlinearVariablesIndex, m_mapExpressionTreesMod, m_mdJacValue, m_miJacNumConTerms, m_miJacStart, m_miNonLinearVarsReverseMap, m_sparseJacMatrix, m_vdDomainUnitVec, m_vdRangeUnitVec, m_vdYjacval, OSExpressionTree::mapVarIdx, reverseAD(), SparseJacobianMatrix::starts, and SparseJacobianMatrix::values.

Referenced by getIterateResults().

bool OSInstance::getSecondOrderResults | ( | double * | x,
|  | double * | objLambda,
|  | double * | conLambda |
| ) |  |  |

Calculate second derivatives.

Parameters:

  | x | is a pointer of doubles of primal values for the current iteration
  | objLambda | is is a pointer of doubles of the current dual (Lagrange) multipliers on the objective functions
  | conLambda | is a pointer of doubles of the current dual (Lagrange) multipliers on the constraints

Returns:
  true if successful

Definition at line 4147 of file OSInstance.cpp.

References DEBUG, getLagrangianHessianSparsityPattern(), SparseHessianMatrix::hessValues, SparseJacobianMatrix::indexes, m_bLagrangianSparseHessianCreated, m_iConstraintNumber, m_iNumberOfNonlinearVariables, m_iObjectiveNumberNonlinear, m_LagrangianSparseHessian, m_mapExpressionTreesMod, m_mdJacValue, m_miJacNumConTerms, m_miJacStart, m_miNonLinearVarsReverseMap, m_mmdDenseObjectiveCoefficients, m_mmdObjGradient, m_sparseJacMatrix, m_vbLagHessNonz, m_vdDomainUnitVec, m_vdLambda, m_vdw, m_vdYjacval, OSExpressionTree::mapVarIdx, reverseAD(), SparseJacobianMatrix::starts, and SparseJacobianMatrix::values.

Referenced by getIterateResults().

bool OSInstance::initForAlgDiff | ( |  | ) |

This should be called by nonlinear solvers using callback functions.

initForAlgDiff will initialize the correct nonlinear structures in preparation for using the algorithmic differentiation routines.

Returns:
  true if successful

Definition at line 4235 of file OSInstance.cpp.

Referenced by CouenneSolver::buildSolverInstance(), calculateFunctionValue(), createOSADFun(), IpoptProblem::get_nlp_info(), BonminProblem::get_nlp_info(), BonminProblem::get_variables_linearity(), getIterateResults(), getLagrangianHessianSparsityPattern(), getNonlinearExpressionTreeInInfix(), KnitroProblem::loadProblemIntoKnitro(), main(), and printModel().

bool OSInstance::initObjGradients | ( |  | ) |

This should be called by initForAlgDiff().

initObjGradients will initialize the objective function gradients to be equal to the coefficients given in the <coef> section of the OSiL instance

Returns:
  true if successful

Definition at line 4264 of file OSInstance.cpp.

bool OSInstance::setTimeDomain | ( | std::string | format | ) |

This sets the format of the time domain ("stages"/"interval"/"none").

Definition at line 4294 of file OSInstance.cpp.

References instanceData, TimeDomain::interval, m_sTimeDomainFormat, TimeDomain::stages, and InstanceData::timeDomain.

bool OSInstance::setTimeDomainStages | ( | int | number,
|  | std::string * | names |
| ) |  |  |

This sets the number (and optionally names) of the time stages.

Definition at line 4335 of file OSInstance.cpp.

References TimeDomainStage::constraints, instanceData, TimeDomain::interval, TimeDomainStages::numberOfStages, TimeDomainStage::objectives, TimeDomainStages::stage, TimeDomain::stages, InstanceData::timeDomain, and TimeDomainStage::variables.

bool OSInstance::setTimeDomainStageVariablesOrdered | ( | int | numberOfStages,
|  | int * | numberOfVariables,
|  | int * | startIdx |
| ) |  |  |

This sets the variables associated with each time domain stage in temporal order.

(I.e., for each stage numberOfVariables gives the number of variables accociated with this stage and startIdx gives the first variable in this stage.)

Definition at line 4405 of file OSInstance.cpp.

References instanceData, TimeDomain::interval, TimeDomainStages::numberOfStages, TimeDomainStageVariables::numberOfVariables, TimeDomainStages::stage, TimeDomain::stages, TimeDomainStageVariables::startIdx, InstanceData::timeDomain, and TimeDomainStage::variables.

bool OSInstance::setTimeDomainStageVariablesUnordered | ( | int | numberOfStages,
|  | int * | numberOfVariables,
|  | int ** | varIndex |
| ) |  |  |

This sets the variables associated with each time domain stage in srbitrary order.

(I.e., for each stage numberOfVariables gives the number of variables accociated with this stage and varIndex[i] gives the index of each variable in stage[i].)

Definition at line 4442 of file OSInstance.cpp.

References TimeDomainStageVar::idx, instanceData, TimeDomain::interval, TimeDomainStages::numberOfStages, TimeDomainStageVariables::numberOfVariables, TimeDomainStages::stage, TimeDomain::stages, InstanceData::timeDomain, TimeDomainStageVariables::var, and TimeDomainStage::variables.

bool OSInstance::setTimeDomainStageConstraintsOrdered | ( | int | numberOfStages,
|  | int * | numberOfConstraints,
|  | int * | startIdx |
| ) |  |  |

This sets the constraints associated with each time domain stage in temporal order.

(I.e., for each stage numberOfConstraints gives the number of constraints accociated with this stage and startIdx gives the first constraint in this stage.)

Definition at line 4500 of file OSInstance.cpp.

References TimeDomainStage::constraints, instanceData, TimeDomain::interval, TimeDomainStageConstraints::numberOfConstraints, TimeDomainStages::numberOfStages, TimeDomainStages::stage, TimeDomain::stages, TimeDomainStageConstraints::startIdx, and InstanceData::timeDomain.

bool OSInstance::setTimeDomainStageConstraintsUnordered | ( | int | numberOfStages,
|  | int * | numberOfConstraints,
|  | int ** | conIndex |
| ) |  |  |

This sets the constraints associated with each time domain stage in srbitrary order.

(I.e., for each stage numberOfConstraints gives the number of constraints accociated with this stage and conIndex[i] gives the index of each constraint in stage[i].)

Definition at line 4537 of file OSInstance.cpp.

References TimeDomainStageConstraints::con, TimeDomainStage::constraints, TimeDomainStageCon::idx, instanceData, TimeDomain::interval, TimeDomainStageConstraints::numberOfConstraints, TimeDomainStages::numberOfStages, TimeDomainStages::stage, TimeDomain::stages, and InstanceData::timeDomain.

bool OSInstance::setTimeDomainStageObjectivesOrdered | ( | int | numberOfStages,
|  | int * | numberOfObjectives,
|  | int * | startIdx |
| ) |  |  |

This sets the objectives associated with each time domain stage in temporal order.

(I.e., for each stage numberOfObjectives gives the number of objectives accociated with this stage and startIdx gives the first objective in this stage.)

Definition at line 4595 of file OSInstance.cpp.

References instanceData, TimeDomain::interval, TimeDomainStageObjectives::numberOfObjectives, TimeDomainStages::numberOfStages, TimeDomainStage::objectives, TimeDomainStages::stage, TimeDomain::stages, TimeDomainStageObjectives::startIdx, and InstanceData::timeDomain.

bool OSInstance::setTimeDomainStageObjectivesUnordered | ( | int | numberOfStages,
|  | int * | numberOfObjectives,
|  | int ** | varIndex |
| ) |  |  |

This sets the objectives associated with each time domain stage in arbitrary order.

(I.e., for each stage numberOfObjectives gives the number of objectives accociated with this stage and objIndex[i] gives the index of each objective in stage[i].)

Definition at line 4630 of file OSInstance.cpp.

References TimeDomainStageObj::idx, instanceData, TimeDomain::interval, TimeDomainStageObjectives::numberOfObjectives, TimeDomainStages::numberOfStages, TimeDomainStageObjectives::obj, TimeDomainStage::objectives, TimeDomainStages::stage, TimeDomain::stages, and InstanceData::timeDomain.

bool OSInstance::setTimeDomainInterval | ( | double | start,
|  | double | horizon |
| ) |  |  |

This sets the start and end of the time interval.

Definition at line 4686 of file OSInstance.cpp.

References TimeDomainInterval::horizon, instanceData, TimeDomain::interval, TimeDomain::stages, TimeDomainInterval::start, and InstanceData::timeDomain.

bool OSInstance::processVariables | ( |  | ) | `[private]`

process variables.

Returns:
  true if the variables are processed.

Exceptions:

  | Exception | if the elements in variables are logically inconsistent.

bool OSInstance::processObjectives | ( |  | ) | `[private]`

process objectives.

Returns:
  true if the objectives are processed.

Exceptions:

  | Exception | if the elements in objectives are logically inconsistent.

bool OSInstance::processConstraints | ( |  | ) | `[private]`

process constraints.

Returns:
  true if the constraints are processed.

Exceptions:

  | Exception | if the elements in constraints are logically inconsistent.

bool OSInstance::processLinearConstraintCoefficients | ( |  | ) | `[private]`

process linear constraint coefficients.

Returns:
  true if the linear constraint coefficients are processed.

Exceptions:

  | Exception | if the elements in linear constraint coefficients are logically inconsistent.

std::string OSInstance::getInstanceName | ( |  | ) |

Get instance name.

Returns:
  instance name. Null or empty std::string ("") if there is no instance name.

std::string OSInstance::getInstanceSource | ( |  | ) |

Get instance source.

Returns:
  instance source. Null or empty std::string ("") if there is no instance source.

std::string OSInstance::getInstanceDescription | ( |  | ) |

Get instance description.

Returns:
  instance description. Null or empty std::string ("") if there is no instance description.

int OSInstance::getVariableNumber | ( |  | ) |

Get variable number.

Returns:
  variable number.

std::string* OSInstance::getVariableNames | ( |  | ) |

Get variable names.

Returns:
  a std::string array of variable names, null if no variable names.

Exceptions:

  | Exception | if the elements in variables are logically inconsistent.

char* OSInstance::getVariableTypes | ( |  | ) |

Get variable types.

- C for Continuous
- B for Binary
- I for Integer
- S for String

Returns:
  a char array of variable types.

Exceptions:

  | Exception | if the elements in variables are logically inconsistent.

int OSInstance::getNumberOfIntegerVariables | ( |  | ) |

getNumberOfIntegerVariables

Returns:
  an integer which is the number of I variables.

int OSInstance::getNumberOfBinaryVariables | ( |  | ) |

getNumberOfBinaryVariables

Returns:
  an integer which is the number of B variables.

double* OSInstance::getVariableLowerBounds | ( |  | ) |

Get variable lower bounds.

Returns:
  a double array of variable lower bounds.

Exceptions:

  | Exception | if the elements in variables are logically inconsistent.

double* OSInstance::getVariableUpperBounds | ( |  | ) |

Get variable upper bounds.

Returns:
  a double array of variable upper bounds.

Exceptions:

  | Exception | if the elements in variables are logically inconsistent.

int OSInstance::getObjectiveNumber | ( |  | ) |

Get objective number.

Returns:
  objective number.

std::string* OSInstance::getObjectiveNames | ( |  | ) |

Get objective names.

Returns:
  a std::string array of objective names. Null if no objective names.

Exceptions:

  | Exception | if the elements in objectives are logically inconsistent.

std::string* OSInstance::getObjectiveMaxOrMins | ( |  | ) |

Get objective maxOrMins.

One maxOrMin for each objective.

Returns:
  a std::string array of objective maxOrMins ("max" or "min"), null if no objectives.

Exceptions:

  | Exception | if the elements in objectives are logically inconsistent.

int* OSInstance::getObjectiveCoefficientNumbers | ( |  | ) |

Get objective coefficient number.

One number for each objective.

Returns:
  an integer array of size of which is equal to number of objectives, each element of the array is the number of nonzero coefficients in that objective function, null if no objectives.

Exceptions:

  | Exception | if the elements in objectives are logically inconsistent.

double* OSInstance::getObjectiveConstants | ( |  | ) |

Get objective constants.

One constant for each objective.

Returns:
  a double array of objective constants, null if no objectives.

Exceptions:

  | Exception | if the elements in objectives are logically inconsistent.

double* OSInstance::getObjectiveWeights | ( |  | ) |

Get objective weights.

One weight for each objective.

Returns:
  a double array of objective weights, null if no objectives.

Exceptions:

  | Exception | if the elements in objectives are logically inconsistent.

SparseVector** OSInstance::getObjectiveCoefficients | ( |  | ) |

Get objective coefficients.

One set of objective coefficients for each objective.

See also:
  org.optimizationservices.oscommon.datastructure.SparseVector

Returns:
  an array of objective coefficients, null if objective coefficients. Each member of the array is of type ObjectiveCoefficients. The ObjectiveCoefficients class contains two arrays: variableIndexes is an integer array and values is a double array of coefficient values.

Exceptions:

  | Exception | if the elements in objectives are logically inconsistent.

double** OSInstance::getDenseObjectiveCoefficients | ( |  | ) |

getDenseObjectiveCoefficients.

Returns:
  an vector of pointers, each pointer points to a dense vector of ObjectiveCoefficients.

int OSInstance::getConstraintNumber | ( |  | ) |

Get constraint number.

Returns:
  constraint number.

std::string* OSInstance::getConstraintNames | ( |  | ) |

Get constraint names.

Returns:
  a std::string array of constraint names, null if no constraint names.

Exceptions:

  | Exception | if the elements in constraints are logically inconsistent.

double* OSInstance::getConstraintLowerBounds | ( |  | ) |

Get constraint lower bounds.

Returns:
  a double array of constraint lower bounds, null if no constraints.

Exceptions:

  | Exception | if the elements in constraints are logically inconsistent.

double* OSInstance::getConstraintUpperBounds | ( |  | ) |

Get constraint upper bounds.

Returns:
  a double array of constraint upper bounds, null if constraints.

Exceptions:

  | Exception | if the elements in constraints are logically inconsistent.

char* OSInstance::getConstraintTypes | ( |  | ) |

Get constraint types.

- R for range constraint lb <= constraint <= ub
- L for less than constraint -INF <= con <= ub or con <= ub
- G for greater than constraint lb <= con <= INF or con >= lb
- E for equal to constraint lb <= con <= ub where lb = ub or con = lb/ub
- U for unconstrained constraint -INF <= con <= INF

Returns:
  a char array of constraint types, null if constraints.

Exceptions:

  | Exception | if the elements in constraints are logically inconsistent.

int OSInstance::getLinearConstraintCoefficientNumber | ( |  | ) |

Get number of specified (usually nonzero) linear constraint coefficient values.

Returns:
  number of specified (usually nonzero) linear constraint coefficient values.

bool OSInstance::getLinearConstraintCoefficientMajor | ( |  | ) |

Get whether the constraint coefficients is in column major (true) or row major (false).

Returns:
  whether the constraint coefficients is in column major (true) or row major (false).

Exceptions:

  | Exception | if the elements in linear constraint coefficients are logically inconsistent.

SparseMatrix* OSInstance::getLinearConstraintCoefficientsInColumnMajor | ( |  | ) |

Get linear constraint coefficients in column major.

Returns:
  a sparse matrix reprsentation of linear constraint coefficients in column major, null if no linear constraint coefficients.

Exceptions:

  | Exception | if the elements in linear constraint coefficients are logically inconsistent.

See also:
  org.optimizationservices.oscommon.datastructure.SparseMatrix

SparseMatrix* OSInstance::getLinearConstraintCoefficientsInRowMajor | ( |  | ) |

Get linear constraint coefficients in row major.

Returns:
  a sparse matrix reprsentation of linear constraint coefficients in row major, null if no linear constraint coefficients.

Exceptions:

  | Exception | if the elements in linear constraint coefficients are logically inconsistent.

See also:
  org.optimizationservices.oscommon.datastructure.SparseMatrix

int OSInstance::getNumberOfQuadraticTerms | ( |  | ) |

Get the number of specified (usually nonzero) qTerms in the quadratic coefficients.

Returns:
  qTerm number.

QuadraticTerms* OSInstance::getQuadraticTerms | ( |  | ) |

Get all the quadratic terms in the instance.

Returns:
  the QuadraticTerms data structure for all quadratic terms in the instance, null if no quadratic terms. The QuadraticTerms contains four arrays: rowIndexes, varOneIndexes, varTwoIndexes, coefficients.

Exceptions:

  | Exception | if the elements in quadratic coefficients are logically inconsistent.

See also:
  org.optimizationservices.oscommon.datastructure.QuadraticTerms

int* OSInstance::getQuadraticRowIndexes | ( |  | ) |

Get the indexes of rows which have a quadratic term.

Returns:
  an integer pointer to the row indexes of rows with quadratic terms, objectives functions have index < 0 NULL if there are no quadratic terms.

int OSInstance::getNumberOfQuadraticRowIndexes | ( |  | ) |

Get the number of rows which have a quadratic term.

Returns:
  an integer which is the number of distinct rows (including obj) with quadratic terms,

int OSInstance::getNumberOfNonlinearExpressions | ( |  | ) |

Get number of nonlinear expressions.

Returns:
  the number of nonlinear expressions.

OSExpressionTree* OSInstance::getNonlinearExpressionTree | ( | int | rowIdx | ) |

Get the expression tree for a given row index.

Returns:
  an expression tree

OSExpressionTree* OSInstance::getNonlinearExpressionTreeMod | ( | int | rowIdx | ) |

Get the expression tree for a given row index for the modified expression trees (quadratic terms added).

Returns:
  an expression tree

std::vector<OSnLNode*> OSInstance::getNonlinearExpressionTreeInPostfix | ( | int | rowIdx | ) |

Get the postfix tokens for a given row index.

Returns:
  a vector of pointers to OSnLNodes in postfix, if rowIdx does not index a row with a nonlinear term throw an exception

std::vector<OSnLNode*> OSInstance::getNonlinearExpressionTreeModInPostfix | ( | int | rowIdx | ) |

Get the postfix tokens for a given row index for the modified Expression Tree (quadratic terms added).

Returns:
  a vector of pointers to OSnLNodes in postfix, if rowIdx does not index a row with a nonlinear term throw an exception

std::vector<OSnLNode*> OSInstance::getNonlinearExpressionTreeInPrefix | ( | int | rowIdx | ) |

Get the prefix tokens for a given row index.

Returns:
  a vector of pointers to OSnLNodes in prefix, if rowIdx does not index a row with a nonlinear term throw an exception

std::vector<OSnLNode*> OSInstance::getNonlinearExpressionTreeModInPrefix | ( | int | rowIdx | ) |

Get the prefix tokens for a given row index for the modified Expression Tree (quadratic terms added).

Returns:
  a vector of pointers to OSnLNodes in prefix, if rowIdx does not index a row with a nonlinear term throw an exception

int OSInstance::getNumberOfNonlinearObjectives | ( |  | ) |

Returns:
  the number of Objectives with a nonlinear term

int OSInstance::getNumberOfNonlinearConstraints | ( |  | ) |

Returns:
  the number of Constraints with a nonlinear term

std::map<int, OSExpressionTree* > OSInstance::getAllNonlinearExpressionTrees | ( |  | ) |

Returns:
  a map: the key is the row index and the value is the corresponding expression tree

std::map<int, OSExpressionTree* > OSInstance::getAllNonlinearExpressionTreesMod | ( |  | ) |

Returns:
  a map: the key is the row index and the value is the corresponding expression tree

int* OSInstance::getNonlinearExpressionTreeIndexes | ( |  | ) |

Get all the nonlinear expression tree indexes, i.e.

indexes of rows (objectives or constraints) that contain nonlinear expressions.

Returns:
  a pointer to an integer array of nonlinear expression tree indexes.

int OSInstance::getNumberOfNonlinearExpressionTreeIndexes | ( |  | ) |

Get the number of unique Nonlinear expression tree indexes.

Returns:
  the number of unique nonlinear expression tree indexes.

int* OSInstance::getNonlinearExpressionTreeModIndexes | ( |  | ) |

Get all the nonlinear expression tree indexes, i.e.

indexes of rows (objetives or constraints) that contain nonlinear expressions after modifying the expression tree to contain quadratic terms.

Returns:
  a pointer to an integer array of nonlinear expression tree indexes (including quadratic terms).

int OSInstance::getNumberOfNonlinearExpressionTreeModIndexes | ( |  | ) |

Get the number of unique Nonlinear expression tree indexes after modifying the expression tree to contain quadratic terms.

Returns:
  the number of unique nonlinear expression tree indexes (including quadratic terms).

std::string OSInstance::getTimeDomainFormat | ( |  | ) |

Get the format of the time domain ("stages"/"interval").

Returns:
  the format of the time domain.

int OSInstance::getTimeDomainStageNumber | ( |  | ) |

Get the number of stages that make up the time domain.

Returns:
  the number of time stages.

std::string* OSInstance::getTimeDomainStageNames | ( |  | ) |

Get the names of the stages (NULL or empty string ("") if a stage has not been given a name.

Returns:
  the names of time stages.

int* OSInstance::getTimeDomainStageNumberOfVariables | ( |  | ) |

Get the number of variables contained in each time stage.

Returns:
  a vector of size numberOfStages.

int* OSInstance::getTimeDomainStageNumberOfConstraints | ( |  | ) |

Get the number of constraints contained in each time stage.

Returns:
  a vector of size numberOfStages.

int* OSInstance::getTimeDomainStageNumberOfObjectives | ( |  | ) |

Get the number of objectives contained in each time stage.

Returns:
  a vector of size numberOfStages.

int** OSInstance::getTimeDomainStageVarList | ( |  | ) |

Get the list of variables in each stage.

Returns:
  one array of integers for each stage.

int** OSInstance::getTimeDomainStageConList | ( |  | ) |

Get the list of constraints in each stage.

Returns:
  one array of integers for each stage.

int** OSInstance::getTimeDomainStageObjList | ( |  | ) |

Get the list of objectives in each stage.

Returns:
  one array of integers for each stage.

double OSInstance::getTimeDomainIntervalStart | ( |  | ) |

Get the start for the time domain interval.

Returns:
  start end of the time interval.

double OSInstance::getTimeDomainIntervalHorizon | ( |  | ) |

Get the horizon for the time domain interval.

Returns:
  the end of the time interval.

bool OSInstance::setInstanceSource | ( | std::string | source | ) |

set the instance source.

Parameters:

  | source | holds the instance source.

Returns:
  whether the instance source is set successfully.

bool OSInstance::setInstanceDescription | ( | std::string | description | ) |

set the instance description.

Parameters:

  | description | holds the instance description.

Returns:
  whether the instance description is set successfully.

bool OSInstance::setInstanceName | ( | std::string | name | ) |

set the instance name.

Parameters:

  | name | holds the instance name.

Returns:
  whether the instance name is set successfully.

bool OSInstance::setVariableNumber | ( | int | number | ) |

set the variable number.

Parameters:

  | number | holds the variable number.

Returns:
  whether the variable number is set successfully.

bool OSInstance::addVariable | ( | int | index,
|  | std::string | name,
|  | double | lowerBound,
|  | double | upperBound,
|  | char | type |
| ) |  |  |

add a variable.

In order to use the add method, the setVariableNumber must first be called so that the variable number is known ahead of time to assign appropriate memory. If a variable with the given variable index already exists, the old variable will be replaced.

Parameters:

  | index | holds the variable index. It is required.
  | name | holds the variable name; use null or empty std::string ("") if no variable name.
  | lowerBound | holds the variable lower bound; use Double.NEGATIVE_INFINITY if no lower bound.
  | upperBound | holds the variable upper bound; use Double.POSITIVE_INFINITY if no upper bound.
  | type | holds the variable type character, B for Binary, I for Integer, S for String, C or any other char for Continuous)
  | init | holds the double variable initial value; use Double.NaN if no initial value -- deprecated
  | initString | holds the std::string variable initial value; use null or empty std::string ("") if no initial std::string value -- deprecated

Returns:
  whether the variable is added successfully.

bool OSInstance::setVariables | ( | int | number,
|  | std::string * | names,
|  | double * | lowerBounds,
|  | double * | upperBounds,
|  | char * | types |
| ) |  |  |

set all the variable related elements.

All the previous variable-related elements will be deleted.

Parameters:

  | number | holds the number of variables. It is required.
  | names | holds a std::string array of variable names; use null if no variable names.
  | lowerBounds | holds a double array of variable lower bounds; use null if all lower bounds are 0; use Double.NEGATIVE_INFINITY if no lower bound for a specific variable in the array.
  | upperBounds | holds a double array of variable upper bounds; use null if no upper bounds; use Double.POSITIVE_INFINITY if no upper bound for a specific variable in the array.
  | types | holds a char array of variable types; use null if all variables are continuous; for a specfic variable in the array use B for Binary, I for Integer, S for String, C or any other char for Continuous,)
  | inits | holds a double array of varible initial values; use null if no initial values. -- deprecated
  | initsString | holds a std::string array of varible initial values; use null if no initial std::string values. -- deprecated

Returns:
  whether the variables are set successfully.

bool OSInstance::setObjectiveNumber | ( | int | number | ) |

set the objective number.

Parameters:

  | number | holds the objective number.

Returns:
  whether the objective number is set successfully.

bool OSInstance::addObjective | ( | int | index,
|  | std::string | name,
|  | std::string | maxOrMin,
|  | double | constant,
|  | double | weight,
|  | SparseVector * | objectiveCoefficients |
| ) |  |  |

add an objective.

In order to use the add method, the setObjectiveNumber must first be called so that the objective number is known ahead of time to assign appropriate memory. If a objective with the given objective index already exists, the old objective will be replaced. Objective index will start from -1, -2, -3, ... down, with -1 corresponding to the first objective.

Parameters:

  | index | holds the objective index. Remember the first objective index is -1, second -2, ...
  | name | holds the objective name; use null or empty std::string ("") if no objective name.
  | maxOrMin | holds the objective sense or direction; it can only take two values: "max" or "min".
  | constant | holds the objective constant; use 0.0 if no objective constant.
  | weight | holds the objective weight; use 1.0 if no objective weight.
  | objectiveCoefficients | holds the objective coefficients (null if no objective coefficients) in a sparse representation that holds two arrays: index array and a value array.

Returns:
  whether the objective is added successfully.

bool OSInstance::setObjectives | ( | int | number,
|  | std::string * | names,
|  | std::string * | maxOrMins,
|  | double * | constants,
|  | double * | weights,
|  | SparseVector ** | objectitiveCoefficients |
| ) |  |  |

set all the objectives related elements.

All the previous objective-related elements will be deleted.

Parameters:

  | number | holds the number of objectives. It is required.
  | names | holds a std::string array of objective names; use null if no objective names.
  | maxOrMins | holds a std::string array of objective objective senses or directions: "max" or "min"; use null if all objectives are "min".
  | constants | holds a double array of objective constants; use null if all objective constants are 0.0.
  | weights | holds a double array of objective weights; use null if all objective weights are 1.0.
  | objectitiveCoefficients | holds an array of objective coefficients, (null if no objective have any coefficeints) For each objective, the coefficients are stored in a sparse representation that holds two arrays: index array and a value array. If for a specific objective, there are no objecitve coefficients, use null for the corresponding array member.

Returns:
  whether the objectives are set successfully.

bool OSInstance::setConstraintNumber | ( | int | number | ) |

set the constraint number.

Parameters:

  | number | holds the constraint number.

Returns:
  whether the constraint number is set successfully.

bool OSInstance::addConstraint | ( | int | index,
|  | std::string | name,
|  | double | lowerBound,
|  | double | upperBound,
|  | double | constant |
| ) |  |  |

add a constraint.

In order to use the add method, the setConstraintNumber must first be called so that the constraint number is known ahead of time to assign appropriate memory. If a constraint with the given constraint index already exists, the old constraint will be replaced.

Parameters:

  | index | holds the constraint index. It is required.
  | name | holds the constraint name; use null or empty std::string ("") if no constraint name.
  | lowerBound | holds the constraint lower bound; use Double.NEGATIVE_INFINITY if no lower bound.
  | upperBound | holds the constraint upper bound; use Double.POSITIVE_INFINITY if no upper bound.

Returns:
  whether the constraint is added successfully.

bool OSInstance::setConstraints | ( | int | number,
|  | std::string * | names,
|  | double * | lowerBounds,
|  | double * | upperBounds,
|  | double * | constants |
| ) |  |  |

set all the constraint related elements.

All the previous constraint-related elements will be deleted.

Parameters:

  | number | holds the number of constraints. It is required.
  | names | holds a std::string array of constraint names; use null if no constraint names.
  | lowerBounds | holds a double array of constraint lower bounds; use null if no lower bounds; use Double.NEGATIVE_INFINITY if no lower bound for a specific constraint in the array.
  | upperBounds | holds a double array of constraint upper bounds; use null if no upper bounds; use Double.POSITIVE_INFINITY if no upper bound for a specific constraint in the array.

Returns:
  whether the constraints are set successfully.

bool OSInstance::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

Parameters:

  | numberOfValues | holds the number of specified coefficient values (usually nonzero) in the coefficient matrix.
  | isColumnMajor | holds whether the coefficient matrix is stored in column major (true) or row major (false).
  | values | holds a double array coefficient values in the matrix.
  | valuesBegin | holds the begin index of the values array to copy from (usually 0).
  | valuesEnd | holds the end index of the values array to copy till (usually values.lenght - 1).
  | indexes | holds an integer array column/row indexes for each value in the values array.
  | indexesBegin | holds the begin index of the indexes array to copy from (usually 0).
  | indexesEnd | holds the end index of the indexes array to copy till (usually indexes.lenght - 1).
  | starts | holds an integer array start indexes in the matrix; the first value of starts should always be 0.
  | startsBegin | holds the begin index of the starts array to copy from (usually 0).
  | startsEnd | holds the end index of the starts array to copy till (usually starts.lenght - 1).

Returns:
  whether the linear constraint coefficients are set successfully.

bool OSInstance::setQuadraticTerms | ( | int | number,
|  | int * | rowIndexes,
|  | int * | varOneIndexes,
|  | int * | varTwoIndexes,
|  | double * | coefficients,
|  | int | begin,
|  | int | end |
| ) |  |  |

set quadratic terms

Parameters:

  | number | holds the number of quadratic terms.
  | rowIndexes | holds an integer array of row indexes of all the quadratic terms. A negative integer corresponds to an objective row, e.g. -1 for 1st objective and -2 for 2nd.
  | varOneIndexes | holds an integer array of the first varialbe indexes of all the quadratic terms.
  | varTwoIndexes | holds an integer array of the second varialbe indexes of all the quadratic terms.
  | coefficients | holds a double array all the quadratic term coefficients.
  | begin | holds the begin index of all the arrays to copy from (usually = 0).
  | end | holds the end index of all the arrays to copy till (usually = array length -1).

Returns:
  whether the quadratic terms are set successfully.

bool OSInstance::setQuadraticTermsInNonlinearExpressions | ( | int | number,
|  | int * | rowIndexes,
|  | int * | varOneIndexes,
|  | int * | varTwoIndexes,
|  | double * | coefficients |
| ) |  |  |

set quadratic terms in nonlinearExpressions

Parameters:

  | number | holds the number of quadratic terms.
  | rowIndexes | holds an integer array of row indexes of all the quadratic terms. A negative integer corresponds to an objective row, e.g. -1 for 1st objective and -2 for 2nd.
  | varOneIndexes | holds an integer array of the first varialbe indexes of all the quadratic terms.
  | varTwoIndexes | holds an integer array of the second varialbe indexes of all the quadratic terms.
  | coefficients | holds a double array all the quadratic term coefficients.

Returns:
  whether the quadratic terms are set successfully.

bool OSInstance::initializeNonLinearStructures | ( |  | ) |

Initialize the data structures for the nonlinear API.

Returns:
  true if we have initialized the nonlinear data strucutres.

double OSInstance::calculateFunctionValue | ( | int | idx,
|  | double * | x,
|  | bool | new_x |
| ) |  |  |

Calculate the function value for function (constraint or objective) indexed by idx.

Parameters:

  | idx | is the index on the constraint (0, 1, 2, 3, ...) or objective function (-1, -2, -3, ...).
  | x | is a pointer (double array) to the current variable values
  | new_x | is false if any evaluation method was previously called for the current x has been evaluated for the current iterate x use a value of false if not sure

Returns:
  the function value as a double.

double* OSInstance::calculateAllConstraintFunctionValues | ( | double * | x,
|  | double * | objLambda,
|  | double * | conLambda,
|  | bool | new_x,
|  | int | highestOrder |
| ) |  |  |

Calculate all of the constraint function values.

Parameters:

  | x | is a pointer (double array) to the current variable values
  | objLambda | is the Lagrange multiplier on the objective function
  | conLambda | is pointer (double array) of Lagrange multipliers on the constratins
  | new_x | is false if any evaluation method was previously called for the current x for the current iterate
  | highestOrder | is the highest order of the derivative being calculated

Returns:
  a double array of constraint function values -- the size of the array is equal to getConstraintNumber().

double* OSInstance::calculateAllConstraintFunctionValues | ( | double * | x,
|  | bool | new_x |
| ) |  |  |

Calculate all of the constraint function values, we are overloading this function and this version of the method will not use any AD and will evaluate function values from the OS Expression Tree.

Parameters:

  | x | is a pointer (double array) to the current variable values
  | new_x | is false if any evaluation method was previously called for the current iterate

Returns:
  a double array of constraint function values -- the size of the array is equal to getConstraintNumber().

double* OSInstance::calculateAllObjectiveFunctionValues | ( | double * | x,
|  | double * | objLambda,
|  | double * | conLambda,
|  | bool | new_x,
|  | int | highestOrder |
| ) |  |  |

Calculate all of the objective function values.

Parameters:

  | x | is a pointer (double array) to the current variable values
  | objLambda | is the Lagrange multiplier on the objective function
  | conLambda | is pointer (double array) of Lagrange multipliers on the constratins
  | new_x | is false if any evaluation method was previously called for the current iterate
  | highestOrder | is the highest order of the derivative being calculated

Returns:
  a double array of objective function values -- the size of the array is equal to getObjectiveNumber().

double* OSInstance::calculateAllObjectiveFunctionValues | ( | double * | x,
|  | bool | new_x |
| ) |  |  |

Calculate all of the objective function values, we are overloading this function and this version of the method will not use any AD and will evaluate function values from the OS Expression Tree.

Parameters:

  | x | is a pointer (double array) to the current variable values
  | new_x | is false if any evaluation method was previously called for the current iterate

Returns:
  a double array of objective function values -- the size of the array is equal to getObjectiveNumber().

SparseJacobianMatrix* OSInstance::calculateAllConstraintFunctionGradients | ( | double * | x,
|  | double * | objLambda,
|  | double * | conLambda,
|  | bool | new_x,
|  | int | highestOrder |
| ) |  |  |

Calculate the gradient of all constraint functions.

Parameters:

  | x | is a pointer (double array) to the current variable values
  | objLambda | is the Lagrange multiplier on the objective function
  | conLambda | is pointer (double array) of Lagrange multipliers on the constratins
  | new_x | is false if any evaluation method was previously called for the current iterate
  | highestOrder | is the highest order of the derivative being calculated

Returns:
  a pointer a SparseJacobianMatrix.

SparseVector* OSInstance::calculateConstraintFunctionGradient | ( | double * | x,
|  | double * | objLambda,
|  | double * | conLambda,
|  | int | idx,
|  | bool | new_x,
|  | int | highestOrder |
| ) |  |  |

Calculate the gradient of the constraint function indexed by idx.

Parameters:

  | x | is a pointer (double array) to the current variable values
  | objLambda | is the Lagrange multiplier on the objective function
  | conLambda | is pointer (double array) of Lagrange multipliers on the constratins idx is the index of the constraint function gradient
  | new_x | is false if any evaluation method was previously called for the current iterate
  | highestOrder | is the highest order of the derivative being calculated

Returns:
  a pointer to a sparse vector of doubles.

SparseVector* OSInstance::calculateConstraintFunctionGradient | ( | double * | x,
|  | int | idx,
|  | bool | new_x |
| ) |  |  |

Calculate the gradient of the constraint function indexed by idx this function is overloaded.

Parameters:

  | x | is a pointer (double array) to the current variable values idx is the index of the constraint function gradient
  | new_x | is false if any evaluation method was previously called for the current iterate
  | highestOrder | is the highest order of the derivative being calculated

Returns:
  a pointer to a sparse vector of doubles.

double** OSInstance::calculateAllObjectiveFunctionGradients | ( | double * | x,
|  | double * | objLambda,
|  | double * | conLambda,
|  | bool | new_x,
|  | int | highestOrder |
| ) |  |  |

Calculate the gradient of all objective functions.

Parameters:

  | x | is a pointer (double array) to the current variable values
  | objLambda | is the Lagrange multiplier on the objective function
  | conLambda | is pointer (double array) of Lagrange multipliers on the constratins
  | new_x | is false if any evaluation method was previously called for the current iterate
  | highestOrder | is the highest order of the derivative being calculated

Returns:
  an array of pointer to dense objective function gradients.

double* OSInstance::calculateObjectiveFunctionGradient | ( | double * | x,
|  | double * | objLambda,
|  | double * | conLambda,
|  | int | objIdx,
|  | bool | new_x,
|  | int | highestOrder |
| ) |  |  |

Calculate the gradient of the objective function indexed by objIdx.

Parameters:

  | x | is a pointer (double array) to the current variable values
  | objLambda | is the Lagrange multiplier on the objective function
  | conLambda | is pointer (double array) of Lagrange multipliers on the constratins objIdx is the index of the objective function being optimized
  | new_x | is false if any evaluation method was previously called for the current iterate
  | highestOrder | is the highest order of the derivative being calculated

Returns:
  a pointer to a dense vector of doubles.

double* OSInstance::calculateObjectiveFunctionGradient | ( | double * | x,
|  | int | objIdx,
|  | bool | new_x |
| ) |  |  |

Calculate the gradient of the objective function indexed by objIdx this function is overloaded.

Parameters:

  | x | is a pointer (double array) to the current variable values
  | objIdx | is the index of the objective function being optimized
  | new_x | is false if any evaluation method was previously called for the current iterate

Returns:
  a pointer to a dense vector of doubles.

SparseHessianMatrix* OSInstance::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 tree for only the first iteration Use this method on if the value of x does not affect the operations sequence.

Parameters:

  | x | is a pointer (double array) to the current variable values
  | objLambda | is the Lagrange multiplier on the objective function
  | conLambda | is pointer (double array) of Lagrange multipliers on the constratins
  | new_x | is false if any evaluation method was previously called for the current iterate
  | highestOrder | is the highest order of the derivative being calculated

Returns:
  a pointer a SparseHessianMatrix. Each array member corresponds to one constraint gradient.

SparseHessianMatrix* OSInstance::calculateHessian | ( | double * | x,
|  | int | idx,
|  | bool | new_x |
| ) |  |  |

Calculate the Hessian of a constraint or objective function.

Parameters:

  | x | is a pointer (double array) to the current variable values
  | new_x | is false if any evaluation method was previously called for the current iterate idx is the index of the either a constraint or objective function Hessian

Returns:
  a pointer a SparseVector. Each array member corresponds to one constraint gradient.

bool OSInstance::getSparseJacobianFromColumnMajor | ( |  | ) |

Returns:
  true if successful in generating the constraints gradient.

bool OSInstance::getSparseJacobianFromRowMajor | ( |  | ) |

Returns:
  true if successful in generating the constraints gradient.

OSExpressionTree* OSInstance::getLagrangianExpTree | ( |  | ) |

Returns:
  a pointer to the ExpressionTree for the Lagrangian function of current instance we only take the Lagrangian of the rows with nonlinear terms

std::map<int, int> OSInstance::getAllNonlinearVariablesIndexMap | ( |  | ) |

Returns:
  a pointer to a map of the indices of all of the variables that appear in the Lagrangian function

SparseHessianMatrix* OSInstance::getLagrangianHessianSparsityPattern | ( |  | ) |

Returns:
  a pointer to a SparseHessianMatrix with the nonzero structure of the Lagrangian Expression Tree

bool OSInstance::addQTermsToExressionTree | ( |  | ) |

Returns:
  true if successful in adding the qTerms to the ExpressionTree.

SparseJacobianMatrix* OSInstance::getJacobianSparsityPattern | ( |  | ) |

Returns:
  pointer to a SparseJacobianMatrix.

void OSInstance::duplicateExpressionTreesMap | ( |  | ) |

duplicate the map of expression trees.

bool OSInstance::createOSADFun | ( | std::vector< double > | vdX | ) |

Create the a CppAD Function object: this is a function where the domain is the set of variables for the problem and the range is the objective function plus constraints.

Parameters:

  | vdX | is a vector of doubles holding the current primal variable values the size of x should equal instanceData->variables->numberOfVariables

Returns:
  if successfully created

std::vector<double> OSInstance::forwardAD | ( | int | p,
|  | std::vector< double > | vdX |
| ) |  |  |

Perform an AD forward sweep.

Parameters:

  | p | is the highest order Taylor coefficient
  | vdX | is a vector of doubles of the current primal variable values the size of vdX m_iNumberOfNonlinearVariables

Returns:
  a double vector equal to the dimension of the range space the result of the forward p sweep

std::vector<double> OSInstance::reverseAD | ( | int | p,
|  | std::vector< double > | vdlambda |
| ) |  |  |

Perform an AD reverse sweep.

Parameters:

  | p | is the order of the sweep
  | vdlambda | is a vector of doubles of the current dual (lagrange) variable values the size of lambda should equal number of objective functions plus number of constraints

Returns:
  a double vector equal to the n*p

int OSInstance::getADSparsityHessian | ( |  | ) |

Call the AD routine to fill in m_vbLagHessNonz and determine the nonzeros.

Returns:
  the number of nonzeros in the Hessian

bool OSInstance::getIterateResults | ( | double * | x,
|  | double * | objLambda,
|  | double * | conLambda,
|  | bool | new_x,
|  | int | highestOrder |
| ) |  |  |

Get the information for each iteration.

Get the functions values, Jacobian and Hessian of the Lagrangian

Parameters:

  | x | is a pointer of doubles of primal values for the current iteration
  | objLambda | is is a pointer of doubles of the current dual (Lagrange) multipliers on the objective functions
  | conLambda | is a pointer of doubles of the current dual (Lagrange) multipliers on the constraints
  | new_x | is false if any evaluation method was previously called
  | highestOrder | is the highest order derivative to be calculated

Returns:
  true if successful

bool OSInstance::getZeroOrderResults | ( | double * | x,
|  | double * | objLambda,
|  | double * | conLambda |
| ) |  |  |

Calculate function values.

Parameters:

  | x | is a pointer of doubles of primal values for the current iteration
  | objLambda | is is a pointer of doubles of the current dual (Lagrange) multipliers on the objective functions
  | conLambda | is a pointer of doubles of the current dual (Lagrange) multipliers on the constraints

Returns:
  true if successful

bool OSInstance::getFirstOrderResults | ( | double * | x,
|  | double * | objLambda,
|  | double * | conLambda |
| ) |  |  |

Calculate first derivatives.

Parameters:

  | x | is a pointer of doubles of primal values for the current iteration
  | objLambda | is is a pointer of doubles of the current dual (Lagrange) multipliers on the objective functions
  | conLambda | is a pointer of doubles of the current dual (Lagrange) multipliers on the constraints

Returns:
  true if successful

bool OSInstance::getSecondOrderResults | ( | double * | x,
|  | double * | objLambda,
|  | double * | conLambda |
| ) |  |  |

Calculate second derivatives.

Parameters:

  | x | is a pointer of doubles of primal values for the current iteration
  | objLambda | is is a pointer of doubles of the current dual (Lagrange) multipliers on the objective functions
  | conLambda | is a pointer of doubles of the current dual (Lagrange) multipliers on the constraints

Returns:
  true if successful

bool OSInstance::initForAlgDiff | ( |  | ) |

This should be called by nonlinear solvers using callback functions.

initForAlgDiff will initialize the correct nonlinear structures in preparation for using the algorithmic differentiation routines.

Returns:
  true if successful

bool OSInstance::initObjGradients | ( |  | ) |

This should be called by initForAlgDiff().

initObjGradients will initialize the objective function gradients to be equal to the coefficients given in the <coef> section of the OSiL instance

Returns:
  true if successful

bool OSInstance::setTimeDomain | ( | std::string | format | ) |

This sets the format of the time domain ("stages"/"interval"/"none").

bool OSInstance::setTimeDomainStages | ( | int | number,
|  | std::string * | names |
| ) |  |  |

This sets the number (and optionally names) of the time stages.

bool OSInstance::setTimeDomainStageVariablesOrdered | ( | int | numberOfStages,
|  | int * | numberOfVariables,
|  | int * | startIdx |
| ) |  |  |

This sets the variables associated with each time domain stage in temporal order.

(I.e., for each stage numberOfVariables gives the number of variables accociated with this stage and startIdx gives the first variable in this stage.)

bool OSInstance::setTimeDomainStageVariablesUnordered | ( | int | numberOfStages,
|  | int * | numberOfVariables,
|  | int ** | varIndex |
| ) |  |  |

This sets the variables associated with each time domain stage in srbitrary order.

(I.e., for each stage numberOfVariables gives the number of variables accociated with this stage and varIndex[i] gives the index of each variable in stage[i].)

bool OSInstance::setTimeDomainStageConstraintsOrdered | ( | int | numberOfStages,
|  | int * | numberOfConstraints,
|  | int * | startIdx |
| ) |  |  |

This sets the constraints associated with each time domain stage in temporal order.

(I.e., for each stage numberOfConstraints gives the number of constraints accociated with this stage and startIdx gives the first constraint in this stage.)

bool OSInstance::setTimeDomainStageConstraintsUnordered | ( | int | numberOfStages,
|  | int * | numberOfConstraints,
|  | int ** | conIndex |
| ) |  |  |

This sets the constraints associated with each time domain stage in srbitrary order.

(I.e., for each stage numberOfConstraints gives the number of constraints accociated with this stage and conIndex[i] gives the index of each constraint in stage[i].)

bool OSInstance::setTimeDomainStageObjectivesOrdered | ( | int | numberOfStages,
|  | int * | numberOfObjectives,
|  | int * | startIdx |
| ) |  |  |

This sets the objectives associated with each time domain stage in temporal order.

(I.e., for each stage numberOfObjectives gives the number of objectives accociated with this stage and startIdx gives the first objective in this stage.)

bool OSInstance::setTimeDomainStageObjectivesUnordered | ( | int | numberOfStages,
|  | int * | numberOfObjectives,
|  | int ** | varIndex |
| ) |  |  |

This sets the objectives associated with each time domain stage in arbitrary order.

(I.e., for each stage numberOfObjectives gives the number of objectives accociated with this stage and objIndex[i] gives the index of each objective in stage[i].)

bool OSInstance::setTimeDomainInterval | ( | double | start,
|  | double | horizon |
| ) |  |  |

This sets the start and end of the time interval.

## Member Data Documentation

GeneralFileHeader* OSInstance::instanceHeader

the instanceHeader is implemented as a general file header object to allow sharing of classes between schemas

Definition at line 814 of file OSInstance.h.

Referenced by getInstanceDescription(), getInstanceName(), getInstanceSource(), OSInstance(), and OSiLWriter::writeOSiL().

InstanceData* OSInstance::instanceData

A pointer to an InstanceData object.

Definition at line 817 of file OSInstance.h.

Referenced by addQTermsToExressionTree(), LindoSolver::buildSolverInstance(), calculateConstraintFunctionGradient(), calculateHessian(), OSgams2osil::createOSInstance(), LindoSolver::dataEchoCheck(), KnitroSolver::dataEchoCheck(), IpoptSolver::dataEchoCheck(), CoinSolver::dataEchoCheck(), BonminSolver::dataEchoCheck(), BonminProblem::eval_f(), BonminProblem::eval_grad_f(), IpoptProblem::get_scaling_parameters(), IpoptProblem::get_starting_point(), BonminProblem::get_starting_point(), getAllNonlinearExpressionTrees(), getConstraintNumber(), getDenseObjectiveCoefficients(), getLagrangianExpTree(), getLinearConstraintCoefficientNumber(), getNumberOfNonlinearExpressions(), getNumberOfQuadraticTerms(), getObjectiveNumber(), getQuadraticTerms(), getSparseJacobianFromColumnMajor(), getSparseJacobianFromRowMajor(), getTimeDomainFormat(), getTimeDomainIntervalHorizon(), getTimeDomainIntervalStart(), getTimeDomainStageConList(), getTimeDomainStageNames(), getTimeDomainStageNumber(), getTimeDomainStageNumberOfConstraints(), getTimeDomainStageNumberOfObjectives(), getTimeDomainStageNumberOfVariables(), getTimeDomainStageObjList(), getTimeDomainStageVarList(), getVariableNumber(), initializeNonLinearStructures(), main(), OSInstance(), processConstraints(), processLinearConstraintCoefficients(), processObjectives(), processVariables(), setConstraintNumber(), setLinearConstraintCoefficients(), setObjectiveNumber(), setQuadraticTerms(), setQuadraticTermsInNonlinearExpressions(), IpoptSolver::setSolverOptions(), CoinSolver::setSolverOptions(), setTimeDomain(), setTimeDomainInterval(), setTimeDomainStageConstraintsOrdered(), setTimeDomainStageConstraintsUnordered(), setTimeDomainStageObjectivesOrdered(), setTimeDomainStageObjectivesUnordered(), setTimeDomainStages(), setTimeDomainStageVariablesOrdered(), setTimeDomainStageVariablesUnordered(), setVariableNumber(), OSDipBlockSlpSolver::solve(), OSDipBlockCoinSolver::solve(), OSiLWriter::writeOSiL(), ~OSInstance(), OSmps2osil::~OSmps2osil(), and OSnl2osil::~OSnl2osil().

bool OSInstance::bVariablesModified

bVariablesModified is true if the variables data has been modified.

Definition at line 827 of file OSInstance.h.

Referenced by main(), printModel(), and processVariables().

bool OSInstance::bObjectivesModified

bObjectivesModified is true if the objective function data has been modified.

Definition at line 832 of file OSInstance.h.

Referenced by getDenseObjectiveCoefficients(), main(), printModel(), processObjectives(), OSDipBlockSlpSolver::solve(), and OSDipBlockCoinSolver::solve().

bool OSInstance::bConstraintsModified

bConstraintsModified is true if the constraints data has been modified.

Definition at line 837 of file OSInstance.h.

Referenced by printModel(), and processConstraints().

bool OSInstance::bAMatrixModified

bAMatrixModified is true if the A matrix data has been modified.

Definition at line 842 of file OSInstance.h.

Referenced by processLinearConstraintCoefficients().

std::string OSInstance::m_sInstanceName`[private]`

m_sInstanceName holds the instance name.

Definition at line 850 of file OSInstance.h.

Referenced by getInstanceName().

std::string OSInstance::m_sInstanceSource`[private]`

m_sInstanceSource holds the instance source.

Definition at line 854 of file OSInstance.h.

Referenced by getInstanceSource().

std::string OSInstance::m_sInstanceDescription`[private]`

m_sInstanceDescription holds the instance description.

Definition at line 858 of file OSInstance.h.

Referenced by getInstanceDescription().

bool OSInstance::m_bProcessVariables`[private]`

m_bProcessVariables holds whether the variables are processed.

Definition at line 863 of file OSInstance.h.

Referenced by initializeNonLinearStructures(), printModel(), processVariables(), and ~OSInstance().

int OSInstance::m_iVariableNumber`[private]`

m_iVariableNumber holds the variable number.

Definition at line 868 of file OSInstance.h.

Referenced by getVariableNumber(), getZeroOrderResults(), and initializeNonLinearStructures().

int OSInstance::m_iNumberOfIntegerVariables`[private]`

m_iNumberOfIntegerVariables holds the number of integer variables.

Definition at line 873 of file OSInstance.h.

Referenced by getNumberOfIntegerVariables(), and processVariables().

int OSInstance::m_iNumberOfBinaryVariables`[private]`

m_iNumberOfBinaryVariables holds the number of binary variables.

Definition at line 878 of file OSInstance.h.

Referenced by getNumberOfBinaryVariables(), and processVariables().

int OSInstance::m_iNumberOfSemiContinuousVariables`[private]`

m_iNumberOfSemiContinuousVariables holds the number of semi-continuous variables.

Definition at line 883 of file OSInstance.h.

Referenced by getNumberOfSemiContinuousVariables(), and processVariables().

int OSInstance::m_iNumberOfSemiIntegerVariables`[private]`

m_iNumberOfSemiIntegerVariables holds the number of semi-integer variables.

Definition at line 888 of file OSInstance.h.

Referenced by getNumberOfSemiIntegerVariables(), and processVariables().

int OSInstance::m_iNumberOfStringVariables`[private]`

m_iNumberOfStringVariables holds the number of string-valued variables.

Definition at line 893 of file OSInstance.h.

Referenced by getNumberOfStringVariables(), and processVariables().

int OSInstance::m_iNumberOfQuadraticRowIndexes`[private]`

m_iNumberOfQuadraticRowIndexes holds the number of distinct rows and objectives with quadratic terms.

Definition at line 898 of file OSInstance.h.

Referenced by getNumberOfQuadraticRowIndexes(), and getQuadraticRowIndexes().

bool OSInstance::m_bQuadraticRowIndexesProcessed`[private]`

m_bQuadraticRowIndexesProcessed is true if getQuadraticRowIndexes() has been called.

Definition at line 903 of file OSInstance.h.

Referenced by getNumberOfQuadraticRowIndexes(), and getQuadraticRowIndexes().

int* OSInstance::m_miQuadRowIndexes`[private]`

m_miQuadRowIndexes is an integer pointer to the distinct rows indexes with a quadratic term.

Definition at line 908 of file OSInstance.h.

Referenced by getQuadraticRowIndexes().

int OSInstance::m_iNumberOfNonlinearExpressionTreeIndexes`[private]`

m_iNumberOfNonlinearExpressionTreeIndexes holds the number of distinct rows and objectives with nonlinear terms.

Definition at line 913 of file OSInstance.h.

Referenced by getNonlinearExpressionTreeIndexes(), and getNumberOfNonlinearExpressionTreeIndexes().

bool OSInstance::m_bNonlinearExpressionTreeIndexesProcessed`[private]`

m_bNonlinearExpressionTreeIndexesProcessed is true if getNonlinearExpressionTreeIndexes has been called.

Definition at line 918 of file OSInstance.h.

Referenced by getNonlinearExpressionTreeIndexes(), and getNumberOfNonlinearExpressionTreeIndexes().

int* OSInstance::m_miNonlinearExpressionTreeIndexes`[private]`

m_miNonlinearExpressionTreeIndexes is an integer pointer to the distinct rows indexes in the nonlinear expression tree map.

Definition at line 924 of file OSInstance.h.

Referenced by getNonlinearExpressionTreeIndexes().

int OSInstance::m_iNumberOfNonlinearExpressionTreeModIndexes`[private]`

m_iNumberOfNonlinearExpressionTreeModIndexes holds the number of distinct rows and objectives with nonlinear terms including quadratic terms added to the nonlinear expression trees.

Definition at line 930 of file OSInstance.h.

Referenced by getNonlinearExpressionTreeModIndexes(), and getNumberOfNonlinearExpressionTreeModIndexes().

bool OSInstance::m_bNonlinearExpressionTreeModIndexesProcessed`[private]`

m_bNonlinearExpressionTreeModIndexesProcessed is true if getNonlinearExpressionTreeModIndexes has been called.

Definition at line 935 of file OSInstance.h.

Referenced by getNonlinearExpressionTreeModIndexes(), and getNumberOfNonlinearExpressionTreeModIndexes().

int* OSInstance::m_miNonlinearExpressionTreeModIndexes`[private]`

m_miNonlinearExpressionTreeModIndexes is an integer pointer to the distinct rows indexes in the modified expression tree map.

Definition at line 941 of file OSInstance.h.

Referenced by getNonlinearExpressionTreeModIndexes().

std::string* OSInstance::m_msVariableNames`[private]`

m_msVariableNames holds an array of variable names.

Definition at line 946 of file OSInstance.h.

Referenced by getVariableNames(), processVariables(), and ~OSInstance().

char* OSInstance::m_mcVariableTypes`[private]`

m_mcVariableTypes holds a char array of variable types (default = 'C').

(C for Continuous; B for Binary; I for Integer; S for String)

Definition at line 952 of file OSInstance.h.

Referenced by getVariableTypes(), printModel(), processVariables(), and ~OSInstance().

double* OSInstance::m_mdVariableLowerBounds`[private]`

m_mdVariableLowerBounds holds a double array of variable lower bounds (default = 0.0).

Definition at line 957 of file OSInstance.h.

Referenced by getVariableLowerBounds(), printModel(), processVariables(), and ~OSInstance().

double* OSInstance::m_mdVariableUpperBounds`[private]`

m_mdVariableUpperBounds holds a double array of variable upper bounds (default = INF).

Definition at line 962 of file OSInstance.h.

Referenced by getVariableUpperBounds(), printModel(), processVariables(), and ~OSInstance().

bool OSInstance::m_bProcessObjectives`[private]`

m_bProcessObjectives holds whether the objectives are processed.

Definition at line 967 of file OSInstance.h.

Referenced by initializeNonLinearStructures(), printModel(), processObjectives(), and ~OSInstance().

int OSInstance::m_iObjectiveNumber`[private]`

m_iObjectiveNumber is the number of objective functions.

Definition at line 972 of file OSInstance.h.

Referenced by getObjectiveNumber(), getZeroOrderResults(), and initializeNonLinearStructures().

int OSInstance::m_iObjectiveNumberNonlinear`[private]`

m_iObjectiveNumber is the number of objective functions with a nonlinear term.

Definition at line 977 of file OSInstance.h.

Referenced by addQTermsToExressionTree(), getAllNonlinearExpressionTrees(), getFirstOrderResults(), getNumberOfNonlinearObjectives(), and getSecondOrderResults().

std::string* OSInstance::m_msObjectiveNames`[private]`

m_msObjectiveNames holds an array of objective names.

Definition at line 982 of file OSInstance.h.

Referenced by getObjectiveNames(), processObjectives(), and ~OSInstance().

std::string* OSInstance::m_msMaxOrMins`[private]`

m_msMaxOrMins holds a std::string array of objective maxOrMins ("max" or "min").

Definition at line 987 of file OSInstance.h.

Referenced by getObjectiveMaxOrMins(), processObjectives(), and ~OSInstance().

int* OSInstance::m_miNumberOfObjCoef`[private]`

m_miNumberOfObjCoef holds an integer array of number of objective coefficients (default = 0.0).

Definition at line 992 of file OSInstance.h.

Referenced by getObjectiveCoefficientNumbers(), printModel(), processObjectives(), and ~OSInstance().

double* OSInstance::m_mdObjectiveConstants`[private]`

m_mdObjectiveConstants holds an array of objective constants (default = 0.0).

Definition at line 997 of file OSInstance.h.

Referenced by calculateFunctionValue(), getObjectiveConstants(), processObjectives(), and ~OSInstance().

double* OSInstance::m_mdObjectiveWeights`[private]`

m_mdObjectiveWeights holds an array of objective weights (default = 1.0).

Definition at line 1002 of file OSInstance.h.

Referenced by getObjectiveWeights(), processObjectives(), and ~OSInstance().

SparseVector** OSInstance::m_mObjectiveCoefficients`[private]`

m_mObjectiveCoefficients holds an array of objective coefficients, one set of objective coefficients for each objective.

Definition at line 1008 of file OSInstance.h.

Referenced by getObjectiveCoefficients(), printModel(), processObjectives(), and ~OSInstance().

bool OSInstance::m_bGetDenseObjectives`[private]`

m_bGetDenseObjectives holds whether the dense objective functions are processed.

Definition at line 1013 of file OSInstance.h.

Referenced by getDenseObjectiveCoefficients(), and ~OSInstance().

double** OSInstance::m_mmdDenseObjectiveCoefficients`[private]`

m_mmdDenseObjectiveCoefficients holds an array of pointers, each pointer points to a vector of dense objective function coefficients

Definition at line 1019 of file OSInstance.h.

Referenced by calculateObjectiveFunctionGradient(), getDenseObjectiveCoefficients(), getSecondOrderResults(), getZeroOrderResults(), and ~OSInstance().

bool OSInstance::m_bProcessConstraints`[private]`

m_bProcessConstraints holds whether the constraints are processed.

Definition at line 1024 of file OSInstance.h.

Referenced by initializeNonLinearStructures(), printModel(), processConstraints(), and ~OSInstance().

int OSInstance::m_iConstraintNumber`[private]`

m_iConstraintNumber is the number of constraints.

Definition at line 1029 of file OSInstance.h.

Referenced by getConstraintNumber(), getFirstOrderResults(), getSecondOrderResults(), getZeroOrderResults(), and initializeNonLinearStructures().

int OSInstance::m_iConstraintNumberNonlinear`[private]`

m_iConstraintNumberNonlinear is the number of constraints that have a nonlinear term.

Definition at line 1034 of file OSInstance.h.

Referenced by addQTermsToExressionTree(), getAllNonlinearExpressionTrees(), and getNumberOfNonlinearConstraints().

std::string* OSInstance::m_msConstraintNames`[private]`

m_msConstraintNames holds an array of constraint names.

Definition at line 1039 of file OSInstance.h.

Referenced by getConstraintNames(), processConstraints(), and ~OSInstance().

double* OSInstance::m_mdConstraintLowerBounds`[private]`

m_mdConstraintLowerBounds holds an array of constraint lower bounds (default = -INF).

Definition at line 1044 of file OSInstance.h.

Referenced by getConstraintLowerBounds(), printModel(), processConstraints(), and ~OSInstance().

double* OSInstance::m_mdConstraintUpperBounds`[private]`

m_mdConstraintUpperBounds holds an array of constraint upper bounds (default = INF).

Definition at line 1049 of file OSInstance.h.

Referenced by getConstraintUpperBounds(), printModel(), processConstraints(), and ~OSInstance().

double* OSInstance::m_mdConstraintConstants`[private]`

m_mdConstraintConstants holds an array of constraint constants (default = 0.0).

Definition at line 1055 of file OSInstance.h.

Referenced by calculateFunctionValue(), getZeroOrderResults(), processConstraints(), and ~OSInstance().

char* OSInstance::m_mcConstraintTypes`[private]`

m_mcConstraintTypes holds a char array of constraint types (R for range; L for <=; G for >=; E for =; U for unconstrained)

Definition at line 1061 of file OSInstance.h.

Referenced by getConstraintTypes(), processConstraints(), and ~OSInstance().

bool OSInstance::m_bProcessLinearConstraintCoefficients`[private]`

m_bProcessLinearConstraintCoefficients holds whether the linear constraint coefficients are processed.

Definition at line 1066 of file OSInstance.h.

Referenced by processLinearConstraintCoefficients().

int OSInstance::m_iLinearConstraintCoefficientNumber`[private]`

m_iLinearConstraintCoefficientNumber holds the number of specified (usually nonzero) linear constraint coefficient values.

Definition at line 1072 of file OSInstance.h.

Referenced by getLinearConstraintCoefficientNumber().

bool OSInstance::m_bColumnMajor`[private]`

m_bColumnMajor holds whether the linear constraint coefficients are stored in column major.

Definition at line 1077 of file OSInstance.h.

Referenced by getJacobianSparsityPattern(), getLinearConstraintCoefficientMajor(), getLinearConstraintCoefficientsInColumnMajor(), getLinearConstraintCoefficientsInRowMajor(), getSparseJacobianFromColumnMajor(), getSparseJacobianFromRowMajor(), and processLinearConstraintCoefficients().

bool OSInstance::m_binitForAlgDiff`[private]`

m_binitForAlgDiff is true if initForAlgDiff() has been called.

Definition at line 1082 of file OSInstance.h.

Referenced by calculateFunctionValue(), createOSADFun(), getIterateResults(), getLagrangianHessianSparsityPattern(), getNonlinearExpressionTreeInInfix(), and ~OSInstance().

SparseMatrix* OSInstance::m_linearConstraintCoefficientsInColumnMajor`[private]`

m_linearConstraintCoefficientsInColumnMajor holds the standard 3 array data structure for linear constraint coefficients (starts, indexes and values) in column major.

Definition at line 1089 of file OSInstance.h.

Referenced by getLinearConstraintCoefficientsInColumnMajor(), getLinearConstraintCoefficientsInRowMajor(), processLinearConstraintCoefficients(), and ~OSInstance().

SparseMatrix* OSInstance::m_linearConstraintCoefficientsInRowMajor`[private]`

m_linearConstraintCoefficientsInRowMajor holds the standard 3 array data structure for linear constraint coefficients (starts, indexes and values) in row major.

Definition at line 1095 of file OSInstance.h.

Referenced by getLinearConstraintCoefficientsInColumnMajor(), getLinearConstraintCoefficientsInRowMajor(), printModel(), processLinearConstraintCoefficients(), and ~OSInstance().

bool OSInstance::m_bProcessQuadraticTerms`[private]`

m_bProcessQuadraticTerms holds whether the quadratic terms are processed.

Definition at line 1101 of file OSInstance.h.

Referenced by getQuadraticTerms().

int OSInstance::m_iQuadraticTermNumber`[private]`

m_iQuadraticTermNumber holds the number of specified (usually nonzero) qTerms in the quadratic coefficients.

Definition at line 1107 of file OSInstance.h.

Referenced by getNumberOfQuadraticTerms().

double* OSInstance::m_mdConstraintFunctionValues`[private]`

m_mdConstraintFunctionValues holds a double array of constraint function values -- the size of the array is equal to getConstraintNumber().

Definition at line 1112 of file OSInstance.h.

Referenced by calculateAllConstraintFunctionValues(), calculateFunctionValue(), getZeroOrderResults(), and initializeNonLinearStructures().

double* OSInstance::m_mdObjectiveFunctionValues`[private]`

m_mdObjectiveFunctionValues holds a double array of objective function values -- the size of the array is equal to getObjectiveNumber().

Definition at line 1117 of file OSInstance.h.

Referenced by calculateAllObjectiveFunctionValues(), calculateFunctionValue(), getZeroOrderResults(), and initializeNonLinearStructures().

int OSInstance::m_iJacValueSize`[private]`

m_iJacValueSize is the number of nonzero partial derivates in the Jacobian.

Definition at line 1122 of file OSInstance.h.

Referenced by getJacobianSparsityPattern(), getSparseJacobianFromColumnMajor(), and getSparseJacobianFromRowMajor().

int* OSInstance::m_miJacStart`[private]`

m_miJacStart holds a int array of starts for the Jacobian matrix in sparse form (row major).

Definition at line 1127 of file OSInstance.h.

Referenced by calculateConstraintFunctionGradient(), getFirstOrderResults(), getJacobianSparsityPattern(), getSecondOrderResults(), getSparseJacobianFromColumnMajor(), and getSparseJacobianFromRowMajor().

int* OSInstance::m_miJacIndex`[private]`

m_miJacIndex holds a int array of variable indices for the Jacobian matrix in sparse form (row major).

Definition at line 1132 of file OSInstance.h.

Referenced by calculateConstraintFunctionGradient(), getJacobianSparsityPattern(), getSparseJacobianFromColumnMajor(), and getSparseJacobianFromRowMajor().

double* OSInstance::m_mdJacValue`[private]`

m_mdJacValue holds a double array of partial derivatives for the Jacobian matrix in sparse form (row major).

Definition at line 1137 of file OSInstance.h.

Referenced by calculateConstraintFunctionGradient(), getFirstOrderResults(), getJacobianSparsityPattern(), getSecondOrderResults(), getSparseJacobianFromColumnMajor(), and getSparseJacobianFromRowMajor().

int* OSInstance::m_miJacNumConTerms`[private]`

m_miJacNumConTerms holds a int array of the number of constant terms (gradient does not change) for the Jacobian matrix in sparse form (row major).

Definition at line 1144 of file OSInstance.h.

Referenced by getFirstOrderResults(), getJacobianSparsityPattern(), getSecondOrderResults(), getSparseJacobianFromColumnMajor(), and getSparseJacobianFromRowMajor().

SparseJacobianMatrix* OSInstance::m_sparseJacMatrix`[private]`

m_sparseJacMatrix is the Jacobian matrix stored in sparse matrix format

Definition at line 1149 of file OSInstance.h.

Referenced by calculateAllConstraintFunctionGradients(), calculateFunctionValue(), getFirstOrderResults(), getJacobianSparsityPattern(), getSecondOrderResults(), and getZeroOrderResults().

int OSInstance::m_iHighestTaylorCoeffOrder`[private]`

m_iHighestTaylorCoeffOrder is the order of highest calculated Taylor coefficient

Definition at line 1155 of file OSInstance.h.

Referenced by createOSADFun(), forwardAD(), and reverseAD().

QuadraticTerms* OSInstance::m_quadraticTerms`[private]`

m_quadraticTerms the data structure for all the quadratic terms in the instance.

` (rowIdx, varOneIdx, varTwoIdx, coef)

Definition at line 1161 of file OSInstance.h.

Referenced by addQTermsToExressionTree(), and getQuadraticTerms().

bool OSInstance::m_bQTermsAdded`[private]`

m_bQTermsAdded is true if we add the quadratic terms to the expression tree

Definition at line 1165 of file OSInstance.h.

Referenced by addQTermsToExressionTree().

unsigned int OSInstance::m_iNumberOfNonlinearVariables`[private]`

m_iNumberOfNonlinearVariables is the number of variables that appear in a nonlinear expression.

Definition at line 1171 of file OSInstance.h.

Referenced by calculateObjectiveFunctionGradient(), getAllNonlinearVariablesIndexMap(), getFirstOrderResults(), getLagrangianHessianSparsityPattern(), and getSecondOrderResults().

bool OSInstance::m_bProcessNonlinearExpressions`[private]`

m_bProcessNonlinearExpressions holds whether the nonlinear expressions are processed.

Definition at line 1176 of file OSInstance.h.

int OSInstance::m_iNonlinearExpressionNumber`[private]`

m_iNonlinearExpressionNumber holds the number of nonlinear expressions.

Definition at line 1181 of file OSInstance.h.

Referenced by addQTermsToExressionTree(), and getNumberOfNonlinearExpressions().

int* OSInstance::m_miNonlinearExpressionIndexes`[private]`

m_miNonlinearExpressionIndexes holds an integer array of nonlinear expression indexes, negative indexes correspond to objectives.

Definition at line 1187 of file OSInstance.h.

bool OSInstance::m_bProcessExpressionTrees`[private]`

m_bProcessExpressionTrees is true if the expression trees have been processed.

Definition at line 1192 of file OSInstance.h.

Referenced by addQTermsToExressionTree(), duplicateExpressionTreesMap(), getAllNonlinearExpressionTrees(), getNonlinearExpressionTree(), getNonlinearExpressionTreeInInfix(), getNonlinearExpressionTreeInPostfix(), getNonlinearExpressionTreeInPrefix(), getNumberOfNonlinearConstraints(), getNumberOfNonlinearObjectives(), and initializeNonLinearStructures().

bool OSInstance::m_bProcessExpressionTreesMod`[private]`

m_bProcessExpressionTreesMod is true if the modified expression trees have been processed.

Definition at line 1197 of file OSInstance.h.

Referenced by getAllNonlinearExpressionTreesMod(), getNonlinearExpressionTreeMod(), getNonlinearExpressionTreeModInPostfix(), and getNonlinearExpressionTreeModInPrefix().

std::map<int, OSExpressionTree*> OSInstance::m_mapExpressionTrees`[private]`

m_mapExpressionTrees holds a hash map of expression tree pointers, with the key being the row index and value being the expression tree representing the nonlinear expression of that row.

Definition at line 1203 of file OSInstance.h.

Referenced by addQTermsToExressionTree(), duplicateExpressionTreesMap(), getAllNonlinearExpressionTrees(), getNonlinearExpressionTree(), getNonlinearExpressionTreeInInfix(), getNonlinearExpressionTreeInPostfix(), and getNonlinearExpressionTreeInPrefix().

std::map<int, int> OSInstance::m_mapOSADFunRangeIndex`[private]`

Definition at line 1207 of file OSInstance.h.

Referenced by createOSADFun(), and getZeroOrderResults().

OSExpressionTree* OSInstance::m_LagrangianExpTree`[private]`

m_LagrangianExpTree is an OSExpressionTree object that is the expression tree for the Lagrangian function.

Definition at line 1213 of file OSInstance.h.

Referenced by getLagrangianExpTree().

bool OSInstance::m_bLagrangianExpTreeCreated`[private]`

m_bLagrangianHessionCreated is true if a Lagrangian function for the Hessian has been created

Definition at line 1218 of file OSInstance.h.

Referenced by getLagrangianExpTree().

SparseHessianMatrix* OSInstance::m_LagrangianSparseHessian`[private]`

m_LagrangianSparseHessian is the Hessian Matrix of the Lagrangian function in sparse format

Definition at line 1223 of file OSInstance.h.

Referenced by calculateHessian(), calculateLagrangianHessian(), getLagrangianHessianSparsityPattern(), and getSecondOrderResults().

bool OSInstance::m_bLagrangianSparseHessianCreated`[private]`

m_bLagrangianSparseHessianCreated is true if the sparse Hessian Matrix for the Lagrangian was created

Definition at line 1229 of file OSInstance.h.

Referenced by getLagrangianHessianSparsityPattern(), and getSecondOrderResults().

std::map<int, int> OSInstance::m_mapAllNonlinearVariablesIndex`[private]`

m_mapAllNonlinearVariablesIndexMap is a map of the variables in the Lagrangian function

Definition at line 1234 of file OSInstance.h.

Referenced by calculateObjectiveFunctionGradient(), createOSADFun(), getAllNonlinearVariablesIndexMap(), getFirstOrderResults(), getIterateResults(), and getLagrangianHessianSparsityPattern().

int* OSInstance::m_miNonLinearVarsReverseMap`[private]`

m_miNonLinearVarsReverseMap maps the nonlinear variable number back into the original variable space

Definition at line 1239 of file OSInstance.h.

Referenced by calculateObjectiveFunctionGradient(), getAllNonlinearVariablesIndexMap(), getFirstOrderResults(), getSecondOrderResults(), and ~OSInstance().

bool OSInstance::m_bAllNonlinearVariablesIndex`[private]`

m_bAllNonlinearVariablesIndexMap is true if the map of the variables in the Lagrangian function has been constructed

Definition at line 1245 of file OSInstance.h.

Referenced by getAllNonlinearVariablesIndexMap().

std::map<int, OSExpressionTree*> OSInstance::m_mapExpressionTreesMod`[private]`

m_mapExpressionTreesMod holds a map of expression trees, with the key being the row index and value being the expression tree representing a modification of the nonlinear expression of that row.

We incorporate the linear and quadratic term for a variable into the corresponding expression tree before gradient and Hessian calculations

Definition at line 1253 of file OSInstance.h.

Referenced by addQTermsToExressionTree(), calculateAllObjectiveFunctionGradients(), calculateFunctionValue(), calculateObjectiveFunctionGradient(), createOSADFun(), duplicateExpressionTreesMap(), getADSparsityHessian(), getAllNonlinearExpressionTreesMod(), getAllNonlinearVariablesIndexMap(), getFirstOrderResults(), getIterateResults(), getLagrangianExpTree(), getLagrangianHessianSparsityPattern(), getNonlinearExpressionTreeMod(), getNonlinearExpressionTreeModInPostfix(), getNonlinearExpressionTreeModInPrefix(), getSecondOrderResults(), getSparseJacobianFromColumnMajor(), getSparseJacobianFromRowMajor(), getZeroOrderResults(), initializeNonLinearStructures(), and printModel().

bool OSInstance::m_bOSADFunIsCreated`[private]`

m_bOSADFunIsCreated is true if we have created the OSInstanc OSAD Function

Definition at line 1259 of file OSInstance.h.

Referenced by calculateObjectiveFunctionGradient(), createOSADFun(), forwardAD(), getIterateResults(), and getLagrangianHessianSparsityPattern().

bool OSInstance::m_bCppADTapesBuilt`[private]`

is true if a CppAD Expresion Tree has been built for each row and objective with a nonlinear expression.

Definition at line 1265 of file OSInstance.h.

bool OSInstance::m_bCppADMustReTape`[private]`

is true if a CppAD Expresion Tree has an expression that can change depending on the value of the input, e.g.

an if statement -- false by default

Definition at line 1271 of file OSInstance.h.

Referenced by calculateObjectiveFunctionGradient(), getIterateResults(), and getLagrangianHessianSparsityPattern().

bool OSInstance::m_bDuplicateExpressionTreesMap`[private]`

m_bDuplicateExpressionTreeMap is true if m_mapExpressionTrees was duplicated.

Definition at line 1276 of file OSInstance.h.

Referenced by duplicateExpressionTreesMap(), and initializeNonLinearStructures().

bool OSInstance::m_bNonLinearStructuresInitialized`[private]`

m_bNonLinearStructuresInitialized is true if initializeNonLinearStructures( ) has been called.

Definition at line 1281 of file OSInstance.h.

Referenced by getAllNonlinearExpressionTreesMod(), getJacobianSparsityPattern(), and initializeNonLinearStructures().

bool OSInstance::m_bSparseJacobianCalculated`[private]`

m_bSparseJacobianCalculated is true if getJacobianSparsityPattern() has been called.

Definition at line 1286 of file OSInstance.h.

Referenced by calculateFunctionValue(), getJacobianSparsityPattern(), getLagrangianExpTree(), and printModel().

std::map<int, std::vector<OSnLNode*> > OSInstance::m_mapExpressionTreesInPostfix`[private]`

m_mapExpressionTreesInPostfix holds a hash map of expression trees in postfix format, with the key being the row index and value being the expression tree representing the nonlinear expression of that row.

Definition at line 1292 of file OSInstance.h.

int OSInstance::m_iHighestOrderEvaluated`[private]`

m_iHighestOrderEvaluated is the highest order derivative of the current iterate

Definition at line 1299 of file OSInstance.h.

Referenced by calculateAllConstraintFunctionGradients(), calculateAllConstraintFunctionValues(), calculateAllObjectiveFunctionGradients(), calculateAllObjectiveFunctionValues(), calculateConstraintFunctionGradient(), calculateHessian(), calculateLagrangianHessian(), calculateObjectiveFunctionGradient(), forwardAD(), getIterateResults(), and reverseAD().

double** OSInstance::m_mmdObjGradient`[private]`

m_mdObjGradient holds an array of pointers, each pointer points to gradient of each objective function

Definition at line 1305 of file OSInstance.h.

Referenced by calculateAllObjectiveFunctionGradients(), calculateObjectiveFunctionGradient(), getSecondOrderResults(), and ~OSInstance().

std::vector<double> OSInstance::m_vdX`[private]`

m_vdX is a vector of primal variables at each iteration

Definition at line 1313 of file OSInstance.h.

Referenced by calculateObjectiveFunctionGradient(), getIterateResults(), and getZeroOrderResults().

std::vector<double> OSInstance::m_vdYval`[private]`

m_vdYval is a vector of function values

Definition at line 1319 of file OSInstance.h.

Referenced by getZeroOrderResults().

std::vector<bool> OSInstance::m_vbLagHessNonz`[private]`

m_vbLagHessNonz is a boolean vector holding the nonzero pattern of the Lagrangian of the Hessian

Definition at line 1326 of file OSInstance.h.

Referenced by getADSparsityHessian(), getLagrangianHessianSparsityPattern(), and getSecondOrderResults().

std::vector<double> OSInstance::m_vdYjacval`[private]`

m_vdYval is a vector equal to a column or row of the Jacobian

Definition at line 1332 of file OSInstance.h.

Referenced by calculateObjectiveFunctionGradient(), getFirstOrderResults(), and getSecondOrderResults().

std::vector<double> OSInstance::m_vdw`[private]`

m_vdYval is a vector of derivatives -- output from a reverse sweep

Definition at line 1338 of file OSInstance.h.

Referenced by getSecondOrderResults().

std::vector<double> OSInstance::m_vdLambda`[private]`

m_vdYval is a vector of Lagrange multipliers

Definition at line 1344 of file OSInstance.h.

Referenced by getSecondOrderResults().

std::vector<double> OSInstance::m_vdDomainUnitVec`[private]`

m_vdDomainUnitVec is a unit vector in the domain space

Definition at line 1351 of file OSInstance.h.

Referenced by getFirstOrderResults(), and getSecondOrderResults().

std::vector<double> OSInstance::m_vdRangeUnitVec`[private]`

m_vdRangeUnitVec is a unit vector in the range space

Definition at line 1357 of file OSInstance.h.

Referenced by calculateObjectiveFunctionGradient(), and getFirstOrderResults().

bool OSInstance::m_bProcessTimeDomain`[private]`

m_bProcessTimeDomain holds whether the time domain has been processed.

Definition at line 1363 of file OSInstance.h.

bool OSInstance::m_bProcessTimeStages`[private]`

m_bProcessTimeStages holds whether the time stages have been processed.

Definition at line 1368 of file OSInstance.h.

bool OSInstance::m_bProcessTimeInterval`[private]`

m_bProcessTimeInterval holds whether a time interval has been processed.

Definition at line 1373 of file OSInstance.h.

bool OSInstance::m_bFiniteTimeStages`[private]`

m_bFiniteTimeStages holds whether the time domain has the form of finite (discrete) stages.

Definition at line 1378 of file OSInstance.h.

int OSInstance::m_iNumberOfTimeStages`[private]`

m_iNumberOfTimeStages holds the number of discrete stages

Definition at line 1383 of file OSInstance.h.

Referenced by getTimeDomainStageConList(), getTimeDomainStageObjList(), and getTimeDomainStageVarList().

std::string OSInstance::m_sTimeDomainFormat`[private]`

m_sTimeDomainFormat holds the format ("stages"/"interval") of the time domain.

Definition at line 1388 of file OSInstance.h.

Referenced by setTimeDomain().

std::string* OSInstance::m_msTimeDomainStageNames`[private]`

m_msTimeDomainStageNames holds the names of the time stages.

Definition at line 1394 of file OSInstance.h.

Referenced by getTimeDomainStageNames().

int* OSInstance::m_miTimeDomainStageVariableNumber`[private]`

m_miTimeDomainStageVariableNumber holds the number of variables in each stage.

Definition at line 1400 of file OSInstance.h.

Referenced by getTimeDomainStageNumberOfVariables(), and getTimeDomainStageVarList().

int** OSInstance::m_mmiTimeDomainStageVarList`[private]`

m_mmiTimeDomainStageVarList holds the list of variables in each stage.

Definition at line 1406 of file OSInstance.h.

Referenced by getTimeDomainStageVarList().

int* OSInstance::m_miTimeDomainStageConstraintNumber`[private]`

m_miTimeDomainStageConstraintNumber holds the number of constraints in each stage.

Definition at line 1412 of file OSInstance.h.

Referenced by getTimeDomainStageConList(), and getTimeDomainStageNumberOfConstraints().

int** OSInstance::m_mmiTimeDomainStageConList`[private]`

m_mmiTimeDomainStageConList holds the list of constraints in each stage.

Definition at line 1418 of file OSInstance.h.

Referenced by getTimeDomainStageConList().

int* OSInstance::m_miTimeDomainStageObjectiveNumber`[private]`

m_miTimeDomainStageObjectiveNumber holds the number of objectives in each stage.

Definition at line 1424 of file OSInstance.h.

Referenced by getTimeDomainStageNumberOfObjectives(), and getTimeDomainStageObjList().

int** OSInstance::m_mmiTimeDomainStageObjList`[private]`

m_mmiTimeDomainStageObjList holds the list of objectives in each stage.

Definition at line 1430 of file OSInstance.h.

Referenced by getTimeDomainStageObjList().

bool OSInstance::bUseExpTreeForFunEval

bUseExpTreeForFunEval is set to true if you wish to use the OS Expression Tree for function evaluations instead of AD -- false by default.

Definition at line 2624 of file OSInstance.h.

Referenced by IpoptProblem::get_nlp_info(), BonminProblem::get_nlp_info(), getIterateResults(), KnitroProblem::loadProblemIntoKnitro(), and main().

InstanceHeader* OSInstance::instanceHeader

A pointer to an InstanceHeader object.

Definition at line 751 of file OSInstance.h.

InstanceData* OSInstance::instanceData

A pointer to an InstanceData object.

Definition at line 754 of file OSInstance.h.

int* OSInstance::m_miQuadRowIndexes`[private]`

m_miQuadRowIndexes is an integer pointer to the distinct rows indexes with a quadratic term.

Definition at line 803 of file OSInstance.h.

int* OSInstance::m_miNonlinearExpressionTreeIndexes`[private]`

m_miNonlinearExpressionTreeIndexes is an integer pointer to the distinct rows indexes in the nonlinear expression tree map.

Definition at line 819 of file OSInstance.h.

int* OSInstance::m_miNonlinearExpressionTreeModIndexes`[private]`

m_miNonlinearExpressionTreeModIndexes is an integer pointer to the distinct rows indexes in the modified expression tree map.

Definition at line 836 of file OSInstance.h.

std::string* OSInstance::m_msVariableNames`[private]`

m_msVariableNames holds an array of variable names.

Definition at line 841 of file OSInstance.h.

char* OSInstance::m_mcVariableTypes`[private]`

m_mcVariableTypes holds a char array of variable types (default = 'C').

(C for Continuous; B for Binary; I for Integer; S for String)

Definition at line 859 of file OSInstance.h.

double* OSInstance::m_mdVariableLowerBounds`[private]`

m_mdVariableLowerBounds holds a double array of variable lower bounds (default = 0.0).

Definition at line 864 of file OSInstance.h.

double* OSInstance::m_mdVariableUpperBounds`[private]`

m_mdVariableUpperBounds holds a double array of variable upper bounds (default = INF).

Definition at line 869 of file OSInstance.h.

std::string* OSInstance::m_msObjectiveNames`[private]`

m_msObjectiveNames holds an array of objective names.

Definition at line 889 of file OSInstance.h.

std::string* OSInstance::m_msMaxOrMins`[private]`

m_msMaxOrMins holds a std::string array of objective maxOrMins ("max" or "min").

Definition at line 894 of file OSInstance.h.

int* OSInstance::m_miNumberOfObjCoef`[private]`

m_miNumberOfObjCoef holds an integer array of number of objective coefficients (default = 0.0).

Definition at line 899 of file OSInstance.h.

double* OSInstance::m_mdObjectiveConstants`[private]`

m_mdObjectiveConstants holds an array of objective constants (default = 0.0).

Definition at line 904 of file OSInstance.h.

double* OSInstance::m_mdObjectiveWeights`[private]`

m_mdObjectiveWeights holds an array of objective weights (default = 1.0).

Definition at line 909 of file OSInstance.h.

SparseVector** OSInstance::m_mObjectiveCoefficients`[private]`

m_mObjectiveCoefficients holds an array of objective coefficients, one set of objective coefficients for each objective.

Definition at line 915 of file OSInstance.h.

double** OSInstance::m_mmdDenseObjectiveCoefficients`[private]`

m_mmdDenseObjectiveCoefficients holds an array of pointers, each pointer points to a vector of dense objective function coefficients

Definition at line 926 of file OSInstance.h.

std::string* OSInstance::m_msConstraintNames`[private]`

m_msConstraintNames holds an array of constraint names.

Definition at line 946 of file OSInstance.h.

double* OSInstance::m_mdConstraintLowerBounds`[private]`

m_mdConstraintLowerBounds holds an array of constraint lower bounds (default = -INF).

Definition at line 951 of file OSInstance.h.

double* OSInstance::m_mdConstraintUpperBounds`[private]`

m_mdConstraintUpperBounds holds an array of constraint upper bounds (default = INF).

Definition at line 956 of file OSInstance.h.

double* OSInstance::m_mdConstraintConstants`[private]`

m_mdConstraintConstants holds an array of constraint constants (default = 0.0).

Definition at line 962 of file OSInstance.h.

char* OSInstance::m_mcConstraintTypes`[private]`

m_mcConstraintTypes holds a char array of constraint types (R for range; L for <=; G for >=; E for =; U for unconstrained)

Definition at line 968 of file OSInstance.h.

SparseMatrix* OSInstance::m_linearConstraintCoefficientsInColumnMajor`[private]`

m_linearConstraintCoefficientsInColumnMajor holds the standard 3 array data structure for linear constraint coefficients (starts, indexes and values) in column major.

Definition at line 996 of file OSInstance.h.

SparseMatrix* OSInstance::m_linearConstraintCoefficientsInRowMajor`[private]`

m_linearConstraintCoefficientsInRowMajor holds the standard 3 array data structure for linear constraint coefficients (starts, indexes and values) in row major.

Definition at line 1002 of file OSInstance.h.

double* OSInstance::m_mdConstraintFunctionValues`[private]`

m_mdConstraintFunctionValues holds a double array of constraint function values -- the size of the array is equal to getConstraintNumber().

Definition at line 1019 of file OSInstance.h.

double* OSInstance::m_mdObjectiveFunctionValues`[private]`

m_mdObjectiveFunctionValues holds a double array of objective function values -- the size of the array is equal to getObjectiveNumber().

Definition at line 1024 of file OSInstance.h.

int* OSInstance::m_miJacStart`[private]`

m_miJacStart holds a int array of starts for the Jacobian matrix in sparse form (row major).

Definition at line 1034 of file OSInstance.h.

int* OSInstance::m_miJacIndex`[private]`

m_miJacIndex holds a int array of variable indices for the Jacobian matrix in sparse form (row major).

Definition at line 1039 of file OSInstance.h.

double* OSInstance::m_mdJacValue`[private]`

m_mdJacValue holds a double array of partial derivatives for the Jacobian matrix in sparse form (row major).

Definition at line 1044 of file OSInstance.h.

int* OSInstance::m_miJacNumConTerms`[private]`

m_miJacNumConTerms holds a int array of the number of constant terms (gradient does not change) for the Jacobian matrix in sparse form (row major).

Definition at line 1051 of file OSInstance.h.

SparseJacobianMatrix* OSInstance::m_sparseJacMatrix`[private]`

m_sparseJacMatrix is the Jacobian matrix stored in sparse matrix format

Definition at line 1056 of file OSInstance.h.

QuadraticTerms* OSInstance::m_quadraticTerms`[private]`

m_quadraticTerms the data structure for all the quadratic terms in the instance.

` (rowIdx, varOneIdx, varTwoIdx, coef)

Definition at line 1068 of file OSInstance.h.

int* OSInstance::m_miNonlinearExpressionIndexes`[private]`

m_miNonlinearExpressionIndexes holds an integer array of nonlinear expression indexes, negative indexes correspond to objectives.

Definition at line 1094 of file OSInstance.h.

std::map<int, OSExpressionTree*> OSInstance::m_mapExpressionTrees`[private]`

m_mapExpressionTrees holds a hash map of expression tree pointers, with the key being the row index and value being the expression tree representing the nonlinear expression of that row.

Definition at line 1110 of file OSInstance.h.

std::map<int, int> OSInstance::m_mapOSADFunRangeIndex`[private]`

Definition at line 1114 of file OSInstance.h.

OSExpressionTree* OSInstance::m_LagrangianExpTree`[private]`

m_LagrangianExpTree is an OSExpressionTree object that is the expression tree for the Lagrangian function.

Definition at line 1120 of file OSInstance.h.

SparseHessianMatrix* OSInstance::m_LagrangianSparseHessian`[private]`

m_LagrangianSparseHessian is the Hessian Matrix of the Lagrangian function in sparse format

Definition at line 1130 of file OSInstance.h.

std::map<int, int> OSInstance::m_mapAllNonlinearVariablesIndex`[private]`

m_mapAllNonlinearVariablesIndexMap is a map of the variables in the Lagrangian function

Definition at line 1141 of file OSInstance.h.

int* OSInstance::m_miNonLinearVarsReverseMap`[private]`

m_miNonLinearVarsReverseMap maps the nonlinear variable number back into the original variable space

Definition at line 1146 of file OSInstance.h.

std::map<int, OSExpressionTree*> OSInstance::m_mapExpressionTreesMod`[private]`

m_mapExpressionTreesMod holds a map of expression trees, with the key being the row index and value being the expression tree representing a modification of the nonlinear expression of that row.

We incorporate the linear and quadratic term for a variable into the corresponding expression tree before gradient and Hessian calculations

Definition at line 1160 of file OSInstance.h.

std::map<int, std::vector<OSnLNode*> > OSInstance::m_mapExpressionTreesInPostfix`[private]`

m_mapExpressionTrees holds a hash map of expression trees in postfix format, with the key being the row index and value being the expression tree representing the nonlinear expression of that row.

Definition at line 1199 of file OSInstance.h.

double** OSInstance::m_mmdObjGradient`[private]`

m_mdObjGradient holds an array of pointers, each pointer points to gradient of each objective function

Definition at line 1212 of file OSInstance.h.

std::vector<double> OSInstance::m_vdX`[private]`

m_vdX is a vector of primal variables at each iteration

Definition at line 1220 of file OSInstance.h.

std::vector<double> OSInstance::m_vdYval`[private]`

m_vdYval is a vector of function values

Definition at line 1226 of file OSInstance.h.

std::vector<bool> OSInstance::m_vbLagHessNonz`[private]`

m_vbLagHessNonz is a boolean vector holding the nonzero pattern of the Lagrangian of the Hessian

Definition at line 1233 of file OSInstance.h.

std::vector<double> OSInstance::m_vdYjacval`[private]`

m_vdYval is a vector equal to a column or row of the Jacobian

Definition at line 1239 of file OSInstance.h.

std::vector<double> OSInstance::m_vdw`[private]`

m_vdYval is a vector of derivatives -- output from a reverse sweep

Definition at line 1245 of file OSInstance.h.

std::vector<double> OSInstance::m_vdLambda`[private]`

m_vdYval is a vector of Lagrange multipliers

Definition at line 1251 of file OSInstance.h.

std::vector<double> OSInstance::m_vdDomainUnitVec`[private]`

m_vdDomainUnitVec is a unit vector in the domain space

Definition at line 1258 of file OSInstance.h.

std::vector<double> OSInstance::m_vdRangeUnitVec`[private]`

m_vdRangeUnitVec is a unit vector in the range space

Definition at line 1264 of file OSInstance.h.

std::string* OSInstance::m_msTimeDomainStageNames`[private]`

m_msTimeDomainStageNames holds the names of the time stages.

Definition at line 1301 of file OSInstance.h.

int* OSInstance::m_miTimeDomainStageVariableNumber`[private]`

m_miTimeDomainStageVariableNumber holds the number of variables in each stage.

Definition at line 1307 of file OSInstance.h.

int** OSInstance::m_mmiTimeDomainStageVarList`[private]`

m_mmiTimeDomainStageVarList holds the list of variables in each stage.

Definition at line 1313 of file OSInstance.h.

int* OSInstance::m_miTimeDomainStageConstraintNumber`[private]`

m_miTimeDomainStageConstraintNumber holds the number of constraints in each stage.

Definition at line 1319 of file OSInstance.h.

int** OSInstance::m_mmiTimeDomainStageConList`[private]`

m_mmiTimeDomainStageConList holds the list of constraints in each stage.

Definition at line 1325 of file OSInstance.h.

int* OSInstance::m_miTimeDomainStageObjectiveNumber`[private]`

m_miTimeDomainStageObjectiveNumber holds the number of objectives in each stage.

Definition at line 1331 of file OSInstance.h.

int** OSInstance::m_mmiTimeDomainStageObjList`[private]`

m_mmiTimeDomainStageObjList holds the list of objectives in each stage.

Definition at line 1337 of file OSInstance.h.

The documentation for this class was generated from the following files:

- /home/coin/SVN-release/OS-2.3.5/OS/src/OSCommonInterfaces/OSInstance.h
- /home/coin/SVN-release/OS-2.3.5/OS/v2.0/OSInstance.h
- /home/coin/SVN-release/OS-2.3.5/OS/src/OSCommonInterfaces/OSInstance.cpp