My Project
OSiLParserData.cpp
Go to the documentation of this file.
1/* $Id$ */
14
15#include "OSiLParserData.h"
16#include <iostream>
17
18using namespace std;
19
21{
22#if 0
23 // clear the vectors of pointers
24 nlNodeVec.clear();
25 //delete nlNodeVec.back();
26 sumVec.clear();
27 maxVec.clear();
28 productVec.clear();
29 minVec.clear();
30 allDiffVec.clear();
31 if (m_miVarStageInfo != NULL)
32 delete []m_miVarStageInfo;
33 m_miVarStageInfo = NULL;
34 if (m_miConStageInfo != NULL)
35 delete []m_miConStageInfo;
36 m_miConStageInfo = NULL;
37 if (m_miObjStageInfo != NULL)
38 delete []m_miObjStageInfo;
39 m_miObjStageInfo = NULL;
40#endif
41}//~OSiLParserData
42
43
45 osillineno(0),
46 qtermcount(0),
47 qtermidxOneattON(false),
48 qtermidxTwoattON(false),
49 qtermidxattON(false),
50 qtermidattON(false),
51 qtermcoefattON(false),
52// nlnodecount(0),
53// tmpnlcount(0),
54// numbertypeattON(false),
55// numbervalueattON(false),
56// numberidattON(false),
57// variableidxattON(false),
58// variablecoefattON(false),
59 timeDomainStages(false),
60 timeDomainInterval(false),
61 stagecount(0),
62 stagenameON(false),
63 stagename(""),
64 stageVariablesON(false),
65 stageConstraintsON(false),
66 stageObjectivesON(false),
76 nvarcovered(0),
77 nconcovered(0),
78 intervalhorizonON(false),
79 intervalhorizon(0.0),
80 intervalstartON(false),
81 intervalstart(0.0),
82
88 numberOfRows(0),
91 numberOfEl(0),
92 numberOf(0),
93 namePresent(false),
94 name(""),
98 normScaleFactor(1.0),
102 axisDirection(-1),
109
115
117 matrixIdxPresent(false),
118 lbMatrixIdxPresent(false),
119 lbConeIdxPresent(false),
120 ubMatrixIdxPresent(false),
121 ubConeIdxPresent(false),
122 orderConeIdxPresent(false),
128 varTypePresent(false),
129
130 matrixIdx(-1),
131 lbMatrixIdx(-1),
132 lbConeIdx(-1),
133 ubMatrixIdx(-1),
134 ubConeIdx(-1),
135 orderConeIdx(-1),
141 varType('C'),
142
143 shapePresent(false),
144 shape(""),
145
146 matrixTermInObj(false),
147
148 kounter(0),
149 kount2(0),
150 tempVal(0.0),
153 parser_errors("")
154{
155 m_miVarStageInfo = NULL;
156 m_miConStageInfo = NULL;
157 m_miObjStageInfo = NULL;
158
159}//OSiLParserData
bool qtermcoefattON
qtermcoefattON is true if we have found the coefficient of the quadratic term
int stagevarcount
...and we need to track the number of variables we have seen
bool constantMatrixIdxPresent
bool qtermidxattON
qtermidxattON is true if we have found the row index of the of a quadratic term
bool numberOfMatrixTermsPresent
bool stageVariablesON
for each stage we need to track whether the <variables>, <constraints>, <objectives> elements are pre...
bool templateMatrixIdxPresent
bool objReferenceMatrixIdxPresent
bool numberOfMatricesPresent
some elements to hold matrices and cones
bool suppressFurtherErrorMessages
bool qtermidxOneattON
qtermidxOneattON is true if we have found the first index of the quadratic term
std::string semidefiniteness
bool secondAxisDirectionPresent
int * m_miConStageInfo
m_miConStageInfo is an array that for each constraint gives the stage to which it belongs.
int nvarcovered
these two integers track how many variables and constraints have been assigned to a stage; this is us...
bool conReferenceMatrixIdxPresent
std::string shape
bool stagenameON
stagenameON is true if the current stage was given a name
bool varReferenceMatrixIdxPresent
bool intervalhorizonON
intervalhorizonON is true if we have found a horizon for the time interval
~OSiLParserData()
the OSiLParserData class destructor
bool ignoreDataAfterErrors
if the parser finds invalid text it is held here and we delete if the file was not valid
bool qtermidattON
qtermidattON is true if we have found the id of the quadratic term
int stagecount
store the number of stages
bool qtermidxTwoattON
qtermidxTwoattON is true if we have found the second index of the quadratic term
std::string name
double intervalhorizon
intervalhorizon holds the value of the end of the planning horizon
bool firstAxisDirectionPresent
double intervalstart
intervalstart holds the value for the start of the planning horizon
int * m_miObjStageInfo
m_miObjStageInfo is an array that for each objective gives the stage to which it belongs.
bool referenceMatrixIdxPresent
bool intervalstartON
intervalstartON is true if we have found a start time for the time interval
int osillineno
if there is a parser error, osillineno holds the line number in the OSiL file where the error occured...
OSiLParserData()
the OSiLParserData class constructor
std::string stagename
store the name of the current stage
int stageVariableStartIdx
...we need to track the first variable, constraint, objective...
std::string parser_errors
used to accumulate error message so the parser does not die on the first error encountered
int qtermcount
These variables are used for processing the <quadraticCoefficients> element.
bool stageVariablesOrdered
...we need to track whether the variables, constraints, objectives are given in temporal order....
int * m_miVarStageInfo
m_miVarStageInfo is an array that for each variable gives the stage to which it belongs.
bool timeDomainStages
These variables are used to parse the <timeDomain> element.