00001
00018
00019
00020 #ifdef DEBUG
00021 #define DEBUG_OSOPTION
00022 #endif
00023
00024 #include "OSOption.h"
00025 #include "OSParameters.h"
00026 #include "OSErrorClass.h"
00027 #include "CoinFinite.hpp"
00028 #include <iostream>
00029 #include <sstream>
00030 #include <limits>
00031 #include <cstdio>
00032
00033 using namespace std;
00034
00035 InstanceLocationOption::InstanceLocationOption():
00036 locationType ("local"),
00037 value ("")
00038 {
00039 #ifdef DEBUG_OSOPTION
00040 cout << "Inside InstanceLocationOption Constructor" << endl;
00041 #endif
00042 }
00043
00044 InstanceLocationOption::~InstanceLocationOption()
00045 {
00046 #ifdef DEBUG_OSOPTION
00047 cout << "InstanceLocationOption Destructor Called" << endl;
00048 #endif
00049 }
00050
00051
00052 ContactOption::ContactOption():
00053 transportType ("osp"),
00054 value ("")
00055 {
00056 #ifdef DEBUG_OSOPTION
00057 cout << "Inside ContactOption Constructor" << endl;
00058 #endif
00059 }
00060
00061 ContactOption::~ContactOption()
00062 {
00063 #ifdef DEBUG_OSOPTION
00064 cout << "ContactOption Destructor Called" << endl;
00065 #endif
00066 }
00067
00068
00069 OtherOption::OtherOption():
00070 name (""),
00071 value (""),
00072 description ("")
00073 {
00074 #ifdef DEBUG_OSOPTION
00075 cout << "Inside OtherOption Constructor" << endl;
00076 #endif
00077 }
00078
00079 OtherOption::~OtherOption()
00080 {
00081 #ifdef DEBUG_OSOPTION
00082 cout << "OtherOption Destructor Called" << endl;
00083 #endif
00084 }
00085
00086
00087 OtherOptions::OtherOptions():
00088 numberOfOtherOptions(0)
00089 {
00090 #ifdef DEBUG_OSOPTION
00091 cout << "Inside OtherOptions Constructor" << endl;
00092 #endif
00093 other = NULL;
00094 }
00095
00096 OtherOptions::~OtherOptions()
00097 {
00098 #ifdef DEBUG_OSOPTION
00099 cout << "OtherOptions Destructor Called" << endl;
00100 #endif
00101
00102 if (other != NULL)
00103 { int i;
00104 for (i=0; i<numberOfOtherOptions; i++)
00105 { delete other[i];
00106 other[i] = NULL;
00107 }
00108 delete[] other;
00109 other = NULL;
00110 }
00111 }
00112
00113
00114 GeneralOption::GeneralOption():
00115 serviceURI (""),
00116 serviceName (""),
00117 instanceName (""),
00118 jobID (""),
00119 solverToInvoke (""),
00120 license (""),
00121 userName (""),
00122 password ("")
00123 {
00124 #ifdef DEBUG_OSOPTION
00125 cout << "Inside GeneralOption Constructor" << endl;
00126 #endif
00127 instanceLocation = NULL;
00128 contact = NULL;
00129 otherOptions = NULL;
00130 }
00131
00132 GeneralOption::~GeneralOption()
00133 {
00134 #ifdef DEBUG_OSOPTION
00135 cout << "GeneralOption Destructor Called" << endl;
00136 #endif
00137 if (instanceLocation != NULL) delete instanceLocation;
00138 instanceLocation = NULL;
00139 if (contact != NULL) delete contact;
00140 contact = NULL;
00141 if (otherOptions != NULL) delete otherOptions;
00142 otherOptions = NULL;
00143 }
00144
00145
00146 MinDiskSpace::MinDiskSpace():
00147 unit ("byte"),
00148 value (0.0)
00149 {
00150 #ifdef DEBUG_OSOPTION
00151 cout << "Inside MinDiskSpace Constructor" << endl;
00152 #endif
00153 }
00154
00155 MinDiskSpace::~MinDiskSpace()
00156 {
00157 #ifdef DEBUG_OSOPTION
00158 cout << "MinDiskSpace Destructor Called" << endl;
00159 #endif
00160 }
00161
00162
00163 MinMemorySize::MinMemorySize():
00164 unit ("byte"),
00165 value (0.0)
00166 {
00167 #ifdef DEBUG_OSOPTION
00168 cout << "Inside MinMemorySize Constructor" << endl;
00169 #endif
00170 }
00171
00172 MinMemorySize::~MinMemorySize()
00173 {
00174 #ifdef DEBUG_OSOPTION
00175 cout << "MinMemorySize Destructor Called" << endl;
00176 #endif
00177 }
00178
00179
00180 MinCPUSpeed::MinCPUSpeed():
00181 unit ("hertz"),
00182 value (0.0)
00183 {
00184 #ifdef DEBUG_OSOPTION
00185 cout << "Inside MinCPUSpeed Constructor" << endl;
00186 #endif
00187 }
00188
00189 MinCPUSpeed::~MinCPUSpeed()
00190 {
00191 #ifdef DEBUG_OSOPTION
00192 cout << "MinCPUSpeed Destructor Called" << endl;
00193 #endif
00194 }
00195
00196
00197 SystemOption::SystemOption():
00198 minCPUNumber (1)
00199 {
00200 #ifdef DEBUG_OSOPTION
00201 cout << "Inside SystemOption Constructor" << endl;
00202 #endif
00203 minDiskSpace = NULL;
00204 minMemorySize = NULL;
00205 minCPUSpeed = NULL;
00206 otherOptions = NULL;
00207 }
00208
00209 SystemOption::~SystemOption()
00210 {
00211 #ifdef DEBUG_OSOPTION
00212 cout << "SystemOption Destructor Called" << endl;
00213 #endif
00214 if (minDiskSpace != NULL) delete minDiskSpace;
00215 minDiskSpace = NULL;
00216 if (minMemorySize != NULL) delete minMemorySize;
00217 minMemorySize = NULL;
00218 if (minCPUSpeed != NULL) delete minCPUSpeed;
00219 minCPUSpeed = NULL;
00220 if (otherOptions != NULL) delete otherOptions;
00221 otherOptions = NULL;
00222 }
00223
00224
00225 ServiceOption::ServiceOption():
00226 type ("solver")
00227 {
00228 #ifdef DEBUG_OSOPTION
00229 cout << "Inside ServiceOption Constructor" << endl;
00230 #endif
00231 otherOptions = NULL;
00232 }
00233
00234 ServiceOption::~ServiceOption()
00235 {
00236 #ifdef DEBUG_OSOPTION
00237 cout << "ServiceOption Destructor Called" << endl;
00238 #endif
00239 if (otherOptions != NULL) delete otherOptions;
00240 otherOptions = NULL;
00241 }
00242
00243
00244 MaxTime::MaxTime():
00245 unit ("second"),
00246 value (OSDBL_MAX)
00247 {
00248 #ifdef DEBUG_OSOPTION
00249 cout << "Inside MaxTime Constructor" << endl;
00250 #endif
00251 }
00252
00253 MaxTime::~MaxTime()
00254 {
00255 #ifdef DEBUG_OSOPTION
00256 cout << "MaxTime Destructor Called" << endl;
00257 #endif
00258 }
00259
00260
00261 JobDependencies::JobDependencies():
00262 numberOfJobIDs (0)
00263 {
00264 #ifdef DEBUG_OSOPTION
00265 cout << "Inside JobDependencies Constructor" << endl;
00266 #endif
00267 jobID = NULL;
00268 }
00269
00270 JobDependencies::~JobDependencies()
00271 {
00272 #ifdef DEBUG_OSOPTION
00273 cout << "JobDependencies Destructor Called" << endl;
00274 #endif
00275
00276 if (jobID != NULL)
00277 { delete[] jobID;
00278 jobID = NULL;
00279 }
00280 }
00281
00282
00283 DirectoriesAndFiles::DirectoriesAndFiles():
00284 numberOfPaths (0)
00285 {
00286 #ifdef DEBUG_OSOPTION
00287 cout << "Inside DirectoriesAndFiles Constructor" << endl;
00288 #endif
00289 path = NULL;
00290 }
00291
00292 DirectoriesAndFiles::~DirectoriesAndFiles()
00293 {
00294 #ifdef DEBUG_OSOPTION
00295 cout << "DirectoriesAndFiles Destructor Called" << endl;
00296 #endif
00297 if (path != NULL)
00298 { delete[] path;
00299 path = NULL;
00300 }
00301 }
00302
00303
00304 PathPair::PathPair():
00305 from (""),
00306 to (""),
00307 makeCopy (false)
00308 {
00309 #ifdef DEBUG_OSOPTION
00310 cout << "Inside PathPair Constructor" << endl;
00311 #endif
00312 }
00313
00314 PathPair::~PathPair()
00315 {
00316 #ifdef DEBUG_OSOPTION
00317 cout << "PathPair Destructor Called" << endl;
00318 #endif
00319 }
00320
00321
00322 PathPairs::PathPairs():
00323 numberOfPathPairs(0)
00324 {
00325 #ifdef DEBUG_OSOPTION
00326 cout << "Inside PathPairs Constructor" << endl;
00327 #endif
00328 pathPair = NULL;
00329 }
00330
00331 PathPairs::~PathPairs()
00332 {
00333 #ifdef DEBUG_OSOPTION
00334 cout << "PathPairs Destructor Called" << endl;
00335 #endif
00336 int i;
00337 if (pathPair != NULL)
00338 { for (i=0; i < numberOfPathPairs; i++)
00339 { delete pathPair[i];
00340 pathPair[i] = NULL;
00341 }
00342 delete[] pathPair;
00343 pathPair = NULL;
00344 }
00345 }
00346
00347
00348
00349 Processes::Processes():
00350 numberOfProcesses(0)
00351 {
00352 #ifdef DEBUG_OSOPTION
00353 cout << "Inside Processes Constructor" << endl;
00354 #endif
00355 process = NULL;
00356 }
00357
00358 Processes::~Processes()
00359 {
00360 #ifdef DEBUG_OSOPTION
00361 cout << "Processes Destructor Called" << endl;
00362 #endif
00363 if (process != NULL)
00364 { delete[] process;
00365 process = NULL;
00366 }
00367 }
00368
00369
00370 JobOption::JobOption():
00371 requestedStartTime("")
00372 {
00373 #ifdef DEBUG_OSOPTION
00374 cout << "Inside JobOption Constructor" << endl;
00375 #endif
00376 maxTime = NULL;
00377 dependencies = NULL;
00378 requiredDirectories = NULL;
00379 requiredFiles = NULL;
00380 directoriesToMake = NULL;
00381 filesToMake = NULL;
00382 inputDirectoriesToMove = NULL;
00383 inputFilesToMove = NULL;
00384 outputFilesToMove = NULL;
00385 outputDirectoriesToMove = NULL;
00386 filesToDelete = NULL;
00387 directoriesToDelete = NULL;
00388 processesToKill = NULL;
00389 otherOptions = NULL;
00390 }
00391
00392 JobOption::~JobOption()
00393 {
00394 #ifdef DEBUG_OSOPTION
00395 cout << "JobOption Destructor Called" << endl;
00396 #endif
00397 if (maxTime != NULL) delete maxTime;
00398 maxTime = NULL;
00399 if (dependencies != NULL) delete dependencies;
00400 dependencies = NULL;
00401 if (requiredDirectories != NULL) delete requiredDirectories;
00402 requiredDirectories = NULL;
00403 if (requiredFiles != NULL) delete requiredFiles;
00404 requiredFiles = NULL;
00405 if (directoriesToMake != NULL) delete directoriesToMake;
00406 directoriesToMake = NULL;
00407 if (filesToMake != NULL) delete filesToMake;
00408 filesToMake = NULL;
00409 if (inputDirectoriesToMove != NULL) delete inputDirectoriesToMove;
00410 inputDirectoriesToMove = NULL;
00411 if (inputFilesToMove != NULL) delete inputFilesToMove;
00412 inputFilesToMove = NULL;
00413 if (outputDirectoriesToMove != NULL) delete outputDirectoriesToMove;
00414 outputDirectoriesToMove = NULL;
00415 if (outputFilesToMove != NULL) delete outputFilesToMove;
00416 outputFilesToMove = NULL;
00417 if (filesToDelete != NULL) delete filesToDelete;
00418 filesToDelete = NULL;
00419 if (directoriesToDelete != NULL) delete directoriesToDelete;
00420 directoriesToDelete = NULL;
00421 if (processesToKill != NULL) delete processesToKill;
00422 processesToKill = NULL;
00423 if (otherOptions != NULL) delete otherOptions;
00424 otherOptions = NULL;
00425 }
00426
00427
00428 InitVarValue::InitVarValue():
00429 idx (-1),
00430 value (OSNAN)
00431 {
00432 #ifdef DEBUG_OSOPTION
00433 cout << "Inside InitVarValue Constructor" << endl;
00434 #endif
00435 }
00436
00437 InitVarValue::~InitVarValue()
00438 {
00439 #ifdef DEBUG_OSOPTION
00440 cout << "InitVarValue Destructor Called" << endl;
00441 #endif
00442 }
00443
00444
00445 InitVariableValues::InitVariableValues():
00446 numberOfVar (0)
00447 {
00448 #ifdef DEBUG_OSOPTION
00449 cout << "Inside InitVariableValues Constructor" << endl;
00450 #endif
00451 var = NULL;
00452 }
00453
00454 InitVariableValues::~InitVariableValues()
00455 {
00456 #ifdef DEBUG_OSOPTION
00457 cout << "InitVariableValues Destructor Called" << endl;
00458 #endif
00459 int i;
00460 if (var != NULL)
00461 { for (i=0; i < numberOfVar; i++)
00462 { delete var[i];
00463 var[i] = NULL;
00464 }
00465 delete[] var;
00466 var = NULL;
00467 }
00468 }
00469
00470
00471 InitVarValueString::InitVarValueString():
00472 idx (-1),
00473 value ("")
00474 {
00475 #ifdef DEBUG_OSOPTION
00476 cout << "Inside InitVarValueString Constructor" << endl;
00477 #endif
00478 }
00479
00480 InitVarValueString::~InitVarValueString()
00481 {
00482 #ifdef DEBUG_OSOPTION
00483 cout << "InitVarValueString Destructor Called" << endl;
00484 #endif
00485 }
00486
00487
00488 InitVariableValuesString::InitVariableValuesString():
00489 numberOfVar (0)
00490 {
00491 #ifdef DEBUG_OSOPTION
00492 cout << "Inside InitVariableValuesString Constructor" << endl;
00493 #endif
00494 var = NULL;
00495 }
00496
00497 InitVariableValuesString::~InitVariableValuesString()
00498 {
00499 #ifdef DEBUG_OSOPTION
00500 cout << "InitVariableValuesString Destructor Called" << endl;
00501 #endif
00502 int i;
00503 if (var != NULL)
00504 { for (i=0; i < numberOfVar; i++)
00505 { delete var[i];
00506 var[i] = NULL;
00507 }
00508 delete[] var;
00509 var = NULL;
00510 }
00511 }
00512
00513 InitBasStatus::InitBasStatus():
00514 idx (-1),
00515 value ("unknown")
00516 {
00517 #ifdef DEBUG_OSOPTION
00518 cout << "Inside InitBasStatus Constructor" << endl;
00519 #endif
00520 }
00521
00522 InitBasStatus::~InitBasStatus()
00523 {
00524 #ifdef DEBUG_OSOPTION
00525 cout << "InitBasStatus Destructor Called" << endl;
00526 #endif
00527 }
00528
00529
00530 InitialBasisStatus::InitialBasisStatus():
00531 numberOfVar (0)
00532 {
00533 #ifdef DEBUG_OSOPTION
00534 cout << "Inside InitialBasisStatus Constructor" << endl;
00535 #endif
00536 var = NULL;
00537 }
00538
00539 InitialBasisStatus::~InitialBasisStatus()
00540 {
00541 #ifdef DEBUG_OSOPTION
00542 cout << "InitialBasisStatus Destructor Called" << endl;
00543 #endif
00544 if (var != NULL)
00545 { int i;
00546 for (i=0; i < numberOfVar; i++)
00547 { delete var[i];
00548 var[i] = NULL;
00549 }
00550 delete[] var;
00551 var = NULL;
00552 }
00553 }
00554
00555 BranchingWeight::BranchingWeight():
00556 idx (-1),
00557 value (0.0)
00558 {
00559 #ifdef DEBUG_OSOPTION
00560 cout << "Inside BranchingWeight Constructor" << endl;
00561 #endif
00562 }
00563
00564 BranchingWeight::~BranchingWeight()
00565 {
00566 #ifdef DEBUG_OSOPTION
00567 cout << "BranchingWeight Destructor Called" << endl;
00568 #endif
00569 }
00570
00571
00572 IntegerVariableBranchingWeights::IntegerVariableBranchingWeights():
00573 numberOfVar (0)
00574 {
00575 #ifdef DEBUG_OSOPTION
00576 cout << "Inside IntegerVariableBranchingWeights Constructor" << endl;
00577 #endif
00578 var = NULL;
00579 }
00580
00581 IntegerVariableBranchingWeights::~IntegerVariableBranchingWeights()
00582 {
00583 #ifdef DEBUG_OSOPTION
00584 cout << "IntegerVariableBranchingWeights Destructor Called; numberOfVar=" << numberOfVar << endl;
00585 #endif
00586 if (var != NULL)
00587 { int i;
00588 for (i=0; i < numberOfVar; i++)
00589 { delete var[i];
00590 var[i] = NULL;
00591 }
00592 delete[] var;
00593 var = NULL;
00594 }
00595 }
00596
00597 SOSWeights::SOSWeights():
00598 sosIdx (-1),
00599 groupWeight (1.0),
00600 numberOfVar (0)
00601 {
00602 #ifdef DEBUG_OSOPTION
00603 cout << "Inside SOSWeights Constructor" << endl;
00604 #endif
00605 var = NULL;
00606 }
00607
00608 SOSWeights::~SOSWeights()
00609 {
00610 #ifdef DEBUG_OSOPTION
00611 cout << "SOSWeights Destructor Called" << endl;
00612 #endif
00613 if (var != NULL)
00614 { int i;
00615 for (i=0; i < numberOfVar; i++)
00616 { delete var[i];
00617 var[i] = NULL;
00618 }
00619 delete[] var;
00620 var = NULL;
00621 }
00622 }
00623
00624 SOSVariableBranchingWeights::SOSVariableBranchingWeights():
00625 numberOfSOS (0)
00626 {
00627 #ifdef DEBUG_OSOPTION
00628 cout << "Inside SOSVariableBranchingWeights Constructor" << endl;
00629 #endif
00630 sos = NULL;
00631 }
00632
00633 SOSVariableBranchingWeights::~SOSVariableBranchingWeights()
00634 {
00635 #ifdef DEBUG_OSOPTION
00636 cout << "SOSVariableBranchingWeights Destructor Called" << endl;
00637 #endif
00638 if (sos != NULL)
00639 { int i;
00640 for (i=0; i < numberOfSOS; i++)
00641 { delete sos[i];
00642 sos[i] = NULL;
00643 }
00644 delete[] sos;
00645 sos = NULL;
00646 }
00647 }
00648
00649 OtherVarOption::OtherVarOption():
00650 idx (0),
00651 value (""),
00652 lbValue (""),
00653 ubValue ("")
00654 {
00655 #ifdef DEBUG_OSOPTION
00656 cout << "Inside OtherVarOption Constructor" << endl;
00657 #endif
00658 }
00659
00660 OtherVarOption::~OtherVarOption()
00661 {
00662 #ifdef DEBUG_OSOPTION
00663 cout << "OtherVarOption Destructor Called" << endl;
00664 #endif
00665 }
00666
00667
00668 OtherVariableOption::OtherVariableOption():
00669 numberOfVar (0),
00670 name (""),
00671 value (""),
00672 solver(""),
00673 category (""),
00674 type ("string"),
00675 description ("")
00676 {
00677 #ifdef DEBUG_OSOPTION
00678 cout << "Inside OtherVariableOption Constructor" << endl;
00679 #endif
00680 var = NULL;
00681 }
00682
00683 OtherVariableOption::~OtherVariableOption()
00684 {
00685 #ifdef DEBUG_OSOPTION
00686 cout << "OtherVariableOption Destructor Called" << endl;
00687 #endif
00688 if (var != NULL)
00689 { int i;
00690 for (i=0; i < numberOfVar; i++)
00691 { delete var[i];
00692 var[i] = NULL;
00693 }
00694 delete[] var;
00695 var = NULL;
00696 };
00697 }
00698
00699
00700 VariableOption::VariableOption():
00701 numberOfOtherVariableOptions(0)
00702 {
00703 #ifdef DEBUG_OSOPTION
00704 cout << "Inside VariableOption Constructor" << endl;
00705 #endif
00706 initialVariableValues = NULL;
00707 initialVariableValuesString = NULL;
00708 initialBasisStatus = NULL;
00709 integerVariableBranchingWeights = NULL;
00710 sosVariableBranchingWeights = NULL;
00711 other = NULL;
00712 }
00713
00714 VariableOption::~VariableOption()
00715 {
00716 #ifdef DEBUG_OSOPTION
00717 cout << "VariableOption Destructor Called" << endl;
00718 #endif
00719 if (initialVariableValues != NULL) delete initialVariableValues;
00720 initialVariableValues = NULL;
00721 if (initialVariableValuesString != NULL) delete initialVariableValuesString;
00722 initialVariableValuesString = NULL;
00723 if (initialBasisStatus != NULL) delete initialBasisStatus;
00724 initialBasisStatus = NULL;
00725 if (integerVariableBranchingWeights != NULL) delete integerVariableBranchingWeights;
00726 integerVariableBranchingWeights = NULL;
00727 if (sosVariableBranchingWeights != NULL) delete sosVariableBranchingWeights;
00728 sosVariableBranchingWeights = NULL;
00729 if (other != NULL)
00730 { int i;
00731 for (i=0; i < numberOfOtherVariableOptions; i++)
00732 { if (other[i] != NULL)
00733 delete other[i];
00734 other[i] = NULL;
00735
00736 };
00737 delete[] other;
00738 other = NULL;
00739 };
00740 }
00741
00742
00743 InitObjValue::InitObjValue():
00744 idx (-1),
00745 value (OSNAN)
00746 {
00747 #ifdef DEBUG_OSOPTION
00748 cout << "Inside InitObjValue Constructor" << endl;
00749 #endif
00750 }
00751
00752 InitObjValue::~InitObjValue()
00753 {
00754 #ifdef DEBUG_OSOPTION
00755 cout << "InitObjValue Destructor Called" << endl;
00756 #endif
00757 }
00758
00759
00760 InitObjectiveValues::InitObjectiveValues():
00761 numberOfObj (0)
00762 {
00763 #ifdef DEBUG_OSOPTION
00764 cout << "Inside InitObjectiveValues Constructor" << endl;
00765 #endif
00766 obj = NULL;
00767 }
00768
00769 InitObjectiveValues::~InitObjectiveValues()
00770 {
00771 #ifdef DEBUG_OSOPTION
00772 cout << "InitObjectiveValues Destructor Called" << endl;
00773 #endif
00774 if (obj != NULL)
00775 { int i;
00776 for (i=0; i < numberOfObj; i++)
00777 { delete obj[i];
00778 obj[i] = NULL;
00779 }
00780 delete[] obj;
00781 obj = NULL;
00782 };
00783 }
00784
00785
00786 InitObjBound::InitObjBound():
00787 idx (-1),
00788 lbValue (-OSDBL_MAX),
00789 ubValue ( OSDBL_MAX)
00790 {
00791 #ifdef DEBUG_OSOPTION
00792 cout << "Inside InitObjBound Constructor" << endl;
00793 #endif
00794 }
00795
00796 InitObjBound::~InitObjBound()
00797 {
00798 #ifdef DEBUG_OSOPTION
00799 cout << "InitObjBound Destructor Called" << endl;
00800 #endif
00801 }
00802
00803
00804 InitObjectiveBounds::InitObjectiveBounds():
00805 numberOfObj (0)
00806 {
00807 #ifdef DEBUG_OSOPTION
00808 cout << "Inside InitObjectiveBounds Constructor" << endl;
00809 #endif
00810 obj = NULL;
00811 }
00812
00813 InitObjectiveBounds::~InitObjectiveBounds()
00814 {
00815 #ifdef DEBUG_OSOPTION
00816 cout << "InitObjectiveBounds Destructor Called" << endl;
00817 #endif
00818 if (obj != NULL)
00819 { int i;
00820 for (i=0; i < numberOfObj; i++)
00821 { delete obj[i];
00822 obj[i] = NULL;
00823 }
00824 delete[] obj;
00825 obj = NULL;
00826 };
00827 }
00828
00829
00830 OtherObjOption::OtherObjOption():
00831 idx (-1),
00832 value (""),
00833 lbValue (""),
00834 ubValue ("")
00835 {
00836 #ifdef DEBUG_OSOPTION
00837 cout << "Inside OtherObjOption Constructor" << endl;
00838 #endif
00839 }
00840
00841 OtherObjOption::~OtherObjOption()
00842 {
00843 #ifdef DEBUG_OSOPTION
00844 cout << "OtherObjOption Destructor Called" << endl;
00845 #endif
00846 }
00847
00848
00849 OtherObjectiveOption::OtherObjectiveOption():
00850 numberOfObj (0),
00851 name (""),
00852 value (""),
00853 solver(""),
00854 category (""),
00855 type ("string"),
00856 description ("")
00857 {
00858 #ifdef DEBUG_OSOPTION
00859 cout << "Inside OtherObjectiveOption Constructor" << endl;
00860 #endif
00861 obj = NULL;
00862 }
00863
00864 OtherObjectiveOption::~OtherObjectiveOption()
00865 {
00866 #ifdef DEBUG_OSOPTION
00867 cout << "OtherObjectiveOption Destructor Called" << endl;
00868 #endif
00869 if (obj != NULL)
00870 { int i;
00871 for (i=0; i < numberOfObj; i++)
00872 { delete obj[i];
00873 obj[i] = NULL;
00874 }
00875 delete[] obj;
00876 obj = NULL;
00877 };
00878 }
00879
00880
00881 ObjectiveOption::ObjectiveOption():
00882 numberOfOtherObjectiveOptions (0)
00883 {
00884 #ifdef DEBUG_OSOPTION
00885 cout << "Inside ObjectiveOption Constructor" << endl;
00886 #endif
00887 initialObjectiveValues = NULL;
00888 initialObjectiveBounds = NULL;
00889 other = NULL;
00890 }
00891
00892 ObjectiveOption::~ObjectiveOption()
00893 {
00894 #ifdef DEBUG_OSOPTION
00895 cout << "ObjectiveOption Destructor Called" << endl;
00896 #endif
00897 if (initialObjectiveValues != NULL) delete initialObjectiveValues;
00898 initialObjectiveValues = NULL;
00899 if (initialObjectiveBounds != NULL) delete initialObjectiveBounds;
00900 initialObjectiveBounds = NULL;
00901 if (other != NULL)
00902 { int i;
00903 for (i=0; i < numberOfOtherObjectiveOptions; i++)
00904 { delete other[i];
00905 other[i] = NULL;
00906 }
00907 delete[] other;
00908 other = NULL;
00909 }
00910 }
00911
00912
00913 InitConValue::InitConValue():
00914 idx (0),
00915 value (OSNAN)
00916 {
00917 #ifdef DEBUG_OSOPTION
00918 cout << "Inside InitConValue Constructor" << endl;
00919 #endif
00920 }
00921
00922 InitConValue::~InitConValue()
00923 {
00924 #ifdef DEBUG_OSOPTION
00925 cout << "InitConValue Destructor Called" << endl;
00926 #endif
00927 }
00928
00929
00930 InitConstraintValues::InitConstraintValues():
00931 numberOfCon (0)
00932 {
00933 #ifdef DEBUG_OSOPTION
00934 cout << "Inside InitConstraintValues Constructor" << endl;
00935 #endif
00936 con = NULL;
00937 }
00938
00939 InitConstraintValues::~InitConstraintValues()
00940 {
00941 #ifdef DEBUG_OSOPTION
00942 cout << "InitConstraintValues Destructor Called" << endl;
00943 #endif
00944 if (con != NULL)
00945 { int i;
00946 for (i=0; i < numberOfCon; i++)
00947 { delete con[i];
00948 con[i] = NULL;
00949 }
00950 delete[] con;
00951 con = NULL;
00952 };
00953 }
00954
00955
00956 InitDualVarValue::InitDualVarValue():
00957 idx (0),
00958 lbDualValue (0.0),
00959 ubDualValue (0.0)
00960 {
00961 #ifdef DEBUG_OSOPTION
00962 cout << "Inside InitDualVarValue Constructor" << endl;
00963 #endif
00964 }
00965
00966 InitDualVarValue::~InitDualVarValue()
00967 {
00968 #ifdef DEBUG_OSOPTION
00969 cout << "InitDualVarValue Destructor Called" << endl;
00970 #endif
00971 }
00972
00973
00974 InitDualVariableValues::InitDualVariableValues():
00975 numberOfCon (0)
00976 {
00977 #ifdef DEBUG_OSOPTION
00978 cout << "Inside InitDualVariableValues Constructor" << endl;
00979 #endif
00980 con = NULL;
00981 }
00982
00983 InitDualVariableValues::~InitDualVariableValues()
00984 {
00985 #ifdef DEBUG_OSOPTION
00986 cout << "InitDualVariableValues Destructor Called" << endl;
00987 #endif
00988 if (con != NULL)
00989 { int i;
00990 for (i=0; i < numberOfCon; i++)
00991 { delete con[i];
00992 con[i] = NULL;
00993 }
00994 delete[] con;
00995 con = NULL;
00996 };
00997 }
00998
00999
01000 OtherConOption::OtherConOption():
01001 idx (0),
01002 value (""),
01003 lbValue (""),
01004 ubValue ("")
01005 {
01006 #ifdef DEBUG_OSOPTION
01007 cout << "Inside OtherConOption Constructor" << endl;
01008 #endif
01009 }
01010
01011 OtherConOption::~OtherConOption()
01012 {
01013 #ifdef DEBUG_OSOPTION
01014 cout << "OtherConOption Destructor Called" << endl;
01015 #endif
01016 }
01017
01018
01019 OtherConstraintOption::OtherConstraintOption():
01020 numberOfCon(0),
01021 name (""),
01022 value (""),
01023 solver(""),
01024 category (""),
01025 type ("string"),
01026 description ("")
01027 {
01028 #ifdef DEBUG_OSOPTION
01029 cout << "Inside OtherConstraintOption Constructor" << endl;
01030 #endif
01031 con = NULL;
01032 }
01033
01034 OtherConstraintOption::~OtherConstraintOption()
01035 {
01036 #ifdef DEBUG_OSOPTION
01037 cout << "OtherConstraintOption Destructor Called" << endl;
01038 #endif
01039 if (con != NULL)
01040 { int i;
01041 for (i=0; i < numberOfCon; i++)
01042 { delete con[i];
01043 con[i] = NULL;
01044 }
01045 delete[] con;
01046 con = NULL;
01047 };
01048 }
01049
01050
01051 ConstraintOption::ConstraintOption():
01052 numberOfOtherConstraintOptions (0)
01053 {
01054 #ifdef DEBUG_OSOPTION
01055 cout << "Inside ConstraintOption Constructor" << endl;
01056 #endif
01057 initialConstraintValues = NULL;
01058 initialDualValues = NULL;
01059 other = NULL;
01060 }
01061
01062 ConstraintOption::~ConstraintOption()
01063 {
01064 #ifdef DEBUG_OSOPTION
01065 cout << "ConstraintOption Destructor Called" << endl;
01066 #endif
01067 if (initialConstraintValues != NULL) delete initialConstraintValues;
01068 initialConstraintValues = NULL;
01069 if (initialDualValues != NULL) delete initialDualValues;
01070 initialDualValues = NULL;
01071 if (other != NULL)
01072 { int i;
01073 for (i=0; i < numberOfOtherConstraintOptions; i++)
01074 { delete other[i];
01075 other[i] = NULL;
01076 }
01077 delete[] other;
01078 other = NULL;
01079 }
01080 }
01081
01082
01083 SolverOption::SolverOption():
01084 name (""),
01085 value (""),
01086 solver(""),
01087 category (""),
01088 type (""),
01089 description ("")
01090 {
01091 #ifdef DEBUG_OSOPTION
01092 cout << "Inside SolverOption Constructor" << endl;
01093 #endif
01094 }
01095
01096 SolverOption::~SolverOption()
01097 {
01098 #ifdef DEBUG_OSOPTION
01099 cout << "SolverOption Destructor Called" << endl;
01100 #endif
01101 }
01102
01103
01104 SolverOptions::SolverOptions():
01105 numberOfSolverOptions(0)
01106 {
01107 #ifdef DEBUG_OSOPTION
01108 cout << "Inside SolverOptions Constructor" << endl;
01109 #endif
01110 solverOption = NULL;
01111 }
01112
01113 SolverOptions::~SolverOptions()
01114 {
01115 #ifdef DEBUG_OSOPTION
01116 cout << "SolverOptions Destructor Called; numberOfSolverOptions=" << numberOfSolverOptions << endl;
01117 #endif
01118 if (solverOption != NULL)
01119 { int i;
01120 for (i=0; i<numberOfSolverOptions; i++)
01121 { delete solverOption[i];
01122 solverOption[i] = NULL;
01123 }
01124 delete[] solverOption;
01125 solverOption = NULL;
01126 }
01127 }
01128
01129
01130 OptimizationOption::OptimizationOption():
01131 numberOfVariables (-1),
01132 numberOfObjectives (-1),
01133 numberOfConstraints (-1)
01134 {
01135 #ifdef DEBUG_OSOPTION
01136 cout << "Inside OptimizationOption Constructor" << endl;
01137 #endif
01138 variables = NULL;
01139 objectives = NULL;
01140 constraints = NULL;
01141 solverOptions = NULL;
01142 }
01143
01144 OptimizationOption::~OptimizationOption()
01145 {
01146 #ifdef DEBUG_OSOPTION
01147 cout << "OptimizationOption Destructor Called" << endl;
01148 #endif
01149 if (variables != NULL) delete variables;
01150 variables = NULL;
01151 if (objectives != NULL) delete objectives;
01152 objectives = NULL;
01153 if (constraints != NULL) delete constraints;
01154 constraints = NULL;
01155 if (solverOptions != NULL) delete solverOptions;
01156 solverOptions = NULL;
01157 }
01158
01159
01160 OSOption::OSOption()
01161
01162 {
01163 #ifdef DEBUG_OSOPTION
01164 cout << "Inside OSOption Constructor" << endl;
01165 #endif
01166
01167 general = NULL;
01168 system = NULL;
01169 service = NULL;
01170 job = NULL;
01171 optimization = NULL;
01172 m_mdInitVarValuesDense = NULL;
01173 m_mdInitVarValuesStringDense = NULL;
01174 m_mdInitBasisStatusDense = NULL;
01175 m_mdIntegerVariableBranchingWeightsDense = NULL;
01176 m_mdInitObjValuesDense = NULL;
01177 m_mdInitObjLowerBoundsDense = NULL;
01178 m_mdInitObjUpperBoundsDense = NULL;
01179 m_mdInitConValuesDense = NULL;
01180 m_mdInitDualVarLowerBoundsDense = NULL;
01181 m_mdInitDualVarUpperBoundsDense = NULL;
01182 }
01183
01184 OSOption::~OSOption()
01185 {
01186 #ifdef DEBUG_OSOPTION
01187 cout << "OSOption Destructor Called" << endl;
01188 #endif
01189 if (general != NULL) delete general;
01190 general = NULL;
01191 if (system != NULL) delete system;
01192 system = NULL;
01193 if (service != NULL) delete service;
01194 service = NULL;
01195 if (job != NULL) delete job;
01196 job = NULL;
01197 if (optimization != NULL) delete optimization;
01198 optimization = NULL;
01199
01200 if (m_mdInitVarValuesDense != NULL)
01201 delete[] m_mdInitVarValuesDense;
01202 m_mdInitVarValuesDense = NULL;
01203
01204 if (m_mdInitVarValuesStringDense != NULL)
01205 delete[] m_mdInitVarValuesStringDense;
01206 m_mdInitVarValuesStringDense = NULL;
01207
01208 if (m_mdInitBasisStatusDense != NULL)
01209 delete[] m_mdInitBasisStatusDense;
01210 m_mdInitBasisStatusDense = NULL;
01211
01212 if (m_mdIntegerVariableBranchingWeightsDense != NULL)
01213 delete[] m_mdIntegerVariableBranchingWeightsDense;
01214 m_mdIntegerVariableBranchingWeightsDense = NULL;
01215
01216 if (m_mdInitObjValuesDense != NULL)
01217 delete[] m_mdInitObjValuesDense;
01218 m_mdInitObjValuesDense = NULL;
01219
01220 if (m_mdInitObjLowerBoundsDense != NULL)
01221 delete[] m_mdInitObjLowerBoundsDense;
01222 m_mdInitObjLowerBoundsDense = NULL;
01223
01224 if (m_mdInitObjUpperBoundsDense != NULL)
01225 delete[] m_mdInitObjUpperBoundsDense;
01226 m_mdInitObjUpperBoundsDense = NULL;
01227
01228 if (m_mdInitConValuesDense != NULL)
01229 delete[] m_mdInitConValuesDense;
01230 m_mdInitConValuesDense = NULL;
01231
01232 if (m_mdInitDualVarLowerBoundsDense != NULL)
01233 delete[] m_mdInitDualVarLowerBoundsDense;
01234 m_mdInitDualVarLowerBoundsDense = NULL;
01235
01236 if (m_mdInitDualVarUpperBoundsDense != NULL)
01237 delete[] m_mdInitDualVarUpperBoundsDense;
01238 m_mdInitDualVarUpperBoundsDense = NULL;
01239 }
01240
01241
01242
01243
01244
01245
01246
01247
01248
01249
01250
01251
01255 std::string OSOption::getServiceURI()
01256 { if (this->general != NULL)
01257 return this->general->serviceURI;
01258
01259 return "";
01260 }
01261
01265 std::string OSOption::getServiceName()
01266 { if (this->general != NULL)
01267 return this->general->serviceName;
01268
01269 return "";
01270 }
01271
01275 std::string OSOption::getInstanceName()
01276 { if (this->general != NULL)
01277 return this->general->instanceName;
01278
01279 return "";
01280 }
01281
01285 std::string OSOption::getInstanceLocation()
01286 { if (this->general != NULL)
01287 if (this->general->instanceLocation != NULL)
01288 return this->general->instanceLocation->value;
01289
01290 return "";
01291 }
01292
01296 std::string OSOption::getInstanceLocationType()
01297 { if (this->general != NULL)
01298 if (this->general->instanceLocation != NULL)
01299 return this->general->instanceLocation->locationType;
01300
01301 return "";
01302 }
01303
01307 std::string OSOption::getJobID()
01308 { if (this->general != NULL)
01309 return this->general->jobID;
01310
01311 return "";
01312 }
01313
01317 std::string OSOption::getSolverToInvoke()
01318 { if (this->general != NULL)
01319 return this->general->solverToInvoke;
01320
01321 return "";
01322 }
01323
01327 std::string OSOption::getLicense()
01328 { if (this->general != NULL)
01329 return this->general->license;
01330
01331 return "";
01332 }
01333
01337 std::string OSOption::getUserName()
01338 { if (this->general != NULL)
01339 return this->general->userName;
01340
01341 return "";
01342 }
01343
01347 std::string OSOption::getPassword()
01348 { if (this->general != NULL)
01349 return this->general->password;
01350
01351 return "";
01352 }
01353
01357 std::string OSOption::getContact()
01358 { if (this->general != NULL)
01359 if (this->general->contact != NULL)
01360 return this->general->contact->value;
01361
01362 return "";
01363 }
01364
01368 std::string OSOption::getContactTransportType()
01369 { if (this->general != NULL)
01370 if (this->general->contact != NULL)
01371 return this->general->contact->transportType;
01372
01373 return "";
01374 }
01375
01379 std::string OSOption::getMinDiskSpaceUnit()
01380 { if (this->system != NULL)
01381 if (this->system->minDiskSpace != NULL)
01382 return this->system->minDiskSpace->unit;
01383
01384 return "";
01385 }
01386
01390 std::string OSOption::getMinMemoryUnit()
01391 { if (this->system != NULL)
01392 if (this->system->minMemorySize != NULL)
01393 return this->system->minMemorySize->unit;
01394
01395 return "";
01396 }
01397
01401 std::string OSOption::getMinCPUSpeedUnit()
01402 { if (this->system != NULL)
01403 if (this->system->minCPUSpeed != NULL)
01404 return this->system->minCPUSpeed->unit;
01405
01406 return "";
01407 }
01408
01412 std::string OSOption::getServiceType()
01413 { if (this->service != NULL)
01414 return this->service->type;
01415
01416 return "";
01417 }
01418
01422 std::string OSOption::getMaxTimeUnit()
01423 { if (this->job != NULL)
01424 if (this->job->maxTime != NULL)
01425 return this->job->maxTime->unit;
01426
01427 return "";
01428 }
01429
01433 std::string OSOption::getRequestedStartTime()
01434 { if (this->job != NULL)
01435 return this->job->requestedStartTime;
01436
01437 return "";
01438 }
01439
01446 std::string OSOption::getOptionStr(std::string optionName)
01447 { if (optionName == "serviceURI")
01448 return this->getServiceURI();
01449
01450 if (optionName == "serviceName")
01451 return this->getServiceName();
01452
01453 if (optionName == "instanceName")
01454 return this->getInstanceName();
01455
01456 if (optionName == "instanceLocation")
01457 return this->getInstanceLocation();
01458
01459 if (optionName == "instanceLocationType")
01460 return this->getInstanceLocationType();
01461
01462 if (optionName == "jobID")
01463 return this->getJobID();
01464
01465 if (optionName == "solverToInvoke")
01466 return this->getSolverToInvoke();
01467
01468 if (optionName == "license")
01469 return this->getLicense();
01470
01471 if (optionName == "userName")
01472 return this->getUserName();
01473
01474 if (optionName == "password")
01475 return this->getPassword();
01476
01477 if (optionName == "contact")
01478 return this->getContact();
01479
01480 if (optionName == "contactTransportType")
01481 return this->getContactTransportType();
01482
01483 if (optionName == "minDiskSpaceUnit")
01484 return this->getMinDiskSpaceUnit();
01485
01486 if (optionName == "minMemoryUnit")
01487 return this->getMinMemoryUnit();
01488
01489 if (optionName == "minCPUSpeedUnit")
01490 return this->getMinCPUSpeedUnit();
01491
01492 if (optionName == "serviceType")
01493 return this->getServiceType();
01494
01495 if (optionName == "maxTimeUnit")
01496 return this->getMaxTimeUnit();
01497
01498 if (optionName == "requestedStartTime")
01499 return this->getRequestedStartTime();
01500
01501 return "";
01502 }
01503
01504
01505
01506
01507
01511 double OSOption::getMinDiskSpace()
01512 { if (this->system != NULL)
01513 if (this->system->minDiskSpace != NULL)
01514 return this->system->minDiskSpace->value;
01515
01516 return 0;
01517 }
01518
01522 double OSOption::getMinMemorySize()
01523 { if (this->system != NULL)
01524 if (this->system->minMemorySize != NULL)
01525 return this->system->minMemorySize->value;
01526
01527 return 0;
01528 }
01529
01533 double OSOption::getMinCPUSpeed()
01534 { if (this->system != NULL)
01535 if (this->system->minCPUSpeed != NULL)
01536 return this->system->minCPUSpeed->value;
01537
01538 return 0;
01539 }
01540
01544 double OSOption::getMaxTime()
01545 { if (this->job != NULL)
01546 if (this->job->maxTime != NULL)
01547 return job->maxTime->value;
01548
01549 return 0;
01550 }
01551
01558 double OSOption::getOptionDbl(std::string optionName)
01559 { if (optionName == "minDiskSpace")
01560 return this->getMinDiskSpace();
01561
01562 if (optionName == "minMemory")
01563 return this->getMinMemorySize();
01564
01565 if (optionName == "minCPUSpeed")
01566 return this->getMinCPUSpeed();
01567
01568 if (optionName == "maxTime")
01569 return this->getMaxTime();
01570
01571 return 0;
01572 }
01573
01581 int OSOption::getMinCPUNumber()
01582 { if (this->system != NULL)
01583 return this->system->minCPUNumber;
01584
01585 return 0;
01586 }
01587
01591 int OSOption::getNumberOfOtherGeneralOptions()
01592 { if (this->general != NULL)
01593 if (this->general->otherOptions != NULL)
01594 return this->general->otherOptions->numberOfOtherOptions;
01595
01596 return 0;
01597 }
01598
01602 int OSOption::getNumberOfOtherSystemOptions()
01603 { if (this->system != NULL)
01604 if (this->system->otherOptions != NULL)
01605 return this->system->otherOptions->numberOfOtherOptions;
01606
01607 return 0;
01608 }
01609
01613 int OSOption::getNumberOfOtherServiceOptions()
01614 { if (this->service != NULL)
01615 if (this->service->otherOptions != NULL)
01616 return this->service->otherOptions->numberOfOtherOptions;
01617
01618 return 0;
01619 }
01620
01624 int OSOption::getNumberOfOtherJobOptions()
01625 { if (this->job != NULL)
01626 if (this->job->otherOptions != NULL)
01627 return this->job->otherOptions->numberOfOtherOptions;
01628
01629 return 0;
01630 }
01631
01635 int OSOption::getNumberOfJobDependencies()
01636 { if (this->job != NULL)
01637 if (this->job->dependencies != NULL)
01638 return this->job->dependencies->numberOfJobIDs;
01639
01640 return 0;
01641 }
01642
01646 int OSOption::getNumberOfRequiredDirectories()
01647 { if (this->job != NULL)
01648 if (this->job->requiredDirectories != NULL)
01649 return this->job->requiredDirectories->numberOfPaths;
01650
01651 return 0;
01652 }
01653
01657 int OSOption::getNumberOfRequiredFiles()
01658 { if (this->job != NULL)
01659 if (this->job->requiredFiles != NULL)
01660 return this->job->requiredFiles->numberOfPaths;
01661
01662 return 0;
01663 }
01664
01668 int OSOption::getNumberOfDirectoriesToMake()
01669 { if (this->job != NULL)
01670 if (this->job->directoriesToMake != NULL)
01671 return this->job->directoriesToMake->numberOfPaths;
01672
01673 return 0;
01674 }
01675
01679 int OSOption::getNumberOfFilesToMake()
01680 { if (this->job != NULL)
01681 if (this->job->filesToMake != NULL)
01682 return this->job->filesToMake->numberOfPaths;
01683
01684 return 0;
01685 }
01686
01690 int OSOption::getNumberOfInputDirectoriesToMove()
01691 { if (this->job != NULL)
01692 if (this->job->inputDirectoriesToMove != NULL)
01693 return this->job->inputDirectoriesToMove->numberOfPathPairs;
01694
01695 return 0;
01696 }
01697
01701 int OSOption::getNumberOfInputFilesToMove()
01702 { if (this->job != NULL)
01703 if (this->job->inputFilesToMove != NULL)
01704 return this->job->inputFilesToMove->numberOfPathPairs;
01705
01706 return 0;
01707 }
01708
01712 int OSOption::getNumberOfOutputDirectoriesToMove()
01713 { if (this->job != NULL)
01714 if (this->job->outputDirectoriesToMove != NULL)
01715 return this->job->outputDirectoriesToMove->numberOfPathPairs;
01716
01717 return 0;
01718 }
01719
01723 int OSOption::getNumberOfOutputFilesToMove()
01724 { if (this->job != NULL)
01725 if (this->job->outputFilesToMove != NULL)
01726 return this->job->outputFilesToMove->numberOfPathPairs;
01727
01728 return 0;
01729 }
01730
01734 int OSOption::getNumberOfFilesToDelete()
01735 { if (this->job != NULL)
01736 if (this->job->filesToDelete != NULL)
01737 return this->job->filesToDelete->numberOfPaths;
01738
01739 return 0;
01740 }
01741
01745 int OSOption::getNumberOfDirectoriesToDelete()
01746 { if (this->job != NULL)
01747 if (this->job->directoriesToDelete != NULL)
01748 return this->job->directoriesToDelete->numberOfPaths;
01749
01750 return 0;
01751 }
01752
01756 int OSOption::getNumberOfProcessesToKill()
01757 { if (this->job != NULL)
01758 if (this->job->processesToKill != NULL)
01759 return this->job->processesToKill->numberOfProcesses;
01760
01761 return 0;
01762 }
01763
01767 int OSOption::getNumberOfVariables()
01768 { if (this->optimization != NULL)
01769 return this->optimization->numberOfVariables;
01770
01771 return -1;
01772 }
01773
01777 int OSOption::getNumberOfObjectives()
01778 { if (this->optimization != NULL)
01779 return this->optimization->numberOfObjectives;
01780
01781 return -1;
01782 }
01783
01787 int OSOption::getNumberOfConstraints()
01788 { if (this->optimization != NULL)
01789 return this->optimization->numberOfConstraints;
01790
01791 return -1;
01792 }
01793
01794
01798 int OSOption::getNumberOfInitVarValues()
01799 {
01800
01801 if (this->optimization != NULL)
01802 {
01803
01804 if (this->optimization->variables != NULL)
01805 {
01806
01807 if (this->optimization->variables->initialVariableValues != NULL)
01808 {
01809
01810
01811 return this->optimization->variables->initialVariableValues->numberOfVar;
01812 }
01813 }
01814 }
01815 return -1;
01816 }
01817
01821 int OSOption::getNumberOfInitVarValuesString()
01822 { if (this->optimization != NULL)
01823 if (this->optimization->variables != NULL)
01824 if (this->optimization->variables->initialVariableValuesString != NULL)
01825 return this->optimization->variables->initialVariableValuesString->numberOfVar;
01826 return -1;
01827 }
01828
01832 int OSOption::getNumberOfInitialBasisVariables()
01833 { if (this->optimization != NULL)
01834 if (this->optimization->variables != NULL)
01835 if (this->optimization->variables->initialBasisStatus != NULL)
01836 return this->optimization->variables->initialBasisStatus->numberOfVar;
01837 return -1;
01838 }
01839
01843 int OSOption::getNumberOfIntegerVariableBranchingWeights()
01844 { if (this->optimization != NULL)
01845 if (this->optimization->variables != NULL)
01846 if (this->optimization->variables->integerVariableBranchingWeights != NULL)
01847 return this->optimization->variables->integerVariableBranchingWeights->numberOfVar;
01848 return -1;
01849 }
01850
01854 int OSOption::getNumberOfSOS()
01855 { if (this->optimization != NULL)
01856 if (this->optimization->variables != NULL)
01857 if (this->optimization->variables->sosVariableBranchingWeights != NULL)
01858 return this->optimization->variables->sosVariableBranchingWeights->numberOfSOS;
01859 return -1;
01860 }
01861
01865 int OSOption::getNumberOfSOSVarBranchingWeights(int iSOS)
01866 { if (this->optimization != NULL)
01867 if (this->optimization->variables != NULL)
01868 if (this->optimization->variables->sosVariableBranchingWeights != NULL)
01869 { if (iSOS >= 0 && iSOS < this->optimization->variables->sosVariableBranchingWeights->numberOfSOS)
01870 if (this->optimization->variables->sosVariableBranchingWeights->sos[iSOS] != NULL)
01871 return this->optimization->variables->sosVariableBranchingWeights->sos[iSOS]->numberOfVar;
01872 }
01873 return -1;
01874 }
01875
01879 int OSOption::getNumberOfOtherVariableOptions()
01880 { if (this->optimization != NULL)
01881 if (this->optimization->variables != NULL)
01882 return this->optimization->variables->numberOfOtherVariableOptions;
01883
01884 return 0;
01885 }
01886
01890 int OSOption::getNumberOfInitObjValues()
01891 { if (this->optimization != NULL)
01892 if (this->optimization->objectives != NULL)
01893 if (this->optimization->objectives->initialObjectiveValues != NULL)
01894 return this->optimization->objectives->initialObjectiveValues->numberOfObj;
01895
01896 return -1;
01897 }
01898
01902 int OSOption::getNumberOfInitObjBounds()
01903 { if (this->optimization != NULL)
01904 if (this->optimization->objectives != NULL)
01905 if (this->optimization->objectives->initialObjectiveBounds != NULL)
01906 return this->optimization->objectives->initialObjectiveBounds->numberOfObj;
01907 return -1;
01908 }
01909
01913 int OSOption::getNumberOfOtherObjectiveOptions()
01914 { if (this->optimization != NULL)
01915 if (this->optimization->objectives != NULL)
01916 return this->optimization->objectives->numberOfOtherObjectiveOptions;
01917
01918 return 0;
01919 }
01920
01924 int OSOption::getNumberOfInitConValues()
01925 { if (this->optimization != NULL)
01926 if (this->optimization->constraints != NULL)
01927 if (this->optimization->constraints->initialConstraintValues != NULL)
01928 return this->optimization->constraints->initialConstraintValues->numberOfCon;
01929
01930 return -1;
01931 }
01932
01936 int OSOption::getNumberOfInitDualVarValues()
01937 { if (this->optimization != NULL)
01938 if (this->optimization->constraints != NULL)
01939 if (this->optimization->constraints->initialDualValues != NULL)
01940 return this->optimization->constraints->initialDualValues->numberOfCon;
01941
01942 return -1;
01943 }
01944
01948 int OSOption::getNumberOfOtherConstraintOptions()
01949 { if (this->optimization != NULL)
01950 if (this->optimization->constraints != NULL)
01951 return this->optimization->constraints->numberOfOtherConstraintOptions;
01952
01953 return -1;
01954 }
01955
01959 int OSOption::getNumberOfSolverOptions()
01960 { if (this->optimization != NULL)
01961 if (this->optimization->solverOptions != NULL)
01962 return this->optimization->solverOptions->numberOfSolverOptions;
01963
01964 return -1;
01965 }
01966
01973 int OSOption::getOptionInt(std::string optionName)
01974 { if (optionName == "minCPUNumber")
01975 return this->getMinCPUNumber();
01976
01977 if (optionName == "numberOfOtherGeneralOptions")
01978 return this->getNumberOfOtherGeneralOptions();
01979
01980 if (optionName == "numberOfOtherSystemOptions")
01981 return this->getNumberOfOtherSystemOptions();
01982
01983 if (optionName == "numberOfOtherServiceOptions")
01984 return this->getNumberOfOtherServiceOptions();
01985
01986 if (optionName == "numberOfOtherJobOptions")
01987 return this->getNumberOfOtherJobOptions();
01988
01989 if (optionName == "numberOfJobDependencies")
01990 return this->getNumberOfJobDependencies();
01991
01992 if (optionName == "numberOfRequiredDirectories")
01993 return this->getNumberOfRequiredDirectories();
01994
01995 if (optionName == "numberOfRequiredFiles")
01996 return this->getNumberOfRequiredFiles();
01997
01998 if (optionName == "numberOfDirectoriesToMake")
01999 return this->getNumberOfDirectoriesToMake();
02000
02001 if (optionName == "numberOfFilesToMake")
02002 return this->getNumberOfFilesToMake();
02003
02004 if (optionName == "numberOfInputDirectoriesToMove")
02005 return this->getNumberOfInputDirectoriesToMove();
02006
02007 if (optionName == "numberOfInputFilesToMove")
02008 return this->getNumberOfInputFilesToMove();
02009
02010 if (optionName == "numberOfOutputDirectoriesToMove")
02011 return this->getNumberOfOutputDirectoriesToMove();
02012
02013 if (optionName == "numberOfOutputFilesToMove")
02014 return this->getNumberOfOutputFilesToMove();
02015
02016 if (optionName == "numberOfFilesToDelete")
02017 return this->getNumberOfFilesToDelete();
02018
02019 if (optionName == "numberOfDirectoriesToDelete")
02020 return this->getNumberOfDirectoriesToDelete();
02021
02022 if (optionName == "numberOfProcessesToKill")
02023 return this->getNumberOfProcessesToKill();
02024
02025 if (optionName == "numberOfVariables")
02026 return this->getNumberOfVariables();
02027
02028 if (optionName == "numberOfObjectives")
02029 return this->getNumberOfObjectives();
02030
02031 if (optionName == "numberOfConstraints")
02032 return this->getNumberOfConstraints();
02033
02034 if (optionName == "numberOfInitVarValues")
02035 return this->getNumberOfInitVarValues();
02036
02037 if (optionName == "numberOfInitVarValuesString")
02038 return this->getNumberOfInitVarValuesString();
02039
02040 if (optionName == "numberOfInitialBasisVariables")
02041 return this->getNumberOfInitialBasisVariables();
02042
02043 if (optionName == "numberOfIntegerVariableBranchingWeights")
02044 return this->getNumberOfIntegerVariableBranchingWeights();
02045
02046 if (optionName == "numberOfSOS")
02047 return this->getNumberOfSOS();
02048
02049 if (optionName == "numberOfOtherVariableOptions")
02050 return this->getNumberOfOtherVariableOptions();
02051
02052 if (optionName == "numberOfInitObjValues")
02053 return this->getNumberOfInitObjValues();
02054
02055 if (optionName == "numberOfInitObjBounds")
02056 return this->getNumberOfInitObjBounds();
02057
02058 if (optionName == "numberOfOtherObjectiveOptions")
02059 return this->getNumberOfOtherObjectiveOptions();
02060
02061 if (optionName == "numberOfInitConValues")
02062 return this->getNumberOfInitConValues();
02063
02064 if (optionName == "numberOfInitDualVarValues")
02065 return this->getNumberOfInitDualVarValues();
02066
02067 if (optionName == "numberOfOtherConstraintOptions")
02068 return this->getNumberOfOtherConstraintOptions();
02069
02070 if (optionName == "numberOfSolverOptions")
02071 return this->getNumberOfSolverOptions();
02072
02073 return -1;
02074 }
02075
02076
02077
02078
02079
02080
02084 OtherOption** OSOption::getOtherGeneralOptions()
02085 { if (this->general != NULL)
02086 { if (this->general->otherOptions != NULL)
02087 return this->general->otherOptions->other;
02088 }
02089 return NULL;
02090 }
02091
02095 OtherOption** OSOption::getOtherSystemOptions()
02096 { if (this->system != NULL)
02097 { if (this->system->otherOptions != NULL)
02098 return this->system->otherOptions->other;
02099 }
02100 return NULL;
02101 }
02102
02106 OtherOption** OSOption::getOtherServiceOptions()
02107 { if (this->service != NULL)
02108 { if (this->service->otherOptions != NULL)
02109 return this->service->otherOptions->other;
02110 }
02111 return NULL;
02112 }
02113
02117 OtherOption** OSOption::getOtherJobOptions()
02118 { if (this->job != NULL)
02119 { if (this->job->otherOptions != NULL)
02120 return this->job->otherOptions->other;
02121 }
02122 return NULL;
02123 }
02124
02131 OtherOption** OSOption::getOtherOptions(std::string category)
02132 { if (category == "general")
02133 return this->getOtherGeneralOptions();
02134
02135 if (category == "system")
02136 return this->getOtherSystemOptions();
02137
02138 if (category == "service")
02139 return this->getOtherServiceOptions();
02140
02141 if (category == "job")
02142 return this->getOtherJobOptions();
02143
02144 return NULL;
02145 }
02146
02150 OtherOption** OSOption::getAllOtherOptions()
02151 { OtherOption** optionVector = NULL;
02152 int prev_options[4];
02153 int num_options[4];
02154 int num_opt;
02155 int i;
02156
02157 for (i = 0; i < 4; i++)
02158 { prev_options[i] = 0;
02159 num_options[i] = 0;
02160 }
02161 if (this->general != NULL)
02162 { if (this->general->otherOptions != NULL)
02163 { num_opt = this->getNumberOfOtherGeneralOptions();
02164 num_options[0] = num_opt;
02165 }
02166 }
02167
02168 if (this->system != NULL)
02169 { if (this->system->otherOptions != NULL)
02170 { num_opt = this->getNumberOfOtherSystemOptions();
02171 num_options[1] = num_opt;
02172 }
02173 }
02174 prev_options[1] = prev_options[0] + num_options[0];
02175
02176 if (this->service != NULL)
02177 { if (this->service->otherOptions != NULL)
02178 { num_opt = this->getNumberOfOtherServiceOptions();
02179 num_options[2] = num_opt;
02180 }
02181 }
02182 prev_options[2] = prev_options[1] + num_options[1];
02183
02184 if (this->job != NULL)
02185 { if (this->job->otherOptions != NULL)
02186 { num_opt = this->getNumberOfOtherJobOptions();
02187 num_options[3] = num_opt;
02188 }
02189 }
02190 prev_options[3] = prev_options[2] + num_options[2];
02191
02192 num_opt = num_options[0] + num_options[1] + num_options[2] + num_options[3];
02193 optionVector = new OtherOption*[num_opt];
02194
02195 if (num_options[0] > 0)
02196 {
02197 for (i = 0; i < num_options[0]; i++)
02198 { optionVector[prev_options[0] + i] = this->general->otherOptions->other[i];
02199 }
02200 }
02201
02202 if (num_options[1] > 0)
02203 { for (i = 0; i < num_options[1]; i++)
02204 { optionVector[prev_options[1] + i] = this->system->otherOptions->other[i];
02205 }
02206 }
02207
02208 if (num_options[2] > 0)
02209 { for (i = 0; i < num_options[2]; i++)
02210 { optionVector[prev_options[2] + i] = this->service->otherOptions->other[i];
02211 }
02212 }
02213
02214 if (num_options[3] > 0)
02215 { for (i = 0; i < num_options[3]; i++)
02216 { optionVector[prev_options[3] + i] = this->job->otherOptions->other[i];
02217 }
02218 }
02219
02220 return optionVector;
02221 }
02222
02226 std::string* OSOption::getJobDependencies()
02227 { std::string* dependenciesVector = NULL;
02228 if (this->job != NULL)
02229 { if (this->job->dependencies != NULL)
02230 dependenciesVector = this->job->dependencies->jobID;
02231 else
02232 throw ErrorClass("<dependencies> object must be defined before getting the jobIDs");
02233 }
02234 else
02235 throw ErrorClass("<job> object must be defined before getting the jobIDs");
02236
02237 return dependenciesVector;
02238 }
02239
02243 std::string* OSOption::getRequiredDirectories()
02244 { std::string* pathVector = NULL;
02245 if (this->job != NULL)
02246 { if (this->job->requiredDirectories != NULL)
02247 pathVector = this->job->requiredDirectories->path;
02248 else
02249 throw ErrorClass("<requiredDirectories> object must be defined before getting the paths");
02250 }
02251 else
02252 throw ErrorClass("<job> object must be defined before getting the paths");
02253 return pathVector;
02254 }
02255
02259 std::string* OSOption::getRequiredFiles()
02260 { std::string* pathVector = NULL;
02261 if (this->job != NULL)
02262 { if (this->job->requiredFiles != NULL)
02263 pathVector = this->job->requiredFiles->path;
02264 else
02265 throw ErrorClass("<requiredFiles> object must be defined before getting the paths");
02266 }
02267 else
02268 throw ErrorClass("<job> object must be defined before getting the paths");
02269 return pathVector;
02270 }
02271
02275 std::string* OSOption::getDirectoriesToMake()
02276 { std::string* pathVector = NULL;
02277 if (this->job != NULL)
02278 { if (this->job->directoriesToMake != NULL)
02279 pathVector = this->job->directoriesToMake->path;
02280 else
02281 throw ErrorClass("<directoriesToMake> object must be defined before getting the paths");
02282 }
02283 else
02284 throw ErrorClass("<job> object must be defined before getting the paths");
02285 return pathVector;
02286 }
02287
02291 std::string* OSOption::getFilesToMake()
02292 { std::string* pathVector = NULL;
02293 if (this->job != NULL)
02294 { if (this->job->filesToMake != NULL)
02295 pathVector = this->job->filesToMake->path;
02296 else
02297 throw ErrorClass("<filesToMake> object must be defined before getting the paths");
02298 }
02299 else
02300 throw ErrorClass("<job> object must be defined before getting the paths");
02301 return pathVector;
02302 }
02303
02307 PathPair** OSOption::getInputDirectoriesToMove()
02308 { PathPair** pathPairVector = NULL;
02309 if (this->job != NULL)
02310 { if (this->job->inputDirectoriesToMove != NULL)
02311 pathPairVector = this->job->inputDirectoriesToMove->pathPair;
02312 else
02313 throw ErrorClass("<inputDirectoriesToMove> object must be defined before getting the paths");
02314 }
02315 else
02316 throw ErrorClass("<job> object must be defined before getting the paths");
02317 return pathPairVector;
02318 }
02319
02323 PathPair** OSOption::getInputFilesToMove()
02324 { PathPair** pathPairVector = NULL;
02325 if (this->job != NULL)
02326 { if (this->job->inputFilesToMove != NULL)
02327 pathPairVector = this->job->inputFilesToMove->pathPair;
02328 else
02329 throw ErrorClass("<inputFilesToMove> object must be defined before getting the paths");
02330 }
02331 else
02332 throw ErrorClass("<job> object must be defined before getting the paths");
02333 return pathPairVector;
02334 }
02335
02339 PathPair** OSOption::getOutputFilesToMove()
02340 { PathPair** pathPairVector = NULL;
02341 if (this->job != NULL)
02342 { if (this->job->outputFilesToMove != NULL)
02343 pathPairVector = this->job->outputFilesToMove->pathPair;
02344 else
02345 throw ErrorClass("<outputFilesToMove> object must be defined before getting the paths");
02346 }
02347 else
02348 throw ErrorClass("<job> object must be defined before getting the paths");
02349 return pathPairVector;
02350 }
02351
02355 PathPair** OSOption::getOutputDirectoriesToMove()
02356 { PathPair** pathPairVector = NULL;
02357 if (this->job != NULL)
02358 { if (this->job->outputDirectoriesToMove != NULL)
02359 pathPairVector = this->job->outputDirectoriesToMove->pathPair;
02360 else
02361 throw ErrorClass("<outputDirectoriesToMove> object must be defined before getting the paths");
02362 }
02363 else
02364 throw ErrorClass("<job> object must be defined before getting the paths");
02365 return pathPairVector;
02366 }
02367
02371 std::string* OSOption::getFilesToDelete()
02372 { std::string* pathVector = NULL;
02373 if (this->job != NULL)
02374 { if (this->job->filesToDelete != NULL)
02375 pathVector = this->job->filesToDelete->path;
02376 else
02377 throw ErrorClass("<filesToDelete> object must be defined before getting the paths");
02378 }
02379 else
02380 throw ErrorClass("<job> object must be defined before getting the paths");
02381 return pathVector;
02382 }
02383
02387 std::string* OSOption::getDirectoriesToDelete()
02388 { std::string* pathVector = NULL;
02389 if (this->job != NULL)
02390 { if (this->job->directoriesToDelete != NULL)
02391 pathVector = this->job->directoriesToDelete->path;
02392 else
02393 throw ErrorClass("<directoriesToDelete> object must be defined before getting the paths");
02394 }
02395 else
02396 throw ErrorClass("<job> object must be defined before getting the paths");
02397 return pathVector;
02398 }
02399
02403 std::string* OSOption::getProcessesToKill()
02404 { std::string* processes = NULL;
02405 if (this->job != NULL)
02406 { if (this->job->processesToKill != NULL)
02407 processes = this->job->processesToKill->process;
02408 else
02409 throw ErrorClass("<processesToKill> object must be defined before getting the processes");
02410 }
02411 else
02412 throw ErrorClass("<job> object must be defined before getting the processes");
02413 return processes;
02414 }
02415
02416
02417
02422 InitVarValue** OSOption::getInitVarValuesSparse()
02423 { InitVarValue** initVarVector;
02424 if (this->optimization != NULL)
02425 { if (this->optimization->variables != NULL)
02426 { if (this->optimization->variables->initialVariableValues != NULL)
02427 initVarVector = this->optimization->variables->initialVariableValues->var;
02428 else
02429 throw ErrorClass("<initialVariableValues> object must be defined before getting the data");
02430 }
02431 else
02432 throw ErrorClass("<variables> object must be defined before getting the data");
02433 }
02434 else
02435 throw ErrorClass("<optimization> object must be defined before getting the data");
02436 return initVarVector;
02437 }
02438
02444 double* OSOption::getInitVarValuesDense()
02445 { try
02446 { int numberOfVariables;
02447 numberOfVariables = this->getNumberOfVariables();
02448 if (numberOfVariables < 0)
02449 throw ErrorClass("\"numberOfVariables\" must be present to use dense methods");
02450
02451 if (this->optimization != NULL)
02452 { if (this->optimization->variables != NULL)
02453 { if (this->optimization->variables->initialVariableValues != NULL)
02454 { int i,j,k;
02455 int num_var;
02456 num_var = this->getNumberOfInitVarValues();
02457
02458 if (m_mdInitVarValuesDense != NULL)
02459 delete [] m_mdInitVarValuesDense;
02460 m_mdInitVarValuesDense = new double[numberOfVariables];
02461 for (k = 0; k < numberOfVariables; k++) m_mdInitVarValuesDense[k] = OSNAN;
02462
02463 for (i = 0; i < num_var; i++)
02464 { j = this->optimization->variables->initialVariableValues->var[i]->idx;
02465 if (j >= 0 && j < numberOfVariables)
02466 m_mdInitVarValuesDense[j]
02467 = this->optimization->variables->initialVariableValues->var[i]->value;
02468 else
02469 throw ErrorClass("Variable index out of range");
02470 }
02471 return m_mdInitVarValuesDense;
02472 }
02473 }
02474 }
02475 }
02476 catch(const ErrorClass& eclass)
02477 { throw ErrorClass(eclass.errormsg);
02478 }
02479 return NULL;
02480 }
02481
02488 double* OSOption::getInitVarValuesDense(int numberOfVariables)
02489 { try
02490 { if (numberOfVariables < 0)
02491 throw ErrorClass("\"numberOfVariables\" must be present to use dense methods");
02492
02493 if (this->optimization != NULL)
02494 { if (this->optimization->variables != NULL)
02495 { if (this->optimization->variables->initialVariableValues != NULL)
02496 { int i,j,k;
02497 int num_var;
02498 num_var = this->getNumberOfInitVarValues();
02499
02500 if (m_mdInitVarValuesDense != NULL)
02501 delete [] m_mdInitVarValuesDense;
02502 m_mdInitVarValuesDense = new double[numberOfVariables];
02503 for (k = 0; k < numberOfVariables; k++) m_mdInitVarValuesDense[k] = OSNAN;
02504
02505 for (i = 0; i < num_var; i++)
02506 { j = this->optimization->variables->initialVariableValues->var[i]->idx;
02507 if (j >= 0 && j < numberOfVariables)
02508 m_mdInitVarValuesDense[j]
02509 = this->optimization->variables->initialVariableValues->var[i]->value;
02510 else
02511 throw ErrorClass("Variable index out of range");
02512 }
02513 return m_mdInitVarValuesDense;
02514 }
02515 }
02516 }
02517 }
02518 catch(const ErrorClass& eclass)
02519 { throw ErrorClass(eclass.errormsg);
02520 }
02521 return NULL;
02522 }
02523
02528 InitVarValueString** OSOption::getInitVarValuesStringSparse()
02529 { InitVarValueString** initVarVector;
02530 if (this->optimization != NULL)
02531 { if (this->optimization->variables != NULL)
02532 { if (this->optimization->variables->initialVariableValuesString != NULL)
02533 initVarVector = this->optimization->variables->initialVariableValuesString->var;
02534 else
02535 throw ErrorClass("<initialVariableValuesString> object must be defined before getting the data");
02536 }
02537 else
02538 throw ErrorClass("<variables> object must be defined before getting the data");
02539 }
02540 else
02541 throw ErrorClass("<optimization> object must be defined before getting the data");
02542 return initVarVector;
02543 }
02544
02550 std::string *OSOption::getInitVarValuesStringDense()
02551 { try
02552 { int numberOfVariables;
02553 numberOfVariables = this->getNumberOfVariables();
02554 if (numberOfVariables < 0)
02555 throw ErrorClass("\"numberOfVariables\" must be present to use dense methods");
02556
02557 if (this->optimization != NULL)
02558 { if (this->optimization->variables != NULL)
02559 { if (this->optimization->variables->initialVariableValuesString != NULL)
02560 { int i,j,k;
02561 int num_var;
02562 num_var = this->getNumberOfInitVarValuesString();
02563
02564 if (m_mdInitVarValuesStringDense != NULL)
02565 delete [] m_mdInitVarValuesStringDense;
02566 m_mdInitVarValuesStringDense = new std::string[numberOfVariables];
02567 for (k = 0; k < numberOfVariables; k++) m_mdInitVarValuesStringDense[k] = "";
02568
02569 for (i = 0; i < num_var; i++)
02570 { j = this->optimization->variables->initialVariableValuesString->var[i]->idx;
02571 if (j >= 0 && j < numberOfVariables)
02572 m_mdInitVarValuesStringDense[j]
02573 = this->optimization->variables->initialVariableValuesString->var[i]->value;
02574 else
02575 throw ErrorClass("Variable index out of range");
02576 }
02577 return m_mdInitVarValuesStringDense;
02578 }
02579 }
02580 }
02581 }
02582 catch(const ErrorClass& eclass)
02583 { throw ErrorClass(eclass.errormsg);
02584 }
02585 return NULL;
02586 }
02587
02594 std::string *OSOption::getInitVarValuesStringDense(int numberOfVariables)
02595 { try
02596 { if (numberOfVariables < 0)
02597 throw ErrorClass("\"numberOfVariables\" must be present to use dense methods");
02598
02599 if (this->optimization != NULL)
02600 { if (this->optimization->variables != NULL)
02601 { if (this->optimization->variables->initialVariableValuesString != NULL)
02602 { int i,j,k;
02603 int num_var;
02604 num_var = this->getNumberOfInitVarValuesString();
02605
02606 if (m_mdInitVarValuesStringDense != NULL)
02607 delete [] m_mdInitVarValuesStringDense;
02608 m_mdInitVarValuesStringDense = new std::string[numberOfVariables];
02609 for (k = 0; k < numberOfVariables; k++) m_mdInitVarValuesStringDense[k] = "";
02610
02611 for (i = 0; i < num_var; i++)
02612 { j = this->optimization->variables->initialVariableValuesString->var[i]->idx;
02613 if (j >= 0 && j < numberOfVariables)
02614 m_mdInitVarValuesStringDense[j]
02615 = this->optimization->variables->initialVariableValuesString->var[i]->value;
02616 else
02617 throw ErrorClass("Variable index out of range");
02618 }
02619 return m_mdInitVarValuesStringDense;
02620 }
02621 }
02622 }
02623 }
02624 catch(const ErrorClass& eclass)
02625 { throw ErrorClass(eclass.errormsg);
02626 }
02627 return NULL;
02628 }
02629
02634 InitBasStatus** OSOption::getInitBasisStatusSparse()
02635 { InitBasStatus** initBasVector;
02636 if (this->optimization != NULL)
02637 { if (this->optimization->variables != NULL)
02638 { if (this->optimization->variables->initialBasisStatus != NULL)
02639 initBasVector = this->optimization->variables->initialBasisStatus->var;
02640 else
02641 throw ErrorClass("<initialBasisStatus> object must be defined before getting the data");
02642 }
02643 else
02644 throw ErrorClass("<variables> object must be defined before getting the data");
02645 }
02646 else
02647 throw ErrorClass("<optimization> object must be defined before getting the data");
02648 return initBasVector;
02649 }
02650
02656 std::string *OSOption::getInitBasisStatusDense()
02657 { try
02658 { int numberOfVariables;
02659 numberOfVariables = this->getNumberOfVariables();
02660 if (numberOfVariables < 0)
02661 throw ErrorClass("\"numberOfVariables\" must be present to use dense methods");
02662
02663 if (this->optimization != NULL)
02664 { if (this->optimization->variables != NULL)
02665 { if (this->optimization->variables->initialBasisStatus != NULL)
02666 { int i,j,k;
02667 int num_var;
02668 num_var = this->getNumberOfInitialBasisVariables();
02669
02670 if (m_mdInitBasisStatusDense != NULL)
02671 delete [] m_mdInitBasisStatusDense;
02672 m_mdInitBasisStatusDense = new std::string[numberOfVariables];
02673 for (k = 0; k < numberOfVariables; k++) m_mdInitBasisStatusDense[k] = "";
02674
02675 for (i = 0; i < num_var; i++)
02676 { j = this->optimization->variables->initialBasisStatus->var[i]->idx;
02677 if (j >= 0 && j < numberOfVariables)
02678 m_mdInitBasisStatusDense[j]
02679 = this->optimization->variables->initialBasisStatus->var[i]->value;
02680 else
02681 throw ErrorClass("Variable index out of range");
02682 }
02683 return m_mdInitBasisStatusDense;
02684 }
02685 }
02686 }
02687 }
02688 catch(const ErrorClass& eclass)
02689 { throw ErrorClass(eclass.errormsg);
02690 }
02691 return NULL;
02692 }
02693
02694
02701 std::string *OSOption::getInitBasisStatusDense(int numberOfVariables)
02702 { try
02703 { if (numberOfVariables < 0)
02704 throw ErrorClass("\"numberOfVariables\" must be present to use dense methods");
02705
02706 if (this->optimization != NULL)
02707 { if (this->optimization->variables != NULL)
02708 { if (this->optimization->variables->initialBasisStatus != NULL)
02709 { int i,j,k;
02710 int num_var;
02711 num_var = this->getNumberOfInitialBasisVariables();
02712
02713 if (m_mdInitBasisStatusDense != NULL)
02714 delete [] m_mdInitBasisStatusDense;
02715 m_mdInitBasisStatusDense = new std::string[numberOfVariables];
02716 for (k = 0; k < numberOfVariables; k++) m_mdInitBasisStatusDense[k] = "";
02717
02718 for (i = 0; i < num_var; i++)
02719 { j = this->optimization->variables->initialBasisStatus->var[i]->idx;
02720 if (j >= 0 && j < numberOfVariables)
02721 m_mdInitBasisStatusDense[j]
02722 = this->optimization->variables->initialBasisStatus->var[i]->value;
02723 else
02724 throw ErrorClass("Variable index out of range");
02725 }
02726 return m_mdInitBasisStatusDense;
02727 }
02728 }
02729 }
02730 }
02731 catch(const ErrorClass& eclass)
02732 { throw ErrorClass(eclass.errormsg);
02733 }
02734 return NULL;
02735 }
02736
02741 BranchingWeight** OSOption::getIntegerVariableBranchingWeightsSparse()
02742 { BranchingWeight** intVarVector;
02743 if (this->optimization != NULL)
02744 { if (this->optimization->variables != NULL)
02745 { if (this->optimization->variables->integerVariableBranchingWeights != NULL)
02746 intVarVector = this->optimization->variables->integerVariableBranchingWeights->var;
02747 else
02748 throw ErrorClass("<integerVariableBranchingWeights> object must be defined before getting the data");
02749 }
02750 else
02751 throw ErrorClass("<variables> object must be defined before getting the data");
02752 }
02753 else
02754 throw ErrorClass("<optimization> object must be defined before getting the data");
02755 return intVarVector;
02756 }
02757
02758
02764 double* OSOption::getIntegerVariableBranchingWeightsDense()
02765 { try
02766 { int numberOfVariables;
02767 numberOfVariables = this->getNumberOfVariables();
02768 if (numberOfVariables < 0)
02769 throw ErrorClass("\"numberOfVariables\" must be present to use dense methods");
02770
02771 if (this->optimization != NULL)
02772 { if (this->optimization->variables != NULL)
02773 { if (this->optimization->variables->integerVariableBranchingWeights != NULL)
02774 { int i,j,k;
02775 int num_var;
02776 num_var = this->getNumberOfIntegerVariableBranchingWeights();
02777
02778 if (m_mdIntegerVariableBranchingWeightsDense != NULL)
02779 delete [] m_mdIntegerVariableBranchingWeightsDense;
02780 m_mdIntegerVariableBranchingWeightsDense = new double[numberOfVariables];
02781 for (k = 0; k < numberOfVariables; k++) m_mdIntegerVariableBranchingWeightsDense[k] = OSNAN;
02782
02783 for (i = 0; i < num_var; i++)
02784 { j = this->optimization->variables->integerVariableBranchingWeights->var[i]->idx;
02785 if (j >= 0 && j < numberOfVariables)
02786 m_mdIntegerVariableBranchingWeightsDense[j]
02787 = this->optimization->variables->integerVariableBranchingWeights->var[i]->value;
02788 else
02789 throw ErrorClass("Variable index out of range");
02790 }
02791 return m_mdIntegerVariableBranchingWeightsDense;
02792 }
02793 }
02794 }
02795 }
02796 catch(const ErrorClass& eclass)
02797 { throw ErrorClass(eclass.errormsg);
02798 }
02799 return NULL;
02800 }
02801
02802
02809 double* OSOption::getIntegerVariableBranchingWeightsDense(int numberOfVariables)
02810 { try
02811 { if (numberOfVariables < 0)
02812 throw ErrorClass("\"numberOfVariables\" must be present to use dense methods");
02813
02814 if (this->optimization != NULL)
02815 { if (this->optimization->variables != NULL)
02816 { if (this->optimization->variables->integerVariableBranchingWeights != NULL)
02817 { int i,j,k;
02818 int num_var;
02819 num_var = this->getNumberOfIntegerVariableBranchingWeights();
02820
02821 if (m_mdIntegerVariableBranchingWeightsDense != NULL)
02822 delete [] m_mdIntegerVariableBranchingWeightsDense;
02823 m_mdIntegerVariableBranchingWeightsDense = new double[numberOfVariables];
02824 for (k = 0; k < numberOfVariables; k++) m_mdIntegerVariableBranchingWeightsDense[k] = OSNAN;
02825
02826 for (i = 0; i < num_var; i++)
02827 { j = this->optimization->variables->integerVariableBranchingWeights->var[i]->idx;
02828 if (j >= 0 && j < numberOfVariables)
02829 m_mdIntegerVariableBranchingWeightsDense[j]
02830 = this->optimization->variables->integerVariableBranchingWeights->var[i]->value;
02831 else
02832 throw ErrorClass("Variable index out of range");
02833 }
02834 return m_mdIntegerVariableBranchingWeightsDense;
02835 }
02836 }
02837 }
02838 }
02839 catch(const ErrorClass& eclass)
02840 { throw ErrorClass(eclass.errormsg);
02841 }
02842 return NULL;
02843 }
02844
02849 SOSWeights** OSOption::getSOSVariableBranchingWeightsSparse()
02850 { SOSWeights** sosVarVector;
02851 if (this->optimization != NULL)
02852 { if (this->optimization->variables != NULL)
02853 { if (this->optimization->variables->sosVariableBranchingWeights != NULL)
02854 sosVarVector = this->optimization->variables->sosVariableBranchingWeights->sos;
02855 else
02856 throw ErrorClass("<sosVariableBranchingWeights> object must be defined before getting the data");
02857 }
02858 else
02859 throw ErrorClass("<variables> object must be defined before getting the data");
02860 }
02861 else
02862 throw ErrorClass("<optimization> object must be defined before getting the data");
02863 return sosVarVector;
02864 }
02865
02866
02872 std::vector<OtherVariableOption*> OSOption::getOtherVariableOptions( std::string solver_name)
02873 { std::vector<OtherVariableOption*> optionsVector;
02874 if (this->optimization != NULL)
02875 { if (this->optimization->variables != NULL)
02876 { int i;
02877 int num_options;
02878 num_options = this->getNumberOfOtherVariableOptions();
02879 for(i = 0; i < num_options; i++)
02880 if (solver_name == this->optimization->variables->other[ i]->solver)
02881 optionsVector.push_back( this->optimization->variables->other[ i]);
02882 }
02883 else
02884 throw ErrorClass("<variables> object must be defined before getting the data");
02885 }
02886 else
02887 throw ErrorClass("<optimization> object must be defined before getting the data");
02888 return optionsVector;
02889 }
02890
02891
02896 OtherVariableOption** OSOption::getAllOtherVariableOptions()
02897 { OtherVariableOption** optionsVector;
02898 if (this->optimization != NULL)
02899 { if (this->optimization->variables != NULL)
02900 optionsVector = this->optimization->variables->other;
02901 else
02902 throw ErrorClass("<variables> object must be defined before getting the data");
02903 }
02904 else
02905 throw ErrorClass("<optimization> object must be defined before getting the data");
02906 return optionsVector;
02907 }
02908
02913 InitObjValue** OSOption::getInitObjValuesSparse()
02914 { InitObjValue** initObjVector;
02915 if (this->optimization != NULL)
02916 { if (this->optimization->objectives != NULL)
02917 { if (this->optimization->objectives->initialObjectiveValues != NULL)
02918 initObjVector = this->optimization->objectives->initialObjectiveValues->obj;
02919 else
02920 throw ErrorClass("<initialObjectiveValues> object must be defined before getting the data");
02921 }
02922 else
02923 throw ErrorClass("<objectives> object must be defined before getting the data");
02924 }
02925 else
02926 throw ErrorClass("<optimization> object must be defined before getting the data");
02927 return initObjVector;
02928 }
02929
02935 double* OSOption::getInitObjValuesDense()
02936 { try
02937 { int numberOfObjectives;
02938 numberOfObjectives = this->getNumberOfObjectives();
02939 if (numberOfObjectives < 0)
02940 throw ErrorClass("\"numberOfObjectives\" must be present to use dense methods");
02941
02942 if (this->optimization != NULL)
02943 { if (this->optimization->objectives != NULL)
02944 { if (this->optimization->objectives->initialObjectiveValues != NULL)
02945 { int i,j,k;
02946 int num_obj;
02947 num_obj = this->getNumberOfInitObjValues();
02948
02949 if (m_mdInitObjValuesDense != NULL)
02950 delete [] m_mdInitObjValuesDense;
02951 m_mdInitObjValuesDense = new double[numberOfObjectives];
02952 for (k = 0; k < numberOfObjectives; k++) m_mdInitObjValuesDense[k] = OSNAN;
02953
02954 for (i = 0; i < num_obj; i++)
02955 { j = this->optimization->objectives->initialObjectiveValues->obj[i]->idx;
02956 if (j < 0 && -j <= numberOfObjectives)
02957 m_mdInitObjValuesDense[-1-j]
02958 = this->optimization->objectives->initialObjectiveValues->obj[i]->value;
02959 else
02960 throw ErrorClass("Objective index out of range");
02961 }
02962 return m_mdInitObjValuesDense;
02963 }
02964 }
02965 }
02966 }
02967 catch(const ErrorClass& eclass)
02968 { throw ErrorClass(eclass.errormsg);
02969 }
02970 return NULL;
02971 }
02972
02973
02980 double* OSOption::getInitObjValuesDense(int numberOfObjectives)
02981 { try
02982 { if (numberOfObjectives < 0)
02983 throw ErrorClass("\"numberOfObjectives\" must be present to use dense methods");
02984
02985 if (this->optimization != NULL)
02986 { if (this->optimization->objectives != NULL)
02987 { if (this->optimization->objectives->initialObjectiveValues != NULL)
02988 { int i,j,k;
02989 int num_obj;
02990 num_obj = this->getNumberOfInitObjValues();
02991
02992 if (m_mdInitObjValuesDense != NULL)
02993 delete [] m_mdInitObjValuesDense;
02994 m_mdInitObjValuesDense = new double[numberOfObjectives];
02995 for (k = 0; k < numberOfObjectives; k++) m_mdInitObjValuesDense[k] = OSNAN;
02996
02997 for (i = 0; i < num_obj; i++)
02998 { j = this->optimization->objectives->initialObjectiveValues->obj[i]->idx;
02999 if (j < 0 && -j <= numberOfObjectives)
03000 m_mdInitObjValuesDense[-1-j]
03001 = this->optimization->objectives->initialObjectiveValues->obj[i]->value;
03002 else
03003 throw ErrorClass("Objective index out of range");
03004 }
03005 return m_mdInitObjValuesDense;
03006 }
03007 }
03008 }
03009 }
03010 catch(const ErrorClass& eclass)
03011 { throw ErrorClass(eclass.errormsg);
03012 }
03013 return NULL;
03014 }
03015
03020 InitObjBound** OSOption::getInitObjBoundsSparse()
03021 { InitObjBound** initObjBounds;
03022 if (this->optimization != NULL)
03023 { if (this->optimization->objectives != NULL)
03024 { if (this->optimization->objectives->initialObjectiveBounds != NULL)
03025 initObjBounds = this->optimization->objectives->initialObjectiveBounds->obj;
03026 else
03027 throw ErrorClass("<initialObjectiveBounds> object must be defined before getting the data");
03028 }
03029 else
03030 throw ErrorClass("<objectives> object must be defined before getting the data");
03031 }
03032 else
03033 throw ErrorClass("<optimization> object must be defined before getting the data");
03034 return initObjBounds;
03035 }
03036
03042 double* OSOption::getInitObjLowerBoundsDense()
03043 { try
03044 { int numberOfObjectives;
03045 numberOfObjectives = this->getNumberOfObjectives();
03046 if (numberOfObjectives < 0)
03047 throw ErrorClass("\"numberOfObjectives\" must be present to use dense methods");
03048
03049 if (this->optimization != NULL)
03050 { if (this->optimization->objectives != NULL)
03051 { if (this->optimization->objectives->initialObjectiveBounds != NULL)
03052 { int i,j,k;
03053 int num_obj;
03054 num_obj = this->getNumberOfInitObjBounds();
03055
03056 if (m_mdInitObjLowerBoundsDense != NULL)
03057 delete [] m_mdInitObjLowerBoundsDense;
03058 m_mdInitObjLowerBoundsDense = new double[numberOfObjectives];
03059 for (k = 0; k < numberOfObjectives; k++) m_mdInitObjLowerBoundsDense[k] = OSNAN;
03060
03061 for (i = 0; i < num_obj; i++)
03062 { j = this->optimization->objectives->initialObjectiveBounds->obj[i]->idx;
03063 if (j < 0 && -j <= numberOfObjectives)
03064 m_mdInitObjLowerBoundsDense[-1-j]
03065 = this->optimization->objectives->initialObjectiveBounds->obj[i]->lbValue;
03066 else
03067 throw ErrorClass("Objective index out of range");
03068 }
03069 return m_mdInitObjLowerBoundsDense;
03070 }
03071 }
03072 }
03073 }
03074 catch(const ErrorClass& eclass)
03075 { throw ErrorClass(eclass.errormsg);
03076 }
03077 return NULL;
03078 }
03079
03086 double* OSOption::getInitObjLowerBoundsDense(int numberOfObjectives)
03087 { try
03088 { if (numberOfObjectives < 0)
03089 throw ErrorClass("\"numberOfObjectives\" must be present to use dense methods");
03090
03091 if (this->optimization != NULL)
03092 { if (this->optimization->objectives != NULL)
03093 { if (this->optimization->objectives->initialObjectiveBounds != NULL)
03094 { int i,j,k;
03095 int num_obj;
03096 num_obj = this->getNumberOfInitObjBounds();
03097
03098 if (m_mdInitObjLowerBoundsDense != NULL)
03099 delete [] m_mdInitObjLowerBoundsDense;
03100 m_mdInitObjLowerBoundsDense = new double[numberOfObjectives];
03101 for (k = 0; k < numberOfObjectives; k++) m_mdInitObjLowerBoundsDense[k] = OSNAN;
03102
03103 for (i = 0; i < num_obj; i++)
03104 { j = this->optimization->objectives->initialObjectiveBounds->obj[i]->idx;
03105 if (j < 0 && -j <= numberOfObjectives)
03106 m_mdInitObjLowerBoundsDense[-1-j]
03107 = this->optimization->objectives->initialObjectiveBounds->obj[i]->lbValue;
03108 else
03109 throw ErrorClass("Objective index out of range");
03110 }
03111 return m_mdInitObjLowerBoundsDense;
03112 }
03113 }
03114 }
03115 }
03116 catch(const ErrorClass& eclass)
03117 { throw ErrorClass(eclass.errormsg);
03118 }
03119 return NULL;
03120 }
03121
03127 double* OSOption::getInitObjUpperBoundsDense()
03128 { try
03129 { int numberOfObjectives;
03130 numberOfObjectives = this->getNumberOfObjectives();
03131 if (numberOfObjectives < 0)
03132 throw ErrorClass("\"numberOfObjectives\" must be present to use dense methods");
03133
03134 if (this->optimization != NULL)
03135 { if (this->optimization->objectives != NULL)
03136 { if (this->optimization->objectives->initialObjectiveBounds != NULL)
03137 { int i,j,k;
03138 int num_obj;
03139 num_obj = this->getNumberOfInitObjBounds();
03140
03141 if (m_mdInitObjUpperBoundsDense != NULL)
03142 delete [] m_mdInitObjUpperBoundsDense;
03143 m_mdInitObjUpperBoundsDense = new double[numberOfObjectives];
03144 for (k = 0; k < numberOfObjectives; k++) m_mdInitObjUpperBoundsDense[k] = OSNAN;
03145
03146 for (i = 0; i < num_obj; i++)
03147 { j = this->optimization->objectives->initialObjectiveBounds->obj[i]->idx;
03148 if (j < 0 && -j <= numberOfObjectives)
03149 m_mdInitObjUpperBoundsDense[-1-j]
03150 = this->optimization->objectives->initialObjectiveBounds->obj[i]->ubValue;
03151 else
03152 throw ErrorClass("Objective index out of range");
03153 }
03154 return m_mdInitObjUpperBoundsDense;
03155 }
03156 }
03157 }
03158 }
03159 catch(const ErrorClass& eclass)
03160 { throw ErrorClass(eclass.errormsg);
03161 }
03162 return NULL;
03163 }
03164
03171 double* OSOption::getInitObjUpperBoundsDense(int numberOfObjectives)
03172 { try
03173 { if (numberOfObjectives < 0)
03174 throw ErrorClass("\"numberOfObjectives\" must be present to use dense methods");
03175
03176 if (this->optimization != NULL)
03177 { if (this->optimization->objectives != NULL)
03178 { if (this->optimization->objectives->initialObjectiveBounds != NULL)
03179 { int i,j,k;
03180 int num_obj;
03181 num_obj = this->getNumberOfInitObjBounds();
03182
03183 if (m_mdInitObjUpperBoundsDense != NULL)
03184 delete [] m_mdInitObjUpperBoundsDense;
03185 m_mdInitObjUpperBoundsDense = new double[numberOfObjectives];
03186 for (k = 0; k < numberOfObjectives; k++) m_mdInitObjUpperBoundsDense[k] = OSNAN;
03187
03188 for (i = 0; i < num_obj; i++)
03189 { j = this->optimization->objectives->initialObjectiveBounds->obj[i]->idx;
03190 if (j < 0 && -j <= numberOfObjectives)
03191 m_mdInitObjUpperBoundsDense[-1-j]
03192 = this->optimization->objectives->initialObjectiveBounds->obj[i]->ubValue;
03193 else
03194 throw ErrorClass("Objective index out of range");
03195 }
03196 return m_mdInitObjUpperBoundsDense;
03197 }
03198 }
03199 }
03200 }
03201 catch(const ErrorClass& eclass)
03202 { throw ErrorClass(eclass.errormsg);
03203 }
03204 return NULL;
03205 }
03206
03212 std::vector<OtherObjectiveOption*> OSOption::getOtherObjectiveOptions( std::string solver_name)
03213 { std::vector<OtherObjectiveOption*> optionsVector;
03214 if (this->optimization != NULL)
03215 { if (this->optimization->variables != NULL)
03216 { int i;
03217 int num_options;
03218 num_options = this->getNumberOfOtherObjectiveOptions();
03219 for(i = 0; i < num_options; i++)
03220 if (solver_name == this->optimization->objectives->other[ i]->solver)
03221 optionsVector.push_back( this->optimization->objectives->other[ i]);
03222 }
03223 else
03224 throw ErrorClass("<objectives> object must be defined before getting the data");
03225 }
03226 else
03227 throw ErrorClass("<optimization> object must be defined before getting the data");
03228 return optionsVector;
03229 }
03230
03235 OtherObjectiveOption** OSOption::getAllOtherObjectiveOptions()
03236 { OtherObjectiveOption** optionsVector;
03237 if (this->optimization != NULL)
03238 { if (this->optimization->objectives != NULL)
03239 optionsVector = this->optimization->objectives->other;
03240 else
03241 throw ErrorClass("<objectives> object must be defined before getting the data");
03242 }
03243 else
03244 throw ErrorClass("<optimization> object must be defined before getting the data");
03245 return optionsVector;
03246 }
03247
03248
03253 InitConValue** OSOption::getInitConValuesSparse()
03254 { InitConValue** initConVector;
03255 if (this->optimization != NULL)
03256 { if (this->optimization->constraints != NULL)
03257 { if (this->optimization->constraints->initialConstraintValues != NULL)
03258 initConVector = this->optimization->constraints->initialConstraintValues->con;
03259 else
03260 throw ErrorClass("<initialConstraintValues> object must be defined before getting the data");
03261 }
03262 else
03263 throw ErrorClass("<constraints> object must be defined before getting the data");
03264 }
03265 else
03266 throw ErrorClass("<optimization> object must be defined before getting the data");
03267 return initConVector;
03268 }
03269
03275 double* OSOption::getInitConValuesDense()
03276 { try
03277 { int numberOfConstraints;
03278 numberOfConstraints = this->getNumberOfConstraints();
03279 if (numberOfConstraints < 0)
03280 throw ErrorClass("\"numberOfConstraints\" must be present to use dense methods");
03281
03282 if (this->optimization != NULL)
03283 { if (this->optimization->constraints != NULL)
03284 { if (this->optimization->constraints->initialConstraintValues != NULL)
03285 { int i,j,k;
03286 int num_con;
03287 num_con = this->getNumberOfInitConValues();
03288
03289 if (m_mdInitConValuesDense != NULL)
03290 delete [] m_mdInitConValuesDense;
03291 m_mdInitConValuesDense = new double[numberOfConstraints];
03292 for (k = 0; k < numberOfConstraints; k++) m_mdInitConValuesDense[k] = OSNAN;
03293
03294 for (i = 0; i < num_con; i++)
03295 { j = this->optimization->constraints->initialConstraintValues->con[i]->idx;
03296 if (j >= 0 && j < numberOfConstraints)
03297 m_mdInitConValuesDense[j]
03298 = this->optimization->constraints->initialConstraintValues->con[i]->value;
03299 else
03300 throw ErrorClass("Constraint index out of range");
03301 }
03302 return m_mdInitConValuesDense;
03303 }
03304 }
03305 }
03306 }
03307 catch(const ErrorClass& eclass)
03308 { throw ErrorClass(eclass.errormsg);
03309 }
03310 return NULL;
03311 }
03312
03319 double* OSOption::getInitConValuesDense(int numberOfConstraints)
03320 { try
03321 { if (numberOfConstraints < 0)
03322 throw ErrorClass("\"numberOfConstraints\" must be present to use dense methods");
03323
03324 if (this->optimization != NULL)
03325 { if (this->optimization->constraints != NULL)
03326 { if (this->optimization->constraints->initialConstraintValues != NULL)
03327 { int i,j,k;
03328 int num_con;
03329 num_con = this->getNumberOfInitConValues();
03330
03331 if (m_mdInitConValuesDense != NULL)
03332 delete [] m_mdInitConValuesDense;
03333 m_mdInitConValuesDense = new double[numberOfConstraints];
03334 for (k = 0; k < numberOfConstraints; k++) m_mdInitConValuesDense[k] = OSNAN;
03335
03336 for (i = 0; i < num_con; i++)
03337 { j = this->optimization->constraints->initialConstraintValues->con[i]->idx;
03338 if (j >= 0 && j < numberOfConstraints)
03339 m_mdInitConValuesDense[j]
03340 = this->optimization->constraints->initialConstraintValues->con[i]->value;
03341 else
03342 throw ErrorClass("Constraint index out of range");
03343 }
03344 return m_mdInitConValuesDense;
03345 }
03346 }
03347 }
03348 }
03349 catch(const ErrorClass& eclass)
03350 { throw ErrorClass(eclass.errormsg);
03351 }
03352 return NULL;
03353 }
03354
03355
03360 InitDualVarValue** OSOption::getInitDualVarValuesSparse()
03361 { InitDualVarValue** initDualVector;
03362 if (this->optimization != NULL)
03363 { if (this->optimization->constraints != NULL)
03364 { if (this->optimization->constraints->initialDualValues != NULL)
03365 initDualVector = this->optimization->constraints->initialDualValues->con;
03366 else
03367 throw ErrorClass("<initialDualValues> object must be defined before getting the data");
03368 }
03369 else
03370 throw ErrorClass("<constraints> object must be defined before getting the data");
03371 }
03372 else
03373 throw ErrorClass("<optimization> object must be defined before getting the data");
03374 return initDualVector;
03375 }
03376
03382 double* OSOption::getInitDualVarLowerBoundsDense()
03383 { try
03384 { int numberOfConstraints;
03385 numberOfConstraints = this->getNumberOfConstraints();
03386 if (numberOfConstraints < 0)
03387 throw ErrorClass("\"numberOfConstraints\" must be present to use dense methods");
03388
03389 if (this->optimization != NULL)
03390 { if (this->optimization->constraints != NULL)
03391 { if (this->optimization->constraints->initialDualValues != NULL)
03392 { int i,j,k;
03393 int num_con;
03394 num_con = this->getNumberOfInitDualVarValues();
03395
03396 if (m_mdInitDualVarLowerBoundsDense != NULL)
03397 delete [] m_mdInitDualVarLowerBoundsDense;
03398 m_mdInitDualVarLowerBoundsDense = new double[numberOfConstraints];
03399 for (k = 0; k < numberOfConstraints; k++) m_mdInitDualVarLowerBoundsDense[k] = 0.0;
03400
03401 for (i = 0; i < num_con; i++)
03402 { j = this->optimization->constraints->initialDualValues->con[i]->idx;
03403 if (j >= 0 && j < numberOfConstraints)
03404 m_mdInitDualVarLowerBoundsDense[j]
03405 = this->optimization->constraints->initialDualValues->con[i]->lbDualValue;
03406 else
03407 throw ErrorClass("Constraint index out of range");
03408 }
03409 return m_mdInitDualVarLowerBoundsDense;
03410 }
03411 }
03412 }
03413 }
03414 catch(const ErrorClass& eclass)
03415 { throw ErrorClass(eclass.errormsg);
03416 }
03417 return NULL;
03418 }
03419
03426 double* OSOption::getInitDualVarLowerBoundsDense(int numberOfConstraints)
03427 { try
03428 { if (numberOfConstraints < 0)
03429 throw ErrorClass("\"numberOfConstraints\" must be present to use dense methods");
03430
03431 if (this->optimization != NULL)
03432 { if (this->optimization->constraints != NULL)
03433 { if (this->optimization->constraints->initialDualValues != NULL)
03434 { int i,j,k;
03435 int num_con;
03436 num_con = this->getNumberOfInitDualVarValues();
03437
03438 if (m_mdInitDualVarLowerBoundsDense != NULL)
03439 delete [] m_mdInitDualVarLowerBoundsDense;
03440 m_mdInitDualVarLowerBoundsDense = new double[numberOfConstraints];
03441 for (k = 0; k < numberOfConstraints; k++) m_mdInitDualVarLowerBoundsDense[k] = 0.0;
03442
03443 for (i = 0; i < num_con; i++)
03444 { j = this->optimization->constraints->initialDualValues->con[i]->idx;
03445 if (j >= 0 && j < numberOfConstraints)
03446 m_mdInitDualVarLowerBoundsDense[j]
03447 = this->optimization->constraints->initialDualValues->con[i]->lbDualValue;
03448 else
03449 throw ErrorClass("Constraint index out of range");
03450 }
03451 return m_mdInitDualVarLowerBoundsDense;
03452 }
03453 }
03454 }
03455 }
03456 catch(const ErrorClass& eclass)
03457 { throw ErrorClass(eclass.errormsg);
03458 }
03459 return NULL;
03460 }
03461
03467 double* OSOption::getInitDualVarUpperBoundsDense()
03468 { try
03469 { int numberOfConstraints;
03470 numberOfConstraints = this->getNumberOfConstraints();
03471 if (numberOfConstraints < 0)
03472 throw ErrorClass("\"numberOfConstraints\" must be present to use dense methods");
03473
03474 if (this->optimization != NULL)
03475 { if (this->optimization->constraints != NULL)
03476 { if (this->optimization->constraints->initialDualValues != NULL)
03477 { int i,j,k;
03478 int num_con;
03479 num_con = this->getNumberOfInitDualVarValues();
03480 numberOfConstraints = this->getNumberOfConstraints();
03481
03482 if (m_mdInitDualVarUpperBoundsDense != NULL)
03483 delete [] m_mdInitDualVarUpperBoundsDense;
03484 m_mdInitDualVarUpperBoundsDense = new double[numberOfConstraints];
03485 for (k = 0; k < numberOfConstraints; k++) m_mdInitDualVarUpperBoundsDense[k] = 0.0;
03486
03487 for (i = 0; i < num_con; i++)
03488 { j = this->optimization->constraints->initialDualValues->con[i]->idx;
03489 if (j >= 0 && j < numberOfConstraints)
03490 m_mdInitDualVarUpperBoundsDense[j]
03491 = this->optimization->constraints->initialDualValues->con[i]->ubDualValue;
03492 else
03493 throw ErrorClass("Constraint index out of range");
03494 }
03495 return m_mdInitDualVarUpperBoundsDense;
03496 }
03497 }
03498 }
03499 }
03500 catch(const ErrorClass& eclass)
03501 { throw ErrorClass(eclass.errormsg);
03502 }
03503 return NULL;
03504 }
03505
03512 double* OSOption::getInitDualVarUpperBoundsDense(int numberOfConstraints)
03513 { try
03514 { if (numberOfConstraints < 0)
03515 throw ErrorClass("\"numberOfConstraints\" must be present to use dense methods");
03516
03517 if (this->optimization != NULL)
03518 { if (this->optimization->constraints != NULL)
03519 { if (this->optimization->constraints->initialDualValues != NULL)
03520 { int i,j,k;
03521 int num_con;
03522 num_con = this->getNumberOfInitDualVarValues();
03523 numberOfConstraints = this->getNumberOfConstraints();
03524
03525 if (m_mdInitDualVarUpperBoundsDense != NULL)
03526 delete [] m_mdInitDualVarUpperBoundsDense;
03527 m_mdInitDualVarUpperBoundsDense = new double[numberOfConstraints];
03528 for (k = 0; k < numberOfConstraints; k++) m_mdInitDualVarUpperBoundsDense[k] = 0.0;
03529
03530 for (i = 0; i < num_con; i++)
03531 { j = this->optimization->constraints->initialDualValues->con[i]->idx;
03532 if (j >= 0 && j < numberOfConstraints)
03533 m_mdInitDualVarUpperBoundsDense[j]
03534 = this->optimization->constraints->initialDualValues->con[i]->ubDualValue;
03535 else
03536 throw ErrorClass("Constraint index out of range");
03537 }
03538 return m_mdInitDualVarUpperBoundsDense;
03539 }
03540 }
03541 }
03542 }
03543 catch(const ErrorClass& eclass)
03544 { throw ErrorClass(eclass.errormsg);
03545 }
03546 return NULL;
03547 }
03548
03554 std::vector<OtherConstraintOption*> OSOption::getOtherConstraintOptions( std::string solver_name)
03555 { std::vector<OtherConstraintOption*> optionsVector;
03556 if (this->optimization != NULL)
03557 { if (this->optimization->constraints != NULL)
03558 { int i;
03559 int num_options;
03560 num_options = this->getNumberOfOtherConstraintOptions();
03561 for(i = 0; i < num_options; i++)
03562 if (solver_name == this->optimization->constraints->other[ i]->solver)
03563 optionsVector.push_back( this->optimization->constraints->other[ i]);
03564 }
03565 else
03566 throw ErrorClass("<constraints> object must be defined before getting the data");
03567 }
03568 else
03569 throw ErrorClass("<optimization> object must be defined before getting the data");
03570 return optionsVector;
03571 }
03572
03577 OtherConstraintOption** OSOption::getAllOtherConstraintOptions()
03578 { OtherConstraintOption** optionsVector;
03579 if (this->optimization != NULL)
03580 { if (this->optimization->constraints != NULL)
03581 optionsVector = this->optimization->constraints->other;
03582 else
03583 throw ErrorClass("<constraints> object must be defined before getting the data");
03584 }
03585 else
03586 throw ErrorClass("<optimization> object must be defined before getting the data");
03587 return optionsVector;
03588 }
03589
03590
03596 std::vector<SolverOption*> OSOption::getSolverOptions( std::string solver_name)
03597 { std::vector<SolverOption*> optionsVector;
03598 if (this->optimization != NULL)
03599 { if (this->optimization->solverOptions != NULL)
03600 { int i;
03601 int num_options;
03602 num_options = this->getNumberOfSolverOptions();
03603 for(i = 0; i < num_options; i++)
03604 if (solver_name == this->optimization->solverOptions->solverOption[ i]->solver)
03605 optionsVector.push_back( this->optimization->solverOptions->solverOption[ i]);
03606 }
03607 else
03608 throw ErrorClass("<solverOptions> object must be defined before getting the data");
03609 }
03610 else
03611 throw ErrorClass("<optimization> object must be defined before getting the data");
03612 return optionsVector;
03613 }
03614
03619 SolverOption** OSOption::getAllSolverOptions()
03620 { SolverOption** optionsVector;
03621 if (this->optimization != NULL)
03622 { if (this->optimization->solverOptions != NULL)
03623 optionsVector = this->optimization->solverOptions->solverOption;
03624 else
03625 throw ErrorClass("<solverOptions> object must be defined before getting the data");
03626 }
03627 else
03628 throw ErrorClass("<optimization> object must be defined before getting the data");
03629 return optionsVector;
03630 }
03631
03632
03633
03640
03641
03642
03643
03644
03645
03649 bool OtherOptions::setOther(int numberOfOptions, OtherOption** other)
03650 { try
03651 { if (this->other != NULL)
03652 throw ErrorClass( "otherOptions array previously used.");
03653
03654 if (numberOfOptions < 0)
03655 throw ErrorClass( "length of otherOptions array cannot be negative.");
03656
03657 this->numberOfOtherOptions = numberOfOptions;
03658 if (numberOfOptions == 0)
03659 return true;
03660
03661 this->other = new OtherOption*[numberOfOptions];
03662
03663 int i;
03664 for (i = 0; i < numberOfOptions; i++)
03665 { this->other[i] = new OtherOption();
03666 *this->other[i] = *other[i];
03667 }
03668 return true;
03669 }
03670 catch(const ErrorClass& eclass)
03671 { cout << eclass.errormsg << endl;
03672 return false;
03673 }
03674 }
03675
03679 bool OtherOptions::addOther(std::string name, std::string value, std::string description)
03680 { try
03681 { int nopt; int i;
03682 if (name.empty() )
03683 throw ErrorClass( "the name of an option cannot be empty." );
03684
03685 if (this->other == NULL)
03686 nopt = 0;
03687 else
03688 nopt = this->numberOfOtherOptions;
03689
03690 OtherOption** temp = new OtherOption*[nopt+1];
03691 for (i = 0; i < nopt; i++)
03692 temp[i] = this->other[i];
03693
03694 delete[] this->other;
03695
03696
03697 temp[ nopt] = new OtherOption();
03698
03699 temp[ nopt]->name = name;
03700 temp[ nopt]->value = value;
03701 temp[ nopt]->description = description;
03702
03703 this->other = temp;
03704 this->numberOfOtherOptions = ++nopt;
03705
03706 return true;
03707 }
03708
03709 catch(const ErrorClass& eclass)
03710 { cout << eclass.errormsg << endl;
03711 return false;
03712 }
03713 }
03714
03715
03721 bool JobDependencies::setJobID(int numberOfJobIDs, std::string *jobID)
03722 { try
03723 { if (this->jobID != NULL)
03724 throw ErrorClass( "jobID array previously used.");
03725
03726 if (numberOfJobIDs < 0)
03727 throw ErrorClass( "length of jobID array cannot be negative.");
03728
03729 this->numberOfJobIDs = numberOfJobIDs;
03730 if (numberOfJobIDs == 0)
03731 return true;
03732
03733 this->jobID = new std::string[numberOfJobIDs];
03734 int i;
03735 for (i = 0; i < numberOfJobIDs; i++)
03736 this->jobID[i] = jobID[i];
03737
03738 return true;
03739 }
03740 catch(const ErrorClass& eclass)
03741 { cout << eclass.errormsg << endl;
03742 return false;
03743 }
03744 }
03745
03751 bool JobDependencies::addJobID(std::string jobID)
03752 { try
03753 { int nopt;
03754 if (jobID.empty() )
03755 throw ErrorClass( "the name of a jobID cannot be empty." );
03756
03757 if (this->jobID == NULL)
03758 nopt = 0;
03759 else
03760 nopt = this->numberOfJobIDs;
03761
03762 std::string* temp = new std::string[nopt+1];
03763 int i;
03764 for (i = 0; i < nopt; i++)
03765 temp[i] = this->jobID[i];
03766
03767 delete[] this->jobID;
03768
03769 temp[nopt] = jobID;
03770
03771 this->jobID = temp;
03772 this->numberOfJobIDs = ++nopt;
03773 return true;
03774 }
03775
03776 catch(const ErrorClass& eclass)
03777 { cout << eclass.errormsg << endl;
03778 return false;
03779 }
03780 }
03781
03788 bool DirectoriesAndFiles::setPath(int numberOfPaths, std::string *path)
03789 { try
03790 { if (this->path != NULL)
03791 throw ErrorClass( "path array previously used.");
03792
03793 if (numberOfPaths < 0)
03794 throw ErrorClass( "length of path array cannot be negative.");
03795
03796 this->numberOfPaths = numberOfPaths;
03797 if (numberOfPaths == 0)
03798 return true;
03799
03800 this->path = new std::string[numberOfPaths];
03801 int i;
03802 for (i = 0; i < numberOfPaths; i++)
03803 this->path[i] = path[i];
03804
03805 return true;
03806 }
03807 catch(const ErrorClass& eclass)
03808 { cout << eclass.errormsg << endl;
03809 return false;
03810 }
03811 }
03812
03818 bool DirectoriesAndFiles::addPath(std::string path)
03819 { try
03820 { int nopt;
03821 if (path.empty() )
03822 throw ErrorClass( "the path cannot be empty." );
03823
03824 if (this->path == NULL)
03825 nopt = 0;
03826 else
03827 nopt = this->numberOfPaths;
03828
03829 std::string* temp = new std::string[nopt+1];
03830 int i;
03831 for (i = 0; i < nopt; i++)
03832 temp[i] = this->path[i];
03833
03834 delete[] this->path;
03835
03836 temp[nopt] = path;
03837
03838 this->path = temp;
03839 this->numberOfPaths = ++nopt;
03840 return true;
03841 }
03842
03843 catch(const ErrorClass& eclass)
03844 { cout << eclass.errormsg << endl;
03845 return false;
03846 }
03847 }
03848
03849
03856 bool PathPairs::setPathPair(int numberOfPathPairs, PathPair **pathPair)
03857 { try
03858 { if (this->pathPair != NULL)
03859 throw ErrorClass( "pathPair array previously used.");
03860
03861 if (numberOfPathPairs < 0)
03862 throw ErrorClass( "length of pathPair array cannot be negative.");
03863
03864 this->numberOfPathPairs = numberOfPathPairs;
03865 if (numberOfPathPairs == 0)
03866 return true;
03867
03868 this->pathPair = new PathPair*[numberOfPathPairs];
03869
03870 int i;
03871 for (i = 0; i < numberOfPathPairs; i++)
03872 { this->pathPair[i] = new PathPair();
03873 *this->pathPair[i] = *pathPair[i];
03874 }
03875 return true;
03876 }
03877 catch(const ErrorClass& eclass)
03878 { cout << eclass.errormsg << endl;
03879 return false;
03880 }
03881 }
03882
03883
03891 bool PathPairs::addPathPair(std::string fromPath, std::string toPath, bool makeCopy)
03892 { try
03893 { int nopt; int i;
03894 if (fromPath.empty() )
03895 throw ErrorClass( "the \"from\" path cannot be empty." );
03896 if (toPath.empty() )
03897 throw ErrorClass( "the \"to\" path cannot be empty." );
03898
03899 if (this->pathPair == NULL)
03900 nopt = 0;
03901 else
03902 nopt = this->numberOfPathPairs;
03903
03904 PathPair** temp = new PathPair*[nopt+1];
03905 for (i = 0; i < nopt; i++)
03906 temp[i] = this->pathPair[i];
03907
03908 delete[] this->pathPair;
03909
03910
03911 temp[ nopt] = new PathPair();
03912
03913 temp[ nopt]->from = fromPath;
03914 temp[ nopt]->to = toPath;
03915 temp[ nopt]->makeCopy = makeCopy;
03916
03917 this->pathPair = temp;
03918 this->numberOfPathPairs = ++nopt;
03919
03920 return true;
03921 }
03922
03923 catch(const ErrorClass& eclass)
03924 { cout << eclass.errormsg << endl;
03925 return false;
03926 }
03927 }
03928
03935 bool Processes::setProcess(int numberOfProcesses, std::string *process)
03936 { try
03937 { if (this->process != NULL)
03938 throw ErrorClass( "process array previously used.");
03939
03940 if (numberOfProcesses < 0)
03941 throw ErrorClass( "length of process array cannot be negative.");
03942
03943 this->numberOfProcesses= numberOfProcesses;
03944 if (numberOfProcesses == 0)
03945 return true;
03946
03947 this->process = new std::string[numberOfProcesses];
03948 int i;
03949 for (i = 0; i < numberOfProcesses; i++)
03950 this->process[i] = process[i];
03951
03952 return true;
03953 }
03954 catch(const ErrorClass& eclass)
03955 { cout << eclass.errormsg << endl;
03956 return false;
03957 }
03958 }
03959
03965 bool Processes::addProcess(std::string process)
03966 { try
03967 { int nopt;
03968 if (process.empty() )
03969 throw ErrorClass( "the name of a process cannot be empty." );
03970
03971 if (this->process == NULL)
03972 nopt = 0;
03973 else
03974 nopt = this->numberOfProcesses;
03975
03976 std::string* temp = new std::string[nopt+1];
03977 int i;
03978 for (i = 0; i < nopt; i++)
03979 temp[i] = this->process[i];
03980
03981 delete[] this->process;
03982
03983 temp[nopt] = process;
03984
03985 this->process = temp;
03986 this->numberOfProcesses = ++nopt;
03987 return true;
03988 }
03989 catch(const ErrorClass& eclass)
03990 { cout << eclass.errormsg << endl;
03991 return false;
03992 }
03993 }
03994
04001 bool InitVariableValues::setVar(int numberOfVar, InitVarValue **var)
04002 { try
04003 { if (this->var != NULL)
04004 throw ErrorClass( "InitVarValue array previously used.");
04005
04006 if (numberOfVar < 0)
04007 throw ErrorClass( "length of var array cannot be negative.");
04008
04009 this->numberOfVar = numberOfVar;
04010 if (numberOfVar == 0)
04011 return true;
04012
04013 this->var = new InitVarValue*[numberOfVar];
04014
04015 int i;
04016 for (i = 0; i < numberOfVar; i++)
04017 { this->var[i] = new InitVarValue();
04018 *this->var[i] = *var[i];
04019 }
04020 return true;
04021 }
04022 catch(const ErrorClass& eclass)
04023 { cout << eclass.errormsg << endl;
04024 return false;
04025 }
04026 }
04027
04034 bool InitVariableValues::addVar(int idx, double value)
04035 { try
04036 { int nopt; int i;
04037 if (idx < 0)
04038 throw ErrorClass( "the index of a variable cannot be negative." );
04039
04040 if (this->var == NULL)
04041 nopt = 0;
04042 else
04043 nopt = this->numberOfVar;
04044
04045 InitVarValue** temp = new InitVarValue*[nopt+1];
04046 for (i = 0; i < nopt; i++)
04047 temp[i] = this->var[i];
04048
04049 delete[] this->var;
04050
04051
04052 temp[ nopt] = new InitVarValue();
04053
04054 temp[ nopt]->idx = idx;
04055 temp[ nopt]->value = value;
04056
04057 this->var = temp;
04058 this->numberOfVar = ++nopt;
04059
04060 return true;
04061 }
04062
04063 catch(const ErrorClass& eclass)
04064 { cout << eclass.errormsg << endl;
04065 return false;
04066 }
04067 }
04068
04075 bool InitVariableValuesString::setVar(int numberOfVar, InitVarValueString **var)
04076 { try
04077 { if (this->var != NULL)
04078 throw ErrorClass( "InitVarValueString array previously used.");
04079
04080 if (numberOfVar < 0)
04081 throw ErrorClass( "length of var array cannot be negative.");
04082
04083 this->numberOfVar = numberOfVar;
04084 if (numberOfVar == 0)
04085 return true;
04086
04087 this->var = new InitVarValueString*[numberOfVar];
04088
04089 int i;
04090 for (i = 0; i < numberOfVar; i++)
04091 { this->var[i] = new InitVarValueString();
04092 *this->var[i] = *var[i];
04093 }
04094 return true;
04095 }
04096 catch(const ErrorClass& eclass)
04097 { cout << eclass.errormsg << endl;
04098 return false;
04099 }
04100 }
04101
04108 bool InitVariableValuesString::addVar(int idx, std::string value)
04109 { try
04110 { int nopt; int i;
04111 if (idx < 0)
04112 throw ErrorClass( "the index of a variable cannot be negative." );
04113
04114 if (this->var == NULL)
04115 nopt = 0;
04116 else
04117 nopt = this->numberOfVar;
04118
04119 InitVarValueString** temp = new InitVarValueString*[nopt+1];
04120 for (i = 0; i < nopt; i++)
04121 temp[i] = this->var[i];
04122
04123 delete[] this->var;
04124
04125
04126 temp[ nopt] = new InitVarValueString();
04127
04128 temp[ nopt]->idx = idx;
04129 temp[ nopt]->value = value;
04130
04131 this->var = temp;
04132 this->numberOfVar = ++nopt;
04133
04134 return true;
04135 }
04136
04137 catch(const ErrorClass& eclass)
04138 { cout << eclass.errormsg << endl;
04139 return false;
04140 }
04141 }
04142
04149 bool InitialBasisStatus::setVar(int numberOfVar, InitBasStatus **var)
04150 { try
04151 { if (this->var != NULL)
04152 throw ErrorClass( "InitBasStatus array previously used.");
04153
04154 if (numberOfVar < 0)
04155 throw ErrorClass( "length of var array cannot be negative.");
04156
04157 this->numberOfVar = numberOfVar;
04158 if (numberOfVar == 0)
04159 return true;
04160
04161 this->var = new InitBasStatus*[numberOfVar];
04162
04163 int i;
04164 for (i = 0; i < numberOfVar; i++)
04165 { this->var[i] = new InitBasStatus();
04166 *this->var[i] = *var[i];
04167 }
04168 return true;
04169 }
04170 catch(const ErrorClass& eclass)
04171 { cout << eclass.errormsg << endl;
04172 return false;
04173 }
04174 }
04175
04182 bool InitialBasisStatus::addVar(int idx, std::string value)
04183 { try
04184 { int nopt; int i;
04185 if (idx < 0)
04186 throw ErrorClass( "the index of a variable cannot be negative." );
04187 if (value != "atLower" && value != "basic" && value != "unknown" &&
04188 value != "atUpper" && value != "superbasic" )
04189 throw ErrorClass( "Illegal basis status " + value );
04190
04191 if (this->var == NULL)
04192 nopt = 0;
04193 else
04194 nopt = this->numberOfVar;
04195
04196 InitBasStatus** temp = new InitBasStatus*[nopt+1];
04197 for (i = 0; i < nopt; i++)
04198 temp[i] = this->var[i];
04199
04200 delete[] this->var;
04201
04202
04203 temp[ nopt] = new InitBasStatus();
04204
04205 temp[ nopt]->idx = idx;
04206 temp[ nopt]->value = value;
04207
04208 this->var = temp;
04209 this->numberOfVar = ++nopt;
04210
04211 return true;
04212 }
04213
04214 catch(const ErrorClass& eclass)
04215 { cout << eclass.errormsg << endl;
04216 return false;
04217 }
04218 }
04219
04226 bool IntegerVariableBranchingWeights::setVar(int numberOfVar, BranchingWeight **var)
04227 { try
04228 { if (this->var != NULL)
04229 throw ErrorClass( "BranchingWeight array previously used.");
04230
04231 if (numberOfVar < 0)
04232 throw ErrorClass( "length of var array cannot be negative.");
04233
04234 this->numberOfVar = numberOfVar;
04235 if (numberOfVar == 0)
04236 return true;
04237
04238 this->var = new BranchingWeight*[numberOfVar];
04239
04240 int i;
04241 for (i = 0; i < numberOfVar; i++)
04242 { this->var[i] = new BranchingWeight();
04243 *this->var[i] = *var[i];
04244 }
04245 return true;
04246 }
04247 catch(const ErrorClass& eclass)
04248 { cout << eclass.errormsg << endl;
04249 return false;
04250 }
04251 }
04252
04259 bool IntegerVariableBranchingWeights::addVar(int idx, double value)
04260 { try
04261 { int nopt; int i;
04262 if (idx < 0)
04263 throw ErrorClass( "the index of a variable cannot be negative." );
04264
04265 if (this->var == NULL)
04266 nopt = 0;
04267 else
04268 nopt = this->numberOfVar;
04269
04270 BranchingWeight** temp = new BranchingWeight*[nopt+1];
04271 for (i = 0; i < nopt; i++)
04272 temp[i] = this->var[i];
04273
04274 delete[] this->var;
04275
04276
04277 temp[ nopt] = new BranchingWeight();
04278
04279 temp[ nopt]->idx = idx;
04280 temp[ nopt]->value = value;
04281
04282 this->var = temp;
04283 this->numberOfVar = ++nopt;
04284
04285 return true;
04286 }
04287
04288 catch(const ErrorClass& eclass)
04289 { cout << eclass.errormsg << endl;
04290 return false;
04291 }
04292 }
04293
04300 bool SOSWeights::setVar(int numberOfVar, BranchingWeight **var)
04301 { try
04302 { if (this->var != NULL)
04303 throw ErrorClass( "BranchingWeight array previously used.");
04304
04305 if (numberOfVar < 0)
04306 throw ErrorClass( "length of var array cannot be negative.");
04307
04308 this->numberOfVar = numberOfVar;
04309 if (numberOfVar == 0)
04310 return true;
04311
04312 this->var = new BranchingWeight*[numberOfVar];
04313
04314 int i;
04315 for (i = 0; i < numberOfVar; i++)
04316 { this->var[i] = new BranchingWeight();
04317 *this->var[i] = *var[i];
04318 }
04319 return true;
04320 }
04321 catch(const ErrorClass& eclass)
04322 { cout << eclass.errormsg << endl;
04323 return false;
04324 }
04325 }
04326
04333 bool SOSWeights::addVar(int idx, double value)
04334 { try
04335 { int nopt; int i;
04336 if (idx < 0)
04337 throw ErrorClass( "the index of a variable cannot be negative." );
04338
04339 if (this->var == NULL)
04340 nopt = 0;
04341 else
04342 nopt = this->numberOfVar;
04343
04344 BranchingWeight** temp = new BranchingWeight*[nopt+1];
04345 for (i = 0; i < nopt; i++)
04346 temp[i] = this->var[i];
04347
04348 delete[] this->var;
04349
04350
04351 temp[ nopt] = new BranchingWeight();
04352
04353 temp[ nopt]->idx = idx;
04354 temp[ nopt]->value = value;
04355
04356 this->var = temp;
04357 this->numberOfVar = ++nopt;
04358
04359 return true;
04360 }
04361
04362 catch(const ErrorClass& eclass)
04363 { cout << eclass.errormsg << endl;
04364 return false;
04365 }
04366 }
04367
04368
04375 bool SOSVariableBranchingWeights::setSOS(int numberOfSOS, SOSWeights **sos)
04376 { try
04377 { if (this->sos != NULL)
04378 throw ErrorClass( "SOS array previously used.");
04379
04380 if (numberOfSOS < 0)
04381 throw ErrorClass( "length of sos array cannot be negative.");
04382
04383 this->numberOfSOS = numberOfSOS;
04384 if (numberOfSOS == 0) return true;
04385
04386 this->sos = new SOSWeights*[numberOfSOS];
04387
04388 int i, j;
04389 for (i = 0; i < numberOfSOS; i++)
04390 { this->sos[i] = new SOSWeights();
04391 this->sos[i]->sosIdx = sos[i]->sosIdx;
04392 this->sos[i]->groupWeight = sos[i]->groupWeight;
04393
04394 if (sos[i]->numberOfVar < 0)
04395 throw ErrorClass( "the number of variables in the SOS cannot be negative.");
04396
04397 this->sos[i]->numberOfVar = sos[i]->numberOfVar;
04398
04399 if (sos[i]->numberOfVar > 0)
04400 { this->sos[i]->var = new BranchingWeight*[sos[i]->numberOfVar];
04401 for (j = 0; j < sos[i]->numberOfVar; j++)
04402 { this->sos[i]->var[j] = new BranchingWeight();
04403 *this->sos[i]->var[j] = *sos[i]->var[j];
04404 }
04405 }
04406 }
04407 return true;
04408 }
04409 catch(const ErrorClass& eclass)
04410 { cout << eclass.errormsg << endl;
04411 return false;
04412 }
04413 }
04414
04420 bool SOSVariableBranchingWeights::addSOS(int sosIdx, int nvar, double weight, int* idx, double* value)
04421 { try
04422 { int nopt; int i;
04423 if (sosIdx < 0)
04424 throw ErrorClass( "the index of the SOS cannot be negative." );
04425 if (nvar < 0)
04426 throw ErrorClass( "the number of variables in the SOS cannot be negative." );
04427
04428 if (this->sos == NULL)
04429 nopt = 0;
04430 else
04431 nopt = this->numberOfSOS;
04432
04433 SOSWeights** temp = new SOSWeights*[nopt+1];
04434 for (i = 0; i < nopt; i++)
04435 temp[i] = this->sos[i];
04436
04437 delete[] this->sos;
04438
04439
04440 temp[ nopt] = new SOSWeights();
04441
04442 temp[ nopt]->sosIdx = sosIdx;
04443 temp[ nopt]->groupWeight = weight;
04444 temp[ nopt]->numberOfVar = nvar;
04445 temp[ nopt]->var = new BranchingWeight*[nvar];
04446 for (i = 0; i < nvar; i++)
04447 { temp[nopt]->var[i] = new BranchingWeight();
04448 temp[nopt]->var[i]->idx = idx[i];
04449 temp[nopt]->var[i]->value = value[i];
04450 }
04451
04452 this->sos = temp;
04453 this->numberOfSOS = ++nopt;
04454
04455 return true;
04456 }
04457
04458 catch(const ErrorClass& eclass)
04459 { cout << eclass.errormsg << endl;
04460 return false;
04461 }
04462 }
04463
04470 bool OtherVariableOption::setVar(int numberOfVar, OtherVarOption **var)
04471 { try
04472 { if (this->var != NULL)
04473 throw ErrorClass( "OtherVarOption array previously used.");
04474
04475 if (numberOfVar < 0)
04476 throw ErrorClass( "length of <var> array cannot be negative.");
04477
04478 this->numberOfVar = numberOfVar;
04479 if (numberOfVar == 0) return true;
04480
04481 this->var = new OtherVarOption*[numberOfVar];
04482
04483 int i;
04484 for (i = 0; i < numberOfVar; i++)
04485 { this->var[i] = new OtherVarOption();
04486 *this->var[i] = *var[i];
04487 }
04488 return true;
04489 }
04490 catch(const ErrorClass& eclass)
04491 { cout << eclass.errormsg << endl;
04492 return false;
04493 }
04494 }
04495
04496
04505 bool OtherVariableOption::addVar(int idx, std::string value, std::string lbValue, std::string ubValue)
04506 { try
04507 { int nopt; int i;
04508 if (idx < 0)
04509 throw ErrorClass( "the index of a variable cannot be negative." );
04510
04511 if (this->var == NULL)
04512 nopt = 0;
04513 else
04514 nopt = this->numberOfVar;
04515
04516 OtherVarOption** temp = new OtherVarOption*[nopt+1];
04517 for (i = 0; i < nopt; i++)
04518 temp[i] = this->var[i];
04519
04520 delete[] this->var;
04521
04522
04523 temp[ nopt] = new OtherVarOption();
04524
04525 temp[ nopt]->idx = idx;
04526 temp[ nopt]->value = value;
04527 temp[ nopt]->lbValue = lbValue;
04528 temp[ nopt]->ubValue = ubValue;
04529
04530 this->var = temp;
04531 this->numberOfVar = ++nopt;
04532
04533 return true;
04534 }
04535
04536 catch(const ErrorClass& eclass)
04537 { cout << eclass.errormsg << endl;
04538 return false;
04539 }
04540 }
04541
04548 bool VariableOption::setOther(int numberOfOptions, OtherVariableOption **other)
04549 { try
04550 { if (this->other != NULL)
04551 throw ErrorClass( "otherVariableOptions array previously used.");
04552
04553 if (numberOfOptions < 0)
04554 throw ErrorClass( "length of <other> array cannot be negative.");
04555
04556 this->numberOfOtherVariableOptions = numberOfOptions;
04557 if (numberOfOptions == 0) return true;
04558
04559 this->other = new OtherVariableOption*[numberOfOptions];
04560
04561 int i, j;
04562 for (i = 0; i < numberOfOptions; i++)
04563 { this->other[i] = new OtherVariableOption();
04564 this->other[i]->name = other[i]->name;
04565 this->other[i]->value = other[i]->value;
04566 this->other[i]->solver = other[i]->solver;
04567 this->other[i]->category = other[i]->category;
04568 this->other[i]->type = other[i]->type;
04569 this->other[i]->description = other[i]->description;
04570
04571 if (other[i]->numberOfVar < 0)
04572 throw ErrorClass( "the number of variables in otherVariableOption cannot be negative.");
04573
04574 this->other[i]->numberOfVar = other[i]->numberOfVar;
04575
04576 if (other[i]->numberOfVar > 0)
04577 {
04578 this->other[i]->var = new OtherVarOption*[other[i]->numberOfVar];
04579 for (j = 0; j < other[i]->numberOfVar; j++)
04580 { this->other[i]->var[j] = new OtherVarOption();
04581 *this->other[i]->var[j] = *other[i]->var[j];
04582 }
04583 }
04584 }
04585 return true;
04586 }
04587 catch(const ErrorClass& eclass)
04588 { cout << eclass.errormsg << endl;
04589 return false;
04590 }
04591 }
04592
04598 bool VariableOption::addOther(OtherVariableOption *other)
04599 { try
04600 { int nopt, i, j;
04601 if (this->other == NULL)
04602 nopt = 0;
04603 else
04604 nopt = this->numberOfOtherVariableOptions;
04605
04606 OtherVariableOption** temp = new OtherVariableOption*[nopt+1];
04607 for (i = 0; i < nopt; i++)
04608 temp[i] = this->other[i];
04609
04610 delete[] this->other;
04611
04612
04613 temp[ nopt] = new OtherVariableOption();
04614 temp[ nopt]->name = other->name;
04615 temp[ nopt]->value = other->value;
04616 temp[ nopt]->solver = other->solver;
04617 temp[ nopt]->category = other->category;
04618 temp[ nopt]->type = other->type;
04619 temp[ nopt]->description = other->description;
04620
04621 if (other->numberOfVar < 0)
04622 throw ErrorClass( "the number of variables in otherVariableOption cannot be negative.");
04623
04624 temp[ nopt]->numberOfVar = other->numberOfVar;
04625
04626 if (other->numberOfVar > 0)
04627 {
04628 temp[ nopt]->var = new OtherVarOption*[other->numberOfVar];
04629 for (j = 0; j < other->numberOfVar; j++)
04630 { temp[ nopt]->var[j] = new OtherVarOption();
04631 *temp[ nopt]->var[j] = *other->var[j];
04632 }
04633 }
04634
04635 this->other = temp;
04636 this->numberOfOtherVariableOptions = ++nopt;
04637
04638 return true;
04639 }
04640
04641 catch(const ErrorClass& eclass)
04642 { cout << eclass.errormsg << endl;
04643 return false;
04644 }
04645 }
04646
04653 bool InitObjectiveValues::setObj(int numberOfObj, InitObjValue **obj)
04654 { try
04655 { if (this->obj != NULL)
04656 throw ErrorClass( "InitObjValue array previously used.");
04657
04658 if (numberOfObj < 0)
04659 throw ErrorClass( "length of obj array cannot be negative.");
04660
04661 this->numberOfObj = numberOfObj;
04662 if (numberOfObj == 0)
04663 return true;
04664
04665 this->obj = new InitObjValue*[numberOfObj];
04666
04667 int i;
04668 for (i = 0; i < numberOfObj; i++)
04669 { this->obj[i] = new InitObjValue();
04670 *this->obj[i] = *obj[i];
04671 }
04672 return true;
04673 }
04674 catch(const ErrorClass& eclass)
04675 { cout << eclass.errormsg << endl;
04676 return false;
04677 }
04678 }
04679
04686 bool InitObjectiveValues::addObj(int idx, double value)
04687 { try
04688 { int nopt; int i;
04689 if (idx >= 0)
04690 throw ErrorClass( "the index of an objective must be negative." );
04691
04692 if (this->obj == NULL)
04693 nopt = 0;
04694 else
04695 nopt = this->numberOfObj;
04696
04697 InitObjValue** temp = new InitObjValue*[nopt+1];
04698 for (i = 0; i < nopt; i++)
04699 temp[i] = this->obj[i];
04700
04701 delete[] this->obj;
04702
04703
04704 temp[ nopt] = new InitObjValue();
04705
04706 temp[ nopt]->idx = idx;
04707 temp[ nopt]->value = value;
04708
04709 this->obj = temp;
04710 this->numberOfObj = ++nopt;
04711
04712 return true;
04713 }
04714
04715 catch(const ErrorClass& eclass)
04716 { cout << eclass.errormsg << endl;
04717 return false;
04718 }
04719 }
04720
04727 bool InitObjectiveBounds::setObj(int numberOfObj, InitObjBound **obj)
04728 { try
04729 { if (this->obj != NULL)
04730 throw ErrorClass( "InitObjBound array previously used.");
04731
04732 if (numberOfObj < 0)
04733 throw ErrorClass( "length of obj array cannot be negative.");
04734
04735 this->numberOfObj = numberOfObj;
04736 if (numberOfObj == 0)
04737 return true;
04738
04739 this->obj = new InitObjBound*[numberOfObj];
04740
04741 int i;
04742 for (i = 0; i < numberOfObj; i++)
04743 { this->obj[i] = new InitObjBound();
04744 *this->obj[i] = *obj[i];
04745 }
04746 return true;
04747 }
04748 catch(const ErrorClass& eclass)
04749 { cout << eclass.errormsg << endl;
04750 return false;
04751 }
04752 }
04753
04754
04762 bool InitObjectiveBounds::addObj(int idx, double lbValue, double ubValue)
04763 { try
04764 { int nopt; int i;
04765 if (idx >= 0)
04766 throw ErrorClass( "the index of an objective must be negative." );
04767
04768 if (this->obj == NULL)
04769 nopt = 0;
04770 else
04771 nopt = this->numberOfObj;
04772
04773 InitObjBound** temp = new InitObjBound*[nopt+1];
04774 for (i = 0; i < nopt; i++)
04775 temp[i] = this->obj[i];
04776
04777 delete[] this->obj;
04778
04779
04780 temp[ nopt] = new InitObjBound();
04781
04782 temp[ nopt]->idx = idx;
04783 temp[ nopt]->lbValue = lbValue;
04784 temp[ nopt]->ubValue = ubValue;
04785
04786 this->obj = temp;
04787 this->numberOfObj = ++nopt;
04788
04789 return true;
04790 }
04791
04792 catch(const ErrorClass& eclass)
04793 { cout << eclass.errormsg << endl;
04794 return false;
04795 }
04796 }
04797
04804 bool OtherObjectiveOption::setObj(int numberOfObj, OtherObjOption **obj)
04805 { try
04806 { if (this->obj != NULL)
04807 throw ErrorClass( "OtherObjOption array previously used.");
04808
04809 if (numberOfObj < 0)
04810 throw ErrorClass( "length of <obj> array cannot be negative.");
04811
04812 this->numberOfObj= numberOfObj;
04813 if (numberOfObj == 0)
04814 return true;
04815
04816 this->obj = new OtherObjOption*[numberOfObj];
04817
04818 int i;
04819 for (i = 0; i < numberOfObj; i++)
04820 { this->obj[i] = new OtherObjOption();
04821 *this->obj[i] = *obj[i];
04822 }
04823 return true;
04824 }
04825 catch(const ErrorClass& eclass)
04826 { cout << eclass.errormsg << endl;
04827 return false;
04828 }
04829 }
04830
04839 bool OtherObjectiveOption::addObj(int idx, std::string value, std::string lbValue, std::string ubValue)
04840 { try
04841 { int nopt; int i;
04842 if (idx >= 0)
04843 throw ErrorClass( "the index of an objective must be negative." );
04844
04845 if (this->obj == NULL)
04846 nopt = 0;
04847 else
04848 nopt = this->numberOfObj;
04849
04850 OtherObjOption** temp = new OtherObjOption*[nopt+1];
04851 for (i = 0; i < nopt; i++)
04852 temp[i] = this->obj[i];
04853
04854 delete[] this->obj;
04855
04856
04857 temp[ nopt] = new OtherObjOption();
04858
04859 temp[ nopt]->idx = idx;
04860 temp[ nopt]->value = value;
04861 temp[ nopt]->lbValue = lbValue;
04862 temp[ nopt]->ubValue = ubValue;
04863
04864 this->obj = temp;
04865 this->numberOfObj = ++nopt;
04866
04867 return true;
04868 }
04869
04870 catch(const ErrorClass& eclass)
04871 { cout << eclass.errormsg << endl;
04872 return false;
04873 }
04874 }
04875
04882 bool ObjectiveOption::setOther(int numberOfOptions, OtherObjectiveOption **other)
04883 { try
04884 { if (this->other != NULL)
04885 throw ErrorClass( "otherObjectiveOptions array previously used.");
04886
04887 if (numberOfOptions < 0)
04888 throw ErrorClass( "length of <other> array cannot be negative.");
04889
04890 this->numberOfOtherObjectiveOptions = numberOfOptions;
04891 if (numberOfOptions == 0) return true;
04892
04893 this->other = new OtherObjectiveOption*[numberOfOptions];
04894
04895 int i, j;
04896 for (i = 0; i < numberOfOptions; i++)
04897 { this->other[i] = new OtherObjectiveOption();
04898 this->other[i]->name = other[i]->name;
04899 this->other[i]->value = other[i]->value;
04900 this->other[i]->solver = other[i]->solver;
04901 this->other[i]->category = other[i]->category;
04902 this->other[i]->type = other[i]->type;
04903 this->other[i]->description = other[i]->description;
04904
04905 if (other[i]->numberOfObj < 0)
04906 throw ErrorClass( "the number of objectives in otherObjectiveOption cannot be negative.");
04907
04908 this->other[i]->numberOfObj = other[i]->numberOfObj;
04909
04910 if (other[i]->numberOfObj > 0)
04911 {
04912 this->other[i]->obj = new OtherObjOption*[other[i]->numberOfObj];
04913 for (j = 0; j < other[i]->numberOfObj; j++)
04914 { this->other[i]->obj[j] = new OtherObjOption();
04915 *this->other[i]->obj[j] = *other[i]->obj[j];
04916 }
04917 }
04918 }
04919 return true;
04920 }
04921 catch(const ErrorClass& eclass)
04922 { cout << eclass.errormsg << endl;
04923 return false;
04924 }
04925 }
04926
04932 bool ObjectiveOption::addOther(OtherObjectiveOption *other)
04933 { try
04934 { int nopt, i, j;
04935 if (this->other == NULL)
04936 nopt = 0;
04937 else
04938 nopt = this->numberOfOtherObjectiveOptions;
04939
04940 OtherObjectiveOption** temp = new OtherObjectiveOption*[nopt+1];
04941 for (i = 0; i < nopt; i++)
04942 temp[i] = this->other[i];
04943
04944 delete[] this->other;
04945
04946
04947 temp[ nopt] = new OtherObjectiveOption();
04948 temp[ nopt]->name = other->name;
04949 temp[ nopt]->value = other->value;
04950 temp[ nopt]->solver = other->solver;
04951 temp[ nopt]->category = other->category;
04952 temp[ nopt]->type = other->type;
04953 temp[ nopt]->description = other->description;
04954
04955 if (other->numberOfObj < 0)
04956 throw ErrorClass( "the number of objectives in otherObjectiveOption cannot be negative.");
04957
04958 temp[ nopt]->numberOfObj = other->numberOfObj;
04959
04960 if (other->numberOfObj > 0)
04961 {
04962 temp[ nopt]->obj = new OtherObjOption*[other->numberOfObj];
04963 for (j = 0; j < other->numberOfObj; j++)
04964 { temp[ nopt]->obj[j] = new OtherObjOption();
04965 *temp[ nopt]->obj[j] = *other->obj[j];
04966 }
04967 }
04968
04969 this->other = temp;
04970 this->numberOfOtherObjectiveOptions = ++nopt;
04971
04972 return true;
04973 }
04974
04975 catch(const ErrorClass& eclass)
04976 { cout << eclass.errormsg << endl;
04977 return false;
04978 }
04979 }
04980
04987 bool InitConstraintValues::setCon(int numberOfCon, InitConValue **con)
04988 { try
04989 { if (this->con != NULL)
04990 throw ErrorClass( "InitConValue array previously used.");
04991
04992 if (numberOfCon < 0)
04993 throw ErrorClass( "length of con array cannot be negative.");
04994
04995 this->numberOfCon = numberOfCon;
04996 if (numberOfCon == 0)
04997 return true;
04998
04999 this->con = new InitConValue*[numberOfCon];
05000
05001 int i;
05002 for (i = 0; i < numberOfCon; i++)
05003 { this->con[i] = new InitConValue();
05004 *this->con[i] = *con[i];
05005 }
05006 return true;
05007 }
05008 catch(const ErrorClass& eclass)
05009 { cout << eclass.errormsg << endl;
05010 return false;
05011 }
05012 }
05013
05020 bool InitConstraintValues::addCon(int idx, double value)
05021 { try
05022 { int nopt; int i;
05023 if (idx < 0)
05024 throw ErrorClass( "the index of a constraint cannot be negative." );
05025
05026 if (this->con == NULL)
05027 nopt = 0;
05028 else
05029 nopt = this->numberOfCon;
05030
05031 InitConValue** temp = new InitConValue*[nopt+1];
05032 for (i = 0; i < nopt; i++)
05033 temp[i] = this->con[i];
05034
05035 delete[] this->con;
05036
05037
05038 temp[ nopt] = new InitConValue();
05039
05040 temp[ nopt]->idx = idx;
05041 temp[ nopt]->value = value;
05042
05043 this->con = temp;
05044 this->numberOfCon = ++nopt;
05045
05046 return true;
05047 }
05048
05049 catch(const ErrorClass& eclass)
05050 { cout << eclass.errormsg << endl;
05051 return false;
05052 }
05053 }
05054
05061 bool InitDualVariableValues::setCon(int numberOfCon, InitDualVarValue **con)
05062 { try
05063 { if (this->con != NULL)
05064 throw ErrorClass( "InitDualVarValue array previously used.");
05065
05066 if (numberOfCon < 0)
05067 throw ErrorClass( "length of con array cannot be negative.");
05068
05069 this->numberOfCon = numberOfCon;
05070 if (numberOfCon == 0)
05071 return true;
05072
05073 this->con = new InitDualVarValue*[numberOfCon];
05074
05075 int i;
05076 for (i = 0; i < numberOfCon; i++)
05077 { this->con[i] = new InitDualVarValue();
05078 *this->con[i] = *con[i];
05079 }
05080 return true;
05081 }
05082 catch(const ErrorClass& eclass)
05083 { cout << eclass.errormsg << endl;
05084 return false;
05085 }
05086 }
05087
05095 bool InitDualVariableValues::addCon(int idx, double lbDualValue, double ubDualValue)
05096 { try
05097 { int nopt; int i;
05098 if (idx < 0)
05099 throw ErrorClass( "the index of a constraint cannot be negative." );
05100
05101 if (this->con == NULL)
05102 nopt = 0;
05103 else
05104 nopt = this->numberOfCon;
05105
05106 InitDualVarValue** temp = new InitDualVarValue*[nopt+1];
05107 for (i = 0; i < nopt; i++)
05108 temp[i] = this->con[i];
05109
05110 delete[] this->con;
05111
05112
05113 temp[ nopt] = new InitDualVarValue();
05114
05115 temp[ nopt]->idx = idx;
05116 temp[ nopt]->lbDualValue = lbDualValue;
05117 temp[ nopt]->ubDualValue = ubDualValue;
05118
05119 this->con = temp;
05120 this->numberOfCon = ++nopt;
05121
05122 return true;
05123 }
05124
05125 catch(const ErrorClass& eclass)
05126 { cout << eclass.errormsg << endl;
05127 return false;
05128 }
05129 }
05130
05137 bool OtherConstraintOption::setCon(int numberOfCon, OtherConOption **con)
05138 { try
05139 { if (this->con != NULL)
05140 throw ErrorClass( "OtherConOption array previously used.");
05141
05142 if (numberOfCon < 0)
05143 throw ErrorClass( "length of <con> array cannot be negative.");
05144
05145 this->numberOfCon = numberOfCon;
05146 if (numberOfCon == 0)
05147 return true;
05148
05149 this->con = new OtherConOption*[numberOfCon];
05150
05151 int i;
05152 for (i = 0; i < numberOfCon; i++)
05153 { this->con[i] = new OtherConOption();
05154 *this->con[i] = *con[i];
05155 }
05156 return true;
05157 }
05158 catch(const ErrorClass& eclass)
05159 { cout << eclass.errormsg << endl;
05160 return false;
05161 }
05162 }
05163
05172 bool OtherConstraintOption::addCon(int idx, std::string value, std::string lbValue, std::string ubValue)
05173 { try
05174 { int nopt; int i;
05175 if (idx < 0)
05176 throw ErrorClass( "the index of a variable cannot be negative." );
05177
05178 if (this->con == NULL)
05179 nopt = 0;
05180 else
05181 nopt = this->numberOfCon;
05182
05183 OtherConOption** temp = new OtherConOption*[nopt+1];
05184 for (i = 0; i < nopt; i++)
05185 temp[i] = this->con[i];
05186
05187 delete[] this->con;
05188
05189
05190 temp[ nopt] = new OtherConOption();
05191
05192 temp[ nopt]->idx = idx;
05193 temp[ nopt]->value = value;
05194 temp[ nopt]->lbValue = lbValue;
05195 temp[ nopt]->ubValue = ubValue;
05196
05197 this->con = temp;
05198 this->numberOfCon = ++nopt;
05199
05200 return true;
05201 }
05202
05203 catch(const ErrorClass& eclass)
05204 { cout << eclass.errormsg << endl;
05205 return false;
05206 }
05207 }
05208
05215 bool ConstraintOption::setOther(int numberOfOptions, OtherConstraintOption **other)
05216 { try
05217 { if (this->other != NULL)
05218 throw ErrorClass( "otherConstraintOptions array previously used.");
05219
05220 if (numberOfOptions < 0)
05221 throw ErrorClass( "length of <other> array cannot be negative.");
05222
05223 this->numberOfOtherConstraintOptions = numberOfOptions;
05224 if (numberOfOptions == 0)
05225 return true;
05226
05227 this->other = new OtherConstraintOption*[numberOfOptions];
05228
05229 int i, j;
05230 for (i = 0; i < numberOfOptions; i++)
05231 { this->other[i] = new OtherConstraintOption();
05232 this->other[i]->name = other[i]->name;
05233 this->other[i]->value = other[i]->value;
05234 this->other[i]->solver = other[i]->solver;
05235 this->other[i]->category = other[i]->category;
05236 this->other[i]->type = other[i]->type;
05237 this->other[i]->description = other[i]->description;
05238
05239 if (other[i]->numberOfCon < 0)
05240 throw ErrorClass( "the number of constraints in otherConstraintOption cannot be negative.");
05241
05242 this->other[i]->numberOfCon = other[i]->numberOfCon;
05243
05244 if (other[i]->numberOfCon > 0)
05245 {
05246 this->other[i]->con = new OtherConOption*[other[i]->numberOfCon];
05247 for (j = 0; j < other[i]->numberOfCon; j++)
05248 { this->other[i]->con[j] = new OtherConOption();
05249 *this->other[i]->con[j] = *other[i]->con[j];
05250 }
05251 }
05252 }
05253 return true;
05254 }
05255 catch(const ErrorClass& eclass)
05256 { cout << eclass.errormsg << endl;
05257 return false;
05258 }
05259 }
05260
05266 bool ConstraintOption::addOther(OtherConstraintOption *other)
05267 { try
05268 { int nopt, i, j;
05269 if (this->other == NULL)
05270 nopt = 0;
05271 else
05272 nopt = this->numberOfOtherConstraintOptions;
05273
05274 OtherConstraintOption** temp = new OtherConstraintOption*[nopt+1];
05275 for (i = 0; i < nopt; i++)
05276 temp[i] = this->other[i];
05277
05278 delete[] this->other;
05279
05280
05281 temp[ nopt] = new OtherConstraintOption();
05282 temp[ nopt]->name = other->name;
05283 temp[ nopt]->value = other->value;
05284 temp[ nopt]->solver = other->solver;
05285 temp[ nopt]->category = other->category;
05286 temp[ nopt]->type = other->type;
05287 temp[ nopt]->description = other->description;
05288
05289 if (other->numberOfCon < 0)
05290 throw ErrorClass( "the number of constraints in otherConstraintOption cannot be negative.");
05291
05292 temp[ nopt]->numberOfCon = other->numberOfCon;
05293
05294 if (other->numberOfCon > 0)
05295 {
05296 temp[ nopt]->con = new OtherConOption*[other->numberOfCon];
05297 for (j = 0; j < other->numberOfCon; j++)
05298 { temp[ nopt]->con[j] = new OtherConOption();
05299 *temp[ nopt]->con[j] = *other->con[j];
05300 }
05301 }
05302
05303 this->other = temp;
05304 this->numberOfOtherConstraintOptions = ++nopt;
05305
05306 return true;
05307 }
05308
05309 catch(const ErrorClass& eclass)
05310 { cout << eclass.errormsg << endl;
05311 return false;
05312 }
05313 }
05314
05321 bool SolverOptions::setSolverOptions(int numberOfOptions, SolverOption **solverOption)
05322 { try
05323 { if (this->solverOption != NULL)
05324 throw ErrorClass( "solverOptions array previously used.");
05325
05326 if (numberOfOptions < 0)
05327 throw ErrorClass( "length of <solverOption> array cannot be negative.");
05328
05329 this->numberOfSolverOptions = numberOfOptions;
05330 if (numberOfOptions == 0)
05331 return true;
05332
05333 this->solverOption = new SolverOption*[numberOfOptions];
05334
05335 int i;
05336 for (i = 0; i < numberOfOptions; i++)
05337 { this->solverOption[i] = new SolverOption();
05338 *this->solverOption[i] = *solverOption[i];
05339 }
05340 return true;
05341 }
05342 catch(const ErrorClass& eclass)
05343 { cout << eclass.errormsg << endl;
05344 return false;
05345 }
05346 }
05347
05358 bool SolverOptions::addSolverOption(std::string name, std::string value, std::string solver,
05359 std::string category, std::string type, std::string description)
05360 { try
05361 { int nopt; int i;
05362 if (name.empty() )
05363 throw ErrorClass( "the name of a solver option cannot be empty." );
05364
05365 if (this->solverOption == NULL)
05366 nopt = 0;
05367 else
05368 nopt = this->numberOfSolverOptions;
05369
05370 SolverOption** temp = new SolverOption*[nopt+1];
05371 for (i = 0; i < nopt; i++)
05372 temp[i] = this->solverOption[i];
05373
05374 delete[] this->solverOption;
05375
05376
05377 temp[ nopt] = new SolverOption();
05378
05379 temp[ nopt]->name = name;
05380 temp[ nopt]->value = value;
05381 temp[ nopt]->solver = solver;
05382 temp[ nopt]->type = type;
05383 temp[ nopt]->category = category;
05384 temp[ nopt]->description = description;
05385
05386 this->solverOption = temp;
05387 this->numberOfSolverOptions = ++nopt;
05388
05389 return true;
05390 }
05391
05392 catch(const ErrorClass& eclass)
05393 { cout << eclass.errormsg << endl;
05394 return false;
05395 }
05396 }
05397
05398
05399
05400
05401
05406 bool OSOption::setServiceURI( std::string serviceURI)
05407 { if (this->general == NULL)
05408 this->general = new GeneralOption();
05409 this->general->serviceURI = serviceURI;
05410 return true;
05411 }
05412
05413 bool OSOption::setServiceName( std::string serviceName)
05414 { if (this->general == NULL)
05415 this->general = new GeneralOption();
05416 this->general->serviceName = serviceName;
05417 return true;
05418 }
05419
05420 bool OSOption::setInstanceName( std::string instanceName)
05421 { if (this->general == NULL)
05422 this->general = new GeneralOption();
05423 this->general->instanceName = instanceName;
05424 return true;
05425 }
05426
05427 bool OSOption::setInstanceLocation( std::string instanceLocation)
05428 { if (this->general == NULL)
05429 this->general = new GeneralOption();
05430 if (this->general->instanceLocation == NULL)
05431 this->general->instanceLocation = new InstanceLocationOption();
05432 this->general->instanceLocation->value = instanceLocation;
05433 return true;
05434 }
05435
05436 bool OSOption::setInstanceLocationType( std::string locationType)
05437 { try
05438 { if (this->general == NULL)
05439 this->general = new GeneralOption();
05440 if (this->general->instanceLocation == NULL)
05441 this->general->instanceLocation = new InstanceLocationOption();
05442
05443 if ((locationType != "local") && (locationType != "http") && (locationType != "ftp"))
05444 throw ErrorClass( "location type not recognized.");
05445
05446 this->general->instanceLocation->locationType = locationType;
05447 return true;
05448 }
05449 catch(const ErrorClass& eclass)
05450 { cout << eclass.errormsg << endl;
05451 return false;
05452 }
05453 }
05454
05455 bool OSOption::setJobID( std::string jobID)
05456 { if (this->general == NULL)
05457 this->general = new GeneralOption();
05458 this->general->jobID = jobID;
05459 return true;
05460 }
05461
05462 bool OSOption::setSolverToInvoke( std::string solverToInvoke)
05463 { if (this->general == NULL)
05464 this->general = new GeneralOption();
05465 this->general->solverToInvoke = solverToInvoke;
05466 return true;
05467 }
05468
05469 bool OSOption::setLicense( std::string license)
05470 { if (this->general == NULL)
05471 this->general = new GeneralOption();
05472 this->general->license = license;
05473 return true;
05474 }
05475
05476 bool OSOption::setUserName( std::string userName)
05477 { if (this->general == NULL)
05478 this->general = new GeneralOption();
05479 this->general->userName = userName;
05480 return true;
05481 }
05482
05483 bool OSOption::setPassword( std::string password)
05484 { if (this->general == NULL)
05485 this->general = new GeneralOption();
05486 this->general->password = password;
05487 return true;
05488 }
05489
05490 bool OSOption::setContact( std::string contact)
05491 { if (this->general == NULL)
05492 this->general = new GeneralOption();
05493 if (this->general->contact == NULL)
05494 this->general->contact = new ContactOption();
05495 this->general->contact->value = contact;
05496 return true;
05497 }
05498
05499 bool OSOption::setContactTransportType( std::string transportType)
05500 { try
05501 { if (this->general == NULL)
05502 this->general = new GeneralOption();
05503 if (this->general->contact == NULL)
05504 this->general->contact = new ContactOption();
05505
05506 if ((transportType != "osp") && (transportType != "http") && (transportType != "smtp") &&
05507 (transportType != "ftp") && (transportType != "other"))
05508 throw ErrorClass( "transport type not recognized.");
05509
05510 this->general->contact->transportType = transportType;
05511 return true;
05512 }
05513 catch(const ErrorClass& eclass)
05514 { cout << eclass.errormsg << endl;
05515 return false;
05516 }
05517 }
05518
05519 bool OSOption::setOtherGeneralOptions(int numberOfOptions, OtherOption** other)
05520 { if (this->general == NULL)
05521 this->general = new GeneralOption();
05522 if (this->general->otherOptions == NULL)
05523 this->general->otherOptions = new OtherOptions();
05524 else
05525 { int i;
05526 for (i = 0; i < this->general->otherOptions->numberOfOtherOptions; i++)
05527 delete this->general->otherOptions->other[i];
05528 delete[] this->general->otherOptions->other;
05529 this->general->otherOptions->other = NULL;
05530 }
05531 return this->general->otherOptions->setOther(numberOfOptions, other);
05532 }
05533
05534 bool OSOption::setAnOtherGeneralOption(std::string name, std::string value, std::string description)
05535 { if (this->general == NULL)
05536 this->general = new GeneralOption();
05537 if (this->general->otherOptions == NULL)
05538 this->general->otherOptions = new OtherOptions();
05539 return this->general->otherOptions->addOther(name, value, description);
05540 }
05541
05542
05543
05548 bool OSOption::setMinDiskSpace(double value)
05549 { if (this->system == NULL)
05550 this->system = new SystemOption();
05551 if (this->system->minDiskSpace == NULL)
05552 this->system->minDiskSpace = new MinDiskSpace();
05553 this->system->minDiskSpace->value = value;
05554 return true;
05555 }
05556
05557 bool OSOption::setMinDiskSpaceUnit(std::string unit)
05558 { try
05559 { if (this->system == NULL)
05560 this->system = new SystemOption();
05561 if (this->system->minDiskSpace == NULL)
05562 this->system->minDiskSpace = new MinDiskSpace();
05563
05564 if ((unit != "petabyte") && (unit != "terabyte") && (unit != "gigabyte") &&
05565 (unit != "megabyte") && (unit != "kilobyte") && (unit != "byte"))
05566 throw ErrorClass( "disk space unit not recognized.");
05567
05568 this->system->minDiskSpace->unit = unit;
05569 return true;
05570 }
05571 catch(const ErrorClass& eclass)
05572 { cout << eclass.errormsg << endl;
05573 return false;
05574 }
05575 }
05576
05577 bool OSOption::setMinMemorySize(double value)
05578 { if (this->system == NULL)
05579 this->system = new SystemOption();
05580 if (this->system->minMemorySize == NULL)
05581 this->system->minMemorySize = new MinMemorySize();
05582 this->system->minMemorySize->value = value;
05583 return true;
05584 }
05585
05586 bool OSOption::setMinMemoryUnit(std::string unit)
05587 { try
05588 { if (this->system == NULL)
05589 this->system = new SystemOption();
05590 if (this->system->minMemorySize == NULL)
05591 this->system->minMemorySize = new MinMemorySize();
05592
05593 if ((unit != "petabyte") && (unit != "terabyte") && (unit != "gigabyte") &&
05594 (unit != "megabyte") && (unit != "kilobyte") && (unit != "byte"))
05595 throw ErrorClass( "memory size unit not recognized.");
05596
05597 this->system->minMemorySize->unit = unit;
05598 return true;
05599 }
05600 catch(const ErrorClass& eclass)
05601 { cout << eclass.errormsg << endl;
05602 return false;
05603 }
05604 }
05605
05606 bool OSOption::setMinCPUSpeed(double value)
05607 { if (this->system == NULL)
05608 this->system = new SystemOption();
05609 if (this->system->minCPUSpeed == NULL)
05610 this->system->minCPUSpeed = new MinCPUSpeed();
05611 this->system->minCPUSpeed->value = value;
05612 return true;
05613 }
05614
05615 bool OSOption::setMinCPUSpeedUnit(std::string unit)
05616 { try
05617 { if (this->system == NULL)
05618 this->system = new SystemOption();
05619 if (this->system->minCPUSpeed == NULL)
05620 this->system->minCPUSpeed = new MinCPUSpeed();
05621
05622 if ((unit != "petaflops") && (unit != "teraflops") && (unit != "gigaflops") &&
05623 (unit != "megaflops") && (unit != "kiloflops") && (unit != "flops") &&
05624 (unit != "petahertz") && (unit != "terahertz") && (unit != "gigahertz") &&
05625 (unit != "megahertz") && (unit != "kilohertz") && (unit != "hertz") )
05626 throw ErrorClass( "CPU speed unit not recognized.");
05627
05628 this->system->minCPUSpeed->unit = unit;
05629 return true;
05630 }
05631 catch(const ErrorClass& eclass)
05632 { cout << eclass.errormsg << endl;
05633 return false;
05634 }
05635 }
05636
05637 bool OSOption::setMinCPUNumber(int number)
05638 { if (this->system == NULL)
05639 this->system = new SystemOption();
05640 this->system->minCPUNumber = number;
05641 return true;
05642 }
05643
05644 bool OSOption::setOtherSystemOptions(int numberOfOptions, OtherOption** other)
05645 { if (this->system == NULL)
05646 this->system = new SystemOption();
05647 if (this->system->otherOptions == NULL)
05648 this->system->otherOptions = new OtherOptions();
05649 else
05650 { int i;
05651 for (i = 0; i < this->system->otherOptions->numberOfOtherOptions; i++)
05652 delete this->system->otherOptions->other[i];
05653 delete[] this->system->otherOptions->other;
05654 this->system->otherOptions->other = NULL;
05655 this->system->otherOptions->numberOfOtherOptions = 0;
05656 }
05657 return this->system->otherOptions->setOther(numberOfOptions, other);
05658 }
05659
05660 bool OSOption::setAnOtherSystemOption(std::string name, std::string value, std::string description)
05661 { if (this->system == NULL)
05662 this->system = new SystemOption();
05663 if (this->system->otherOptions == NULL)
05664 this->system->otherOptions = new OtherOptions();
05665 return this->system->otherOptions->addOther(name, value, description);
05666 }
05667
05668
05673 bool OSOption::setServiceType( std::string serviceType)
05674 { try
05675 { if (this->service == NULL)
05676 this->service = new ServiceOption();
05677
05678 if ((serviceType != "analyzer" ) && (serviceType != "solver" ) &&
05679 (serviceType != "scheduler") && (serviceType != "modeler") &&
05680 (serviceType != "registry" ) && (serviceType != "agent" ) &&
05681 (serviceType != "simulations"))
05682 throw ErrorClass( "service type not recognized.");
05683
05684 this->service->type = serviceType;
05685 return true;
05686 }
05687 catch(const ErrorClass& eclass)
05688 { cout << eclass.errormsg << endl;
05689 return false;
05690 }
05691 }
05692
05693
05694 bool OSOption::setOtherServiceOptions(int numberOfOptions, OtherOption** other)
05695 { if (this->service == NULL)
05696 this->service = new ServiceOption();
05697 if (this->service->otherOptions == NULL)
05698 this->service->otherOptions = new OtherOptions();
05699 else
05700 { int i;
05701 for (i = 0; i < this->service->otherOptions->numberOfOtherOptions; i++)
05702 delete this->service->otherOptions->other[i];
05703 delete[] this->service->otherOptions->other;
05704 this->service->otherOptions->other = NULL;
05705 }
05706 return this->service->otherOptions->setOther(numberOfOptions, other);
05707 }
05708
05709 bool OSOption::setAnOtherServiceOption(std::string name, std::string value, std::string description)
05710 { if (this->service == NULL)
05711 this->service = new ServiceOption();
05712 if (this->service->otherOptions == NULL)
05713 this->service->otherOptions = new OtherOptions();
05714 return this->service->otherOptions->addOther(name, value, description);
05715 }
05716
05721 bool OSOption::setMaxTime(double value)
05722 { if (this->job == NULL)
05723 this->job = new JobOption();
05724 if (this->job->maxTime == NULL)
05725 this->job->maxTime = new MaxTime();
05726 this->job->maxTime->value = value;
05727 return true;
05728 }
05729
05730 bool OSOption::setMaxTimeUnit(std::string unit)
05731 { try
05732 { if (this->job == NULL)
05733 this->job = new JobOption();
05734 if (this->job->maxTime == NULL)
05735 this->job->maxTime = new MaxTime();
05736
05737 if ((unit != "second") && (unit != "minute") && (unit != "hour") &&
05738 (unit != "day") && (unit != "week") && (unit != "month") &&
05739 (unit != "year"))
05740 throw ErrorClass( "time unit not recognized.");
05741
05742 this->job->maxTime->unit = unit;
05743 return true;
05744 }
05745 catch(const ErrorClass& eclass)
05746 { cout << eclass.errormsg << endl;
05747 return false;
05748 }
05749 }
05750
05751 bool OSOption::setRequestedStartTime(std::string time)
05752 { if (this->job == NULL)
05753 this->job = new JobOption();
05754 this->job->requestedStartTime = time;
05755 return true;
05756 }
05757
05758
05759 bool OSOption::setJobDependencies(int numberOfDependencies, std::string* jobDependencies)
05760 { if (this->job == NULL)
05761 this->job = new JobOption();
05762 if (this->job->dependencies == NULL)
05763 this->job->dependencies = new JobDependencies();
05764 else
05765 delete[] this->job->dependencies->jobID;
05766 this->job->dependencies->jobID = NULL;
05767 return this->job->dependencies->setJobID(numberOfDependencies, jobDependencies);
05768 }
05769
05770 bool OSOption::setAnotherJobDependency(std::string jobID)
05771 { if (this->job == NULL)
05772 this->job = new JobOption();
05773 if (this->job->dependencies == NULL)
05774 this->job->dependencies = new JobDependencies();
05775 return this->job->dependencies->addJobID(jobID);
05776 }
05777
05778
05779 bool OSOption::setRequiredDirectories(int numberOfPaths, std::string* paths)
05780 { if (this->job == NULL)
05781 this->job = new JobOption();
05782 if (this->job->requiredDirectories == NULL)
05783 this->job->requiredDirectories = new DirectoriesAndFiles();
05784 else
05785 delete[] this->job->requiredDirectories->path;
05786 this->job->requiredDirectories->path = NULL;
05787 return this->job->requiredDirectories->setPath(numberOfPaths, paths);
05788 }
05789
05790 bool OSOption::setAnotherRequiredDirectory(std::string path)
05791 { if (this->job == NULL)
05792 this->job = new JobOption();
05793 if (this->job->requiredDirectories == NULL)
05794 this->job->requiredDirectories = new DirectoriesAndFiles();
05795 return this->job->requiredDirectories->addPath(path);
05796 }
05797
05798
05799 bool OSOption::setRequiredFiles(int numberOfPaths, std::string* paths)
05800 { if (this->job == NULL)
05801 this->job = new JobOption();
05802 if (this->job->requiredFiles == NULL)
05803 this->job->requiredFiles = new DirectoriesAndFiles();
05804 else
05805 delete[] this->job->requiredFiles->path;
05806 this->job->requiredFiles->path = NULL;
05807 return this->job->requiredFiles->setPath(numberOfPaths, paths);
05808 }
05809
05810 bool OSOption::setAnotherRequiredFile(std::string path)
05811 { if (this->job == NULL)
05812 this->job = new JobOption();
05813 if (this->job->requiredFiles == NULL)
05814 this->job->requiredFiles = new DirectoriesAndFiles();
05815 return this->job->requiredFiles->addPath(path);
05816 }
05817
05818
05819 bool OSOption::setDirectoriesToMake(int numberOfPaths, std::string* paths)
05820 { if (this->job == NULL)
05821 this->job = new JobOption();
05822 if (this->job->directoriesToMake == NULL)
05823 this->job->directoriesToMake = new DirectoriesAndFiles();
05824 else
05825 delete[] this->job->directoriesToMake->path;
05826 this->job->directoriesToMake->path = NULL;
05827 return this->job->directoriesToMake->setPath(numberOfPaths, paths);
05828 }
05829
05830 bool OSOption::setAnotherDirectoryToMake(std::string path)
05831 { if (this->job == NULL)
05832 this->job = new JobOption();
05833 if (this->job->directoriesToMake == NULL)
05834 this->job->directoriesToMake = new DirectoriesAndFiles();
05835 return this->job->directoriesToMake->addPath(path);
05836 }
05837
05838
05839 bool OSOption::setFilesToMake(int numberOfPaths, std::string* paths)
05840 { if (this->job == NULL)
05841 this->job = new JobOption();
05842 if (this->job->filesToMake == NULL)
05843 this->job->filesToMake = new DirectoriesAndFiles();
05844 else
05845 delete[] this->job->filesToMake->path;
05846 this->job->filesToMake->path = NULL;
05847 return this->job->filesToMake->setPath(numberOfPaths, paths);
05848 }
05849
05850 bool OSOption::setAnotherFileToMake(std::string path)
05851 { if (this->job == NULL)
05852 this->job = new JobOption();
05853 if (this->job->filesToMake == NULL)
05854 this->job->filesToMake = new DirectoriesAndFiles();
05855 return this->job->filesToMake->addPath(path);
05856 }
05857
05858
05859 bool OSOption::setInputDirectoriesToMove(int numberOfPathPairs, PathPair** pathPair)
05860 { if (this->job == NULL)
05861 this->job = new JobOption();
05862 if (this->job->inputDirectoriesToMove == NULL)
05863 this->job->inputDirectoriesToMove = new PathPairs();
05864 else
05865 delete[] this->job->inputDirectoriesToMove->pathPair;
05866 this->job->inputDirectoriesToMove->pathPair = NULL;
05867 return this->job->inputDirectoriesToMove->setPathPair(numberOfPathPairs, pathPair);
05868 }
05869
05870 bool OSOption::setAnotherInputDirectoryToMove(std::string fromPath, std::string toPath, bool makeCopy)
05871 { if (this->job == NULL)
05872 this->job = new JobOption();
05873 if (this->job->inputDirectoriesToMove == NULL)
05874 this->job->inputDirectoriesToMove = new PathPairs();
05875 return this->job->inputDirectoriesToMove->addPathPair(fromPath, toPath, makeCopy);
05876 }
05877
05878
05879 bool OSOption::setInputFilesToMove(int numberOfPathPairs, PathPair** pathPair)
05880 { if (this->job == NULL)
05881 this->job = new JobOption();
05882 if (this->job->inputFilesToMove == NULL)
05883 this->job->inputFilesToMove = new PathPairs();
05884 else
05885 delete[] this->job->inputFilesToMove->pathPair;
05886 this->job->inputFilesToMove->pathPair = NULL;
05887 return this->job->inputFilesToMove->setPathPair(numberOfPathPairs, pathPair);
05888 }
05889
05890 bool OSOption::setAnotherInputFileToMove(std::string fromPath, std::string toPath, bool makeCopy)
05891 { if (this->job == NULL)
05892 this->job = new JobOption();
05893 if (this->job->inputFilesToMove == NULL)
05894 this->job->inputFilesToMove = new PathPairs();
05895 return this->job->inputFilesToMove->addPathPair(fromPath, toPath, makeCopy);
05896 }
05897
05898
05899 bool OSOption::setOutputFilesToMove(int numberOfPathPairs, PathPair** pathPair)
05900 { if (this->job == NULL)
05901 this->job = new JobOption();
05902 if (this->job->outputFilesToMove == NULL)
05903 this->job->outputFilesToMove = new PathPairs();
05904 else
05905 delete[] this->job->outputFilesToMove->pathPair;
05906 this->job->outputFilesToMove->pathPair = NULL;
05907 return this->job->outputFilesToMove->setPathPair(numberOfPathPairs, pathPair);
05908 }
05909
05910 bool OSOption::setAnotherOutputFileToMove(std::string fromPath, std::string toPath, bool makeCopy)
05911 { if (this->job == NULL)
05912 this->job = new JobOption();
05913 if (this->job->outputFilesToMove == NULL)
05914 this->job->outputFilesToMove = new PathPairs();
05915 return this->job->outputFilesToMove->addPathPair(fromPath, toPath, makeCopy);
05916 }
05917
05918
05919 bool OSOption::setOutputDirectoriesToMove(int numberOfPathPairs, PathPair** pathPair)
05920 { if (this->job == NULL)
05921 this->job = new JobOption();
05922 if (this->job->outputDirectoriesToMove == NULL)
05923 this->job->outputDirectoriesToMove = new PathPairs();
05924 else
05925 delete[] this->job->outputDirectoriesToMove->pathPair;
05926 this->job->outputDirectoriesToMove->pathPair = NULL;
05927 return this->job->outputDirectoriesToMove->setPathPair(numberOfPathPairs, pathPair);
05928 }
05929
05930 bool OSOption::setAnotherOutputDirectoryToMove(std::string fromPath, std::string toPath, bool makeCopy)
05931 { if (this->job == NULL)
05932 this->job = new JobOption();
05933 if (this->job->outputDirectoriesToMove == NULL)
05934 this->job->outputDirectoriesToMove = new PathPairs();
05935 return this->job->outputDirectoriesToMove->addPathPair(fromPath, toPath, makeCopy);
05936 }
05937
05938
05939 bool OSOption::setFilesToDelete(int numberOfPaths, std::string* paths)
05940 { if (this->job == NULL)
05941 this->job = new JobOption();
05942 if (this->job->filesToDelete == NULL)
05943 this->job->filesToDelete = new DirectoriesAndFiles();
05944 else
05945 delete[] this->job->filesToDelete->path;
05946 this->job->filesToDelete->path = NULL;
05947 return this->job->filesToDelete->setPath(numberOfPaths, paths);
05948 }
05949
05950 bool OSOption::setAnotherFileToDelete(std::string path)
05951 { if (this->job == NULL)
05952 this->job = new JobOption();
05953 if (this->job->filesToDelete == NULL)
05954 this->job->filesToDelete = new DirectoriesAndFiles();
05955 return this->job->filesToDelete->addPath(path);
05956 }
05957
05958
05959 bool OSOption::setDirectoriesToDelete(int numberOfPaths, std::string* paths)
05960 { if (this->job == NULL)
05961 this->job = new JobOption();
05962 if (this->job->directoriesToDelete == NULL)
05963 this->job->directoriesToDelete = new DirectoriesAndFiles();
05964 else
05965 delete[] this->job->directoriesToDelete->path;
05966 this->job->directoriesToDelete->path = NULL;
05967 return this->job->directoriesToDelete->setPath(numberOfPaths, paths);
05968 }
05969
05970 bool OSOption::setAnotherDirectoryToDelete(std::string path)
05971 { if (this->job == NULL)
05972 this->job = new JobOption();
05973 if (this->job->directoriesToDelete == NULL)
05974 this->job->directoriesToDelete = new DirectoriesAndFiles();
05975 return this->job->directoriesToDelete->addPath(path);
05976 }
05977
05978
05979 bool OSOption::setProcessesToKill(int numberOfProcesses, std::string* processes)
05980 { if (this->job == NULL)
05981 this->job = new JobOption();
05982 if (this->job->processesToKill == NULL)
05983 this->job->processesToKill = new Processes();
05984 else
05985 delete[] this->job->processesToKill->process;
05986 this->job->processesToKill->process = NULL;
05987 return this->job->processesToKill->setProcess(numberOfProcesses, processes);
05988 }
05989
05990 bool OSOption::setAnotherProcessToKill(std::string process)
05991 { if (this->job == NULL)
05992 this->job = new JobOption();
05993 if (this->job->processesToKill == NULL)
05994 this->job->processesToKill = new Processes();
05995 return this->job->processesToKill->addProcess(process);
05996 }
05997
05998
05999 bool OSOption::setOtherJobOptions(int numberOfOptions, OtherOption** other)
06000 { if (this->job == NULL)
06001 this->job = new JobOption();
06002 if (this->job->otherOptions == NULL)
06003 this->job->otherOptions = new OtherOptions();
06004 else
06005 { int i;
06006 for (i = 0; i < this->job->otherOptions->numberOfOtherOptions; i++)
06007 delete this->job->otherOptions->other[i];
06008 delete[] this->job->otherOptions->other;
06009 this->job->otherOptions->other = NULL;
06010 }
06011 return this->job->otherOptions->setOther(numberOfOptions, other);
06012 }
06013
06014 bool OSOption::setAnOtherJobOption(std::string name, std::string value, std::string description)
06015 { if (this->job == NULL)
06016 this->job = new JobOption();
06017 if (this->job->otherOptions == NULL)
06018 this->job->otherOptions = new OtherOptions();
06019 return this->job->otherOptions->addOther(name, value, description);
06020 }
06021
06022
06023
06024 bool OSOption::setNumberOfVariables(int numberOfObjects)
06025 { if (this->optimization == NULL)
06026 this->optimization = new OptimizationOption();
06027 this->optimization->numberOfVariables = numberOfObjects;
06028 return true;
06029 }
06030
06031 bool OSOption::setNumberOfObjectives(int numberOfObjects)
06032 { if (this->optimization == NULL)
06033 this->optimization = new OptimizationOption();
06034 this->optimization->numberOfObjectives = numberOfObjects;
06035 return true;
06036 }
06037
06038 bool OSOption::setNumberOfConstraints(int numberOfObjects)
06039 { if (this->optimization == NULL)
06040 this->optimization = new OptimizationOption();
06041 this->optimization->numberOfConstraints = numberOfObjects;
06042 return true;
06043 }
06044
06045
06046 bool OSOption::setInitVarValuesSparse(int numberOfVar, InitVarValue** var)
06047 { if (this->optimization == NULL)
06048 this->optimization = new OptimizationOption();
06049 if (this->optimization->variables == NULL)
06050 this->optimization->variables = new VariableOption();
06051 if (this->optimization->variables->initialVariableValues == NULL)
06052 this->optimization->variables->initialVariableValues = new InitVariableValues();
06053 else
06054 { int i;
06055 for (i = 0; i < this->optimization->variables->initialVariableValues->numberOfVar; i++)
06056 delete this->optimization->variables->initialVariableValues->var[i];
06057 delete[] this->optimization->variables->initialVariableValues->var;
06058 this->optimization->variables->initialVariableValues->var = NULL;
06059 }
06060 return this->optimization->variables->initialVariableValues->setVar(numberOfVar, var);
06061 }
06062
06063 bool OSOption::setInitVarValuesDense(int numberOfVar, double *value)
06064 { if (this->optimization == NULL)
06065 this->optimization = new OptimizationOption();
06066 if (this->optimization->variables == NULL)
06067 this->optimization->variables = new VariableOption();
06068 if (this->optimization->variables->initialVariableValues == NULL)
06069 this->optimization->variables->initialVariableValues = new InitVariableValues();
06070 else
06071 { delete[] this->optimization->variables->initialVariableValues->var;
06072 this->optimization->variables->initialVariableValues->var = NULL;
06073 }
06074
06075 int i;
06076 for (i = 0; i < numberOfVar; i++)
06077 {
06078 if (!CoinIsnan(value[i]))
06079 if (!this->optimization->variables->initialVariableValues->addVar(i, value[i]))
06080 return false;
06081 }
06082 return true;
06083 }
06084
06085 bool OSOption::setAnotherInitVarValue(int idx, double value)
06086 { if (this->optimization == NULL)
06087 this->optimization = new OptimizationOption();
06088 if (this->optimization->variables == NULL)
06089 this->optimization->variables = new VariableOption();
06090 if (this->optimization->variables->initialVariableValues == NULL)
06091 this->optimization->variables->initialVariableValues = new InitVariableValues();
06092 return this->optimization->variables->initialVariableValues->addVar(idx, value);
06093 }
06094
06095
06096 bool OSOption::setInitVarValuesStringSparse(int numberOfVar, InitVarValueString** var)
06097 { if (this->optimization == NULL)
06098 this->optimization = new OptimizationOption();
06099 if (this->optimization->variables == NULL)
06100 this->optimization->variables = new VariableOption();
06101 if (this->optimization->variables->initialVariableValuesString == NULL)
06102 this->optimization->variables->initialVariableValuesString = new InitVariableValuesString();
06103 else
06104 { int i;
06105 for (i = 0; i < this->optimization->variables->initialVariableValuesString->numberOfVar; i++)
06106 delete this->optimization->variables->initialVariableValuesString->var[i];
06107 delete[] this->optimization->variables->initialVariableValuesString->var;
06108 this->optimization->variables->initialVariableValuesString->var = NULL;
06109 }
06110 return this->optimization->variables->initialVariableValuesString->setVar(numberOfVar, var);
06111 }
06112
06113 bool OSOption::setInitVarValuesStringDense(int numberOfVar, std::string *value)
06114 { if (this->optimization == NULL)
06115 this->optimization = new OptimizationOption();
06116 if (this->optimization->variables == NULL)
06117 this->optimization->variables = new VariableOption();
06118 if (this->optimization->variables->initialVariableValuesString == NULL)
06119 this->optimization->variables->initialVariableValuesString = new InitVariableValuesString();
06120 else
06121 { delete[] this->optimization->variables->initialVariableValuesString->var;
06122 this->optimization->variables->initialVariableValuesString->var = NULL;
06123 }
06124 int i;
06125 for (i = 0; i < numberOfVar; i++)
06126 { if (value[i] != "")
06127 if (!this->optimization->variables->initialVariableValuesString->addVar(i, value[i]))
06128 return false;
06129 }
06130 return true;
06131 }
06132
06133 bool OSOption::setAnotherInitVarValueString(int idx, std::string value)
06134 { if (this->optimization == NULL)
06135 this->optimization = new OptimizationOption();
06136 if (this->optimization->variables == NULL)
06137 this->optimization->variables = new VariableOption();
06138 if (this->optimization->variables->initialVariableValuesString == NULL)
06139 this->optimization->variables->initialVariableValuesString = new InitVariableValuesString();
06140 return this->optimization->variables->initialVariableValuesString->addVar(idx, value);
06141 }
06142
06143
06144 bool OSOption::setInitBasisStatusSparse(int numberOfVar, InitBasStatus** var)
06145 { if (this->optimization == NULL)
06146 this->optimization = new OptimizationOption();
06147 if (this->optimization->variables == NULL)
06148 this->optimization->variables = new VariableOption();
06149 if (this->optimization->variables->initialBasisStatus == NULL)
06150 this->optimization->variables->initialBasisStatus = new InitialBasisStatus();
06151 else
06152 { int i;
06153 for (i = 0; i < this->optimization->variables->initialBasisStatus->numberOfVar; i++)
06154 delete this->optimization->variables->initialBasisStatus->var[i];
06155 delete[] this->optimization->variables->initialBasisStatus->var;
06156 this->optimization->variables->initialBasisStatus->var = NULL;
06157 }
06158 return this->optimization->variables->initialBasisStatus->setVar(numberOfVar, var);
06159 }
06160
06161 bool OSOption::setInitBasisStatusDense(int numberOfVar, std::string *value)
06162 { if (this->optimization == NULL)
06163 this->optimization = new OptimizationOption();
06164 if (this->optimization->variables == NULL)
06165 this->optimization->variables = new VariableOption();
06166 if (this->optimization->variables->initialBasisStatus == NULL)
06167 this->optimization->variables->initialBasisStatus = new InitialBasisStatus();
06168 else
06169 { delete[] this->optimization->variables->initialBasisStatus->var;
06170 this->optimization->variables->initialBasisStatus->var = NULL;
06171 }
06172 int i;
06173 for (i = 0; i < numberOfVar; i++)
06174 { if ((value[i] == "superbasic") || (value[i] == "atLower") || (value[i] == "basic")
06175 || (value[i] == "atUpper") || (value[i] == "unknown"))
06176 if (!this->optimization->variables->initialBasisStatus->addVar(i, value[i]))
06177 return false;
06178 }
06179 return true;
06180 }
06181
06182 bool OSOption::setAnotherInitBasisStatus(int idx, std::string value)
06183 { if (this->optimization == NULL)
06184 this->optimization = new OptimizationOption();
06185 if (this->optimization->variables == NULL)
06186 this->optimization->variables = new VariableOption();
06187 if (this->optimization->variables->initialBasisStatus == NULL)
06188 this->optimization->variables->initialBasisStatus = new InitialBasisStatus();
06189 return this->optimization->variables->initialBasisStatus->addVar(idx, value);
06190 }
06191
06192
06193 bool OSOption::setIntegerVariableBranchingWeightsSparse(int numberOfVar, BranchingWeight** var)
06194 { if (this->optimization == NULL)
06195 this->optimization = new OptimizationOption();
06196 if (this->optimization->variables == NULL)
06197 this->optimization->variables = new VariableOption();
06198 if (this->optimization->variables->integerVariableBranchingWeights == NULL)
06199 this->optimization->variables->integerVariableBranchingWeights = new IntegerVariableBranchingWeights();
06200 else
06201 { int i;
06202 for (i = 0; i < this->optimization->variables->integerVariableBranchingWeights->numberOfVar; i++)
06203 delete this->optimization->variables->integerVariableBranchingWeights->var[i];
06204 delete[] this->optimization->variables->integerVariableBranchingWeights->var;
06205 this->optimization->variables->integerVariableBranchingWeights->var = NULL;
06206 }
06207 return this->optimization->variables->integerVariableBranchingWeights->setVar(numberOfVar, var);
06208 }
06209
06210 bool OSOption::setIntegerVariableBranchingWeightsDense(int numberOfVar, double *value)
06211 { if (this->optimization == NULL)
06212 this->optimization = new OptimizationOption();
06213 if (this->optimization->variables == NULL)
06214 this->optimization->variables = new VariableOption();
06215 if (this->optimization->variables->integerVariableBranchingWeights == NULL)
06216 this->optimization->variables->integerVariableBranchingWeights = new IntegerVariableBranchingWeights();
06217 else
06218 { delete[] this->optimization->variables->integerVariableBranchingWeights->var;
06219 this->optimization->variables->integerVariableBranchingWeights->var = NULL;
06220 }
06221 int i;
06222 for (i = 0; i < numberOfVar; i++)
06223 { if (!CoinIsnan(value[i]))
06224 if (!this->optimization->variables->integerVariableBranchingWeights->addVar(i, value[i]))
06225 return false;
06226 }
06227 return true;
06228 }
06229
06230 bool OSOption::setAnotherIntegerVariableBranchingWeight(int idx, double value)
06231 { if (this->optimization == NULL)
06232 this->optimization = new OptimizationOption();
06233 if (this->optimization->variables == NULL)
06234 this->optimization->variables = new VariableOption();
06235 if (this->optimization->variables->integerVariableBranchingWeights == NULL)
06236 this->optimization->variables->integerVariableBranchingWeights = new IntegerVariableBranchingWeights();
06237 return this->optimization->variables->integerVariableBranchingWeights->addVar(idx, value);
06238 }
06239
06240
06241 bool OSOption::setSOSVariableBranchingWeights(int numberOfSOS, SOSWeights** sos)
06242 { if (this->optimization == NULL)
06243 this->optimization = new OptimizationOption();
06244 if (this->optimization->variables == NULL)
06245 this->optimization->variables = new VariableOption();
06246 if (this->optimization->variables->sosVariableBranchingWeights == NULL)
06247 this->optimization->variables->sosVariableBranchingWeights = new SOSVariableBranchingWeights();
06248 else
06249 { int i;
06250 for (i = 0; i < this->optimization->variables->sosVariableBranchingWeights->numberOfSOS; i++)
06251 delete this->optimization->variables->sosVariableBranchingWeights->sos[i];
06252 delete[] this->optimization->variables->sosVariableBranchingWeights->sos;
06253 this->optimization->variables->sosVariableBranchingWeights->sos = NULL;
06254 }
06255 return this->optimization->variables->sosVariableBranchingWeights->setSOS(numberOfSOS, sos);
06256 }
06257
06258 bool OSOption::setAnotherSOSVariableBranchingWeight(int sosIdx, int nvar, double weight, int* idx, double* value)
06259 { if (this->optimization == NULL)
06260 this->optimization = new OptimizationOption();
06261 if (this->optimization->variables == NULL)
06262 this->optimization->variables = new VariableOption();
06263 if (this->optimization->variables->sosVariableBranchingWeights == NULL)
06264 this->optimization->variables->sosVariableBranchingWeights = new SOSVariableBranchingWeights();
06265 return this->optimization->variables->sosVariableBranchingWeights->addSOS(sosIdx, nvar, weight, idx, value);
06266 }
06267
06268
06269 bool OSOption::setOtherVariableOptions(int numberOfOptions, OtherVariableOption** other)
06270 { if (this->optimization == NULL)
06271 this->optimization = new OptimizationOption();
06272 if (this->optimization->variables == NULL)
06273 this->optimization->variables = new VariableOption();
06274 else
06275 { int i;
06276 for (i = 0; i < this->optimization->variables->numberOfOtherVariableOptions; i++)
06277 delete this->optimization->variables->other[i];
06278 delete[] this->optimization->variables->other;
06279 this->optimization->variables->other = NULL;
06280 }
06281 return this->optimization->variables->setOther(numberOfOptions, other);
06282 }
06283
06284 bool OSOption::setAnOtherVariableOption(OtherVariableOption* optionValue)
06285 { if (this->optimization == NULL)
06286 this->optimization = new OptimizationOption();
06287 if (this->optimization->variables == NULL)
06288 this->optimization->variables = new VariableOption();
06289 return this->optimization->variables->addOther(optionValue);
06290 }
06291
06292
06293 bool OSOption::setInitObjValuesSparse(int numberOfObj, InitObjValue** obj)
06294 { if (this->optimization == NULL)
06295 this->optimization = new OptimizationOption();
06296 if (this->optimization->objectives == NULL)
06297 this->optimization->objectives = new ObjectiveOption();
06298 if (this->optimization->objectives->initialObjectiveValues == NULL)
06299 this->optimization->objectives->initialObjectiveValues = new InitObjectiveValues();
06300 else
06301 { int i;
06302 for (i = 0; i < this->optimization->objectives->initialObjectiveValues->numberOfObj; i++)
06303 delete this->optimization->objectives->initialObjectiveValues->obj[i];
06304 delete[] this->optimization->objectives->initialObjectiveValues->obj;
06305 this->optimization->objectives->initialObjectiveValues->obj = NULL;
06306 }
06307 return this->optimization->objectives->initialObjectiveValues->setObj(numberOfObj, obj);
06308 }
06309
06310 bool OSOption::setInitObjValuesDense(int numberOfObj, double *value)
06311 { if (this->optimization == NULL)
06312 this->optimization = new OptimizationOption();
06313 if (this->optimization->objectives == NULL)
06314 this->optimization->objectives = new ObjectiveOption();
06315 if (this->optimization->objectives->initialObjectiveValues == NULL)
06316 this->optimization->objectives->initialObjectiveValues = new InitObjectiveValues();
06317 else
06318 { delete[] this->optimization->objectives->initialObjectiveValues->obj;
06319 this->optimization->objectives->initialObjectiveValues->obj = NULL;
06320 }
06321 int i;
06322 for (i = 0; i < numberOfObj; i++)
06323 { if (!CoinIsnan(value[i]))
06324 if (!this->optimization->objectives->initialObjectiveValues->addObj(-1-i, value[i]))
06325 return false;
06326 }
06327 return true;
06328 }
06329
06330 bool OSOption::setAnotherInitObjValue(int idx, double value)
06331 { if (this->optimization == NULL)
06332 this->optimization = new OptimizationOption();
06333 if (this->optimization->objectives == NULL)
06334 this->optimization->objectives = new ObjectiveOption();
06335 if (this->optimization->objectives->initialObjectiveValues == NULL)
06336 this->optimization->objectives->initialObjectiveValues = new InitObjectiveValues();
06337 return this->optimization->objectives->initialObjectiveValues->addObj(idx, value);
06338 }
06339
06340
06341 bool OSOption::setInitObjBoundsSparse(int numberOfObj, InitObjBound** obj)
06342 { if (this->optimization == NULL)
06343 this->optimization = new OptimizationOption();
06344 if (this->optimization->objectives == NULL)
06345 this->optimization->objectives = new ObjectiveOption();
06346 if (this->optimization->objectives->initialObjectiveBounds == NULL)
06347 this->optimization->objectives->initialObjectiveBounds = new InitObjectiveBounds();
06348 else
06349 { int i;
06350 for (i = 0; i < this->optimization->objectives->initialObjectiveBounds->numberOfObj; i++)
06351 delete this->optimization->objectives->initialObjectiveBounds->obj[i];
06352 delete[] this->optimization->objectives->initialObjectiveBounds->obj;
06353 this->optimization->objectives->initialObjectiveBounds->obj = NULL;
06354 }
06355 return this->optimization->objectives->initialObjectiveBounds->setObj(numberOfObj, obj);
06356 }
06357
06358 bool OSOption::setInitObjBoundsDense(int numberOfObj, double* lb, double* ub)
06359 { if (this->optimization == NULL)
06360 this->optimization = new OptimizationOption();
06361 if (this->optimization->objectives == NULL)
06362 this->optimization->objectives = new ObjectiveOption();
06363 if (this->optimization->objectives->initialObjectiveBounds == NULL)
06364 this->optimization->objectives->initialObjectiveBounds = new InitObjectiveBounds();
06365 else
06366 { delete[] this->optimization->objectives->initialObjectiveBounds->obj;
06367 this->optimization->objectives->initialObjectiveBounds->obj = NULL;
06368 }
06369 int i;
06370 for (i = 0; i < numberOfObj; i++)
06371 { if (!this->optimization->objectives->initialObjectiveBounds->addObj(-1-i, lb[i], ub[i]))
06372 return false;
06373 }
06374 return true;
06375 }
06376
06377 bool OSOption::setAnotherInitObjBound(int idx, double lb, double ub)
06378 { if (this->optimization == NULL)
06379 this->optimization = new OptimizationOption();
06380 if (this->optimization->objectives == NULL)
06381 this->optimization->objectives = new ObjectiveOption();
06382 if (this->optimization->objectives->initialObjectiveBounds == NULL)
06383 this->optimization->objectives->initialObjectiveBounds = new InitObjectiveBounds();
06384 return this->optimization->objectives->initialObjectiveBounds->addObj(idx, lb, ub);
06385 }
06386
06387
06388 bool OSOption::setOtherObjectiveOptions(int numberOfOptions, OtherObjectiveOption** other)
06389 { if (this->optimization == NULL)
06390 this->optimization = new OptimizationOption();
06391 if (this->optimization->objectives == NULL)
06392 this->optimization->objectives = new ObjectiveOption();
06393 else
06394 { int i;
06395 for (i = 0; i < this->optimization->objectives->numberOfOtherObjectiveOptions; i++)
06396 delete this->optimization->objectives->other[i];
06397 delete[] this->optimization->objectives->other;
06398 this->optimization->objectives->other = NULL;
06399 }
06400 return this->optimization->objectives->setOther(numberOfOptions, other);
06401 }
06402
06403 bool OSOption::setAnOtherObjectiveOption(OtherObjectiveOption* optionValue)
06404 { if (this->optimization == NULL)
06405 this->optimization = new OptimizationOption();
06406 if (this->optimization->objectives == NULL)
06407 this->optimization->objectives = new ObjectiveOption();
06408 return this->optimization->objectives->addOther(optionValue);
06409 }
06410
06411
06412 bool OSOption::setInitConValuesSparse(int numberOfCon, InitConValue** con)
06413 { if (this->optimization == NULL)
06414 this->optimization = new OptimizationOption();
06415 if (this->optimization->constraints == NULL)
06416 this->optimization->constraints = new ConstraintOption();
06417 if (this->optimization->constraints->initialConstraintValues == NULL)
06418 this->optimization->constraints->initialConstraintValues = new InitConstraintValues();
06419 else
06420 { int i;
06421 for (i = 0; i < this->optimization->constraints->initialConstraintValues->numberOfCon; i++)
06422 delete this->optimization->constraints->initialConstraintValues->con[i];
06423 delete[] this->optimization->constraints->initialConstraintValues->con;
06424 this->optimization->constraints->initialConstraintValues->con = NULL;
06425 }
06426 return this->optimization->constraints->initialConstraintValues->setCon(numberOfCon, con);
06427 }
06428
06429 bool OSOption::setInitConValuesDense(int numberOfCon, double *value)
06430 { if (this->optimization == NULL)
06431 this->optimization = new OptimizationOption();
06432 if (this->optimization->constraints == NULL)
06433 this->optimization->constraints = new ConstraintOption();
06434 if (this->optimization->constraints->initialConstraintValues == NULL)
06435 this->optimization->constraints->initialConstraintValues = new InitConstraintValues();
06436 else
06437 { delete[] this->optimization->constraints->initialConstraintValues->con;
06438 this->optimization->constraints->initialConstraintValues->con = NULL;
06439 }
06440 int i;
06441 for (i = 0; i < numberOfCon; i++)
06442 { if (!CoinIsnan(value[i]))
06443 if (!this->optimization->constraints->initialConstraintValues->addCon(i, value[i]))
06444 return false;
06445 }
06446 return true;
06447 }
06448
06449 bool OSOption::setAnotherInitConValue(int idx, double value)
06450 { if (this->optimization == NULL)
06451 this->optimization = new OptimizationOption();
06452 if (this->optimization->constraints == NULL)
06453 this->optimization->constraints = new ConstraintOption();
06454 if (this->optimization->constraints->initialConstraintValues == NULL)
06455 this->optimization->constraints->initialConstraintValues = new InitConstraintValues();
06456 return this->optimization->constraints->initialConstraintValues->addCon(idx, value);
06457 }
06458
06459
06460 bool OSOption::setInitDualVarValuesSparse(int numberOfCon, InitDualVarValue** con)
06461 { if (this->optimization == NULL)
06462 this->optimization = new OptimizationOption();
06463 if (this->optimization->constraints == NULL)
06464 this->optimization->constraints = new ConstraintOption();
06465 if (this->optimization->constraints->initialDualValues == NULL)
06466 this->optimization->constraints->initialDualValues = new InitDualVariableValues();
06467 else
06468 { int i;
06469 for (i = 0; i < this->optimization->constraints->initialDualValues->numberOfCon; i++)
06470 delete this->optimization->constraints->initialDualValues->con[i];
06471 delete[] this->optimization->constraints->initialDualValues->con;
06472 this->optimization->constraints->initialDualValues->con = NULL;
06473 }
06474 return this->optimization->constraints->initialDualValues->setCon(numberOfCon, con);
06475 }
06476
06477 bool OSOption::setInitDualVarValuesDense(int numberOfCon, double* lb, double* ub)
06478 { if (this->optimization == NULL)
06479 this->optimization = new OptimizationOption();
06480 if (this->optimization->constraints == NULL)
06481 this->optimization->constraints = new ConstraintOption();
06482 if (this->optimization->constraints->initialDualValues == NULL)
06483 this->optimization->constraints->initialDualValues = new InitDualVariableValues();
06484 else
06485 { delete[] this->optimization->constraints->initialDualValues->con;
06486 this->optimization->constraints->initialDualValues->con = NULL;
06487 }
06488 int i;
06489 for (i = 0; i < numberOfCon; i++)
06490 { if ((lb[i] != 0.0) || (ub[i] != 0.0))
06491 if (!this->optimization->constraints->initialDualValues->addCon(i, lb[i], ub[i]))
06492 return false;
06493 }
06494 return true;
06495 }
06496
06497 bool OSOption::setAnotherInitDualVarValue(int idx, double lbValue, double ubValue)
06498 { if (this->optimization == NULL)
06499 this->optimization = new OptimizationOption();
06500 if (this->optimization->constraints == NULL)
06501 this->optimization->constraints = new ConstraintOption();
06502 if (this->optimization->constraints->initialDualValues == NULL)
06503 this->optimization->constraints->initialDualValues = new InitDualVariableValues();
06504 return this->optimization->constraints->initialDualValues->addCon(idx, lbValue, ubValue);
06505 }
06506
06507
06508 bool OSOption::setOtherConstraintOptions(int numberOfOptions, OtherConstraintOption** other)
06509 { if (this->optimization == NULL)
06510 this->optimization = new OptimizationOption();
06511 if (this->optimization->constraints == NULL)
06512 this->optimization->constraints = new ConstraintOption();
06513 else
06514 { int i;
06515 for (i = 0; i < this->optimization->constraints->numberOfOtherConstraintOptions; i++)
06516 delete this->optimization->constraints->other[i];
06517 delete[] this->optimization->constraints->other;
06518 this->optimization->constraints->other = NULL;
06519 }
06520 return this->optimization->constraints->setOther(numberOfOptions, other);
06521 }
06522
06523 bool OSOption::setAnOtherConstraintOption(OtherConstraintOption* optionValue)
06524 { if (this->optimization == NULL)
06525 this->optimization = new OptimizationOption();
06526 if (this->optimization->constraints == NULL)
06527 this->optimization->constraints = new ConstraintOption();
06528 return this->optimization->constraints->addOther(optionValue);
06529 }
06530
06531
06532 bool OSOption::setSolverOptions(int numberOfSolverOptions, SolverOption** solverOption)
06533 { if (this->optimization == NULL)
06534 this->optimization = new OptimizationOption();
06535 if (this->optimization->solverOptions == NULL)
06536 this->optimization->solverOptions = new SolverOptions();
06537 else
06538 { int i;
06539 for (i = 0; i < this->optimization->solverOptions->numberOfSolverOptions; i++)
06540 delete this->optimization->solverOptions->solverOption[i];
06541 delete[] this->optimization->solverOptions->solverOption;
06542 this->optimization->solverOptions->solverOption = NULL;
06543 }
06544 return this->optimization->solverOptions->setSolverOptions(numberOfSolverOptions, solverOption);
06545 }
06546
06547 bool OSOption::setAnotherSolverOption(std::string name, std::string value, std::string solver,
06548 std::string category, std::string type, std::string description)
06549 { if (this->optimization == NULL)
06550 this->optimization = new OptimizationOption();
06551 if (this->optimization->solverOptions == NULL)
06552 this->optimization->solverOptions = new SolverOptions();
06553 return this->optimization->solverOptions->addSolverOption(name, value, solver, category, type, description);
06554 }
06555
06556
06557 bool OSOption::setOptionStr(std::string optionName, std::string optionValue)
06558 { if (optionName == "serviceURI")
06559 return this->setServiceURI(optionValue);
06560
06561 if (optionName == "serviceName")
06562 return this->setServiceName(optionValue);
06563
06564 if (optionName == "instanceName")
06565 return this->setInstanceName(optionValue);
06566
06567 if (optionName == "instanceLocation")
06568 return this->setInstanceLocation(optionValue);
06569
06570 if (optionName == "locationType")
06571 return this->setInstanceLocationType(optionValue);
06572
06573 if (optionName == "jobID")
06574 return this->setJobID(optionValue);
06575
06576 if (optionName == "solverName")
06577 return this->setSolverToInvoke(optionValue);
06578
06579 if (optionName == "solverToInvoke")
06580 return this->setSolverToInvoke(optionValue);
06581
06582 if (optionName == "license")
06583 return this->setLicense(optionValue);
06584
06585 if (optionName == "userName")
06586 return this->setUserName(optionValue);
06587
06588 if (optionName == "password")
06589 return this->setPassword(optionValue);
06590
06591 if (optionName == "contact")
06592 return this->setContact(optionValue);
06593
06594 if (optionName == "transportType")
06595 return this->setContactTransportType(optionValue);
06596
06597 if (optionName == "minDiskSpaceUnit")
06598 return this->setMinDiskSpaceUnit(optionValue);
06599
06600 if (optionName == "minMemoryUnit")
06601 return this->setMinMemoryUnit(optionValue);
06602
06603 if (optionName == "minCPUSpeedUnit")
06604 return this->setMinCPUSpeedUnit(optionValue);
06605
06606 if (optionName == "serviceType")
06607 return this->setServiceType(optionValue);
06608
06609 if (optionName == "maxTimeUnit")
06610 return this->setMaxTimeUnit(optionValue);
06611
06612 if (optionName == "requestedStartTime")
06613 return this->setRequestedStartTime(optionValue);
06614
06615 return false;
06616 }
06617
06618
06619 bool OSOption::setOptionInt(std::string optionName, int optionValue)
06620 { if (optionName == "minCPUNumber")
06621 return this->setMinCPUNumber(optionValue);
06622
06623 return false;
06624 }
06625
06626
06627 bool OSOption::setOptionDbl(std::string optionName, double value)
06628 { if (optionName == "minDiskSpace")
06629 return this->setMinDiskSpace(value);
06630
06631 if (optionName == "minMemory")
06632 return this->setMinMemorySize(value);
06633
06634 if (optionName == "minCPUSpeed")
06635 return this->setMinCPUSpeed(value);
06636
06637 if (optionName == "maxTime")
06638 return this->setMaxTime(value);
06639
06640 return false;
06641 }
06642
06643
06644
06645
06646
06647 bool OSOption::IsEqual(OSOption *that)
06648 {
06649 #ifdef DEBUG_OSOPTION
06650 cout << "Start comparing in OSOption" << endl;
06651 #endif
06652 if (this == NULL)
06653 { if (that == NULL)
06654 return true;
06655 else
06656 {
06657 #ifdef DEBUG_OSOPTION
06658 cout << "First object is NULL, second is not" << endl;
06659 #endif
06660 return false;
06661 }
06662 }
06663 else
06664 { if (that == NULL)
06665 {
06666 #ifdef DEBUG_OSOPTION
06667 cout << "Second object is NULL, first is not" << endl;
06668 #endif
06669 return false;
06670 }
06671 else
06672 { if (!this->general->IsEqual(that->general))
06673 return false;
06674 if (!this->system->IsEqual(that->system))
06675 return false;
06676 if (!this->service->IsEqual(that->service))
06677 return false;
06678 if (!this->job->IsEqual(that->job))
06679 return false;
06680 if (!this->optimization->IsEqual(that->optimization))
06681 return false;
06682 return true;
06683 }
06684 }
06685 }
06686
06687
06688 bool GeneralOption::IsEqual(GeneralOption *that)
06689 {
06690 #ifdef DEBUG_OSOPTION
06691 cout << "Start comparing in GeneralOption" << endl;
06692 #endif
06693 if (this == NULL)
06694 { if (that == NULL)
06695 return true;
06696 else
06697 {
06698 #ifdef DEBUG_OSOPTION
06699 cout << "First object is NULL, second is not" << endl;
06700 #endif
06701 return false;
06702 }
06703 }
06704 else
06705 { if (that == NULL)
06706 {
06707 #ifdef DEBUG_OSOPTION
06708 cout << "Second object is NULL, first is not" << endl;
06709 #endif
06710 return false;
06711 }
06712 else
06713 { bool same;
06714 same = (this->serviceURI == that->serviceURI);
06715 same = ((this->serviceName == that->serviceName ) && same);
06716 same = ((this->instanceName == that->instanceName ) && same);
06717 same = ((this->jobID == that->jobID ) && same);
06718 same = ((this->solverToInvoke == that->solverToInvoke) && same);
06719 same = ((this->license == that->license ) && same);
06720 same = ((this->userName == that->userName ) && same);
06721 same = ((this->password == that->password ) && same);
06722 if (!same)
06723 {
06724 #ifdef DEBUG_OSOPTION
06725 cout << "serviceURI: " << this->serviceURI << " vs. " << that->serviceURI << endl;
06726 cout << "serviceName: " << this->serviceName << " vs. " << that->serviceName << endl;
06727 cout << "instanceName: " << this->instanceName << " vs. " << that->instanceName << endl;
06728 cout << "jobID: " << this->jobID << " vs. " << that->jobID << endl;
06729 cout << "solverToInvoke:" << this->solverToInvoke << " vs. " << that->solverToInvoke << endl;
06730 cout << "license: " << this->license << " vs. " << that->license << endl;
06731 cout << "userName: " << this->userName << " vs. " << that->userName << endl;
06732 cout << "password: " << this->password << " vs. " << that->password << endl;
06733 #endif
06734 return false;
06735 }
06736 if (!this->instanceLocation->IsEqual(that->instanceLocation))
06737 return false;
06738 if (!this->contact->IsEqual(that->contact))
06739 return false;
06740 if (!this->otherOptions->IsEqual(that->otherOptions))
06741 return false;
06742 return true;
06743 }
06744 }
06745 }
06746
06747
06748 bool SystemOption::IsEqual(SystemOption *that)
06749 {
06750 #ifdef DEBUG_OSOPTION
06751 cout << "Start comparing in SystemOption" << endl;
06752 #endif
06753 if (this == NULL)
06754 { if (that == NULL)
06755 return true;
06756 else
06757 {
06758 #ifdef DEBUG_OSOPTION
06759 cout << "First object is NULL, second is not" << endl;
06760 #endif
06761 return false;
06762 }
06763 }
06764 else
06765 { if (that == NULL)
06766 {
06767 #ifdef DEBUG_OSOPTION
06768 cout << "Second object is NULL, first is not" << endl;
06769 #endif
06770 return false;
06771 }
06772 else
06773 { if (this->minCPUNumber != that->minCPUNumber)
06774 {
06775 #ifdef DEBUG_OSOPTION
06776 cout << "minCPUNumber: " << this->minCPUNumber << " vs. " << that->minCPUNumber << endl;
06777 #endif
06778 return false;
06779 }
06780
06781 if (!this->minDiskSpace->IsEqual(that->minDiskSpace))
06782 return false;
06783 if (!this->minMemorySize->IsEqual(that->minMemorySize))
06784 return false;
06785 if (!this->minCPUSpeed->IsEqual(that->minCPUSpeed))
06786 return false;
06787 if (!this->otherOptions->IsEqual(that->otherOptions))
06788 return false;
06789 return true;
06790 }
06791 }
06792 }
06793
06794
06795 bool ServiceOption::IsEqual(ServiceOption *that)
06796 {
06797 #ifdef DEBUG_OSOPTION
06798 cout << "Start comparing in ServiceOption" << endl;
06799 #endif
06800 if (this == NULL)
06801 { if (that == NULL)
06802 return true;
06803 else
06804 {
06805 #ifdef DEBUG_OSOPTION
06806 cout << "First object is NULL, second is not" << endl;
06807 #endif
06808 return false;
06809 }
06810 }
06811 else
06812 { if (that == NULL)
06813 {
06814 #ifdef DEBUG_OSOPTION
06815 cout << "Second object is NULL, first is not" << endl;
06816 #endif
06817 return false;
06818 }
06819 else
06820 { if (this->type != that->type)
06821 {
06822 #ifdef DEBUG_OSOPTION
06823 cout << "service type: " << this->type << " vs. " << that->type << endl;
06824 #endif
06825 return false;
06826 }
06827
06828 if (!this->otherOptions->IsEqual(that->otherOptions))
06829 return false;
06830 return true;
06831 }
06832 }
06833 }
06834
06835
06836 bool JobOption::IsEqual(JobOption *that)
06837 {
06838 #ifdef DEBUG_OSOPTION
06839 cout << "Start comparing in JobOption" << endl;
06840 #endif
06841 if (this == NULL)
06842 { if (that == NULL)
06843 return true;
06844 else
06845 {
06846 #ifdef DEBUG_OSOPTION
06847 cout << "First object is NULL, second is not" << endl;
06848 #endif
06849 return false;
06850 }
06851 }
06852 else
06853 { if (that == NULL)
06854 {
06855 #ifdef DEBUG_OSOPTION
06856 cout << "Second object is NULL, first is not" << endl;
06857 #endif
06858 return false;
06859 }
06860 else
06861 { if (this->requestedStartTime != that->requestedStartTime)
06862 {
06863 #ifdef DEBUG_OSOPTION
06864 cout << "requestedStartTime: " << this->requestedStartTime << " vs. " << that->requestedStartTime << endl;
06865 #endif
06866 return false;
06867 }
06868
06869 if (!this->maxTime->IsEqual(that->maxTime))
06870 return false;
06871 if (!this->dependencies->IsEqual(that->dependencies))
06872 return false;
06873 if (!this->requiredDirectories->IsEqual(that->requiredDirectories))
06874 return false;
06875 if (!this->requiredFiles->IsEqual(that->requiredFiles))
06876 return false;
06877 if (!this->directoriesToMake->IsEqual(that->directoriesToMake))
06878 return false;
06879 if (!this->filesToMake->IsEqual(that->filesToMake))
06880 return false;
06881 if (!this->inputDirectoriesToMove->IsEqual(that->inputDirectoriesToMove))
06882 return false;
06883 if (!this->inputFilesToMove->IsEqual(that->inputFilesToMove))
06884 return false;
06885 if (!this->outputFilesToMove->IsEqual(that->outputFilesToMove))
06886 return false;
06887 if (!this->outputDirectoriesToMove->IsEqual(that->outputDirectoriesToMove))
06888 return false;
06889 if (!this->filesToDelete->IsEqual(that->filesToDelete))
06890 return false;
06891 if (!this->otherOptions->IsEqual(that->otherOptions))
06892 return false;
06893 if (!this->otherOptions->IsEqual(that->otherOptions))
06894 return false;
06895 if (!this->otherOptions->IsEqual(that->otherOptions))
06896 return false;
06897 if (!this->otherOptions->IsEqual(that->otherOptions))
06898 return false;
06899 return true;
06900 }
06901 }
06902 }
06903
06904 bool OptimizationOption::IsEqual(OptimizationOption *that)
06905 {
06906 #ifdef DEBUG_OSOPTION
06907 cout << "Start comparing in OptimizationOption" << endl;
06908 #endif
06909 if (this == NULL)
06910 { if (that == NULL)
06911 return true;
06912 else
06913 {
06914 #ifdef DEBUG_OSOPTION
06915 cout << "First object is NULL, second is not" << endl;
06916 #endif
06917 return false;
06918 }
06919 }
06920 else
06921 { if (that == NULL)
06922 {
06923 #ifdef DEBUG_OSOPTION
06924 cout << "Second object is NULL, first is not" << endl;
06925 #endif
06926 return false;
06927 }
06928 else
06929 { if ((this->numberOfVariables != that->numberOfVariables) &&
06930 (this->numberOfVariables * that->numberOfVariables) != 0)
06931 {
06932 #ifdef DEBUG_OSOPTION
06933 cout << "numberOfVariables: "
06934 << this->numberOfVariables << " vs. " << that->numberOfVariables << endl;
06935 #endif
06936 return false;
06937 }
06938 if ((this->numberOfObjectives != that->numberOfObjectives) &&
06939 (this->numberOfObjectives * that->numberOfObjectives) != 0)
06940 {
06941 #ifdef DEBUG_OSOPTION
06942 cout << "numberOfObjectives: "
06943 << this->numberOfObjectives << " vs. " << that->numberOfObjectives << endl;
06944 #endif
06945 return false;
06946 }
06947 if ((this->numberOfConstraints != that->numberOfConstraints) &&
06948 (this->numberOfConstraints * that->numberOfConstraints) != 0)
06949 {
06950 #ifdef DEBUG_OSOPTION
06951 cout << "numberOfConstraints: "
06952 << this->numberOfConstraints << " vs. " << that->numberOfConstraints << endl;
06953 #endif
06954 return false;
06955 }
06956
06957 if (!this->variables->IsEqual(that->variables))
06958 return false;
06959 if (!this->objectives->IsEqual(that->objectives))
06960 return false;
06961 if (!this->constraints->IsEqual(that->constraints))
06962 return false;
06963 if (!this->solverOptions->IsEqual(that->solverOptions))
06964 return false;
06965 return true;
06966 }
06967 }
06968 }
06969
06970 bool InstanceLocationOption::IsEqual(InstanceLocationOption *that)
06971 {
06972 #ifdef DEBUG_OSOPTION
06973 cout << "Start comparing in InstanceLocationOption" << endl;
06974 #endif
06975 if (this == NULL)
06976 { if (that == NULL)
06977 return true;
06978 else
06979 {
06980 #ifdef DEBUG_OSOPTION
06981 cout << "First object is NULL, second is not" << endl;
06982 #endif
06983 return false;
06984 }
06985 }
06986 else
06987 { if (that == NULL)
06988 {
06989 #ifdef DEBUG_OSOPTION
06990 cout << "Second object is NULL, first is not" << endl;
06991 #endif
06992 return false;
06993 }
06994 else
06995 { if ((this->locationType != that->locationType) || (this->value != that->value))
06996 {
06997 #ifdef DEBUG_OSOPTION
06998 cout << "location type: " << this->locationType << " vs. " << that->locationType << endl;
06999 cout << "value: " << this->value << " vs. " << that->value << endl;
07000 #endif
07001 return false;
07002 }
07003 return true;
07004 }
07005 }
07006 }
07007
07008 bool ContactOption::IsEqual(ContactOption *that)
07009 {
07010 #ifdef DEBUG_OSOPTION
07011 cout << "Start comparing in ContactOption" << endl;
07012 #endif
07013 if (this == NULL)
07014 { if (that == NULL)
07015 return true;
07016 else
07017 {
07018 #ifdef DEBUG_OSOPTION
07019 cout << "First object is NULL, second is not" << endl;
07020 #endif
07021 return false;
07022 }
07023 }
07024 else
07025 { if (that == NULL)
07026 {
07027 #ifdef DEBUG_OSOPTION
07028 cout << "Second object is NULL, first is not" << endl;
07029 #endif
07030 return false;
07031 }
07032 else
07033 { if ((this->transportType != that->transportType) || (this->value != that->value))
07034 {
07035 #ifdef DEBUG_OSOPTION
07036 cout << "transport type: " << this->transportType << " vs. " << that->transportType << endl;
07037 cout << "value: " << this->value << " vs. " << that->value << endl;
07038 #endif
07039 return false;
07040 }
07041 return true;
07042 }
07043 }
07044 }
07045
07046 bool OtherOptions::IsEqual(OtherOptions *that)
07047 {
07048 #ifdef DEBUG_OSOPTION
07049 cout << "Start comparing in OtherOptions" << endl;
07050 #endif
07051 if (this == NULL)
07052 { if (that == NULL)
07053 return true;
07054 else
07055 {
07056 #ifdef DEBUG_OSOPTION
07057 cout << "First object is NULL, second is not" << endl;
07058 #endif
07059 return false;
07060 }
07061 }
07062 else
07063 { if (that == NULL)
07064 {
07065 #ifdef DEBUG_OSOPTION
07066 cout << "Second object is NULL, first is not" << endl;
07067 #endif
07068 return false;
07069 }
07070 else
07071 { if (this->numberOfOtherOptions != that->numberOfOtherOptions)
07072 {
07073 #ifdef DEBUG_OSOPTION
07074 cout << "numberOfOtherOptions: " << this->numberOfOtherOptions << " vs. " << that->numberOfOtherOptions << endl;
07075 #endif
07076 return false;
07077 }
07078 int i;
07079 for (i = 0; i < this->numberOfOtherOptions; i++)
07080 if (!this->other[i]->IsEqual(that->other[i]))
07081 return false;
07082 return true;
07083 }
07084 }
07085 }
07086
07087
07088 bool OtherOption::IsEqual(OtherOption *that)
07089 {
07090 #ifdef DEBUG_OSOPTION
07091 cout << "Start comparing in OtherOption" << endl;
07092 #endif
07093 if (this == NULL)
07094 { if (that == NULL)
07095 return true;
07096 else
07097 {
07098 #ifdef DEBUG_OSOPTION
07099 cout << "First object is NULL, second is not" << endl;
07100 #endif
07101 return false;
07102 }
07103 }
07104 else
07105 { if (that == NULL)
07106 {
07107 #ifdef DEBUG_OSOPTION
07108 cout << "Second object is NULL, first is not" << endl;
07109 #endif
07110 return false;
07111 }
07112 else
07113 { if ((this->name != that->name) ||
07114 (this->value != that->value) ||
07115 (this->description != that->description) )
07116 {
07117 #ifdef DEBUG_OSOPTION
07118 cout << "name: " << this->name << " vs. " << that->name << endl;
07119 cout << "value: " << this->value << " vs. " << that->value << endl;
07120 cout << "description: " << this->description << " vs. " << that->description << endl;
07121 #endif
07122 return false;
07123 }
07124 return true;
07125 }
07126 }
07127 }
07128
07129 bool MinDiskSpace::IsEqual(MinDiskSpace *that)
07130 {
07131 #ifdef DEBUG_OSOPTION
07132 cout << "Start comparing in MinDiskSpace" << endl;
07133 #endif
07134 if (this == NULL)
07135 { if (that == NULL)
07136 return true;
07137 else
07138 {
07139 #ifdef DEBUG_OSOPTION
07140 cout << "First object is NULL, second is not" << endl;
07141 #endif
07142 return false;
07143 }
07144 }
07145 else
07146 { if (that == NULL)
07147 {
07148 #ifdef DEBUG_OSOPTION
07149 cout << "Second object is NULL, first is not" << endl;
07150 #endif
07151 return false;
07152 }
07153 else
07154 { if ((this->unit != that->unit) ||
07155 (this->value != that->value) )
07156 {
07157 #ifdef DEBUG_OSOPTION
07158 cout << "unit: " << this->unit << " vs. " << that->unit << endl;
07159 cout << "value: " << this->value << " vs. " << that->value << endl;
07160 #endif
07161 return false;
07162 }
07163 return true;
07164 }
07165 }
07166 }
07167
07168 bool MinMemorySize::IsEqual(MinMemorySize *that)
07169 {
07170 #ifdef DEBUG_OSOPTION
07171 cout << "Start comparing in MinMemorySize" << endl;
07172 #endif
07173 if (this == NULL)
07174 { if (that == NULL)
07175 return true;
07176 else
07177 {
07178 #ifdef DEBUG_OSOPTION
07179 cout << "First object is NULL, second is not" << endl;
07180 #endif
07181 return false;
07182 }
07183 }
07184 else
07185 { if (that == NULL)
07186 {
07187 #ifdef DEBUG_OSOPTION
07188 cout << "Second object is NULL, first is not" << endl;
07189 #endif
07190 return false;
07191 }
07192 else
07193 { if ((this->unit != that->unit) ||
07194 (this->value != that->value) )
07195 {
07196 #ifdef DEBUG_OSOPTION
07197 cout << "unit: " << this->unit << " vs. " << that->unit << endl;
07198 cout << "value: " << this->value << " vs. " << that->value << endl;
07199 #endif
07200 return false;
07201 }
07202 return true;
07203 }
07204 }
07205 }
07206
07207
07208 bool MaxTime::IsEqual(MaxTime *that)
07209 {
07210 #ifdef DEBUG_OSOPTION
07211 cout << "Start comparing in MaxTime" << endl;
07212 #endif
07213 if (this == NULL)
07214 { if (that == NULL)
07215 return true;
07216 else
07217 {
07218 #ifdef DEBUG_OSOPTION
07219 cout << "First object is NULL, second is not" << endl;
07220 #endif
07221 return false;
07222 }
07223 }
07224 else
07225 { if (that == NULL)
07226 {
07227 #ifdef DEBUG_OSOPTION
07228 cout << "Second object is NULL, first is not" << endl;
07229 #endif
07230 return false;
07231 }
07232 else
07233 { if ((this->unit != that->unit) ||
07234 (this->value != that->value) )
07235 {
07236 #ifdef DEBUG_OSOPTION
07237 cout << "unit: " << this->unit << " vs. " << that->unit << endl;
07238 cout << "value: " << this->value << " vs. " << that->value << endl;
07239 #endif
07240 return false;
07241 }
07242 return true;
07243 }
07244 }
07245 }
07246
07247 bool MinCPUSpeed::IsEqual(MinCPUSpeed *that)
07248 {
07249 #ifdef DEBUG_OSOPTION
07250 cout << "Start comparing in MinCPUSpeed" << endl;
07251 #endif
07252 if (this == NULL)
07253 { if (that == NULL)
07254 return true;
07255 else
07256 {
07257 #ifdef DEBUG_OSOPTION
07258 cout << "First object is NULL, second is not" << endl;
07259 #endif
07260 return false;
07261 }
07262 }
07263 else
07264 { if (that == NULL)
07265 {
07266 #ifdef DEBUG_OSOPTION
07267 cout << "Second object is NULL, first is not" << endl;
07268 #endif
07269 return false;
07270 }
07271 else
07272 { if ((this->unit != that->unit) ||
07273 (this->value != that->value) )
07274 {
07275 #ifdef DEBUG_OSOPTION
07276 cout << "unit: " << this->unit << " vs. " << that->unit << endl;
07277 cout << "value: " << this->value << " vs. " << that->value << endl;
07278 #endif
07279 return false;
07280 }
07281 return true;
07282 }
07283 }
07284 }
07285
07286
07287 bool JobDependencies::IsEqual(JobDependencies *that)
07288 {
07289 #ifdef DEBUG_OSOPTION
07290 cout << "Start comparing in JobDependencies" << endl;
07291 #endif
07292 if (this == NULL)
07293 { if (that == NULL)
07294 return true;
07295 else
07296 {
07297 #ifdef DEBUG_OSOPTION
07298 cout << "First object is NULL, second is not" << endl;
07299 #endif
07300 return false;
07301 }
07302 }
07303 else
07304 { if (that == NULL)
07305 {
07306 #ifdef DEBUG_OSOPTION
07307 cout << "Second object is NULL, first is not" << endl;
07308 #endif
07309 return false;
07310 }
07311 else
07312 { if (this->numberOfJobIDs != that->numberOfJobIDs)
07313 {
07314 #ifdef DEBUG_OSOPTION
07315 cout << "numberOfJobIDs: " << this->numberOfJobIDs << " vs. " << that->numberOfJobIDs << endl;
07316 #endif
07317 return false;
07318 }
07319 int i;
07320 for (i = 0; i < numberOfJobIDs; i++)
07321 if (this->jobID[i] != that->jobID[i])
07322 {
07323 #ifdef DEBUG_OSOPTION
07324 cout << "jobID[" << i << "]: " << this->jobID[i] << " vs. " << that->jobID[i] << endl;
07325 #endif
07326 return false;
07327 }
07328 return true;
07329 }
07330 }
07331 }
07332
07333 bool DirectoriesAndFiles::IsEqual(DirectoriesAndFiles *that)
07334 {
07335 #ifdef DEBUG_OSOPTION
07336 cout << "Start comparing in DirectoriesAndFiles" << endl;
07337 #endif
07338 if (this == NULL)
07339 { if (that == NULL)
07340 return true;
07341 else
07342 {
07343 #ifdef DEBUG_OSOPTION
07344 cout << "First object is NULL, second is not" << endl;
07345 #endif
07346 return false;
07347 }
07348 }
07349 else
07350 { if (that == NULL)
07351 {
07352 #ifdef DEBUG_OSOPTION
07353 cout << "Second object is NULL, first is not" << endl;
07354 #endif
07355 return false;
07356 }
07357 else
07358 { if (this->numberOfPaths != that->numberOfPaths)
07359 {
07360 #ifdef DEBUG_OSOPTION
07361 cout << "numberOfPaths: " << this->numberOfPaths << " vs. " << that->numberOfPaths << endl;
07362 #endif
07363 return false;
07364 }
07365 int i;
07366 for (i = 0; i < numberOfPaths; i++)
07367 if (this->path[i] != that->path[i])
07368 {
07369 #ifdef DEBUG_OSOPTION
07370 cout << "path[" << i << "]: \'" << this->path[i] << "\' vs. \'" << that->path[i] << "\'" << endl;
07371 #endif
07372 return false;
07373 }
07374 return true;
07375 }
07376 }
07377 }
07378
07379 bool PathPairs::IsEqual(PathPairs *that)
07380 {
07381 #ifdef DEBUG_OSOPTION
07382 cout << "Start comparing in PathPairs" << endl;
07383 #endif
07384 if (this == NULL)
07385 { if (that == NULL)
07386 return true;
07387 else
07388 {
07389 #ifdef DEBUG_OSOPTION
07390 cout << "First object is NULL, second is not" << endl;
07391 #endif
07392 return false;
07393 }
07394 }
07395 else
07396 { if (that == NULL)
07397 {
07398 #ifdef DEBUG_OSOPTION
07399 cout << "Second object is NULL, first is not" << endl;
07400 #endif
07401 return false;
07402 }
07403 else
07404 { if (this->numberOfPathPairs != that->numberOfPathPairs)
07405 {
07406 #ifdef DEBUG_OSOPTION
07407 cout << "numberOfPathPairs: " << this->numberOfPathPairs << " vs. " << that->numberOfPathPairs << endl;
07408 #endif
07409 return false;
07410 }
07411 int i;
07412 for (i = 0; i < numberOfPathPairs; i++)
07413 if (!this->pathPair[i]->IsEqual(that->pathPair[i]))
07414 return false;
07415 return true;
07416 }
07417 }
07418 }
07419
07420
07421 bool PathPair::IsEqual(PathPair *that)
07422 {
07423 #ifdef DEBUG_OSOPTION
07424 cout << "Start comparing in PathPair" << endl;
07425 #endif
07426 if (this == NULL)
07427 { if (that == NULL)
07428 return true;
07429 else
07430 {
07431 #ifdef DEBUG_OSOPTION
07432 cout << "First object is NULL, second is not" << endl;
07433 #endif
07434 return false;
07435 }
07436 }
07437 else
07438 { if (that == NULL)
07439 {
07440 #ifdef DEBUG_OSOPTION
07441 cout << "Second object is NULL, first is not" << endl;
07442 #endif
07443 return false;
07444 }
07445 else
07446 { if ((this->from != that->from) || (this->to != that->to) ||
07447 (this->makeCopy != that->makeCopy))
07448 {
07449 #ifdef DEBUG_OSOPTION
07450 cout << "from: " << this->from << " vs. " << that->from << endl;
07451 cout << "to: " << this->to << " vs. " << that->to << endl;
07452 cout << "makeCopy: " << this->makeCopy << " vs. " << that->makeCopy << endl;
07453 #endif
07454 return false;
07455 }
07456 return true;
07457 }
07458 }
07459 }
07460
07461 bool Processes::IsEqual(Processes *that)
07462 {
07463 #ifdef DEBUG_OSOPTION
07464 cout << "Start comparing in Processes" << endl;
07465 #endif
07466 if (this == NULL)
07467 { if (that == NULL)
07468 return true;
07469 else
07470 {
07471 #ifdef DEBUG_OSOPTION
07472 cout << "First object is NULL, second is not" << endl;
07473 #endif
07474 return false;
07475 }
07476 }
07477 else
07478 { if (that == NULL)
07479 {
07480 #ifdef DEBUG_OSOPTION
07481 cout << "Second object is NULL, first is not" << endl;
07482 #endif
07483 return false;
07484 }
07485 else
07486 { if (this->numberOfProcesses != that->numberOfProcesses)
07487 {
07488 #ifdef DEBUG_OSOPTION
07489 cout << "numberOfProcesses: " << this->numberOfProcesses << " vs. " << that->numberOfProcesses << endl;
07490 #endif
07491 return false;
07492 }
07493 int i;
07494 for (i = 0; i < numberOfProcesses; i++)
07495 if (this->process[i] != that->process[i])
07496 {
07497 #ifdef DEBUG_OSOPTION
07498 cout << "process[" << i << "]: " << this->process[i] << " vs. " << that->process[i] << endl;
07499 #endif
07500 return false;
07501 }
07502 return true;
07503 }
07504 }
07505 }
07506
07507
07508 bool VariableOption::IsEqual(VariableOption *that)
07509 {
07510 #ifdef DEBUG_OSOPTION
07511 cout << "Start comparing in VariableOption" << endl;
07512 #endif
07513 if (this == NULL)
07514 { if (that == NULL)
07515 return true;
07516 else
07517 {
07518 #ifdef DEBUG_OSOPTION
07519 cout << "First object is NULL, second is not" << endl;
07520 #endif
07521 return false;
07522 }
07523 }
07524 else
07525 { if (that == NULL)
07526 {
07527 #ifdef DEBUG_OSOPTION
07528 cout << "Second object is NULL, first is not" << endl;
07529 #endif
07530 return false;
07531 }
07532 else
07533 {
07534 if (!this->initialVariableValues->IsEqual(that->initialVariableValues))
07535 return false;
07536 if (!this->initialVariableValuesString->IsEqual(that->initialVariableValuesString))
07537 return false;
07538 if (!this->initialBasisStatus->IsEqual(that->initialBasisStatus))
07539 return false;
07540 if (!this->integerVariableBranchingWeights->IsEqual(that->integerVariableBranchingWeights))
07541 return false;
07542 if (!this->sosVariableBranchingWeights->IsEqual(that->sosVariableBranchingWeights))
07543 return false;
07544
07545 if (this->numberOfOtherVariableOptions != that->numberOfOtherVariableOptions)
07546 {
07547 #ifdef DEBUG_OSOPTION
07548 cout << "numberOfOtherVariableOptions: " << this->numberOfOtherVariableOptions << " vs. " << that->numberOfOtherVariableOptions << endl;
07549 #endif
07550 return false;
07551 }
07552
07553 int i;
07554 for (i = 0; i < numberOfOtherVariableOptions; i++)
07555 if (!this->other[i]->IsEqual(that->other[i]))
07556 {
07557 #ifdef DEBUG_OSOPTION
07558 cout << "other[" << i << "]: " << this->other[i] << " vs. " << that->other[i] << endl;
07559 #endif
07560 return false;
07561 }
07562
07563 return true;
07564 }
07565 }
07566 }
07567
07568 bool InitVariableValues::IsEqual(InitVariableValues *that)
07569 {
07570 #ifdef DEBUG_OSOPTION
07571 cout << "Start comparing in InitVariableValues" << endl;
07572 #endif
07573 if (this == NULL)
07574 { if (that == NULL)
07575 return true;
07576 else
07577 {
07578 #ifdef DEBUG_OSOPTION
07579 cout << "First object is NULL, second is not" << endl;
07580 #endif
07581 return false;
07582 }
07583 }
07584 else
07585 { if (that == NULL)
07586 {
07587 #ifdef DEBUG_OSOPTION
07588 cout << "Second object is NULL, first is not" << endl;
07589 #endif
07590 return false;
07591 }
07592 else
07593 { if (this->numberOfVar != that->numberOfVar)
07594 {
07595 #ifdef DEBUG_OSOPTION
07596 cout << "numberOfVar: " << this->numberOfVar << " vs. " << that->numberOfVar << endl;
07597 #endif
07598 return false;
07599 }
07600 int i;
07601 for (i = 0; i < numberOfVar; i++)
07602 if (!this->var[i]->IsEqual(that->var[i]))
07603 return false;
07604 return true;
07605 }
07606 }
07607 }
07608
07609 bool InitVarValue::IsEqual(InitVarValue *that)
07610 {
07611 #ifdef DEBUG_OSOPTION
07612 cout << "Start comparing in InitVarValue" << endl;
07613 #endif
07614 if (this == NULL)
07615 { if (that == NULL)
07616 return true;
07617 else
07618 {
07619 #ifdef DEBUG_OSOPTION
07620 cout << "First object is NULL, second is not" << endl;
07621 #endif
07622 return false;
07623 }
07624 }
07625 else
07626 { if (that == NULL)
07627 {
07628 #ifdef DEBUG_OSOPTION
07629 cout << "Second object is NULL, first is not" << endl;
07630 #endif
07631 return false;
07632 }
07633 else
07634 { if ((this->idx != that->idx) || (this->value != that->value))
07635 {
07636 #ifdef DEBUG_OSOPTION
07637 cout << "idx: " << this->idx << " vs. " << that->idx << endl;
07638 cout << "value: " << this->value << " vs. " << that->value << endl;
07639 #endif
07640 return false;
07641 }
07642 return true;
07643 }
07644 }
07645 }
07646
07647
07648 bool InitVariableValuesString::IsEqual(InitVariableValuesString *that)
07649 {
07650 #ifdef DEBUG_OSOPTION
07651 cout << "Start comparing in InitVariableValuesString" << endl;
07652 #endif
07653 if (this == NULL)
07654 { if (that == NULL)
07655 return true;
07656 else
07657 {
07658 #ifdef DEBUG_OSOPTION
07659 cout << "First object is NULL, second is not" << endl;
07660 #endif
07661 return false;
07662 }
07663 }
07664 else
07665 { if (that == NULL)
07666 {
07667 #ifdef DEBUG_OSOPTION
07668 cout << "Second object is NULL, first is not" << endl;
07669 #endif
07670 return false;
07671 }
07672 else
07673 { if (this->numberOfVar != that->numberOfVar)
07674 {
07675 #ifdef DEBUG_OSOPTION
07676 cout << "numberOfVar: " << this->numberOfVar << " vs. " << that->numberOfVar << endl;
07677 #endif
07678 return false;
07679 }
07680 int i;
07681 for (i = 0; i < numberOfVar; i++)
07682 if (!this->var[i]->IsEqual(that->var[i]))
07683 return false;
07684 return true;
07685 }
07686 }
07687 }
07688
07689 bool InitVarValueString::IsEqual(InitVarValueString *that)
07690 {
07691 #ifdef DEBUG_OSOPTION
07692 cout << "Start comparing in InitVarValueString" << endl;
07693 #endif
07694 if (this == NULL)
07695 { if (that == NULL)
07696 return true;
07697 else
07698 {
07699 #ifdef DEBUG_OSOPTION
07700 cout << "First object is NULL, second is not" << endl;
07701 #endif
07702 return false;
07703 }
07704 }
07705 else
07706 { if (that == NULL)
07707 {
07708 #ifdef DEBUG_OSOPTION
07709 cout << "Second object is NULL, first is not" << endl;
07710 #endif
07711 return false;
07712 }
07713 else
07714 { if ((this->idx != that->idx) || (this->value != that->value))
07715 {
07716 #ifdef DEBUG_OSOPTION
07717 cout << "idx: " << this->idx << " vs. " << that->idx << endl;
07718 cout << "value: " << this->value << " vs. " << that->value << endl;
07719 #endif
07720 return false;
07721 }
07722 return true;
07723 }
07724 }
07725 }
07726
07727 bool InitialBasisStatus::IsEqual(InitialBasisStatus *that)
07728 {
07729 #ifdef DEBUG_OSOPTION
07730 cout << "Start comparing in InitialBasisStatus" << endl;
07731 #endif
07732 if (this == NULL)
07733 { if (that == NULL)
07734 return true;
07735 else
07736 {
07737 #ifdef DEBUG_OSOPTION
07738 cout << "First object is NULL, second is not" << endl;
07739 #endif
07740 return false;
07741 }
07742 }
07743 else
07744 { if (that == NULL)
07745 {
07746 #ifdef DEBUG_OSOPTION
07747 cout << "Second object is NULL, first is not" << endl;
07748 #endif
07749 return false;
07750 }
07751 else
07752 { if (this->numberOfVar != that->numberOfVar)
07753 {
07754 #ifdef DEBUG_OSOPTION
07755 cout << "numberOfVar: " << this->numberOfVar << " vs. " << that->numberOfVar << endl;
07756 #endif
07757 return false;
07758 }
07759 int i;
07760 for (i = 0; i < numberOfVar; i++)
07761 if (!this->var[i]->IsEqual(that->var[i]))
07762 return false;
07763 return true;
07764 }
07765 }
07766 }
07767
07768 bool InitBasStatus::IsEqual(InitBasStatus *that)
07769 {
07770 #ifdef DEBUG_OSOPTION
07771 cout << "Start comparing in InitBasStatus" << endl;
07772 #endif
07773 if (this == NULL)
07774 { if (that == NULL)
07775 return true;
07776 else
07777 {
07778 #ifdef DEBUG_OSOPTION
07779 cout << "First object is NULL, second is not" << endl;
07780 #endif
07781 return false;
07782 }
07783 }
07784 else
07785 { if (that == NULL)
07786 {
07787 #ifdef DEBUG_OSOPTION
07788 cout << "Second object is NULL, first is not" << endl;
07789 #endif
07790 return false;
07791 }
07792 else
07793 { if ((this->idx != that->idx) || (this->value != that->value))
07794 if ((this->value != "unknown" && that->value != "") ||
07795 (that->value != "unknown" && this->value != "") )
07796 {
07797 #ifdef DEBUG_OSOPTION
07798 cout << "idx: " << this->idx << " vs. " << that->idx << endl;
07799 cout << "value: " << this->value << " vs. " << that->value << endl;
07800 #endif
07801 return false;
07802 }
07803 return true;
07804 }
07805 }
07806 }
07807
07808
07809 bool IntegerVariableBranchingWeights::IsEqual(IntegerVariableBranchingWeights *that)
07810 {
07811 #ifdef DEBUG_OSOPTION
07812 cout << "Start comparing in IntegerVariableBranchingWeights" << endl;
07813 #endif
07814 if (this == NULL)
07815 { if (that == NULL)
07816 return true;
07817 else
07818 {
07819 #ifdef DEBUG_OSOPTION
07820 cout << "First object is NULL, second is not" << endl;
07821 #endif
07822 return false;
07823 }
07824 }
07825 else
07826 { if (that == NULL)
07827 {
07828 #ifdef DEBUG_OSOPTION
07829 cout << "Second object is NULL, first is not" << endl;
07830 #endif
07831 return false;
07832 }
07833 else
07834 { if (this->numberOfVar != that->numberOfVar)
07835 {
07836 #ifdef DEBUG_OSOPTION
07837 cout << "numberOfVar: " << this->numberOfVar << " vs. " << that->numberOfVar << endl;
07838 #endif
07839 return false;
07840 }
07841 int i;
07842 for (i = 0; i < numberOfVar; i++)
07843 if (!this->var[i]->IsEqual(that->var[i]))
07844 return false;
07845 return true;
07846 }
07847 }
07848 }
07849
07850 bool SOSVariableBranchingWeights::IsEqual(SOSVariableBranchingWeights *that)
07851 {
07852 #ifdef DEBUG_OSOPTION
07853 cout << "Start comparing in SOSVariableBranchingWeights" << endl;
07854 #endif
07855 if (this == NULL)
07856 { if (that == NULL)
07857 return true;
07858 else
07859 {
07860 #ifdef DEBUG_OSOPTION
07861 cout << "First object is NULL, second is not" << endl;
07862 #endif
07863 return false;
07864 }
07865 }
07866 else
07867 { if (that == NULL)
07868 {
07869 #ifdef DEBUG_OSOPTION
07870 cout << "Second object is NULL, first is not" << endl;
07871 #endif
07872 return false;
07873 }
07874 else
07875 { if (this->numberOfSOS != that->numberOfSOS)
07876 {
07877 #ifdef DEBUG_OSOPTION
07878 cout << "numberOfSOS: " << this->numberOfSOS << " vs. " << that->numberOfSOS << endl;
07879 #endif
07880 return false;
07881 }
07882 int i;
07883 for (i = 0; i < numberOfSOS; i++)
07884 { cout << "SOS " << i << " of " << numberOfSOS << endl;
07885 if (!this->sos[i]->IsEqual(that->sos[i]))
07886 return false;
07887 }
07888 return true;
07889 }
07890 }
07891 }
07892
07893
07894 bool SOSWeights::IsEqual(SOSWeights *that)
07895 {
07896 #ifdef DEBUG_OSOPTION
07897 cout << "Start comparing in SOSWeights" << endl;
07898 #endif
07899 if (this == NULL)
07900 { if (that == NULL)
07901 return true;
07902 else
07903 {
07904 #ifdef DEBUG_OSOPTION
07905 cout << "First object is NULL, second is not" << endl;
07906 #endif
07907 return false;
07908 }
07909 }
07910 else
07911 { if (that == NULL)
07912 {
07913 #ifdef DEBUG_OSOPTION
07914 cout << "Second object is NULL, first is not" << endl;
07915 #endif
07916 return false;
07917 }
07918 else
07919 { if ((this->sosIdx != that->sosIdx) ||
07920 (this->groupWeight != that->groupWeight))
07921 {
07922 #ifdef DEBUG_OSOPTION
07923 cout << "sosIdx: " << this->sosIdx << " vs. " << that->sosIdx << endl;
07924 cout << "groupWeight: " << this->groupWeight << " vs. " << that->groupWeight << endl;
07925 #endif
07926 return false;
07927 }
07928
07929 if (this->numberOfVar != that->numberOfVar)
07930 {
07931 #ifdef DEBUG_OSOPTION
07932 cout << "numberOfVar: " << this->numberOfVar << " vs. " << that->numberOfVar << endl;
07933 #endif
07934 return false;
07935 }
07936 int i;
07937 for (i = 0; i < numberOfVar; i++)
07938 {
07939 if (!this->var[i]->IsEqual(that->var[i]))
07940 return false;
07941 }
07942 return true;
07943 }
07944 }
07945 }
07946
07947
07948 bool BranchingWeight::IsEqual(BranchingWeight *that)
07949 {
07950 #ifdef DEBUG_OSOPTION
07951 cout << "Start comparing in BranchingWeight" << endl;
07952 #endif
07953 if (this == NULL)
07954 { if (that == NULL)
07955 return true;
07956 else
07957 {
07958 #ifdef DEBUG_OSOPTION
07959 cout << "First object is NULL, second is not" << endl;
07960 #endif
07961 return false;
07962 }
07963 }
07964 else
07965 { if (that == NULL)
07966 {
07967 #ifdef DEBUG_OSOPTION
07968 cout << "Second object is NULL, first is not" << endl;
07969 #endif
07970 return false;
07971 }
07972 else
07973 { if ((this->idx != that->idx) || (this->value != that->value))
07974 {
07975 #ifdef DEBUG_OSOPTION
07976 cout << "idx: " << this->idx << " vs. " << that->idx << endl;
07977 cout << "value: " << this->value << " vs. " << that->value << endl;
07978 #endif
07979 return false;
07980 }
07981 return true;
07982 }
07983 }
07984 }
07985
07986 bool OtherVariableOption::IsEqual(OtherVariableOption *that)
07987 {
07988 #ifdef DEBUG_OSOPTION
07989 cout << "Start comparing in OtherVariableOption" << endl;
07990 #endif
07991 if (this == NULL)
07992 { if (that == NULL)
07993 return true;
07994 else
07995 {
07996 #ifdef DEBUG_OSOPTION
07997 cout << "First object is NULL, second is not" << endl;
07998 #endif
07999 return false;
08000 }
08001 }
08002 else
08003 { if (that == NULL)
08004 {
08005 #ifdef DEBUG_OSOPTION
08006 cout << "Second object is NULL, first is not" << endl;
08007 #endif
08008 return false;
08009 }
08010 else
08011 { if ((this->name != that->name) ||
08012 (this->value != that->value) ||
08013 (this->solver != that->solver) ||
08014 (this->category != that->category) ||
08015 (this->type != that->type) ||
08016 (this->description != that->description))
08017 {
08018 #ifdef DEBUG_OSOPTION
08019 cout << "name: " << this->name << " vs. " << that->name << endl;
08020 cout << "value: " << this->value << " vs. " << that->value << endl;
08021 cout << "solver: " << this->solver << " vs. " << that->solver << endl;
08022 cout << "category: " << this->category << " vs. " << that->category << endl;
08023 cout << "type: " << this->type << " vs. " << that->type << endl;
08024 cout << "description: " << this->description << " vs. " << that->description << endl;
08025 #endif
08026 return false;
08027 }
08028
08029 if (this->numberOfVar != that->numberOfVar)
08030 {
08031 #ifdef DEBUG_OSOPTION
08032 cout << "numberOfVar: " << this->numberOfVar << " vs. " << that->numberOfVar << endl;
08033 #endif
08034 return false;
08035 }
08036 int i;
08037 for (i = 0; i < numberOfVar; i++)
08038 if (!this->var[i]->IsEqual(that->var[i]))
08039 return false;
08040 return true;
08041 }
08042 }
08043 }
08044
08045 bool OtherVarOption::IsEqual(OtherVarOption *that)
08046 {
08047 #ifdef DEBUG_OSOPTION
08048 cout << "Start comparing in OtherVarOption" << endl;
08049 #endif
08050 if (this == NULL)
08051 { if (that == NULL)
08052 return true;
08053 else
08054 {
08055 #ifdef DEBUG_OSOPTION
08056 cout << "First object is NULL, second is not" << endl;
08057 #endif
08058 return false;
08059 }
08060 }
08061 else
08062 { if (that == NULL)
08063 {
08064 #ifdef DEBUG_OSOPTION
08065 cout << "Second object is NULL, first is not" << endl;
08066 #endif
08067 return false;
08068 }
08069 else
08070 { if ((this->idx != that->idx) || (this->value != that->value) ||
08071 (this->lbValue != that->lbValue) || (this->ubValue != that->ubValue))
08072 {
08073 #ifdef DEBUG_OSOPTION
08074 cout << "idx: " << this->idx << " vs. " << that->idx << endl;
08075 cout << "value: " << this->value << " vs. " << that->value << endl;
08076 cout << "lbValue: " << this->lbValue << " vs. " << that->lbValue << endl;
08077 cout << "ubValue: " << this->ubValue << " vs. " << that->ubValue << endl;
08078 #endif
08079 return false;
08080 }
08081 return true;
08082 }
08083 }
08084 }
08085
08086 bool ObjectiveOption::IsEqual(ObjectiveOption *that)
08087 {
08088 #ifdef DEBUG_OSOPTION
08089 cout << "Start comparing in ObjectiveOption" << endl;
08090 #endif
08091 if (this == NULL)
08092 { if (that == NULL)
08093 return true;
08094 else
08095 {
08096 #ifdef DEBUG_OSOPTION
08097 cout << "First object is NULL, second is not" << endl;
08098 #endif
08099 return false;
08100 }
08101 }
08102 else
08103 { if (that == NULL)
08104 {
08105 #ifdef DEBUG_OSOPTION
08106 cout << "Second object is NULL, first is not" << endl;
08107 #endif
08108 return false;
08109 }
08110 else
08111 {
08112 if (!this->initialObjectiveValues->IsEqual(that->initialObjectiveValues))
08113 return false;
08114 if (!this->initialObjectiveBounds->IsEqual(that->initialObjectiveBounds))
08115 return false;
08116
08117 if (this->numberOfOtherObjectiveOptions != that->numberOfOtherObjectiveOptions)
08118 {
08119 #ifdef DEBUG_OSOPTION
08120 cout << "numberOfOtherObjectiveOptions: " << this->numberOfOtherObjectiveOptions << " vs. " << that->numberOfOtherObjectiveOptions << endl;
08121 #endif
08122 return false;
08123 }
08124 int i;
08125 for (i = 0; i < numberOfOtherObjectiveOptions; i++)
08126 if (!this->other[i]->IsEqual(that->other[i]))
08127 return false;
08128
08129 return true;
08130 }
08131 }
08132 }
08133
08134 bool InitObjectiveValues::IsEqual(InitObjectiveValues *that)
08135 {
08136 #ifdef DEBUG_OSOPTION
08137 cout << "Start comparing in InitObjectiveValues" << endl;
08138 #endif
08139 if (this == NULL)
08140 { if (that == NULL)
08141 return true;
08142 else
08143 {
08144 #ifdef DEBUG_OSOPTION
08145 cout << "First object is NULL, second is not" << endl;
08146 #endif
08147 return false;
08148 }
08149 }
08150 else
08151 { if (that == NULL)
08152 {
08153 #ifdef DEBUG_OSOPTION
08154 cout << "Second object is NULL, first is not" << endl;
08155 #endif
08156 return false;
08157 }
08158 else
08159 { if (this->numberOfObj != that->numberOfObj)
08160 {
08161 #ifdef DEBUG_OSOPTION
08162 cout << "numberOfObj: " << this->numberOfObj << " vs. " << that->numberOfObj << endl;
08163 #endif
08164 return false;
08165 }
08166 int i;
08167 for (i = 0; i < numberOfObj; i++)
08168 if (!this->obj[i]->IsEqual(that->obj[i]))
08169 return false;
08170 return true;
08171 }
08172 }
08173 }
08174
08175 bool InitObjValue::IsEqual(InitObjValue *that)
08176 {
08177 #ifdef DEBUG_OSOPTION
08178 cout << "Start comparing in InitObjValue" << endl;
08179 #endif
08180 if (this == NULL)
08181 { if (that == NULL)
08182 return true;
08183 else
08184 {
08185 #ifdef DEBUG_OSOPTION
08186 cout << "First object is NULL, second is not" << endl;
08187 #endif
08188 return false;
08189 }
08190 }
08191 else
08192 { if (that == NULL)
08193 {
08194 #ifdef DEBUG_OSOPTION
08195 cout << "Second object is NULL, first is not" << endl;
08196 #endif
08197 return false;
08198 }
08199 else
08200 { if ((this->idx != that->idx) || (this->value != that->value))
08201 {
08202 #ifdef DEBUG_OSOPTION
08203 cout << "idx: " << this->idx << " vs. " << that->idx << endl;
08204 cout << "value: " << this->value << " vs. " << that->value << endl;
08205 #endif
08206 return false;
08207 }
08208 return true;
08209 }
08210 }
08211 }
08212
08213 bool InitObjectiveBounds::IsEqual(InitObjectiveBounds *that)
08214 {
08215 #ifdef DEBUG_OSOPTION
08216 cout << "Start comparing in InitObjectiveBounds" << endl;
08217 #endif
08218 if (this == NULL)
08219 { if (that == NULL)
08220 return true;
08221 else
08222 {
08223 #ifdef DEBUG_OSOPTION
08224 cout << "First object is NULL, second is not" << endl;
08225 #endif
08226 return false;
08227 }
08228 }
08229 else
08230 { if (that == NULL)
08231 {
08232 #ifdef DEBUG_OSOPTION
08233 cout << "Second object is NULL, first is not" << endl;
08234 #endif
08235 return false;
08236 }
08237 else
08238 { if (this->numberOfObj != that->numberOfObj)
08239 {
08240 #ifdef DEBUG_OSOPTION
08241 cout << "numberOfObj: " << this->numberOfObj << " vs. " << that->numberOfObj << endl;
08242 #endif
08243 return false;
08244 }
08245 int i;
08246 for (i = 0; i < numberOfObj; i++)
08247 if (!this->obj[i]->IsEqual(that->obj[i]))
08248 return false;
08249 return true;
08250 }
08251 }
08252 }
08253
08254 bool InitObjBound::IsEqual(InitObjBound *that)
08255 {
08256 #ifdef DEBUG_OSOPTION
08257 cout << "Start comparing in InitObjBound" << endl;
08258 #endif
08259 if (this == NULL)
08260 { if (that == NULL)
08261 return true;
08262 else
08263 {
08264 #ifdef DEBUG_OSOPTION
08265 cout << "First object is NULL, second is not" << endl;
08266 #endif
08267 return false;
08268 }
08269 }
08270 else
08271 { if (that == NULL)
08272 {
08273 #ifdef DEBUG_OSOPTION
08274 cout << "Second object is NULL, first is not" << endl;
08275 #endif
08276 return false;
08277 }
08278 else
08279 { if ((this->idx != that->idx) || (this->lbValue != that->lbValue) ||
08280 (this->ubValue != that->ubValue) )
08281 {
08282 #ifdef DEBUG_OSOPTION
08283 cout << "idx: " << this->idx << " vs. " << that->idx << endl;
08284 cout << "lbValue: " << this->lbValue << " vs. " << that->lbValue << endl;
08285 cout << "ubValue: " << this->ubValue << " vs. " << that->ubValue << endl;
08286 #endif
08287 return false;
08288 }
08289 return true;
08290 }
08291 }
08292 }
08293
08294 bool OtherObjectiveOption::IsEqual(OtherObjectiveOption *that)
08295 {
08296 #ifdef DEBUG_OSOPTION
08297 cout << "Start comparing in OtherObjectiveOption" << endl;
08298 #endif
08299 if (this == NULL)
08300 { if (that == NULL)
08301 return true;
08302 else
08303 {
08304 #ifdef DEBUG_OSOPTION
08305 cout << "First object is NULL, second is not" << endl;
08306 #endif
08307 return false;
08308 }
08309 }
08310 else
08311 { if (that == NULL)
08312 {
08313 #ifdef DEBUG_OSOPTION
08314 cout << "Second object is NULL, first is not" << endl;
08315 #endif
08316 return false;
08317 }
08318 else
08319 { if ((this->name != that->name) ||
08320 (this->value != that->value) ||
08321 (this->solver != that->solver) ||
08322 (this->category != that->category) ||
08323 (this->type != that->type) ||
08324 (this->description != that->description))
08325 {
08326 #ifdef DEBUG_OSOPTION
08327 cout << "name: " << this->name << " vs. " << that->name << endl;
08328 cout << "value: " << this->value << " vs. " << that->value << endl;
08329 cout << "solver: " << this->solver << " vs. " << that->solver << endl;
08330 cout << "category: " << this->category << " vs. " << that->category << endl;
08331 cout << "type: " << this->type << " vs. " << that->type << endl;
08332 cout << "description: " << this->description << " vs. " << that->description << endl;
08333 #endif
08334 return false;
08335 }
08336
08337 if (this->numberOfObj != that->numberOfObj)
08338 {
08339 #ifdef DEBUG_OSOPTION
08340 cout << "numberOfObj: " << this->numberOfObj << " vs. " << that->numberOfObj << endl;
08341 #endif
08342 return false;
08343 }
08344 int i;
08345 for (i = 0; i < numberOfObj; i++)
08346 if (!this->obj[i]->IsEqual(that->obj[i]))
08347 return false;
08348 return true;
08349 }
08350 }
08351 }
08352
08353 bool OtherObjOption::IsEqual(OtherObjOption *that)
08354 {
08355 #ifdef DEBUG_OSOPTION
08356 cout << "Start comparing in OtherObjOption" << endl;
08357 #endif
08358 if (this == NULL)
08359 { if (that == NULL)
08360 return true;
08361 else
08362 {
08363 #ifdef DEBUG_OSOPTION
08364 cout << "First object is NULL, second is not" << endl;
08365 #endif
08366 return false;
08367 }
08368 }
08369 else
08370 { if (that == NULL)
08371 {
08372 #ifdef DEBUG_OSOPTION
08373 cout << "Second object is NULL, first is not" << endl;
08374 #endif
08375 return false;
08376 }
08377 else
08378 { if ((this->idx != that->idx) || (this->value != that->value) ||
08379 (this->lbValue != that->lbValue) || (this->ubValue != that->ubValue))
08380 {
08381 #ifdef DEBUG_OSOPTION
08382 cout << "idx: " << this->idx << " vs. " << that->idx << endl;
08383 cout << "value: " << this->value << " vs. " << that->value << endl;
08384 cout << "lbValue: " << this->lbValue << " vs. " << that->lbValue << endl;
08385 cout << "ubValue: " << this->ubValue << " vs. " << that->ubValue << endl;
08386 #endif
08387 return false;
08388 }
08389 return true;
08390 }
08391 }
08392 }
08393
08394 bool ConstraintOption::IsEqual(ConstraintOption *that)
08395 {
08396 #ifdef DEBUG_OSOPTION
08397 cout << "Start comparing in ConstraintOption" << endl;
08398 #endif
08399 if (this == NULL)
08400 { if (that == NULL)
08401 return true;
08402 else
08403 {
08404 #ifdef DEBUG_OSOPTION
08405 cout << "First object is NULL, second is not" << endl;
08406 #endif
08407 return false;
08408 }
08409 }
08410 else
08411 { if (that == NULL)
08412 {
08413 #ifdef DEBUG_OSOPTION
08414 cout << "Second object is NULL, first is not" << endl;
08415 #endif
08416 return false;
08417 }
08418 else
08419 {
08420 if (!this->initialConstraintValues->IsEqual(that->initialConstraintValues))
08421 return false;
08422 if (!this->initialDualValues->IsEqual(that->initialDualValues))
08423 return false;
08424
08425 if (this->numberOfOtherConstraintOptions != that->numberOfOtherConstraintOptions)
08426 {
08427 #ifdef DEBUG_OSOPTION
08428 cout << "numberOfOtherConstraintOptions: " << this->numberOfOtherConstraintOptions << " vs. " << that->numberOfOtherConstraintOptions << endl;
08429 #endif
08430 return false;
08431 }
08432 int i;
08433 for (i = 0; i < numberOfOtherConstraintOptions; i++)
08434 if (!this->other[i]->IsEqual(that->other[i]))
08435 return false;
08436
08437 return true;
08438 }
08439 }
08440 }
08441
08442 bool InitConstraintValues::IsEqual(InitConstraintValues *that)
08443 {
08444 #ifdef DEBUG_OSOPTION
08445 cout << "Start comparing in InitConstraintValues" << endl;
08446 #endif
08447 if (this == NULL)
08448 { if (that == NULL)
08449 return true;
08450 else
08451 {
08452 #ifdef DEBUG_OSOPTION
08453 cout << "First object is NULL, second is not" << endl;
08454 #endif
08455 return false;
08456 }
08457 }
08458 else
08459 { if (that == NULL)
08460 {
08461 #ifdef DEBUG_OSOPTION
08462 cout << "Second object is NULL, first is not" << endl;
08463 #endif
08464 return false;
08465 }
08466 else
08467 { if (this->numberOfCon != that->numberOfCon)
08468 {
08469 #ifdef DEBUG_OSOPTION
08470 cout << "numberOfCon: " << this->numberOfCon << " vs. " << that->numberOfCon << endl;
08471 #endif
08472 return false;
08473 }
08474 int i;
08475 for (i = 0; i < numberOfCon; i++)
08476 if (!this->con[i]->IsEqual(that->con[i]))
08477 return false;
08478 return true;
08479 }
08480 }
08481 }
08482
08483 bool InitConValue::IsEqual(InitConValue *that)
08484 {
08485 #ifdef DEBUG_OSOPTION
08486 cout << "Start comparing in InitConValue" << endl;
08487 #endif
08488 if (this == NULL)
08489 { if (that == NULL)
08490 return true;
08491 else
08492 {
08493 #ifdef DEBUG_OSOPTION
08494 cout << "First object is NULL, second is not" << endl;
08495 #endif
08496 return false;
08497 }
08498 }
08499 else
08500 { if (that == NULL)
08501 {
08502 #ifdef DEBUG_OSOPTION
08503 cout << "Second object is NULL, first is not" << endl;
08504 #endif
08505 return false;
08506 }
08507 else
08508 { if ((this->idx != that->idx) || (this->value != that->value))
08509 {
08510 #ifdef DEBUG_OSOPTION
08511 cout << "idx: " << this->idx << " vs. " << that->idx << endl;
08512 cout << "value: " << this->value << " vs. " << that->value << endl;
08513 #endif
08514 return false;
08515 }
08516 return true;
08517 }
08518 }
08519 }
08520
08521 bool InitDualVariableValues::IsEqual(InitDualVariableValues *that)
08522 {
08523 #ifdef DEBUG_OSOPTION
08524 cout << "Start comparing in InitDualVariableValues" << endl;
08525 #endif
08526 if (this == NULL)
08527 { if (that == NULL)
08528 return true;
08529 else
08530 {
08531 #ifdef DEBUG_OSOPTION
08532 cout << "First object is NULL, second is not" << endl;
08533 #endif
08534 return false;
08535 }
08536 }
08537 else
08538 { if (that == NULL)
08539 {
08540 #ifdef DEBUG_OSOPTION
08541 cout << "Second object is NULL, first is not" << endl;
08542 #endif
08543 return false;
08544 }
08545 else
08546 { if (this->numberOfCon != that->numberOfCon)
08547 {
08548 #ifdef DEBUG_OSOPTION
08549 cout << "numberOfCon: " << this->numberOfCon << " vs. " << that->numberOfCon << endl;
08550 #endif
08551 return false;
08552 }
08553 int i;
08554 for (i = 0; i < numberOfCon; i++)
08555 if (!this->con[i]->IsEqual(that->con[i]))
08556 return false;
08557 return true;
08558 }
08559 }
08560 }
08561
08562 bool InitDualVarValue::IsEqual(InitDualVarValue *that)
08563 {
08564 #ifdef DEBUG_OSOPTION
08565 cout << "Start comparing in InitDualVarValue" << endl;
08566 #endif
08567 if (this == NULL)
08568 { if (that == NULL)
08569 return true;
08570 else
08571 {
08572 #ifdef DEBUG_OSOPTION
08573 cout << "First object is NULL, second is not" << endl;
08574 #endif
08575 return false;
08576 }
08577 }
08578 else
08579 { if (that == NULL)
08580 {
08581 #ifdef DEBUG_OSOPTION
08582 cout << "Second object is NULL, first is not" << endl;
08583 #endif
08584 return false;
08585 }
08586 else
08587 { if ((this->idx != that->idx) || (this->lbDualValue != that->lbDualValue) ||
08588 (this->ubDualValue != that->ubDualValue))
08589 {
08590 #ifdef DEBUG_OSOPTION
08591 cout << "idx: " << this->idx << " vs. " << that->idx << endl;
08592 cout << "lbDualValue: " << this->lbDualValue << " vs. " << that->lbDualValue << endl;
08593 cout << "ubDualValue: " << this->ubDualValue << " vs. " << that->ubDualValue << endl;
08594 #endif
08595 return false;
08596 }
08597 return true;
08598 }
08599 }
08600 }
08601
08602 bool OtherConstraintOption::IsEqual(OtherConstraintOption *that)
08603 {
08604 #ifdef DEBUG_OSOPTION
08605 cout << "Start comparing in OtherConstraintOption" << endl;
08606 #endif
08607 if (this == NULL)
08608 { if (that == NULL)
08609 return true;
08610 else
08611 {
08612 #ifdef DEBUG_OSOPTION
08613 cout << "First object is NULL, second is not" << endl;
08614 #endif
08615 return false;
08616 }
08617 }
08618 else
08619 { if (that == NULL)
08620 {
08621 #ifdef DEBUG_OSOPTION
08622 cout << "Second object is NULL, first is not" << endl;
08623 #endif
08624 return false;
08625 }
08626 else
08627 { if ((this->name != that->name) ||
08628 (this->value != that->value) ||
08629 (this->solver != that->solver) ||
08630 (this->category != that->category) ||
08631 (this->type != that->type) ||
08632 (this->description != that->description))
08633 {
08634 #ifdef DEBUG_OSOPTION
08635 cout << "name: " << this->name << " vs. " << that->name << endl;
08636 cout << "value: " << this->value << " vs. " << that->value << endl;
08637 cout << "solver: " << this->solver << " vs. " << that->solver << endl;
08638 cout << "category: " << this->category << " vs. " << that->category << endl;
08639 cout << "type: " << this->type << " vs. " << that->type << endl;
08640 cout << "description: " << this->description << " vs. " << that->description << endl;
08641 #endif
08642 return false;
08643 }
08644
08645 if (this->numberOfCon != that->numberOfCon)
08646 {
08647 #ifdef DEBUG_OSOPTION
08648 cout << "numberOfCon: " << this->numberOfCon << " vs. " << that->numberOfCon << endl;
08649 #endif
08650 return false;
08651 }
08652 int i;
08653 for (i = 0; i < numberOfCon; i++)
08654 if (!this->con[i]->IsEqual(that->con[i]))
08655 return false;
08656 return true;
08657 }
08658 }
08659 }
08660
08661 bool OtherConOption::IsEqual(OtherConOption *that)
08662 {
08663 #ifdef DEBUG_OSOPTION
08664 cout << "Start comparing in OtherConOption" << endl;
08665 #endif
08666 if (this == NULL)
08667 { if (that == NULL)
08668 return true;
08669 else
08670 {
08671 #ifdef DEBUG_OSOPTION
08672 cout << "First object is NULL, second is not" << endl;
08673 #endif
08674 return false;
08675 }
08676 }
08677 else
08678 { if (that == NULL)
08679 {
08680 #ifdef DEBUG_OSOPTION
08681 cout << "Second object is NULL, first is not" << endl;
08682 #endif
08683 return false;
08684 }
08685 else
08686 { if ((this->idx != that->idx) || (this->value != that->value) ||
08687 (this->lbValue != that->lbValue) || (this->ubValue != that->ubValue))
08688 {
08689 #ifdef DEBUG_OSOPTION
08690 cout << "idx: " << this->idx << " vs. " << that->idx << endl;
08691 cout << "value: " << this->value << " vs. " << that->value << endl;
08692 cout << "lbValue: " << this->lbValue << " vs. " << that->lbValue << endl;
08693 cout << "ubValue: " << this->ubValue << " vs. " << that->ubValue << endl;
08694 #endif
08695 return false;
08696 }
08697 return true;
08698 }
08699 }
08700 }
08701
08702
08703 bool SolverOptions::IsEqual(SolverOptions *that)
08704 {
08705 #ifdef DEBUG_OSOPTION
08706 cout << "Start comparing in SolverOptions" << endl;
08707 #endif
08708 if (this == NULL)
08709 { if (that == NULL)
08710 return true;
08711 else
08712 {
08713 #ifdef DEBUG_OSOPTION
08714 cout << "First object is NULL, second is not" << endl;
08715 #endif
08716 return false;
08717 }
08718 }
08719 else
08720 { if (that == NULL)
08721 {
08722 #ifdef DEBUG_OSOPTION
08723 cout << "Second object is NULL, first is not" << endl;
08724 #endif
08725 return false;
08726 }
08727 else
08728 { if (this->numberOfSolverOptions != that->numberOfSolverOptions)
08729 {
08730 #ifdef DEBUG_OSOPTION
08731 cout << "numberOfSolverOptions: " << this->numberOfSolverOptions << " vs. " << that->numberOfSolverOptions << endl;
08732 #endif
08733 return false;
08734 }
08735
08736 int i;
08737 for (i = 0; i < numberOfSolverOptions; i++)
08738 if (!this->solverOption[i]->IsEqual(that->solverOption[i]))
08739 return false;
08740
08741 return true;
08742 }
08743 }
08744 }
08745
08746 bool SolverOption::IsEqual(SolverOption *that)
08747 {
08748 #ifdef DEBUG_OSOPTION
08749 cout << "Start comparing in SolverOption" << endl;
08750 #endif
08751 if (this == NULL)
08752 { if (that == NULL)
08753 return true;
08754 else
08755 {
08756 #ifdef DEBUG_OSOPTION
08757 cout << "First object is NULL, second is not" << endl;
08758 #endif
08759 return false;
08760 }
08761 }
08762 else
08763 { if (that == NULL)
08764 {
08765 #ifdef DEBUG_OSOPTION
08766 cout << "Second object is NULL, first is not" << endl;
08767 #endif
08768 return false;
08769 }
08770 else
08771 { if ((this->name != that->name) ||
08772 (this->value != that->value) ||
08773 (this->solver != that->solver) ||
08774 (this->category != that->category) ||
08775 (this->type != that->type) ||
08776 (this->description != that->description))
08777 {
08778 #ifdef DEBUG_OSOPTION
08779 cout << "name: " << this->name << " vs. " << that->name << endl;
08780 cout << "value: " << this->value << " vs. " << that->value << endl;
08781 cout << "solver: " << this->solver << " vs. " << that->solver << endl;
08782 cout << "category: " << this->category << " vs. " << that->category << endl;
08783 cout << "type: " << this->type << " vs. " << that->type << endl;
08784 cout << "description: " << this->description << " vs. " << that->description << endl;
08785 #endif
08786 return false;
08787 }
08788 return true;
08789 }
08790 }
08791 }