/Users/kmartin/Documents/files/code/cpp/OScpp/COIN-OS/OS/src/OSParsers/OSrLParserData.cpp

Go to the documentation of this file.
00001 
00015  #include "OSrLParserData.h" 
00016 
00017  OSrLParserData::~OSrLParserData() {
00018         if(numberOfSolutions > 0){
00019                 if(objectiveIdx != NULL) delete[] objectiveIdx;
00020                 objectiveIdx = NULL;
00021                 for(int i = 0; i < numberOfSolutions; i++){
00022                         if(primalSolution[ i]  != NULL)   delete[] primalSolution[ i];
00023                         primalSolution[ i] = NULL;
00024                         // now delete other var
00025                         for(int k = 0; k < numberOfOtherVariableResult; k++){
00026                                 // the following delete gets rid of otherVarText in otherVarStruct
00027                                 if( (otherVarVec[ k]  != NULL) && (otherVarVec[ k]->otherVarText != NULL) ) delete[] otherVarVec[ k]->otherVarText;
00028                                 // the following should delete each of otherVarStruct created
00029                                 // each element of otherVarVec is a pointer to an otherVarStruct
00030                                 if( otherVarVec[ k]  != NULL) delete otherVarVec[ k];
00031                         }
00032                         otherVarVec.clear();
00033                         if( (dualSolution != NULL)  && (numberOfConstraints > 0) ) {
00034                                 if(dualSolution[ i] != NULL) delete[] dualSolution[ i];
00035                                 dualSolution[ i] = NULL;
00036                         }
00037                         if( (objectiveValues != NULL)  && (objectiveValues[i] != NULL) ) delete[] objectiveValues[i];
00038                         objectiveValues[i] = NULL;
00039                 }
00040         }
00041         if(primalSolution != NULL) delete[]  primalSolution;
00042         primalSolution = NULL;
00043         if(dualSolution != NULL) delete[] dualSolution;
00044         dualSolution = NULL;
00045         if(objectiveValues != NULL) delete[] objectiveValues;
00046         objectiveValues = NULL;
00047 
00048 
00049  }//~OSrLParserData
00050  
00051 
00052  OSrLParserData::OSrLParserData() :
00053         statusType(""),
00054         statusDescription(""),
00055         numberOfSolutions(0),
00056         numberOfVariables(0),
00057         numberOfConstraints(0),
00058         numberOfObjectives(0),
00059         kounter( 0),
00060         numberOfOtherVariableResult( 0),
00061         solutionIdx( 0),
00062         statusTypePresent( false),
00063         generalStatusTypePresent( false),
00064         otherNamePresent( false),
00065         objectiveIdx( NULL),
00066         objectiveValues( NULL),
00067         primalSolution( NULL),
00068         dualSolution( NULL),
00069         otherVarStruct( NULL),
00070         errorText(NULL)
00071  {
00072 
00073  }//OSrLParserData
00074  

Generated on Sat Mar 29 22:38:02 2008 by  doxygen 1.5.3