/home/coin/SVN-release/OS-2.0.1/OS/v2.0/OSrLParserData.cpp

Go to the documentation of this file.
00001 
00015 #define PARSERDATA_DEBUG
00016 
00017 #include "OSrLParserData.h" 
00018 
00019  OSrLParserData::~OSrLParserData() {
00020         if(numberOfSolutions > 0){
00021 #ifdef PARSERDATA_DEBUG
00022                 std::cout << "delete objectiveIdx" << std::endl;
00023 #endif
00024                 if(objectiveIdx != NULL) delete[] objectiveIdx;
00025                 objectiveIdx = NULL;
00026                 for(int i = 0; i < numberOfSolutions; i++){
00027 #ifdef PARSERDATA_DEBUG
00028                 std::cout << "delete primalSolution" << std::endl;
00029 #endif
00030                         if(primalSolution[ i]  != NULL)   delete[] primalSolution[ i];
00031                         primalSolution[ i] = NULL;
00032                         // now delete other var
00033                         for(int k = 0; k < numberOfOtherVariableResults; k++){
00034                                 // the following delete gets rid of otherVarText in otherVarStruct
00035 #ifdef PARSERDATA_DEBUG
00036                 std::cout << "delete otherVarText" << std::endl;
00037 #endif
00038                                 if( (otherVarVec[ k]  != NULL) && (otherVarVec[ k]->otherVarText != NULL) ) 
00039                                         delete[] otherVarVec[ k]->otherVarText;
00040                                 if( (otherVarVec[ k]  != NULL) && (otherVarVec[ k]->otherVarIndex != NULL) ) 
00041                                         delete[] otherVarVec[ k]->otherVarIndex;
00042                                 
00043                                 // the following should delete each of otherVarStruct created
00044                                 // each element of otherVarVec is a pointer to an otherVarStruct
00045 #ifdef PARSERDATA_DEBUG
00046                 std::cout << "delete otherVarVec" << std::endl;
00047 #endif
00048                                 if( otherVarVec[ k]  != NULL) delete otherVarVec[ k];
00049                         }
00050 #ifdef PARSERDATA_DEBUG
00051                 std::cout << "clear otherVarVec" << std::endl;
00052 #endif
00053                         otherVarVec.clear();
00054 #ifdef PARSERDATA_DEBUG
00055                 std::cout << "delete dualSolution" << std::endl;
00056 #endif
00057                         if( (dualSolution != NULL)  && (numberOfConstraints > 0) ) {
00058                                 if(dualSolution[ i] != NULL) delete[] dualSolution[ i];
00059                                 dualSolution[ i] = NULL;
00060                         }
00061 #ifdef PARSERDATA_DEBUG
00062                 std::cout << "delete objectiveValues" << std::endl;
00063 #endif
00064                         if( (objectiveValues != NULL)  && (objectiveValues[i] != NULL) ) delete[] objectiveValues[i];
00065                         objectiveValues[i] = NULL;
00066                 }
00067         }
00068 #ifdef PARSERDATA_DEBUG
00069                 std::cout << "delete primalSolution" << std::endl;
00070 #endif
00071         if(primalSolution != NULL) delete[]  primalSolution;
00072         primalSolution = NULL;
00073 #ifdef PARSERDATA_DEBUG
00074                 std::cout << "delete dualSolution" << std::endl;
00075 #endif
00076         if(dualSolution != NULL) delete[] dualSolution;
00077         dualSolution = NULL;
00078 #ifdef PARSERDATA_DEBUG
00079                 std::cout << "delete objectiveValues" << std::endl;
00080 #endif
00081         if(objectiveValues != NULL) delete[] objectiveValues;
00082         objectiveValues = NULL;
00083 #ifdef PARSERDATA_DEBUG
00084                 std::cout << "success" << std::endl;
00085 #endif
00086 
00087 
00088  }//~OSrLParserData
00089  
00090 
00091  OSrLParserData::OSrLParserData() :
00092         statusType(""),
00093         statusDescription(""),
00094         timeValue(0.0),
00095         timeType("elapsedTime"),
00096         timeCategory("total"),
00097         timeUnit("second"),
00098         timeDescription(""),
00099         numberOfTimes(0),
00100         tmpOtherValue(""),
00101         tmpOtherName(""),
00102         tmpOtherDescription(""),
00103 
00104         numberOfSolutions(0),
00105         numberOfVariables(0),
00106         numberOfConstraints(0),
00107         numberOfObjectives(0),
00108         kounter( 0),
00109         iOther(0),
00110         ivar(0),
00111         tempVal(0.0),
00112         outStr(""),
00113         numberOfOtherVariableResults( 0),
00114         solutionIdx( 0),
00115         statusTypePresent( false),
00116         generalStatusTypePresent( false),
00117         otherNamePresent( false),
00118         objectiveIdx( NULL),
00119         objectiveValues( NULL),
00120         primalSolution( NULL),
00121         dualSolution( NULL),
00122         otherVarStruct( NULL),
00123         errorText(NULL)
00124  {
00125 
00126  }//OSrLParserData
00127  

Generated on Thu Oct 8 03:03:01 2009 by  doxygen 1.4.7