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

- File List
- File Members

# /home/coin/SVN-release/OS-2.3.5/OS/src/OSCommonInterfaces/OSInstance.h

Go to the documentation of this file.

    00001 /* $Id: OSInstance.h 4120 2011-03-30 06:28:16Z kmartin $ */
    00034 #ifndef OSINSTANCE_H
    00035 #define OSINSTANCE_H
    00036 #include "OSParameters.h"
    00037 #include "OSGeneral.h"
    00038 #include "OSnLNode.h"
    00039 #include "OSExpressionTree.h"
    00040 #include <string>
    00041 #include <map>
    00042
    00043
    00048 class InstanceHeader{
    00049 public:
    00050
    00052         InstanceHeader();
    00053
    00055         ~InstanceHeader();
    00056
    00058         std::string description;
    00059
    00061         std::string name;
    00062
    00064         std::string source;
    00065
    00069         bool IsEqual(InstanceHeader *that);
    00070 };//class InstanceHeader
    00071
    00072
    00073
    00077 class Variable{
    00078 public:
    00080         Variable();
    00081
    00083         ~Variable();
    00084
    00088         double lb;
    00089
    00093         double ub;
    00094
    00098         char type;
    00099
    00103         std::string name;
    00104
    00105
    00109         bool IsEqual(Variable *that);
    00110 }; // class Variable
    00111
    00112
    00116 class Variables{
    00117 public:
    00118
    00120         Variables();
    00121
    00123         ~Variables();
    00124
    00126         int numberOfVariables;
    00127
    00129         Variable **var;
    00130
    00134         bool IsEqual(Variables *that);
    00135 }; // class Variables
    00136
    00137
    00142 class ObjCoef{
    00143 public:
    00144
    00146         ObjCoef();
    00147
    00149         ~ObjCoef();
    00150
    00154         int idx;
    00155
    00159         double value;
    00160
    00164         bool IsEqual(ObjCoef *that);
    00165 };//class ObjCoef
    00166
    00167
    00172 class Objective{
    00173 public:
    00174
    00176         Objective();
    00177
    00179         ~Objective();
    00180
    00182         std::string name;
    00183
    00187         std::string maxOrMin;
    00188
    00192         double constant;
    00193
    00197         double weight;
    00198
    00202         int numberOfObjCoef;
    00203
    00206         ObjCoef **coef;
    00207
    00211         bool IsEqual(Objective *that);
    00212 };//class Objective
    00213
    00218 class Objectives{
    00219 public:
    00220
    00222         Objectives();
    00223
    00225         ~Objectives();
    00226
    00230         int numberOfObjectives;
    00231
    00234         Objective **obj;
    00235
    00239         bool IsEqual(Objectives *that);
    00240 };//class Objectives
    00241
    00242
    00247 class Constraint{
    00248 public:
    00249
    00251         Constraint();
    00252
    00254         ~Constraint();
    00255
    00257         std::string name;
    00258
    00260         double constant;
    00261
    00263         double lb;
    00264
    00266         double ub;
    00267
    00271         bool IsEqual(Constraint *that);
    00272 };//class Constraint
    00273
    00274
    00279 class Constraints{
    00280 public:
    00281
    00283         Constraints();
    00284
    00286         ~Constraints();
    00287
    00291         int numberOfConstraints;
    00292
    00295         Constraint **con;
    00296
    00300         bool IsEqual(Constraints *that);
    00301 };//class Constraints
    00302
    00303
    00315 class LinearConstraintCoefficients{
    00316 public:
    00317
    00319         LinearConstraintCoefficients();
    00320
    00322         ~LinearConstraintCoefficients();
    00323
    00327         int numberOfValues;
    00328
    00332         IntVector *start;
    00333
    00335         IntVector *rowIdx;
    00336
    00338         IntVector *colIdx;
    00339
    00341         DoubleVector *value;
    00348         int iNumberOfStartElements;
    00349
    00353         bool IsEqual(LinearConstraintCoefficients *that);
    00354 };//class LinearConstraintCoefficients
    00355
    00356
    00366 class QuadraticTerm{
    00367 public:
    00368
    00370         QuadraticTerm();
    00371
    00373         ~QuadraticTerm();
    00374
    00378         int idx;
    00379
    00383     int idxOne;
    00384
    00388     int idxTwo;
    00389
    00391     double coef;
    00392
    00396         bool IsEqual(QuadraticTerm *that);
    00397 }; // QuadraticTerm
    00398
    00399
    00400
    00401
    00407 class QuadraticCoefficients {
    00408 public:
    00409
    00411         QuadraticCoefficients();
    00412
    00414         ~QuadraticCoefficients();
    00415
    00419         int numberOfQuadraticTerms;
    00420
    00423     QuadraticTerm** qTerm;
    00424
    00428         bool IsEqual(QuadraticCoefficients *that);
    00429 }; // QuadraticCoefficients
    00430
    00431
    00436 class Nl{
    00437 public:
    00439         int idx;
    00440
    00446         bool m_bDeleteExpressionTree;
    00447
    00449         OSExpressionTree *osExpressionTree;
    00450
    00454         Nl();
    00455
    00459         ~Nl();
    00460
    00464         bool IsEqual(Nl *that);
    00465 };//end Nl
    00466
    00471 class NonlinearExpressions {
    00472 public:
    00473
    00475         NonlinearExpressions();
    00476
    00478         ~NonlinearExpressions();
    00479
    00484         int numberOfNonlinearExpressions;
    00485
    00488     Nl **nl;
    00489
    00493         bool IsEqual(NonlinearExpressions *that);
    00494 }; // NonlinearExpressions
    00495
    00496
    00497
    00502 class TimeDomainStageVar {
    00503 public:
    00504
    00506         TimeDomainStageVar();
    00507
    00509         ~TimeDomainStageVar();
    00510
    00512         int idx;
    00513 }; // TimeDomainStageVar
    00514
    00519 class TimeDomainStageVariables {
    00520 public:
    00521
    00523         TimeDomainStageVariables();
    00524
    00526         ~TimeDomainStageVariables();
    00527
    00529         int numberOfVariables;
    00530
    00532         int startIdx;
    00533
    00535         TimeDomainStageVar** var;
    00536 }; // TimeDomainStageVariables
    00537
    00538
    00543 class TimeDomainStageCon {
    00544 public:
    00545
    00547         TimeDomainStageCon();
    00548
    00550         ~TimeDomainStageCon();
    00551
    00553         int idx;
    00554 }; // TimeDomainStageCon
    00555
    00560 class TimeDomainStageConstraints {
    00561 public:
    00562
    00564         TimeDomainStageConstraints();
    00565
    00567         ~TimeDomainStageConstraints();
    00568
    00570         int numberOfConstraints;
    00571
    00573         int startIdx;
    00574
    00576         TimeDomainStageCon** con;
    00577 }; // TimeDomainStageConstraints
    00578
    00579
    00584 class TimeDomainStageObj {
    00585 public:
    00586
    00588         TimeDomainStageObj();
    00589
    00591         ~TimeDomainStageObj();
    00592
    00594         int idx;
    00595 }; // TimeDomainStageObj
    00596
    00601 class TimeDomainStageObjectives {
    00602 public:
    00603
    00605         TimeDomainStageObjectives();
    00606
    00608         ~TimeDomainStageObjectives();
    00609
    00611         int numberOfObjectives;
    00612
    00614         int startIdx;
    00615
    00617         TimeDomainStageObj** obj;
    00618 }; // TimeDomainStageObjectives
    00619
    00620
    00625 class TimeDomainStage {
    00626 public:
    00627
    00629         TimeDomainStage();
    00630
    00632         ~TimeDomainStage();
    00633
    00637         std::string name;
    00638
    00640         TimeDomainStageVariables *variables;
    00641
    00643         TimeDomainStageConstraints *constraints;
    00644
    00646         TimeDomainStageObjectives *objectives;
    00647 }; // TimeDomainStage
    00648
    00653 class TimeDomainStages {
    00654 public:
    00655
    00657         TimeDomainStages();
    00658
    00660         ~TimeDomainStages();
    00661
    00665         int numberOfStages;
    00666
    00668     TimeDomainStage **stage;
    00669 }; // Stages
    00670
    00675 class TimeDomainInterval {
    00676 public:
    00677
    00679         TimeDomainInterval();
    00680
    00682         ~TimeDomainInterval();
    00683
    00687         double start;
    00688
    00692         double horizon;
    00693 }; // Interval
    00694
    00699 class TimeDomain {
    00700 public:
    00701
    00703         TimeDomain();
    00704
    00706         ~TimeDomain();
    00707
    00710         TimeDomainStages *stages;
    00711
    00714         TimeDomainInterval *interval;
    00715 }; // TimeDomain
    00716
    00733 class InstanceData{
    00734 public:
    00735
    00737         InstanceData();
    00738
    00740         ~InstanceData();
    00741
    00743         Variables *variables;
    00744
    00746         Objectives *objectives;
    00747
    00749         Constraints *constraints;
    00750
    00754         LinearConstraintCoefficients *linearConstraintCoefficients;
    00755
    00759         QuadraticCoefficients* quadraticCoefficients;
    00760
    00764         NonlinearExpressions* nonlinearExpressions;
    00765
    00769         TimeDomain* timeDomain;
    00770
    00774         bool IsEqual(InstanceData *that);
    00775 }; // class InstanceData
    00776
    00777
    00804 class OSInstance {
    00805 public:
    00806
    00808         OSInstance();
    00809
    00811         ~OSInstance();
    00812
    00814         GeneralFileHeader *instanceHeader;
    00815
    00817         InstanceData *instanceData;
    00818
    00822         bool IsEqual(OSInstance *that);
    00823
    00827         bool bVariablesModified ;
    00828
    00832         bool bObjectivesModified ;
    00833
    00837         bool bConstraintsModified ;
    00838
    00842         bool bAMatrixModified ;
    00843
    00844
    00845
    00846 private:
    00850         std::string m_sInstanceName;
    00854         std::string m_sInstanceSource;
    00858         std::string m_sInstanceDescription;
    00859
    00863         bool m_bProcessVariables;
    00864
    00868         int m_iVariableNumber;
    00869
    00873         int m_iNumberOfIntegerVariables;
    00874
    00878         int m_iNumberOfBinaryVariables;
    00879
    00883         int m_iNumberOfSemiContinuousVariables;
    00884
    00888         int m_iNumberOfSemiIntegerVariables;
    00889
    00893         int m_iNumberOfStringVariables;
    00894
    00898         int m_iNumberOfQuadraticRowIndexes;
    00899
    00903         bool m_bQuadraticRowIndexesProcessed;
    00904
    00908         int *m_miQuadRowIndexes;
    00909
    00913         int m_iNumberOfNonlinearExpressionTreeIndexes;
    00914
    00918         bool m_bNonlinearExpressionTreeIndexesProcessed;
    00919
    00924         int *m_miNonlinearExpressionTreeIndexes;
    00925
    00930         int m_iNumberOfNonlinearExpressionTreeModIndexes;
    00931
    00935         bool m_bNonlinearExpressionTreeModIndexesProcessed;
    00936
    00941         int *m_miNonlinearExpressionTreeModIndexes;
    00942
    00946         std::string* m_msVariableNames;
    00947
    00952         char* m_mcVariableTypes;
    00953
    00957         double* m_mdVariableLowerBounds;
    00958
    00962         double* m_mdVariableUpperBounds;
    00963
    00967         bool m_bProcessObjectives;
    00968
    00972         int m_iObjectiveNumber;
    00973
    00977         int m_iObjectiveNumberNonlinear;
    00978
    00982         std::string* m_msObjectiveNames;
    00983
    00987         std::string* m_msMaxOrMins;
    00988
    00992         int* m_miNumberOfObjCoef;
    00993
    00997         double* m_mdObjectiveConstants;
    00998
    01002         double* m_mdObjectiveWeights;
    01003
    01008         SparseVector** m_mObjectiveCoefficients;
    01009
    01013         bool m_bGetDenseObjectives;
    01014
    01019         double** m_mmdDenseObjectiveCoefficients;
    01020
    01024         bool m_bProcessConstraints;
    01025
    01029         int m_iConstraintNumber;
    01030
    01034         int m_iConstraintNumberNonlinear;
    01035
    01039         std::string* m_msConstraintNames;
    01040
    01044         double* m_mdConstraintLowerBounds;
    01045
    01049         double* m_mdConstraintUpperBounds;
    01050
    01055         double* m_mdConstraintConstants;
    01056
    01061         char* m_mcConstraintTypes;
    01062
    01066         bool m_bProcessLinearConstraintCoefficients;
    01067
    01072         int m_iLinearConstraintCoefficientNumber;
    01073
    01077         bool m_bColumnMajor;
    01078
    01082         bool m_binitForAlgDiff;
    01083
    01084
    01089         SparseMatrix* m_linearConstraintCoefficientsInColumnMajor;
    01090
    01095         SparseMatrix* m_linearConstraintCoefficientsInRowMajor;
    01096
    01097
    01101         bool m_bProcessQuadraticTerms;
    01102
    01107         int m_iQuadraticTermNumber;
    01108
    01112     double *m_mdConstraintFunctionValues;
    01113
    01117     double *m_mdObjectiveFunctionValues;
    01118
    01122         int m_iJacValueSize;
    01123
    01127         int *m_miJacStart;
    01128
    01132         int *m_miJacIndex;
    01133
    01137         double *m_mdJacValue;
    01138
    01139
    01144         int *m_miJacNumConTerms;
    01145
    01149         SparseJacobianMatrix *m_sparseJacMatrix;
    01150
    01155          int m_iHighestTaylorCoeffOrder;
    01156
    01161          QuadraticTerms* m_quadraticTerms;
    01162
    01165          bool m_bQTermsAdded;
    01166
    01171         unsigned int m_iNumberOfNonlinearVariables;
    01172
    01176         bool m_bProcessNonlinearExpressions;
    01177
    01181         int m_iNonlinearExpressionNumber;
    01182
    01187         int* m_miNonlinearExpressionIndexes;
    01188
    01192         bool m_bProcessExpressionTrees;
    01193
    01197         bool m_bProcessExpressionTreesMod;
    01198
    01203         std::map<int, OSExpressionTree*> m_mapExpressionTrees ;
    01204
    01205
    01206
    01207         std::map<int, int> m_mapOSADFunRangeIndex ;
    01208
    01213         OSExpressionTree *m_LagrangianExpTree ;
    01214
    01218         bool m_bLagrangianExpTreeCreated ;
    01219
    01223         SparseHessianMatrix* m_LagrangianSparseHessian;
    01224
    01229         bool m_bLagrangianSparseHessianCreated;
    01230
    01234          std::map<int, int> m_mapAllNonlinearVariablesIndex;
    01235
    01239         int *m_miNonLinearVarsReverseMap;
    01240
    01245          bool m_bAllNonlinearVariablesIndex;
    01246
    01253         std::map<int, OSExpressionTree*> m_mapExpressionTreesMod ;
    01254
    01259          bool m_bOSADFunIsCreated;
    01260
    01265         bool m_bCppADTapesBuilt;
    01266
    01271         bool m_bCppADMustReTape;
    01272
    01276         bool m_bDuplicateExpressionTreesMap;
    01277
    01281         bool m_bNonLinearStructuresInitialized;
    01282
    01286         bool m_bSparseJacobianCalculated;
    01287
    01292         std::map<int, std::vector<OSnLNode*> > m_mapExpressionTreesInPostfix ;
    01293
    01294
    01299          int m_iHighestOrderEvaluated;
    01300
    01305         double **m_mmdObjGradient;
    01306
    01307         //define the vectors
    01308
    01313         std::vector<double> m_vdX;
    01314
    01319         std::vector<double> m_vdYval;
    01320
    01326         std::vector<bool> m_vbLagHessNonz;
    01327
    01332         std::vector<double> m_vdYjacval;
    01333
    01338         std::vector<double> m_vdw;
    01339
    01344         std::vector<double> m_vdLambda;
    01345
    01346
    01351         std::vector<double> m_vdDomainUnitVec;
    01352
    01357         std::vector<double> m_vdRangeUnitVec;
    01358
    01359
    01363         bool m_bProcessTimeDomain;
    01364
    01368         bool m_bProcessTimeStages;
    01369
    01373         bool m_bProcessTimeInterval;
    01374
    01378         bool m_bFiniteTimeStages;
    01379
    01383         int m_iNumberOfTimeStages;
    01384
    01388         std::string m_sTimeDomainFormat;
    01389
    01394         std::string* m_msTimeDomainStageNames;
    01395
    01400         int* m_miTimeDomainStageVariableNumber;
    01401
    01406         int** m_mmiTimeDomainStageVarList;
    01407
    01412         int* m_miTimeDomainStageConstraintNumber;
    01413
    01418         int** m_mmiTimeDomainStageConList;
    01419
    01424         int* m_miTimeDomainStageObjectiveNumber;
    01425
    01430         int** m_mmiTimeDomainStageObjList;
    01431
    01432
    01439         bool processVariables() ;
    01440
    01447         bool processObjectives();
    01448
    01449
    01456         bool processConstraints();
    01457
    01458
    01465         bool processLinearConstraintCoefficients();
    01466
    01467
    01468 public:
    01469
    01474         std::string getInstanceName();
    01475
    01476
    01481         std::string getInstanceSource();
    01482
    01483
    01489         std::string getInstanceDescription();
    01490
    01496         int getVariableNumber();
    01497
    01504         std::string* getVariableNames();
    01505
    01513         //double* getVariableInitialValues();
    01514
    01522         //std::string* getVariableInitialStringValues();
    01523
    01535         char* getVariableTypes();
    01536
    01541         int getNumberOfIntegerVariables();
    01542
    01547         int getNumberOfBinaryVariables();
    01548
    01553         int getNumberOfSemiContinuousVariables();
    01554
    01559         int getNumberOfSemiIntegerVariables();
    01560
    01565         int getNumberOfStringVariables();
    01566
    01573         double* getVariableLowerBounds();
    01574
    01581         double* getVariableUpperBounds();
    01582
    01588         int getObjectiveNumber();
    01589
    01590
    01597         std::string* getObjectiveNames();
    01598
    01605         std::string* getObjectiveMaxOrMins();
    01606
    01615         int* getObjectiveCoefficientNumbers();
    01616
    01623         double* getObjectiveConstants();
    01624
    01631         double* getObjectiveWeights();
    01632
    01643         SparseVector** getObjectiveCoefficients();
    01644
    01651         double** getDenseObjectiveCoefficients();
    01652
    01658         int getConstraintNumber();
    01659
    01666         std::string* getConstraintNames();
    01667
    01674         double* getConstraintLowerBounds();
    01675
    01682         double *getConstraintUpperBounds();
    01683
    01696         char* getConstraintTypes();
    01697
    01703         int getLinearConstraintCoefficientNumber();
    01704
    01705
    01712         bool getLinearConstraintCoefficientMajor();
    01713
    01714
    01721         SparseMatrix* getLinearConstraintCoefficientsInColumnMajor();
    01722
    01729         SparseMatrix* getLinearConstraintCoefficientsInRowMajor();
    01730
    01736         int getNumberOfQuadraticTerms();
    01737
    01746         QuadraticTerms* getQuadraticTerms();
    01747
    01755         int* getQuadraticRowIndexes();
    01756
    01762         int getNumberOfQuadraticRowIndexes();
    01763
    01769         int getNumberOfNonlinearExpressions();
    01770
    01771
    01777         OSExpressionTree* getNonlinearExpressionTree(int rowIdx);
    01778
    01785         OSExpressionTree* getNonlinearExpressionTreeMod(int rowIdx);
    01786
    01793         std::vector<OSnLNode*> getNonlinearExpressionTreeInPostfix( int rowIdx);
    01794
    01802         std::vector<OSnLNode*> getNonlinearExpressionTreeModInPostfix( int rowIdx);
    01803
    01810         std::vector<OSnLNode*> getNonlinearExpressionTreeInPrefix( int rowIdx);
    01811
    01819         std::string getNonlinearExpressionTreeInInfix( int rowIdx);
    01820
    01821
    01826         std::string printModel( );
    01827
    01828
    01836         std::string printModel( int rowIdx);
    01837
    01845         std::vector<OSnLNode*> getNonlinearExpressionTreeModInPrefix( int rowIdx);
    01846
    01847
    01851         int getNumberOfNonlinearObjectives();
    01852
    01856         int getNumberOfNonlinearConstraints();
    01857
    01861         std::map<int, OSExpressionTree* > getAllNonlinearExpressionTrees();
    01862
    01863
    01867         std::map<int, OSExpressionTree* > getAllNonlinearExpressionTreesMod();
    01868
    01874         int* getNonlinearExpressionTreeIndexes();
    01875
    01876
    01882         int getNumberOfNonlinearExpressionTreeIndexes();
    01883
    01884
    01891         int* getNonlinearExpressionTreeModIndexes();
    01892
    01893
    01900         int getNumberOfNonlinearExpressionTreeModIndexes();
    01901
    01902
    01908         std::string getTimeDomainFormat();
    01909
    01915         int getTimeDomainStageNumber();
    01916
    01922         std::string* getTimeDomainStageNames();
    01923
    01929         int* getTimeDomainStageNumberOfVariables();
    01930
    01936         int* getTimeDomainStageNumberOfConstraints();
    01937
    01943         int* getTimeDomainStageNumberOfObjectives();
    01944
    01950         int** getTimeDomainStageVarList();
    01951
    01957         int** getTimeDomainStageConList();
    01958
    01964         int** getTimeDomainStageObjList();
    01965
    01971         double getTimeDomainIntervalStart();
    01972
    01978         double getTimeDomainIntervalHorizon();
    01979
    01980
    01981
    01982         // the set() methods
    01983
    01984
    01991         bool setInstanceSource(std::string source);
    01992
    01999         bool setInstanceDescription(std::string description);
    02000
    02001
    02008         bool setInstanceName(std::string name);
    02009
    02016         bool setVariableNumber(int number);
    02017
    02035         bool addVariable(int index, std::string name, double lowerBound, double upperBound, char type);
    02036
    02055         bool setVariables(int number, std::string* names, double* lowerBounds,
    02056                 double* upperBounds, char* types);
    02057
    02064         bool setObjectiveNumber(int number);
    02065
    02083         bool addObjective(int index, std::string name, std::string maxOrMin, double constant, double weight, SparseVector* objectiveCoefficients);
    02084
    02100         bool setObjectives(int number, std::string *names, std::string *maxOrMins, double *constants, double *weights, SparseVector **objectitiveCoefficients);
    02101
    02108         bool setConstraintNumber(int number);
    02109
    02123 bool addConstraint(int index, std::string name, double lowerBound, double upperBound, double constant);
    02124
    02136 bool setConstraints(int number, std::string* names, double* lowerBounds, double* upperBounds, double* constants);
    02137
    02156 bool setLinearConstraintCoefficients(int numberOfValues, bool isColumnMajor,
    02157         double* values, int valuesBegin, int valuesEnd,
    02158         int* indexes, int indexesBegin, int indexesEnd,
    02159         int* starts, int startsBegin, int startsEnd);
    02160
    02176         bool setQuadraticTerms(int number,
    02177                 int* rowIndexes, int* varOneIndexes, int* varTwoIndexes, double* coefficients,
    02178                 int begin, int end);
    02179
    02193         bool setQuadraticTermsInNonlinearExpressions(int number,
    02194                 int* rowIndexes, int* varOneIndexes, int* varTwoIndexes, double* coefficients);
    02195
    02196
    02197
    02198         // nonlinear API methods
    02199
    02200
    02206         bool initializeNonLinearStructures( );
    02207
    02221         double calculateFunctionValue(int idx, double* x, bool new_x);
    02222
    02237         double *calculateAllConstraintFunctionValues(double* x, double *objLambda, double *conLambda,
    02238                 bool new_x, int highestOrder);
    02239
    02253         double *calculateAllConstraintFunctionValues(double* x, bool new_x);
    02254
    02270         double *calculateAllObjectiveFunctionValues(double* x, double *objLambda, double *conLambda,
    02271                 bool new_x, int highestOrder);
    02272
    02286         double *calculateAllObjectiveFunctionValues(double* x, bool new_x);
    02287
    02288
    02303         SparseJacobianMatrix *calculateAllConstraintFunctionGradients(double* x, double *objLambda,
    02304                 double *conLambda, bool new_x, int highestOrder);
    02305
    02306
    02322         SparseVector *calculateConstraintFunctionGradient(double* x, double *objLambda, double *conLambda,
    02323                 int idx, bool new_x, int highestOrder);
    02324
    02338         SparseVector *calculateConstraintFunctionGradient(double* x, int idx, bool new_x );
    02339
    02354         double **calculateAllObjectiveFunctionGradients(double* x, double *objLambda, double *conLambda,
    02355                 bool new_x, int highestOrder);
    02356
    02372         double *calculateObjectiveFunctionGradient(double* x, double *objLambda, double *conLambda,
    02373                 int objIdx, bool new_x, int highestOrder);
    02374
    02387         double *calculateObjectiveFunctionGradient(double* x, int objIdx, bool new_x );
    02388
    02406         SparseHessianMatrix *calculateLagrangianHessian( double* x, double *objLambda, double *conLambda,
    02407                 bool new_x, int highestOrder);
    02408
    02421         SparseHessianMatrix *calculateHessian( double* x, int idx, bool new_x);
    02422
    02423
    02428         bool getSparseJacobianFromColumnMajor();
    02429
    02434         bool getSparseJacobianFromRowMajor();
    02435
    02440         OSExpressionTree* getLagrangianExpTree( );
    02441
    02446         std::map<int, int> getAllNonlinearVariablesIndexMap( );
    02447
    02452         SparseHessianMatrix* getLagrangianHessianSparsityPattern();
    02453
    02458         bool addQTermsToExressionTree();
    02459
    02464         SparseJacobianMatrix *getJacobianSparsityPattern();
    02465
    02470         void duplicateExpressionTreesMap();
    02471
    02472 #ifdef COIN_HAS_CPPAD
    02473
    02477         CppAD::ADFun<double> *Fad;
    02478 #endif
    02479
    02490         bool createOSADFun(std::vector<double> vdX );
    02491
    02502         std::vector<double> forwardAD(int p, std::vector<double> vdX);
    02503
    02514         std::vector<double> reverseAD(int p, std::vector<double> vdlambda);
    02515
    02528         int  getADSparsityHessian();
    02529
    02549         bool getIterateResults(double *x, double *objLambda, double *conLambda,
    02550                         bool new_x, int highestOrder);
    02551
    02552
    02553
    02566         bool getZeroOrderResults(double *x, double *objLambda, double *conLambda);
    02567
    02580         bool getFirstOrderResults(double *x, double *objLambda, double *conLambda );
    02581
    02594         bool getSecondOrderResults(double *x, double *objLambda, double *conLambda );
    02595
    02596
    02606         bool initForAlgDiff();
    02607
    02617         bool initObjGradients();
    02618
    02619
    02624         bool bUseExpTreeForFunEval;
    02625
    02626
    02630         bool setTimeDomain(std::string format);
    02631
    02635         bool setTimeDomainStages(int number, std::string *names);
    02636
    02642         bool setTimeDomainStageVariablesOrdered(int numberOfStages, int *numberOfVariables, int *startIdx);
    02643
    02649         bool setTimeDomainStageVariablesUnordered(int numberOfStages, int *numberOfVariables, int **varIndex);
    02650
    02656         bool setTimeDomainStageConstraintsOrdered(int numberOfStages, int *numberOfConstraints, int *startIdx);
    02657
    02663         bool setTimeDomainStageConstraintsUnordered(int numberOfStages, int *numberOfConstraints, int **conIndex);
    02664
    02670         bool setTimeDomainStageObjectivesOrdered(int numberOfStages, int *numberOfObjectives, int *startIdx);
    02671
    02677         bool setTimeDomainStageObjectivesUnordered(int numberOfStages, int *numberOfObjectives, int **varIndex);
    02678
    02682         bool setTimeDomainInterval(double start, double horizon);
    02683
    02684
    02685 }; //class OSInstance
    02686
    02687 #endif
    02688