00001
00017 #include "OSOption.h"
00018 #include "OSParameters.h"
00019 #include "OSGeneral.h"
00020 #include "OSErrorClass.h"
00021 #include "OSOutput.h"
00022
00023 #include "CoinFinite.hpp"
00024 #include <iostream>
00025 #include <sstream>
00026 #include <limits>
00027 #include <cstdio>
00028 #include "OSMathUtil.h"
00029
00030 using namespace std;
00031
00032 InstanceLocationOption::InstanceLocationOption():
00033 locationType ("local"),
00034 value ("")
00035 {
00036 #ifndef NDEBUG
00037 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Inside InstanceLocationOption Constructor");
00038 #endif
00039 }
00040
00041 InstanceLocationOption::~InstanceLocationOption()
00042 {
00043 #ifndef NDEBUG
00044 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "InstanceLocationOption Destructor Called");
00045 #endif
00046 }
00047
00048
00049 ContactOption::ContactOption():
00050 transportType ("osp"),
00051 value ("")
00052 {
00053 #ifndef NDEBUG
00054 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Inside ContactOption Constructor");
00055 #endif
00056 }
00057
00058 ContactOption::~ContactOption()
00059 {
00060 #ifndef NDEBUG
00061 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "ContactOption Destructor Called");
00062 #endif
00063 }
00064
00065
00066 OtherOption::OtherOption():
00067 name (""),
00068 value (""),
00069 description ("")
00070 {
00071 #ifndef NDEBUG
00072 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Inside OtherOption Constructor");
00073 #endif
00074 }
00075
00076 OtherOption::~OtherOption()
00077 {
00078 #ifndef NDEBUG
00079 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "OtherOption Destructor Called");
00080 #endif
00081 }
00082
00083
00084 OtherOptions::OtherOptions():
00085 numberOfOtherOptions(0)
00086 {
00087 #ifndef NDEBUG
00088 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Inside OtherOptions Constructor");
00089 #endif
00090 other = NULL;
00091 }
00092
00093 OtherOptions::~OtherOptions()
00094 {
00095 #ifndef NDEBUG
00096 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "OtherOptions Destructor Called");
00097 #endif
00098
00099 if (other != NULL)
00100 {
00101 int i;
00102 for (i=0; i<numberOfOtherOptions; i++)
00103 {
00104 delete other[i];
00105 other[i] = NULL;
00106 }
00107 delete[] other;
00108 other = NULL;
00109 }
00110 }
00111
00112
00113 GeneralOption::GeneralOption():
00114 serviceURI (""),
00115 serviceName (""),
00116 instanceName (""),
00117 jobID (""),
00118 solverToInvoke (""),
00119 license (""),
00120 userName (""),
00121 password ("")
00122 {
00123 #ifndef NDEBUG
00124 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Inside GeneralOption Constructor");
00125 #endif
00126 instanceLocation = NULL;
00127 contact = NULL;
00128 otherOptions = NULL;
00129 }
00130
00131 GeneralOption::~GeneralOption()
00132 {
00133 #ifndef NDEBUG
00134 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "GeneralOption Destructor Called");
00135 #endif
00136 if (instanceLocation != NULL) delete instanceLocation;
00137 instanceLocation = NULL;
00138 if (contact != NULL) delete contact;
00139 contact = NULL;
00140 if (otherOptions != NULL) delete otherOptions;
00141 otherOptions = NULL;
00142 }
00143
00144
00145 MinDiskSpace::MinDiskSpace():
00146 unit ("byte"),
00147 description(""),
00148 value (0.0)
00149 {
00150 #ifndef NDEBUG
00151 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Inside MinDiskSpace Constructor");
00152 #endif
00153 }
00154
00155 MinDiskSpace::~MinDiskSpace()
00156 {
00157 #ifndef NDEBUG
00158 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "MinDiskSpace Destructor Called");
00159 #endif
00160 }
00161
00162
00163 MinMemorySize::MinMemorySize():
00164 unit ("byte"),
00165 description(""),
00166 value (0.0)
00167 {
00168 #ifndef NDEBUG
00169 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Inside MinMemorySize Constructor");
00170 #endif
00171 }
00172
00173 MinMemorySize::~MinMemorySize()
00174 {
00175 #ifndef NDEBUG
00176 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "MinMemorySize Destructor Called");
00177 #endif
00178 }
00179
00180
00181 MinCPUSpeed::MinCPUSpeed():
00182 unit ("hertz"),
00183 description(""),
00184 value (0.0)
00185 {
00186 #ifndef NDEBUG
00187 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Inside MinCPUSpeed Constructor");
00188 #endif
00189 }
00190
00191 MinCPUSpeed::~MinCPUSpeed()
00192 {
00193 #ifndef NDEBUG
00194 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "MinCPUSpeed Destructor Called");
00195 #endif
00196 }
00197
00198 MinCPUNumber::MinCPUNumber():
00199 description(""),
00200 value (0)
00201 {
00202 #ifndef NDEBUG
00203 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Inside MinCPUNumber Constructor");
00204 #endif
00205 }
00206
00207 MinCPUNumber::~MinCPUNumber()
00208 {
00209 #ifndef NDEBUG
00210 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "MinCPUNumber Destructor Called");
00211 #endif
00212 }
00213
00214
00215 SystemOption::SystemOption()
00216 {
00217 #ifndef NDEBUG
00218 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Inside SystemOption Constructor");
00219 #endif
00220 minDiskSpace = NULL;
00221 minMemorySize = NULL;
00222 minCPUSpeed = NULL;
00223 minCPUNumber = NULL;
00224 otherOptions = NULL;
00225 }
00226
00227 SystemOption::~SystemOption()
00228 {
00229 #ifndef NDEBUG
00230 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "SystemOption Destructor Called");
00231 #endif
00232 if (minDiskSpace != NULL) delete minDiskSpace;
00233 minDiskSpace = NULL;
00234 if (minMemorySize != NULL) delete minMemorySize;
00235 minMemorySize = NULL;
00236 if (minCPUSpeed != NULL) delete minCPUSpeed;
00237 minCPUSpeed = NULL;
00238 if (minCPUNumber != NULL) delete minCPUNumber;
00239 minCPUNumber = NULL;
00240 if (otherOptions != NULL) delete otherOptions;
00241 otherOptions = NULL;
00242 }
00243
00244
00245 ServiceOption::ServiceOption():
00246 type ("solver")
00247 {
00248 #ifndef NDEBUG
00249 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Inside ServiceOption Constructor");
00250 #endif
00251 otherOptions = NULL;
00252 }
00253
00254 ServiceOption::~ServiceOption()
00255 {
00256 #ifndef NDEBUG
00257 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "ServiceOption Destructor Called");
00258 #endif
00259 if (otherOptions != NULL) delete otherOptions;
00260 otherOptions = NULL;
00261 }
00262
00263
00264 JobDependencies::JobDependencies():
00265 numberOfJobIDs (0)
00266 {
00267 #ifndef NDEBUG
00268 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Inside JobDependencies Constructor");
00269 #endif
00270 jobID = NULL;
00271 }
00272
00273 JobDependencies::~JobDependencies()
00274 {
00275 #ifndef NDEBUG
00276 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "JobDependencies Destructor Called");
00277 #endif
00278
00279 if (jobID != NULL)
00280 {
00281 delete[] jobID;
00282 jobID = NULL;
00283 }
00284 }
00285
00286
00287 DirectoriesAndFiles::DirectoriesAndFiles():
00288 numberOfPaths (0)
00289 {
00290 #ifndef NDEBUG
00291 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Inside DirectoriesAndFiles Constructor");
00292 #endif
00293 path = NULL;
00294 }
00295
00296 DirectoriesAndFiles::~DirectoriesAndFiles()
00297 {
00298 #ifndef NDEBUG
00299 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "DirectoriesAndFiles Destructor Called");
00300 #endif
00301 if (path != NULL)
00302 {
00303 delete[] path;
00304 path = NULL;
00305 }
00306 }
00307
00308
00309 PathPair::PathPair():
00310 from (""),
00311 to (""),
00312 makeCopy (false)
00313 {
00314 #ifndef NDEBUG
00315 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Inside PathPair Constructor");
00316 #endif
00317 }
00318
00319 PathPair::~PathPair()
00320 {
00321 #ifndef NDEBUG
00322 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "PathPair Destructor Called");
00323 #endif
00324 }
00325
00326
00327 PathPairs::PathPairs():
00328 numberOfPathPairs(0)
00329 {
00330 #ifndef NDEBUG
00331 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Inside PathPairs Constructor");
00332 #endif
00333 pathPair = NULL;
00334 }
00335
00336 PathPairs::~PathPairs()
00337 {
00338 #ifndef NDEBUG
00339 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "PathPairs Destructor Called");
00340 #endif
00341 int i;
00342 if (pathPair != NULL)
00343 {
00344 for (i=0; i < numberOfPathPairs; i++)
00345 {
00346 delete pathPair[i];
00347 pathPair[i] = NULL;
00348 }
00349 delete[] pathPair;
00350 pathPair = NULL;
00351 }
00352 }
00353
00354
00355
00356 Processes::Processes():
00357 numberOfProcesses(0)
00358 {
00359 #ifndef NDEBUG
00360 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Inside Processes Constructor");
00361 #endif
00362 process = NULL;
00363 }
00364
00365 Processes::~Processes()
00366 {
00367 #ifndef NDEBUG
00368 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Processes Destructor Called");
00369 #endif
00370 if (process != NULL)
00371 {
00372 delete[] process;
00373 process = NULL;
00374 }
00375 }
00376
00377
00378 JobOption::JobOption():
00379 requestedStartTime("")
00380 {
00381 #ifndef NDEBUG
00382 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Inside JobOption Constructor");
00383 #endif
00384 maxTime = NULL;
00385 dependencies = NULL;
00386 requiredDirectories = NULL;
00387 requiredFiles = NULL;
00388 directoriesToMake = NULL;
00389 filesToMake = NULL;
00390 inputDirectoriesToMove = NULL;
00391 inputFilesToMove = NULL;
00392 outputFilesToMove = NULL;
00393 outputDirectoriesToMove = NULL;
00394 filesToDelete = NULL;
00395 directoriesToDelete = NULL;
00396 processesToKill = NULL;
00397 otherOptions = NULL;
00398 }
00399
00400 JobOption::~JobOption()
00401 {
00402 #ifndef NDEBUG
00403 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "JobOption Destructor Called");
00404 #endif
00405 if (maxTime != NULL) delete maxTime;
00406 maxTime = NULL;
00407 if (dependencies != NULL) delete dependencies;
00408 dependencies = NULL;
00409 if (requiredDirectories != NULL) delete requiredDirectories;
00410 requiredDirectories = NULL;
00411 if (requiredFiles != NULL) delete requiredFiles;
00412 requiredFiles = NULL;
00413 if (directoriesToMake != NULL) delete directoriesToMake;
00414 directoriesToMake = NULL;
00415 if (filesToMake != NULL) delete filesToMake;
00416 filesToMake = NULL;
00417 if (inputDirectoriesToMove != NULL) delete inputDirectoriesToMove;
00418 inputDirectoriesToMove = NULL;
00419 if (inputFilesToMove != NULL) delete inputFilesToMove;
00420 inputFilesToMove = NULL;
00421 if (outputDirectoriesToMove != NULL) delete outputDirectoriesToMove;
00422 outputDirectoriesToMove = NULL;
00423 if (outputFilesToMove != NULL) delete outputFilesToMove;
00424 outputFilesToMove = NULL;
00425 if (filesToDelete != NULL) delete filesToDelete;
00426 filesToDelete = NULL;
00427 if (directoriesToDelete != NULL) delete directoriesToDelete;
00428 directoriesToDelete = NULL;
00429 if (processesToKill != NULL) delete processesToKill;
00430 processesToKill = NULL;
00431 if (otherOptions != NULL) delete otherOptions;
00432 otherOptions = NULL;
00433 }
00434
00435
00436 InitVarValue::InitVarValue():
00437 idx (-1),
00438 name (""),
00439 value (OSNaN())
00440 {
00441 #ifndef NDEBUG
00442 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Inside InitVarValue Constructor");
00443 #endif
00444 }
00445
00446 InitVarValue::~InitVarValue()
00447 {
00448 #ifndef NDEBUG
00449 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "InitVarValue Destructor Called");
00450 #endif
00451 }
00452
00453
00454 InitVariableValues::InitVariableValues():
00455 numberOfVar (0)
00456 {
00457 #ifndef NDEBUG
00458 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Inside InitVariableValues Constructor");
00459 #endif
00460 var = NULL;
00461 }
00462
00463 InitVariableValues::~InitVariableValues()
00464 {
00465 #ifndef NDEBUG
00466 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "InitVariableValues Destructor Called");
00467 #endif
00468 int i;
00469 if (var != NULL)
00470 {
00471 for (i=0; i < numberOfVar; i++)
00472 {
00473 delete var[i];
00474 var[i] = NULL;
00475 }
00476 delete[] var;
00477 var = NULL;
00478 }
00479 }
00480
00481
00482 InitVarValueString::InitVarValueString():
00483 idx (-1),
00484 name (""),
00485 value ("")
00486 {
00487 #ifndef NDEBUG
00488 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Inside InitVarValueString Constructor");
00489 #endif
00490 }
00491
00492 InitVarValueString::~InitVarValueString()
00493 {
00494 #ifndef NDEBUG
00495 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "InitVarValueString Destructor Called");
00496 #endif
00497 }
00498
00499
00500 InitVariableValuesString::InitVariableValuesString():
00501 numberOfVar (0)
00502 {
00503 #ifndef NDEBUG
00504 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Inside InitVariableValuesString Constructor");
00505 #endif
00506 var = NULL;
00507 }
00508
00509 InitVariableValuesString::~InitVariableValuesString()
00510 {
00511 #ifndef NDEBUG
00512 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "InitVariableValuesString Destructor Called");
00513 #endif
00514 int i;
00515 if (var != NULL)
00516 {
00517 for (i=0; i < numberOfVar; i++)
00518 {
00519 delete var[i];
00520 var[i] = NULL;
00521 }
00522 delete[] var;
00523 var = NULL;
00524 }
00525 }
00526
00527 InitBasStatus::InitBasStatus():
00528 idx (-1),
00529 value ("unknown")
00530 {
00531 #ifndef NDEBUG
00532 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Inside InitBasStatus Constructor");
00533 #endif
00534 }
00535
00536 InitBasStatus::~InitBasStatus()
00537 {
00538 #ifndef NDEBUG
00539 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "InitBasStatus Destructor Called");
00540 #endif
00541 }
00542
00543
00544 InitialBasisStatus::InitialBasisStatus():
00545 numberOfVar (0)
00546 {
00547 #ifndef NDEBUG
00548 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Inside InitialBasisStatus Constructor");
00549 #endif
00550 var = NULL;
00551 }
00552
00553 InitialBasisStatus::~InitialBasisStatus()
00554 {
00555 #ifndef NDEBUG
00556 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "InitialBasisStatus Destructor Called");
00557 #endif
00558 if (var != NULL)
00559 {
00560 int i;
00561 for (i=0; i < numberOfVar; i++)
00562 {
00563 delete var[i];
00564 var[i] = NULL;
00565 }
00566 delete[] var;
00567 var = NULL;
00568 }
00569 }
00570
00571 BranchingWeight::BranchingWeight():
00572 idx (-1),
00573 name (""),
00574 value (0.0)
00575 {
00576 #ifndef NDEBUG
00577 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Inside BranchingWeight Constructor");
00578 #endif
00579 }
00580
00581 BranchingWeight::~BranchingWeight()
00582 {
00583 #ifndef NDEBUG
00584 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "BranchingWeight Destructor Called");
00585 #endif
00586 }
00587
00588
00589 IntegerVariableBranchingWeights::IntegerVariableBranchingWeights():
00590 numberOfVar (0)
00591 {
00592 #ifndef NDEBUG
00593 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Inside IntegerVariableBranchingWeights Constructor");
00594 #endif
00595 var = NULL;
00596 }
00597
00598 IntegerVariableBranchingWeights::~IntegerVariableBranchingWeights()
00599 {
00600 #ifndef NDEBUG
00601 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "IntegerVariableBranchingWeights Destructor Called");
00602 #endif
00603 if (var != NULL)
00604 {
00605 int i;
00606 for (i=0; i < numberOfVar; i++)
00607 {
00608 delete var[i];
00609 var[i] = NULL;
00610 }
00611 delete[] var;
00612 var = NULL;
00613 }
00614 }
00615
00616 SOSWeights::SOSWeights():
00617 sosIdx (-1),
00618 groupWeight (1.0),
00619 numberOfVar (0)
00620 {
00621 #ifndef NDEBUG
00622 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Inside SOSWeights Constructor");
00623 #endif
00624 var = NULL;
00625 }
00626
00627 SOSWeights::~SOSWeights()
00628 {
00629 #ifndef NDEBUG
00630 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "SOSWeights Destructor Called");
00631 #endif
00632 if (var != NULL)
00633 {
00634 int i;
00635 for (i=0; i < numberOfVar; i++)
00636 {
00637 delete var[i];
00638 var[i] = NULL;
00639 }
00640 delete[] var;
00641 var = NULL;
00642 }
00643 }
00644
00645 SOSVariableBranchingWeights::SOSVariableBranchingWeights():
00646 numberOfSOS (0)
00647 {
00648 #ifndef NDEBUG
00649 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Inside SOSVariableBranchingWeights Constructor");
00650 #endif
00651 sos = NULL;
00652 }
00653
00654 SOSVariableBranchingWeights::~SOSVariableBranchingWeights()
00655 {
00656 #ifndef NDEBUG
00657 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "SOSVariableBranchingWeights Destructor Called");
00658 #endif
00659 if (sos != NULL)
00660 {
00661 int i;
00662 for (i=0; i < numberOfSOS; i++)
00663 {
00664 delete sos[i];
00665 sos[i] = NULL;
00666 }
00667 delete[] sos;
00668 sos = NULL;
00669 }
00670 }
00671
00672 OtherVarOption::OtherVarOption():
00673 idx (0),
00674 name (""),
00675 value (""),
00676 lbValue (""),
00677 ubValue ("")
00678 {
00679 #ifndef NDEBUG
00680 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Inside OtherVarOption Constructor");
00681 #endif
00682 }
00683
00684 OtherVarOption::~OtherVarOption()
00685 {
00686 #ifndef NDEBUG
00687 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "OtherVarOption Destructor Called");
00688 #endif
00689 }
00690
00691
00692 OtherVariableOption::OtherVariableOption():
00693 numberOfVar(0),
00694 numberOfEnumerations(0),
00695 name (""),
00696 value (""),
00697 solver(""),
00698 category (""),
00699 type (""),
00700 description (""),
00701
00702 varType (""),
00703 enumType ("")
00704 {
00705 #ifndef NDEBUG
00706 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Inside OtherVariableOption Constructor");
00707 #endif
00708 var = NULL;
00709 enumeration = NULL;
00710 }
00711
00712 OtherVariableOption::~OtherVariableOption()
00713 {
00714 #ifndef NDEBUG
00715 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "OtherVariableOption Destructor Called");
00716 #endif
00717 if (var != NULL)
00718 {
00719 for (int i=0; i < numberOfVar; i++)
00720 {
00721 delete var[i];
00722 var[i] = NULL;
00723 }
00724 delete[] var;
00725 var = NULL;
00726 }
00727 if (enumeration != NULL)
00728 {
00729 for (int i=0; i < numberOfEnumerations; i++)
00730 {
00731 delete enumeration[i];
00732 enumeration[i] = NULL;
00733 }
00734 delete[] enumeration;
00735 enumeration = NULL;
00736 }
00737 }
00738
00739
00740 VariableOption::VariableOption():
00741 numberOfOtherVariableOptions(0)
00742 {
00743 #ifndef NDEBUG
00744 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Inside VariableOption Constructor");
00745 #endif
00746 initialVariableValues = NULL;
00747 initialVariableValuesString = NULL;
00748 initialBasisStatus = NULL;
00749 integerVariableBranchingWeights = NULL;
00750 sosVariableBranchingWeights = NULL;
00751 other = NULL;
00752 }
00753
00754 VariableOption::~VariableOption()
00755 {
00756 #ifndef NDEBUG
00757 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "VariableOption Destructor Called");
00758 #endif
00759 if (initialVariableValues != NULL) delete initialVariableValues;
00760 initialVariableValues = NULL;
00761 if (initialVariableValuesString != NULL) delete initialVariableValuesString;
00762 initialVariableValuesString = NULL;
00763 if (initialBasisStatus != NULL) delete initialBasisStatus;
00764 initialBasisStatus = NULL;
00765 if (integerVariableBranchingWeights != NULL) delete integerVariableBranchingWeights;
00766 integerVariableBranchingWeights = NULL;
00767 if (sosVariableBranchingWeights != NULL) delete sosVariableBranchingWeights;
00768 sosVariableBranchingWeights = NULL;
00769 if (other != NULL)
00770 {
00771 int i;
00772 for (i=0; i < numberOfOtherVariableOptions; i++)
00773 {
00774 if (other[i] != NULL)
00775 delete other[i];
00776 other[i] = NULL;
00777
00778 };
00779 delete[] other;
00780 other = NULL;
00781 };
00782 }
00783
00784
00785 InitObjValue::InitObjValue():
00786 idx (-1),
00787 name (""),
00788 value (OSNaN())
00789 {
00790 #ifndef NDEBUG
00791 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Inside InitObjValue Constructor");
00792 #endif
00793 }
00794
00795 InitObjValue::~InitObjValue()
00796 {
00797 #ifndef NDEBUG
00798 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "InitObjValue Destructor Called");
00799 #endif
00800 }
00801
00802
00803 InitObjectiveValues::InitObjectiveValues():
00804 numberOfObj (0)
00805 {
00806 #ifndef NDEBUG
00807 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Inside InitObjectiveValues Constructor");
00808 #endif
00809 obj = NULL;
00810 }
00811
00812 InitObjectiveValues::~InitObjectiveValues()
00813 {
00814 #ifndef NDEBUG
00815 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "InitObjectiveValues Destructor Called");
00816 #endif
00817 if (obj != NULL)
00818 {
00819 int i;
00820 for (i=0; i < numberOfObj; i++)
00821 {
00822 delete obj[i];
00823 obj[i] = NULL;
00824 }
00825 delete[] obj;
00826 obj = NULL;
00827 };
00828 }
00829
00830
00831 InitObjBound::InitObjBound():
00832 idx (-1),
00833 name (""),
00834 lbValue (-OSDBL_MAX),
00835 ubValue ( OSDBL_MAX)
00836 {
00837 #ifndef NDEBUG
00838 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Inside InitObjBound Constructor");
00839 #endif
00840 }
00841
00842 InitObjBound::~InitObjBound()
00843 {
00844 #ifndef NDEBUG
00845 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "InitObjBound Destructor Called");
00846 #endif
00847 }
00848
00849
00850 InitObjectiveBounds::InitObjectiveBounds():
00851 numberOfObj (0)
00852 {
00853 #ifndef NDEBUG
00854 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Inside InitObjectiveBounds Constructor");
00855 #endif
00856 obj = NULL;
00857 }
00858
00859 InitObjectiveBounds::~InitObjectiveBounds()
00860 {
00861 #ifndef NDEBUG
00862 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "InitObjectiveBounds Destructor Called");
00863 #endif
00864 if (obj != NULL)
00865 {
00866 int i;
00867 for (i=0; i < numberOfObj; i++)
00868 {
00869 delete obj[i];
00870 obj[i] = NULL;
00871 }
00872 delete[] obj;
00873 obj = NULL;
00874 };
00875 }
00876
00877
00878 OtherObjOption::OtherObjOption():
00879 idx (-1),
00880 name (""),
00881 value (""),
00882 lbValue (""),
00883 ubValue ("")
00884 {
00885 #ifndef NDEBUG
00886 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Inside OtherObjOption Constructor");
00887 #endif
00888 }
00889
00890 OtherObjOption::~OtherObjOption()
00891 {
00892 #ifndef NDEBUG
00893 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "OtherObjOption Destructor Called");
00894 #endif
00895 }
00896
00897
00898 OtherObjectiveOption::OtherObjectiveOption():
00899 numberOfObj(0),
00900 numberOfEnumerations(0),
00901 name (""),
00902 value (""),
00903 solver(""),
00904 category (""),
00905 type (""),
00906 description (""),
00907 objType (""),
00908 enumType ("")
00909 {
00910 #ifndef NDEBUG
00911 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Inside OtherObjectiveOption Constructor");
00912 #endif
00913 obj = NULL;
00914 enumeration = NULL;
00915 }
00916
00917 OtherObjectiveOption::~OtherObjectiveOption()
00918 {
00919 #ifndef NDEBUG
00920 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "OtherObjectiveOption Destructor Called");
00921 #endif
00922 if (obj != NULL)
00923 {
00924 for (int i=0; i < numberOfObj; i++)
00925 {
00926 delete obj[i];
00927 obj[i] = NULL;
00928 }
00929 delete[] obj;
00930 obj = NULL;
00931 }
00932 if (enumeration != NULL)
00933 {
00934 for (int i=0; i < numberOfEnumerations; i++)
00935 {
00936 delete enumeration[i];
00937 enumeration[i] = NULL;
00938 }
00939 delete[] enumeration;
00940 enumeration = NULL;
00941 }
00942 }
00943
00944
00945 ObjectiveOption::ObjectiveOption():
00946 numberOfOtherObjectiveOptions (0)
00947 {
00948 #ifndef NDEBUG
00949 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Inside ObjectiveOption Constructor");
00950 #endif
00951 initialObjectiveValues = NULL;
00952 initialObjectiveBounds = NULL;
00953 initialBasisStatus = NULL;
00954 other = NULL;
00955 }
00956
00957 ObjectiveOption::~ObjectiveOption()
00958 {
00959 #ifndef NDEBUG
00960 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "ObjectiveOption Destructor Called");
00961 #endif
00962 if (initialObjectiveValues != NULL) delete initialObjectiveValues;
00963 initialObjectiveValues = NULL;
00964 if (initialObjectiveBounds != NULL) delete initialObjectiveBounds;
00965 initialObjectiveBounds = NULL;
00966 if (initialBasisStatus != NULL) delete initialBasisStatus;
00967 initialBasisStatus = NULL;
00968 if (other != NULL)
00969 {
00970 int i;
00971 for (i=0; i < numberOfOtherObjectiveOptions; i++)
00972 {
00973 delete other[i];
00974 other[i] = NULL;
00975 }
00976 delete[] other;
00977 other = NULL;
00978 }
00979 }
00980
00981
00982 InitConValue::InitConValue():
00983 idx (0),
00984 name (""),
00985 value (OSNaN())
00986 {
00987 #ifndef NDEBUG
00988 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Inside InitConValue Constructor");
00989 #endif
00990 }
00991
00992 InitConValue::~InitConValue()
00993 {
00994 #ifndef NDEBUG
00995 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "InitConValue Destructor Called");
00996 #endif
00997 }
00998
00999
01000 InitConstraintValues::InitConstraintValues():
01001 numberOfCon (0)
01002 {
01003 #ifndef NDEBUG
01004 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Inside InitConstraintValues Constructor");
01005 #endif
01006 con = NULL;
01007 }
01008
01009 InitConstraintValues::~InitConstraintValues()
01010 {
01011 #ifndef NDEBUG
01012 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "InitConstraintValues Destructor Called");
01013 #endif
01014 if (con != NULL)
01015 {
01016 int i;
01017 for (i=0; i < numberOfCon; i++)
01018 {
01019 delete con[i];
01020 con[i] = NULL;
01021 }
01022 delete[] con;
01023 con = NULL;
01024 };
01025 }
01026
01027
01028 InitDualVarValue::InitDualVarValue():
01029 idx (0),
01030 name (""),
01031 lbDualValue (0.0),
01032 ubDualValue (0.0)
01033 {
01034 #ifndef NDEBUG
01035 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Inside InitDualVarValue Constructor");
01036 #endif
01037 }
01038
01039 InitDualVarValue::~InitDualVarValue()
01040 {
01041 #ifndef NDEBUG
01042 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "InitDualVarValue Destructor Called");
01043 #endif
01044 }
01045
01046
01047 InitDualVariableValues::InitDualVariableValues():
01048 numberOfCon (0)
01049 {
01050 #ifndef NDEBUG
01051 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Inside InitDualVariableValues Constructor");
01052 #endif
01053 con = NULL;
01054 }
01055
01056 InitDualVariableValues::~InitDualVariableValues()
01057 {
01058 #ifndef NDEBUG
01059 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "InitDualVariableValues Destructor Called");
01060 #endif
01061 if (con != NULL)
01062 {
01063 int i;
01064 for (i=0; i < numberOfCon; i++)
01065 {
01066 delete con[i];
01067 con[i] = NULL;
01068 }
01069 delete[] con;
01070 con = NULL;
01071 };
01072 }
01073
01074
01075 OtherConOption::OtherConOption():
01076 idx (0),
01077 name (""),
01078 value (""),
01079 lbValue (""),
01080 ubValue ("")
01081 {
01082 #ifndef NDEBUG
01083 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Inside OtherConOption Constructor");
01084 #endif
01085 }
01086
01087 OtherConOption::~OtherConOption()
01088 {
01089 #ifndef NDEBUG
01090 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "OtherConOption Destructor Called");
01091 #endif
01092 }
01093
01094
01095 OtherConstraintOption::OtherConstraintOption():
01096 numberOfCon(0),
01097 numberOfEnumerations(0),
01098 name (""),
01099 value (""),
01100 solver(""),
01101 category (""),
01102 type (""),
01103 description (""),
01104 conType (""),
01105 enumType ("")
01106 {
01107 #ifndef NDEBUG
01108 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Inside OtherConstraintOption Constructor");
01109 #endif
01110 con = NULL;
01111 enumeration = NULL;
01112 }
01113
01114 OtherConstraintOption::~OtherConstraintOption()
01115 {
01116 #ifndef NDEBUG
01117 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "OtherConstraintOption Destructor Called");
01118 #endif
01119 if (con != NULL)
01120 {
01121 for (int i=0; i < numberOfCon; i++)
01122 {
01123 if (con[i]!= NULL) delete con[i];
01124 con[i] = NULL;
01125 }
01126 delete[] con;
01127 con = NULL;
01128 }
01129 if (enumeration != NULL)
01130 {
01131 for (int i=0; i < numberOfEnumerations; i++)
01132 {
01133 delete enumeration[i];
01134 enumeration[i] = NULL;
01135 }
01136 delete[] enumeration;
01137 enumeration = NULL;
01138 }
01139 }
01140
01141
01142 ConstraintOption::ConstraintOption():
01143 numberOfOtherConstraintOptions (0)
01144 {
01145 #ifndef NDEBUG
01146 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Inside ConstraintOption Constructor");
01147 #endif
01148 initialConstraintValues = NULL;
01149 initialDualValues = NULL;
01150 initialBasisStatus = NULL;
01151 other = NULL;
01152 }
01153
01154 ConstraintOption::~ConstraintOption()
01155 {
01156 #ifndef NDEBUG
01157 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "ConstraintOption Destructor Called");
01158 #endif
01159 if (initialConstraintValues != NULL) delete initialConstraintValues;
01160 initialConstraintValues = NULL;
01161 if (initialDualValues != NULL) delete initialDualValues;
01162 initialDualValues = NULL;
01163 if (initialBasisStatus != NULL) delete initialBasisStatus;
01164 initialBasisStatus = NULL;
01165 if (other != NULL)
01166 {
01167 int i;
01168 for (i=0; i < numberOfOtherConstraintOptions; i++)
01169 {
01170 delete other[i];
01171 other[i] = NULL;
01172 }
01173 delete[] other;
01174 other = NULL;
01175 }
01176 }
01177
01178
01179 SolverOption::SolverOption():
01180 name (""),
01181 value (""),
01182 solver(""),
01183 category (""),
01184 type (""),
01185 description (""),
01186 numberOfItems(0),
01187 item(NULL)
01188 {
01189 #ifndef NDEBUG
01190 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Inside SolverOption Constructor");
01191 #endif
01192 }
01193
01194 SolverOption::~SolverOption()
01195 {
01196 #ifndef NDEBUG
01197 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "SolverOption Destructor Called");
01198 #endif
01199 if (item != NULL) delete[] item;
01200 item = NULL;
01201 }
01202
01203
01204 SolverOptions::SolverOptions():
01205 numberOfSolverOptions(0)
01206 {
01207 #ifndef NDEBUG
01208 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Inside SolverOptions Constructor");
01209 #endif
01210 solverOption = NULL;
01211 }
01212
01213 SolverOptions::~SolverOptions()
01214 {
01215 #ifndef NDEBUG
01216 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "SolverOptions Destructor Called");
01217 #endif
01218 if (solverOption != NULL)
01219 {
01220 int i;
01221 for (i=0; i<numberOfSolverOptions; i++)
01222 {
01223 delete solverOption[i];
01224 solverOption[i] = NULL;
01225 }
01226 delete[] solverOption;
01227 solverOption = NULL;
01228 }
01229 }
01230
01231
01232 OptimizationOption::OptimizationOption():
01233 numberOfVariables (-1),
01234 numberOfObjectives (-1),
01235 numberOfConstraints (-1)
01236 {
01237 #ifndef NDEBUG
01238 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Inside OptimizationOption Constructor");
01239 #endif
01240 variables = NULL;
01241 objectives = NULL;
01242 constraints = NULL;
01243 solverOptions = NULL;
01244 }
01245
01246 OptimizationOption::~OptimizationOption()
01247 {
01248 #ifndef NDEBUG
01249 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "OptimizationOption Destructor Called");
01250 #endif
01251 if (variables != NULL) delete variables;
01252 variables = NULL;
01253 if (objectives != NULL) delete objectives;
01254 objectives = NULL;
01255 if (constraints != NULL) delete constraints;
01256 constraints = NULL;
01257 if (solverOptions != NULL) delete solverOptions;
01258 solverOptions = NULL;
01259 }
01260
01261
01262 OSOption::OSOption()
01263
01264 {
01265 #ifndef NDEBUG
01266 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Inside OSOption Constructor");
01267 #endif
01268
01269 optionHeader = NULL;
01270 general = NULL;
01271 system = NULL;
01272 service = NULL;
01273 job = NULL;
01274 optimization = NULL;
01275 m_mdInitVarValuesDense = NULL;
01276 m_mdInitVarValuesStringDense = NULL;
01277 m_mdInitBasisStatusDense = NULL;
01278 m_mdIntegerVariableBranchingWeightsDense = NULL;
01279 m_mdInitObjValuesDense = NULL;
01280 m_mdInitObjLowerBoundsDense = NULL;
01281 m_mdInitObjUpperBoundsDense = NULL;
01282 m_mdInitConValuesDense = NULL;
01283 m_mdInitDualVarLowerBoundsDense = NULL;
01284 m_mdInitDualVarUpperBoundsDense = NULL;
01285 }
01286
01287 OSOption::~OSOption()
01288 {
01289 #ifndef NDEBUG
01290 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "OSOption Destructor Called");
01291 #endif
01292 if (optionHeader != NULL) delete optionHeader;
01293 optionHeader = NULL;
01294 if (general != NULL) delete general;
01295 general = NULL;
01296 if (system != NULL) delete system;
01297 system = NULL;
01298 if (service != NULL) delete service;
01299 service = NULL;
01300 if (job != NULL) delete job;
01301 job = NULL;
01302 if (optimization != NULL) delete optimization;
01303 optimization = NULL;
01304
01305 if (m_mdInitVarValuesDense != NULL)
01306 delete[] m_mdInitVarValuesDense;
01307 m_mdInitVarValuesDense = NULL;
01308
01309 if (m_mdInitVarValuesStringDense != NULL)
01310 delete[] m_mdInitVarValuesStringDense;
01311 m_mdInitVarValuesStringDense = NULL;
01312
01313 if (m_mdInitBasisStatusDense != NULL)
01314 delete[] m_mdInitBasisStatusDense;
01315 m_mdInitBasisStatusDense = NULL;
01316
01317 if (m_mdIntegerVariableBranchingWeightsDense != NULL)
01318 delete[] m_mdIntegerVariableBranchingWeightsDense;
01319 m_mdIntegerVariableBranchingWeightsDense = NULL;
01320
01321 if (m_mdInitObjValuesDense != NULL)
01322 delete[] m_mdInitObjValuesDense;
01323 m_mdInitObjValuesDense = NULL;
01324
01325 if (m_mdInitObjLowerBoundsDense != NULL)
01326 delete[] m_mdInitObjLowerBoundsDense;
01327 m_mdInitObjLowerBoundsDense = NULL;
01328
01329 if (m_mdInitObjUpperBoundsDense != NULL)
01330 delete[] m_mdInitObjUpperBoundsDense;
01331 m_mdInitObjUpperBoundsDense = NULL;
01332
01333 if (m_mdInitConValuesDense != NULL)
01334 delete[] m_mdInitConValuesDense;
01335 m_mdInitConValuesDense = NULL;
01336
01337 if (m_mdInitDualVarLowerBoundsDense != NULL)
01338 delete[] m_mdInitDualVarLowerBoundsDense;
01339 m_mdInitDualVarLowerBoundsDense = NULL;
01340
01341 if (m_mdInitDualVarUpperBoundsDense != NULL)
01342 delete[] m_mdInitDualVarUpperBoundsDense;
01343 m_mdInitDualVarUpperBoundsDense = NULL;
01344 }
01345
01346
01347
01348
01349
01350
01351
01352
01353
01354
01355
01356
01360 std::string OSOption::getFileName()
01361 {
01362 if (this->optionHeader != NULL)
01363 return this->optionHeader->name;
01364
01365 return "";
01366 }
01367
01371 std::string OSOption::getFileSource()
01372 {
01373 if (this->optionHeader != NULL)
01374 return this->optionHeader->source;
01375
01376 return "";
01377 }
01378
01382 std::string OSOption::getFileDescription()
01383 {
01384 if (this->optionHeader != NULL)
01385 return this->optionHeader->description;
01386
01387 return "";
01388 }
01389
01393 std::string OSOption::getFileCreator()
01394 {
01395 if (this->optionHeader != NULL)
01396 return this->optionHeader->fileCreator;
01397
01398 return "";
01399 }
01400
01404 std::string OSOption::getFileLicence()
01405 {
01406 if (this->optionHeader != NULL)
01407 return this->optionHeader->licence;
01408
01409 return "";
01410 }
01411
01412
01416 std::string OSOption::getServiceURI()
01417 {
01418 if (this->general != NULL)
01419 return this->general->serviceURI;
01420
01421 return "";
01422 }
01423
01427 std::string OSOption::getServiceName()
01428 {
01429 if (this->general != NULL)
01430 return this->general->serviceName;
01431
01432 return "";
01433 }
01434
01438 std::string OSOption::getInstanceName()
01439 {
01440 if (this->general != NULL)
01441 return this->general->instanceName;
01442
01443 return "";
01444 }
01445
01449 std::string OSOption::getInstanceLocation()
01450 {
01451 if (this->general != NULL)
01452 if (this->general->instanceLocation != NULL)
01453 return this->general->instanceLocation->value;
01454
01455 return "";
01456 }
01457
01461 std::string OSOption::getInstanceLocationType()
01462 {
01463 if (this->general != NULL)
01464 if (this->general->instanceLocation != NULL)
01465 return this->general->instanceLocation->locationType;
01466
01467 return "";
01468 }
01469
01473 std::string OSOption::getJobID()
01474 {
01475 if (this->general != NULL)
01476 return this->general->jobID;
01477
01478 return "";
01479 }
01480
01484 std::string OSOption::getSolverToInvoke()
01485 {
01486 if (this->general != NULL)
01487 return this->general->solverToInvoke;
01488
01489 return "";
01490 }
01491
01495 std::string OSOption::getLicense()
01496 {
01497 if (this->general != NULL)
01498 return this->general->license;
01499
01500 return "";
01501 }
01502
01506 std::string OSOption::getUserName()
01507 {
01508 if (this->general != NULL)
01509 return this->general->userName;
01510
01511 return "";
01512 }
01513
01517 std::string OSOption::getPassword()
01518 {
01519 if (this->general != NULL)
01520 return this->general->password;
01521
01522 return "";
01523 }
01524
01528 std::string OSOption::getContact()
01529 {
01530 if (this->general != NULL)
01531 if (this->general->contact != NULL)
01532 return this->general->contact->value;
01533
01534 return "";
01535 }
01536
01540 std::string OSOption::getContactTransportType()
01541 {
01542 if (this->general != NULL)
01543 if (this->general->contact != NULL)
01544 return this->general->contact->transportType;
01545
01546 return "";
01547 }
01548
01552 std::string OSOption::getMinDiskSpaceUnit()
01553 {
01554 if (this->system != NULL)
01555 if (this->system->minDiskSpace != NULL)
01556 return this->system->minDiskSpace->unit;
01557
01558 return "";
01559 }
01560
01564 std::string OSOption::getMinDiskSpaceDescription()
01565 {
01566 if (this->system != NULL)
01567 if (this->system->minDiskSpace != NULL)
01568 return this->system->minDiskSpace->description;
01569
01570 return "";
01571 }
01572
01576 std::string OSOption::getMinMemoryUnit()
01577 {
01578 if (this->system != NULL)
01579 if (this->system->minMemorySize != NULL)
01580 return this->system->minMemorySize->unit;
01581
01582 return "";
01583 }
01584
01588 std::string OSOption::getMinMemoryDescription()
01589 {
01590 if (this->system != NULL)
01591 if (this->system->minMemorySize != NULL)
01592 return this->system->minMemorySize->description;
01593
01594 return "";
01595 }
01596
01600 std::string OSOption::getMinCPUSpeedUnit()
01601 {
01602 if (this->system != NULL)
01603 if (this->system->minCPUSpeed != NULL)
01604 return this->system->minCPUSpeed->unit;
01605
01606 return "";
01607 }
01608
01612 std::string OSOption::getMinCPUSpeedDescription()
01613 {
01614 if (this->system != NULL)
01615 if (this->system->minCPUSpeed != NULL)
01616 return this->system->minCPUSpeed->description;
01617
01618 return "";
01619 }
01620
01624 std::string OSOption::getMinCPUNumberDescription()
01625 {
01626 if (this->system != NULL)
01627 if (this->system->minCPUNumber != NULL)
01628 return this->system->minCPUNumber->description;
01629
01630 return "";
01631 }
01632
01636 std::string OSOption::getServiceType()
01637 {
01638 if (this->service != NULL)
01639 return this->service->type;
01640
01641 return "";
01642 }
01643
01647 std::string OSOption::getMaxTimeUnit()
01648 {
01649 if (this->job != NULL)
01650 if (this->job->maxTime != NULL)
01651 return this->job->maxTime->unit;
01652
01653 return "";
01654 }
01655
01659 std::string OSOption::getRequestedStartTime()
01660 {
01661 if (this->job != NULL)
01662 return this->job->requestedStartTime;
01663
01664 return "";
01665 }
01666
01673 std::string OSOption::getOptionStr(std::string optionName)
01674 {
01675 if (optionName == "serviceURI")
01676 return this->getServiceURI();
01677
01678 if (optionName == "serviceName")
01679 return this->getServiceName();
01680
01681 if (optionName == "instanceName")
01682 return this->getInstanceName();
01683
01684 if (optionName == "instanceLocation")
01685 return this->getInstanceLocation();
01686
01687 if (optionName == "instanceLocationType")
01688 return this->getInstanceLocationType();
01689
01690 if (optionName == "jobID")
01691 return this->getJobID();
01692
01693 if (optionName == "solverToInvoke")
01694 return this->getSolverToInvoke();
01695
01696 if (optionName == "license")
01697 return this->getLicense();
01698
01699 if (optionName == "userName")
01700 return this->getUserName();
01701
01702 if (optionName == "password")
01703 return this->getPassword();
01704
01705 if (optionName == "contact")
01706 return this->getContact();
01707
01708 if (optionName == "contactTransportType")
01709 return this->getContactTransportType();
01710
01711 if (optionName == "minDiskSpaceUnit")
01712 return this->getMinDiskSpaceUnit();
01713
01714 if (optionName == "minMemoryUnit")
01715 return this->getMinMemoryUnit();
01716
01717 if (optionName == "minCPUSpeedUnit")
01718 return this->getMinCPUSpeedUnit();
01719
01720 if (optionName == "serviceType")
01721 return this->getServiceType();
01722
01723 if (optionName == "maxTimeUnit")
01724 return this->getMaxTimeUnit();
01725
01726 if (optionName == "requestedStartTime")
01727 return this->getRequestedStartTime();
01728
01729 return "";
01730 }
01731
01732
01733
01734
01735
01739 double OSOption::getMinDiskSpace()
01740 {
01741 if (this->system != NULL)
01742 if (this->system->minDiskSpace != NULL)
01743 return this->system->minDiskSpace->value;
01744
01745 return 0;
01746 }
01747
01751 double OSOption::getMinMemorySize()
01752 {
01753 if (this->system != NULL)
01754 if (this->system->minMemorySize != NULL)
01755 return this->system->minMemorySize->value;
01756
01757 return 0;
01758 }
01759
01763 double OSOption::getMinCPUSpeed()
01764 {
01765 if (this->system != NULL)
01766 if (this->system->minCPUSpeed != NULL)
01767 return this->system->minCPUSpeed->value;
01768
01769 return 0;
01770 }
01771
01775 double OSOption::getMaxTime()
01776 {
01777 if (this->job != NULL)
01778 if (this->job->maxTime != NULL)
01779 return job->maxTime->value;
01780
01781 return 0;
01782 }
01783
01790 double OSOption::getOptionDbl(std::string optionName)
01791 {
01792 if (optionName == "minDiskSpace")
01793 return this->getMinDiskSpace();
01794
01795 if (optionName == "minMemory")
01796 return this->getMinMemorySize();
01797
01798 if (optionName == "minCPUSpeed")
01799 return this->getMinCPUSpeed();
01800
01801 if (optionName == "maxTime")
01802 return this->getMaxTime();
01803
01804 return 0;
01805 }
01806
01814 int OSOption::getMinCPUNumber()
01815 {
01816 if (this->system != NULL)
01817 return this->system->minCPUNumber->value;
01818
01819 return 0;
01820 }
01821
01825 int OSOption::getNumberOfOtherGeneralOptions()
01826 {
01827 if (this->general != NULL)
01828 if (this->general->otherOptions != NULL)
01829 return this->general->otherOptions->numberOfOtherOptions;
01830
01831 return 0;
01832 }
01833
01837 int OSOption::getNumberOfOtherSystemOptions()
01838 {
01839 if (this->system != NULL)
01840 if (this->system->otherOptions != NULL)
01841 return this->system->otherOptions->numberOfOtherOptions;
01842
01843 return 0;
01844 }
01845
01849 int OSOption::getNumberOfOtherServiceOptions()
01850 {
01851 if (this->service != NULL)
01852 if (this->service->otherOptions != NULL)
01853 return this->service->otherOptions->numberOfOtherOptions;
01854
01855 return 0;
01856 }
01857
01861 int OSOption::getNumberOfOtherJobOptions()
01862 {
01863 if (this->job != NULL)
01864 if (this->job->otherOptions != NULL)
01865 return this->job->otherOptions->numberOfOtherOptions;
01866
01867 return 0;
01868 }
01869
01873 int OSOption::getNumberOfJobDependencies()
01874 {
01875 if (this->job != NULL)
01876 if (this->job->dependencies != NULL)
01877 return this->job->dependencies->numberOfJobIDs;
01878
01879 return 0;
01880 }
01881
01885 int OSOption::getNumberOfRequiredDirectories()
01886 {
01887 if (this->job != NULL)
01888 if (this->job->requiredDirectories != NULL)
01889 return this->job->requiredDirectories->numberOfPaths;
01890
01891 return 0;
01892 }
01893
01897 int OSOption::getNumberOfRequiredFiles()
01898 {
01899 if (this->job != NULL)
01900 if (this->job->requiredFiles != NULL)
01901 return this->job->requiredFiles->numberOfPaths;
01902
01903 return 0;
01904 }
01905
01909 int OSOption::getNumberOfDirectoriesToMake()
01910 {
01911 if (this->job != NULL)
01912 if (this->job->directoriesToMake != NULL)
01913 return this->job->directoriesToMake->numberOfPaths;
01914
01915 return 0;
01916 }
01917
01921 int OSOption::getNumberOfFilesToMake()
01922 {
01923 if (this->job != NULL)
01924 if (this->job->filesToMake != NULL)
01925 return this->job->filesToMake->numberOfPaths;
01926
01927 return 0;
01928 }
01929
01933 int OSOption::getNumberOfInputDirectoriesToMove()
01934 {
01935 if (this->job != NULL)
01936 if (this->job->inputDirectoriesToMove != NULL)
01937 return this->job->inputDirectoriesToMove->numberOfPathPairs;
01938
01939 return 0;
01940 }
01941
01945 int OSOption::getNumberOfInputFilesToMove()
01946 {
01947 if (this->job != NULL)
01948 if (this->job->inputFilesToMove != NULL)
01949 return this->job->inputFilesToMove->numberOfPathPairs;
01950
01951 return 0;
01952 }
01953
01957 int OSOption::getNumberOfOutputDirectoriesToMove()
01958 {
01959 if (this->job != NULL)
01960 if (this->job->outputDirectoriesToMove != NULL)
01961 return this->job->outputDirectoriesToMove->numberOfPathPairs;
01962
01963 return 0;
01964 }
01965
01969 int OSOption::getNumberOfOutputFilesToMove()
01970 {
01971 if (this->job != NULL)
01972 if (this->job->outputFilesToMove != NULL)
01973 return this->job->outputFilesToMove->numberOfPathPairs;
01974
01975 return 0;
01976 }
01977
01981 int OSOption::getNumberOfFilesToDelete()
01982 {
01983 if (this->job != NULL)
01984 if (this->job->filesToDelete != NULL)
01985 return this->job->filesToDelete->numberOfPaths;
01986
01987 return 0;
01988 }
01989
01993 int OSOption::getNumberOfDirectoriesToDelete()
01994 {
01995 if (this->job != NULL)
01996 if (this->job->directoriesToDelete != NULL)
01997 return this->job->directoriesToDelete->numberOfPaths;
01998
01999 return 0;
02000 }
02001
02005 int OSOption::getNumberOfProcessesToKill()
02006 {
02007 if (this->job != NULL)
02008 if (this->job->processesToKill != NULL)
02009 return this->job->processesToKill->numberOfProcesses;
02010
02011 return 0;
02012 }
02013
02017 int OSOption::getNumberOfVariables()
02018 {
02019 if (this->optimization != NULL)
02020 return this->optimization->numberOfVariables;
02021
02022 return -1;
02023 }
02024
02028 int OSOption::getNumberOfObjectives()
02029 {
02030 if (this->optimization != NULL)
02031 return this->optimization->numberOfObjectives;
02032
02033 return -1;
02034 }
02035
02039 int OSOption::getNumberOfConstraints()
02040 {
02041 if (this->optimization != NULL)
02042 return this->optimization->numberOfConstraints;
02043
02044 return -1;
02045 }
02046
02047
02051 int OSOption::getNumberOfInitVarValues()
02052 {
02053 if (this->optimization != NULL)
02054 {
02055 if (this->optimization->variables != NULL)
02056 {
02057 if (this->optimization->variables->initialVariableValues != NULL)
02058 {
02059 return this->optimization->variables->initialVariableValues->numberOfVar;
02060 }
02061 }
02062 }
02063 return -1;
02064 }
02065
02069 int OSOption::getNumberOfInitVarValuesString()
02070 {
02071 if (this->optimization != NULL)
02072 if (this->optimization->variables != NULL)
02073 if (this->optimization->variables->initialVariableValuesString != NULL)
02074 return this->optimization->variables->initialVariableValuesString->numberOfVar;
02075 return -1;
02076 }
02077
02078
02082 int OSOption::getNumberOfIntegerVariableBranchingWeights()
02083 {
02084 if (this->optimization != NULL)
02085 if (this->optimization->variables != NULL)
02086 if (this->optimization->variables->integerVariableBranchingWeights != NULL)
02087 return this->optimization->variables->integerVariableBranchingWeights->numberOfVar;
02088 return -1;
02089 }
02090
02094 int OSOption::getNumberOfSOS()
02095 {
02096 if (this->optimization != NULL)
02097 if (this->optimization->variables != NULL)
02098 if (this->optimization->variables->sosVariableBranchingWeights != NULL)
02099 return this->optimization->variables->sosVariableBranchingWeights->numberOfSOS;
02100 return -1;
02101 }
02102
02106 int OSOption::getNumberOfSOSVarBranchingWeights(int iSOS)
02107 {
02108 if (this->optimization != NULL)
02109 if (this->optimization->variables != NULL)
02110 if (this->optimization->variables->sosVariableBranchingWeights != NULL)
02111 {
02112 if (iSOS >= 0 && iSOS < this->optimization->variables->sosVariableBranchingWeights->numberOfSOS)
02113 if (this->optimization->variables->sosVariableBranchingWeights->sos[iSOS] != NULL)
02114 return this->optimization->variables->sosVariableBranchingWeights->sos[iSOS]->numberOfVar;
02115 }
02116 return -1;
02117 }
02118
02122 int OSOption::getNumberOfOtherVariableOptions()
02123 {
02124 if (this->optimization != NULL)
02125 if (this->optimization->variables != NULL)
02126 return this->optimization->variables->numberOfOtherVariableOptions;
02127
02128 return 0;
02129 }
02130
02134 int OSOption::getNumberOfInitObjValues()
02135 {
02136 if (this->optimization != NULL)
02137 if (this->optimization->objectives != NULL)
02138 if (this->optimization->objectives->initialObjectiveValues != NULL)
02139 return this->optimization->objectives->initialObjectiveValues->numberOfObj;
02140
02141 return -1;
02142 }
02143
02147 int OSOption::getNumberOfInitObjBounds()
02148 {
02149 if (this->optimization != NULL)
02150 if (this->optimization->objectives != NULL)
02151 if (this->optimization->objectives->initialObjectiveBounds != NULL)
02152 return this->optimization->objectives->initialObjectiveBounds->numberOfObj;
02153 return -1;
02154 }
02155
02159 int OSOption::getNumberOfOtherObjectiveOptions()
02160 {
02161 if (this->optimization != NULL)
02162 if (this->optimization->objectives != NULL)
02163 return this->optimization->objectives->numberOfOtherObjectiveOptions;
02164 return 0;
02165 }
02166
02170 int OSOption::getNumberOfInitConValues()
02171 {
02172 if (this->optimization != NULL)
02173 if (this->optimization->constraints != NULL)
02174 if (this->optimization->constraints->initialConstraintValues != NULL)
02175 return this->optimization->constraints->initialConstraintValues->numberOfCon;
02176 return -1;
02177 }
02178
02182 int OSOption::getNumberOfInitDualVarValues()
02183 {
02184 if (this->optimization != NULL)
02185 if (this->optimization->constraints != NULL)
02186 if (this->optimization->constraints->initialDualValues != NULL)
02187 return this->optimization->constraints->initialDualValues->numberOfCon;
02188
02189 return -1;
02190 }
02191
02195 int OSOption::getNumberOfOtherConstraintOptions()
02196 {
02197 if (this->optimization != NULL)
02198 if (this->optimization->constraints != NULL)
02199 return this->optimization->constraints->numberOfOtherConstraintOptions;
02200
02201 return -1;
02202 }
02203
02207 int OSOption::getNumberOfSolverOptions()
02208 {
02209 if (this->optimization != NULL)
02210 if (this->optimization->solverOptions != NULL)
02211 return this->optimization->solverOptions->numberOfSolverOptions;
02212
02213 return -1;
02214 }
02215
02222 int OSOption::getOptionInt(std::string optionName)
02223 {
02224 if (optionName == "minCPUNumber")
02225 return this->getMinCPUNumber();
02226
02227 if (optionName == "numberOfOtherGeneralOptions")
02228 return this->getNumberOfOtherGeneralOptions();
02229
02230 if (optionName == "numberOfOtherSystemOptions")
02231 return this->getNumberOfOtherSystemOptions();
02232
02233 if (optionName == "numberOfOtherServiceOptions")
02234 return this->getNumberOfOtherServiceOptions();
02235
02236 if (optionName == "numberOfOtherJobOptions")
02237 return this->getNumberOfOtherJobOptions();
02238
02239 if (optionName == "numberOfJobDependencies")
02240 return this->getNumberOfJobDependencies();
02241
02242 if (optionName == "numberOfRequiredDirectories")
02243 return this->getNumberOfRequiredDirectories();
02244
02245 if (optionName == "numberOfRequiredFiles")
02246 return this->getNumberOfRequiredFiles();
02247
02248 if (optionName == "numberOfDirectoriesToMake")
02249 return this->getNumberOfDirectoriesToMake();
02250
02251 if (optionName == "numberOfFilesToMake")
02252 return this->getNumberOfFilesToMake();
02253
02254 if (optionName == "numberOfInputDirectoriesToMove")
02255 return this->getNumberOfInputDirectoriesToMove();
02256
02257 if (optionName == "numberOfInputFilesToMove")
02258 return this->getNumberOfInputFilesToMove();
02259
02260 if (optionName == "numberOfOutputDirectoriesToMove")
02261 return this->getNumberOfOutputDirectoriesToMove();
02262
02263 if (optionName == "numberOfOutputFilesToMove")
02264 return this->getNumberOfOutputFilesToMove();
02265
02266 if (optionName == "numberOfFilesToDelete")
02267 return this->getNumberOfFilesToDelete();
02268
02269 if (optionName == "numberOfDirectoriesToDelete")
02270 return this->getNumberOfDirectoriesToDelete();
02271
02272 if (optionName == "numberOfProcessesToKill")
02273 return this->getNumberOfProcessesToKill();
02274
02275 if (optionName == "numberOfVariables")
02276 return this->getNumberOfVariables();
02277
02278 if (optionName == "numberOfObjectives")
02279 return this->getNumberOfObjectives();
02280
02281 if (optionName == "numberOfConstraints")
02282 return this->getNumberOfConstraints();
02283
02284 if (optionName == "numberOfInitVarValues")
02285 return this->getNumberOfInitVarValues();
02286
02287 if (optionName == "numberOfInitVarValuesString")
02288 return this->getNumberOfInitVarValuesString();
02289
02290 if (optionName == "numberOfIntegerVariableBranchingWeights")
02291 return this->getNumberOfIntegerVariableBranchingWeights();
02292
02293 if (optionName == "numberOfSOS")
02294 return this->getNumberOfSOS();
02295
02296 if (optionName == "numberOfOtherVariableOptions")
02297 return this->getNumberOfOtherVariableOptions();
02298
02299 if (optionName == "numberOfInitObjValues")
02300 return this->getNumberOfInitObjValues();
02301
02302 if (optionName == "numberOfInitObjBounds")
02303 return this->getNumberOfInitObjBounds();
02304
02305 if (optionName == "numberOfOtherObjectiveOptions")
02306 return this->getNumberOfOtherObjectiveOptions();
02307
02308 if (optionName == "numberOfInitConValues")
02309 return this->getNumberOfInitConValues();
02310
02311 if (optionName == "numberOfInitDualVarValues")
02312 return this->getNumberOfInitDualVarValues();
02313
02314 if (optionName == "numberOfOtherConstraintOptions")
02315 return this->getNumberOfOtherConstraintOptions();
02316
02317 if (optionName == "numberOfSolverOptions")
02318 return this->getNumberOfSolverOptions();
02319
02320 return -1;
02321 }
02322
02323
02324
02325
02326
02327
02331 OtherOption** OSOption::getOtherGeneralOptions()
02332 {
02333 if (this->general != NULL)
02334 {
02335 if (this->general->otherOptions != NULL)
02336 return this->general->otherOptions->other;
02337 }
02338 return NULL;
02339 }
02340
02344 OtherOption** OSOption::getOtherSystemOptions()
02345 {
02346 if (this->system != NULL)
02347 {
02348 if (this->system->otherOptions != NULL)
02349 return this->system->otherOptions->other;
02350 }
02351 return NULL;
02352 }
02353
02357 OtherOption** OSOption::getOtherServiceOptions()
02358 {
02359 if (this->service != NULL)
02360 {
02361 if (this->service->otherOptions != NULL)
02362 return this->service->otherOptions->other;
02363 }
02364 return NULL;
02365 }
02366
02370 OtherOption** OSOption::getOtherJobOptions()
02371 {
02372 if (this->job != NULL)
02373 {
02374 if (this->job->otherOptions != NULL)
02375 return this->job->otherOptions->other;
02376 }
02377 return NULL;
02378 }
02379
02386 OtherOption** OSOption::getOtherOptions(std::string category)
02387 {
02388 if (category == "general")
02389 return this->getOtherGeneralOptions();
02390
02391 if (category == "system")
02392 return this->getOtherSystemOptions();
02393
02394 if (category == "service")
02395 return this->getOtherServiceOptions();
02396
02397 if (category == "job")
02398 return this->getOtherJobOptions();
02399
02400 return NULL;
02401 }
02402
02406 OtherOption** OSOption::getAllOtherOptions()
02407 {
02408 OtherOption** optionVector = NULL;
02409 int prev_options[4];
02410 int num_options[4];
02411 int num_opt;
02412 int i;
02413
02414 for (i = 0; i < 4; i++)
02415 {
02416 prev_options[i] = 0;
02417 num_options[i] = 0;
02418 }
02419 if (this->general != NULL)
02420 {
02421 if (this->general->otherOptions != NULL)
02422 {
02423 num_opt = this->getNumberOfOtherGeneralOptions();
02424 num_options[0] = num_opt;
02425 }
02426 }
02427
02428 if (this->system != NULL)
02429 {
02430 if (this->system->otherOptions != NULL)
02431 {
02432 num_opt = this->getNumberOfOtherSystemOptions();
02433 num_options[1] = num_opt;
02434 }
02435 }
02436 prev_options[1] = prev_options[0] + num_options[0];
02437
02438 if (this->service != NULL)
02439 {
02440 if (this->service->otherOptions != NULL)
02441 {
02442 num_opt = this->getNumberOfOtherServiceOptions();
02443 num_options[2] = num_opt;
02444 }
02445 }
02446 prev_options[2] = prev_options[1] + num_options[1];
02447
02448 if (this->job != NULL)
02449 {
02450 if (this->job->otherOptions != NULL)
02451 {
02452 num_opt = this->getNumberOfOtherJobOptions();
02453 num_options[3] = num_opt;
02454 }
02455 }
02456 prev_options[3] = prev_options[2] + num_options[2];
02457
02458 num_opt = num_options[0] + num_options[1] + num_options[2] + num_options[3];
02459 optionVector = new OtherOption*[num_opt];
02460
02461 if (num_options[0] > 0)
02462 {
02463 for (i = 0; i < num_options[0]; i++)
02464 {
02465 optionVector[prev_options[0] + i] = this->general->otherOptions->other[i];
02466 }
02467 }
02468
02469 if (num_options[1] > 0)
02470 {
02471 for (i = 0; i < num_options[1]; i++)
02472 {
02473 optionVector[prev_options[1] + i] = this->system->otherOptions->other[i];
02474 }
02475 }
02476
02477 if (num_options[2] > 0)
02478 {
02479 for (i = 0; i < num_options[2]; i++)
02480 {
02481 optionVector[prev_options[2] + i] = this->service->otherOptions->other[i];
02482 }
02483 }
02484
02485 if (num_options[3] > 0)
02486 {
02487 for (i = 0; i < num_options[3]; i++)
02488 {
02489 optionVector[prev_options[3] + i] = this->job->otherOptions->other[i];
02490 }
02491 }
02492
02493 return optionVector;
02494 }
02495
02499 std::string* OSOption::getJobDependencies()
02500 {
02501 std::string* dependenciesVector = NULL;
02502 if (this->job != NULL)
02503 {
02504 if (this->job->dependencies != NULL)
02505 dependenciesVector = this->job->dependencies->jobID;
02506 else
02507 throw ErrorClass("<dependencies> object must be defined before getting the jobIDs");
02508 }
02509 else
02510 throw ErrorClass("<job> object must be defined before getting the jobIDs");
02511
02512 return dependenciesVector;
02513 }
02514
02518 std::string* OSOption::getRequiredDirectories()
02519 {
02520 std::string* pathVector = NULL;
02521 if (this->job != NULL)
02522 {
02523 if (this->job->requiredDirectories != NULL)
02524 pathVector = this->job->requiredDirectories->path;
02525 else
02526 throw ErrorClass("<requiredDirectories> object must be defined before getting the paths");
02527 }
02528 else
02529 throw ErrorClass("<job> object must be defined before getting the paths");
02530 return pathVector;
02531 }
02532
02536 std::string* OSOption::getRequiredFiles()
02537 {
02538 std::string* pathVector = NULL;
02539 if (this->job != NULL)
02540 {
02541 if (this->job->requiredFiles != NULL)
02542 pathVector = this->job->requiredFiles->path;
02543 else
02544 throw ErrorClass("<requiredFiles> object must be defined before getting the paths");
02545 }
02546 else
02547 throw ErrorClass("<job> object must be defined before getting the paths");
02548 return pathVector;
02549 }
02550
02554 std::string* OSOption::getDirectoriesToMake()
02555 {
02556 std::string* pathVector = NULL;
02557 if (this->job != NULL)
02558 {
02559 if (this->job->directoriesToMake != NULL)
02560 pathVector = this->job->directoriesToMake->path;
02561 else
02562 throw ErrorClass("<directoriesToMake> object must be defined before getting the paths");
02563 }
02564 else
02565 throw ErrorClass("<job> object must be defined before getting the paths");
02566 return pathVector;
02567 }
02568
02572 std::string* OSOption::getFilesToMake()
02573 {
02574 std::string* pathVector = NULL;
02575 if (this->job != NULL)
02576 {
02577 if (this->job->filesToMake != NULL)
02578 pathVector = this->job->filesToMake->path;
02579 else
02580 throw ErrorClass("<filesToMake> object must be defined before getting the paths");
02581 }
02582 else
02583 throw ErrorClass("<job> object must be defined before getting the paths");
02584 return pathVector;
02585 }
02586
02590 PathPair** OSOption::getInputDirectoriesToMove()
02591 {
02592 PathPair** pathPairVector = NULL;
02593 if (this->job != NULL)
02594 {
02595 if (this->job->inputDirectoriesToMove != NULL)
02596 pathPairVector = this->job->inputDirectoriesToMove->pathPair;
02597 else
02598 throw ErrorClass("<inputDirectoriesToMove> object must be defined before getting the paths");
02599 }
02600 else
02601 throw ErrorClass("<job> object must be defined before getting the paths");
02602 return pathPairVector;
02603 }
02604
02608 PathPair** OSOption::getInputFilesToMove()
02609 {
02610 PathPair** pathPairVector = NULL;
02611 if (this->job != NULL)
02612 {
02613 if (this->job->inputFilesToMove != NULL)
02614 pathPairVector = this->job->inputFilesToMove->pathPair;
02615 else
02616 throw ErrorClass("<inputFilesToMove> object must be defined before getting the paths");
02617 }
02618 else
02619 throw ErrorClass("<job> object must be defined before getting the paths");
02620 return pathPairVector;
02621 }
02622
02626 PathPair** OSOption::getOutputFilesToMove()
02627 {
02628 PathPair** pathPairVector = NULL;
02629 if (this->job != NULL)
02630 {
02631 if (this->job->outputFilesToMove != NULL)
02632 pathPairVector = this->job->outputFilesToMove->pathPair;
02633 else
02634 throw ErrorClass("<outputFilesToMove> object must be defined before getting the paths");
02635 }
02636 else
02637 throw ErrorClass("<job> object must be defined before getting the paths");
02638 return pathPairVector;
02639 }
02640
02644 PathPair** OSOption::getOutputDirectoriesToMove()
02645 {
02646 PathPair** pathPairVector = NULL;
02647 if (this->job != NULL)
02648 {
02649 if (this->job->outputDirectoriesToMove != NULL)
02650 pathPairVector = this->job->outputDirectoriesToMove->pathPair;
02651 else
02652 throw ErrorClass("<outputDirectoriesToMove> object must be defined before getting the paths");
02653 }
02654 else
02655 throw ErrorClass("<job> object must be defined before getting the paths");
02656 return pathPairVector;
02657 }
02658
02662 std::string* OSOption::getFilesToDelete()
02663 {
02664 std::string* pathVector = NULL;
02665 if (this->job != NULL)
02666 {
02667 if (this->job->filesToDelete != NULL)
02668 pathVector = this->job->filesToDelete->path;
02669 else
02670 throw ErrorClass("<filesToDelete> object must be defined before getting the paths");
02671 }
02672 else
02673 throw ErrorClass("<job> object must be defined before getting the paths");
02674 return pathVector;
02675 }
02676
02680 std::string* OSOption::getDirectoriesToDelete()
02681 {
02682 std::string* pathVector = NULL;
02683 if (this->job != NULL)
02684 {
02685 if (this->job->directoriesToDelete != NULL)
02686 pathVector = this->job->directoriesToDelete->path;
02687 else
02688 throw ErrorClass("<directoriesToDelete> object must be defined before getting the paths");
02689 }
02690 else
02691 throw ErrorClass("<job> object must be defined before getting the paths");
02692 return pathVector;
02693 }
02694
02698 std::string* OSOption::getProcessesToKill()
02699 {
02700 std::string* processes = NULL;
02701 if (this->job != NULL)
02702 {
02703 if (this->job->processesToKill != NULL)
02704 processes = this->job->processesToKill->process;
02705 else
02706 throw ErrorClass("<processesToKill> object must be defined before getting the processes");
02707 }
02708 else
02709 throw ErrorClass("<job> object must be defined before getting the processes");
02710 return processes;
02711 }
02712
02713
02714
02719 InitVarValue** OSOption::getInitVarValuesSparse()
02720 {
02721 InitVarValue** initVarVector;
02722 if (this->optimization != NULL)
02723 {
02724 if (this->optimization->variables != NULL)
02725 {
02726 if (this->optimization->variables->initialVariableValues != NULL)
02727 initVarVector = this->optimization->variables->initialVariableValues->var;
02728 else
02729 throw ErrorClass("<initialVariableValues> object must be defined before getting the data");
02730 }
02731 else
02732 throw ErrorClass("<variables> object must be defined before getting the data");
02733 }
02734 else
02735 throw ErrorClass("<optimization> object must be defined before getting the data");
02736 return initVarVector;
02737 }
02738
02744 double* OSOption::getInitVarValuesDense()
02745 {
02746 try
02747 {
02748 int numberOfVariables;
02749 numberOfVariables = this->getNumberOfVariables();
02750 if (numberOfVariables < 0)
02751 throw ErrorClass("\"numberOfVariables\" must be present to use dense methods");
02752
02753 if (this->optimization != NULL)
02754 {
02755 if (this->optimization->variables != NULL)
02756 {
02757 if (this->optimization->variables->initialVariableValues != NULL)
02758 {
02759 int i,j,k;
02760 int num_var;
02761 num_var = this->getNumberOfInitVarValues();
02762
02763 if (m_mdInitVarValuesDense != NULL)
02764 delete [] m_mdInitVarValuesDense;
02765 m_mdInitVarValuesDense = new double[numberOfVariables];
02766 for (k = 0; k < numberOfVariables; k++) m_mdInitVarValuesDense[k] = OSNaN();
02767
02768 for (i = 0; i < num_var; i++)
02769 {
02770 j = this->optimization->variables->initialVariableValues->var[i]->idx;
02771 if (j >= 0 && j < numberOfVariables)
02772 m_mdInitVarValuesDense[j]
02773 = this->optimization->variables->initialVariableValues->var[i]->value;
02774 else
02775 throw ErrorClass("Variable index out of range");
02776 }
02777 return m_mdInitVarValuesDense;
02778 }
02779 }
02780 }
02781 }
02782 catch(const ErrorClass& eclass)
02783 {
02784 throw ErrorClass(eclass.errormsg);
02785 }
02786 return NULL;
02787 }
02788
02795 double* OSOption::getInitVarValuesDense(int numberOfVariables)
02796 {
02797 try
02798 {
02799 if (numberOfVariables < 0)
02800 throw ErrorClass("\"numberOfVariables\" must be present to use dense methods");
02801
02802 if (this->optimization != NULL)
02803 {
02804 if (this->optimization->variables != NULL)
02805 {
02806 if (this->optimization->variables->initialVariableValues != NULL)
02807 {
02808 int i,j,k;
02809
02810
02811
02812
02813
02814
02815
02816 int num_var;
02817 num_var = this->getNumberOfInitVarValues();
02818
02819 if (m_mdInitVarValuesDense != NULL)
02820 delete [] m_mdInitVarValuesDense;
02821 m_mdInitVarValuesDense = new double[numberOfVariables];
02822 for (k = 0; k < numberOfVariables; k++) m_mdInitVarValuesDense[k] = OSNaN();
02823
02824 for (i = 0; i < num_var; i++)
02825 {
02826 j = this->optimization->variables->initialVariableValues->var[i]->idx;
02827 if (j >= 0 && j < numberOfVariables)
02828 m_mdInitVarValuesDense[j]
02829 = this->optimization->variables->initialVariableValues->var[i]->value;
02830 else
02831 throw ErrorClass("Variable index out of range");
02832 }
02833 return m_mdInitVarValuesDense;
02834 }
02835 }
02836 }
02837 }
02838 catch(const ErrorClass& eclass)
02839 {
02840 throw ErrorClass(eclass.errormsg);
02841 }
02842 return NULL;
02843 }
02844
02849 InitVarValueString** OSOption::getInitVarValuesStringSparse()
02850 {
02851 InitVarValueString** initVarVector;
02852 if (this->optimization != NULL)
02853 {
02854 if (this->optimization->variables != NULL)
02855 {
02856 if (this->optimization->variables->initialVariableValuesString != NULL)
02857 initVarVector = this->optimization->variables->initialVariableValuesString->var;
02858 else
02859 throw ErrorClass("<initialVariableValuesString> object must be defined before getting the data");
02860 }
02861 else
02862 throw ErrorClass("<variables> object must be defined before getting the data");
02863 }
02864 else
02865 throw ErrorClass("<optimization> object must be defined before getting the data");
02866 return initVarVector;
02867 }
02868
02874 std::string *OSOption::getInitVarValuesStringDense()
02875 {
02876 try
02877 {
02878 int numberOfVariables;
02879 numberOfVariables = this->getNumberOfVariables();
02880 if (numberOfVariables < 0)
02881 throw ErrorClass("\"numberOfVariables\" must be present to use dense methods");
02882
02883 if (this->optimization != NULL)
02884 {
02885 if (this->optimization->variables != NULL)
02886 {
02887 if (this->optimization->variables->initialVariableValuesString != NULL)
02888 {
02889 int i,j,k;
02890 int num_var;
02891 num_var = this->getNumberOfInitVarValuesString();
02892
02893 if (m_mdInitVarValuesStringDense != NULL)
02894 delete [] m_mdInitVarValuesStringDense;
02895 m_mdInitVarValuesStringDense = new std::string[numberOfVariables];
02896 for (k = 0; k < numberOfVariables; k++) m_mdInitVarValuesStringDense[k] = "";
02897
02898 for (i = 0; i < num_var; i++)
02899 {
02900 j = this->optimization->variables->initialVariableValuesString->var[i]->idx;
02901 if (j >= 0 && j < numberOfVariables)
02902 m_mdInitVarValuesStringDense[j]
02903 = this->optimization->variables->initialVariableValuesString->var[i]->value;
02904 else
02905 throw ErrorClass("Variable index out of range");
02906 }
02907 return m_mdInitVarValuesStringDense;
02908 }
02909 }
02910 }
02911 }
02912 catch(const ErrorClass& eclass)
02913 {
02914 throw ErrorClass(eclass.errormsg);
02915 }
02916 return NULL;
02917 }
02918
02968 int* OSOption::getVariableInitialBasisStatusDense(int numberOfVariables)
02969 {
02970 try
02971 {
02972 if (numberOfVariables < 0)
02973 throw ErrorClass("\"numberOfVariables\" must be set to use dense methods");
02974
02975 if (this->optimization == NULL)
02976 throw ErrorClass("<optimization> element was never set");
02977
02978 if (this->optimization->variables == NULL)
02979 throw ErrorClass("<optimization> <variables> element was never set");
02980
02981 if (this->optimization->variables->initialBasisStatus == NULL)
02982 throw ErrorClass("initial basis was never set");
02983
02984 int i,j,k;
02985
02986 if (m_mdInitBasisStatusDense != NULL)
02987 delete [] m_mdInitBasisStatusDense;
02988 m_mdInitBasisStatusDense = new int[numberOfVariables];
02989 for (k = 0; k < numberOfVariables; k++) m_mdInitBasisStatusDense[k] = ENUM_BASIS_STATUS_unknown;
02990
02991 int num_var;
02992
02993
02994 if (this->optimization->variables->initialBasisStatus->basic != NULL)
02995 {
02996 num_var = this->optimization->variables->initialBasisStatus->basic->numberOfEl;
02997 for (i = 0; i < num_var; i++)
02998 {
02999 j = this->optimization->variables->initialBasisStatus->basic->el[i];
03000 if (j >= 0 && j < numberOfVariables)
03001 m_mdInitBasisStatusDense[j] = ENUM_BASIS_STATUS_basic;
03002 else
03003 throw ErrorClass("Variable index out of range");
03004 }
03005 }
03006
03007 if (this->optimization->variables->initialBasisStatus->atLower != NULL)
03008 {
03009 num_var = this->optimization->variables->initialBasisStatus->atLower->numberOfEl;
03010 for (i = 0; i < num_var; i++)
03011 {
03012 j = this->optimization->variables->initialBasisStatus->atLower->el[i];
03013 if (j >= 0 && j < numberOfVariables)
03014 m_mdInitBasisStatusDense[j] = ENUM_BASIS_STATUS_atLower;
03015 else
03016 throw ErrorClass("Variable index out of range");
03017 }
03018 }
03019
03020 if (this->optimization->variables->initialBasisStatus->atUpper != NULL)
03021 {
03022 num_var = this->optimization->variables->initialBasisStatus->atUpper->numberOfEl;
03023
03024
03025
03026 for (i = 0; i < num_var; i++)
03027 {
03028 j = this->optimization->variables->initialBasisStatus->atUpper->el[i];
03029 if (j >= 0 && j < numberOfVariables)
03030 m_mdInitBasisStatusDense[j] = ENUM_BASIS_STATUS_atUpper;
03031 else
03032 throw ErrorClass("Variable index out of range");
03033 }
03034 }
03035
03036 if (this->optimization->variables->initialBasisStatus->isFree != NULL)
03037 {
03038 num_var = this->optimization->variables->initialBasisStatus->isFree->numberOfEl;
03039 for (i = 0; i < num_var; i++)
03040 {
03041 j = this->optimization->variables->initialBasisStatus->isFree->el[i];
03042 if (j >= 0 && j < numberOfVariables)
03043 m_mdInitBasisStatusDense[j] = ENUM_BASIS_STATUS_isFree;
03044 else
03045 throw ErrorClass("Variable index out of range");
03046 }
03047 }
03048
03049 if (this->optimization->variables->initialBasisStatus->superbasic != NULL)
03050 {
03051 num_var = this->optimization->variables->initialBasisStatus->superbasic->numberOfEl;
03052 for (i = 0; i < num_var; i++)
03053 {
03054 j = this->optimization->variables->initialBasisStatus->superbasic->el[i];
03055 if (j >= 0 && j < numberOfVariables)
03056 m_mdInitBasisStatusDense[j] = ENUM_BASIS_STATUS_superbasic;
03057 else
03058 throw ErrorClass("Variable index out of range");
03059 }
03060 }
03061
03062 return m_mdInitBasisStatusDense;
03063 }
03064
03065 catch(const ErrorClass& eclass)
03066 {
03067 throw ErrorClass(eclass.errormsg);
03068 }
03069 return NULL;
03070 }
03071
03072
03073 int OSOption::getNumberOfInitialBasisElements(int type, int status)
03074 {
03075 if (this->optimization == NULL)
03076 throw ErrorClass("<optimization> element was never set");
03077
03078 switch (type)
03079 {
03080 case ENUM_PROBLEM_COMPONENT_variables:
03081 {
03082 if (this->optimization->variables == NULL)
03083 throw ErrorClass("<optimization> <variables> element was never set");
03084
03085 if (this->optimization->variables->initialBasisStatus == NULL)
03086 throw ErrorClass("initial basis was never set");
03087
03088 return this->optimization->variables->initialBasisStatus->getNumberOfEl(status);
03089 }
03090 case ENUM_PROBLEM_COMPONENT_objectives:
03091 {
03092 if (this->optimization->objectives == NULL)
03093 throw ErrorClass("<optimization> <objectives> element was never set");
03094
03095 if (this->optimization->objectives->initialBasisStatus == NULL)
03096 throw ErrorClass("initial basis was never set");
03097
03098 return this->optimization->objectives->initialBasisStatus->getNumberOfEl(status);
03099 }
03100 case ENUM_PROBLEM_COMPONENT_constraints:
03101 {
03102 if (this->optimization->constraints == NULL)
03103 throw ErrorClass("<optimization> <constraints> element was never set");
03104
03105 if (this->optimization->constraints->initialBasisStatus == NULL)
03106 throw ErrorClass("initial basis was never set");
03107
03108 return this->optimization->constraints->initialBasisStatus->getNumberOfEl(status);
03109 }
03110 default:
03111 throw ErrorClass("target object not implemented in getNumberOfInitialBasisElements");
03112 }
03113 }
03114
03115 bool OSOption::getInitialBasisElements(int type, int status, int* elem)
03116 {
03117 if (this->optimization == NULL)
03118 throw ErrorClass("<optimization> element was never set");
03119
03120 switch (type)
03121 {
03122 case ENUM_PROBLEM_COMPONENT_variables:
03123 {
03124 if (this->optimization->variables == NULL)
03125 throw ErrorClass("<optimization> <variables> element was never set");
03126
03127 if (this->optimization->variables->initialBasisStatus == NULL)
03128 throw ErrorClass("initial basis was never set");
03129
03130 return this->optimization->variables->initialBasisStatus->getIntVector(status, elem);
03131 }
03132 case ENUM_PROBLEM_COMPONENT_objectives:
03133 {
03134 if (this->optimization->objectives == NULL)
03135 throw ErrorClass("<optimization> <objectives> element was never set");
03136
03137 if (this->optimization->objectives->initialBasisStatus == NULL)
03138 throw ErrorClass("initial basis was never set");
03139
03140 return this->optimization->objectives->initialBasisStatus->getIntVector(status, elem);
03141 }
03142 case ENUM_PROBLEM_COMPONENT_constraints:
03143 {
03144 if (this->optimization->constraints == NULL)
03145 throw ErrorClass("<optimization> <constraints> element was never set");
03146
03147 if (this->optimization->constraints->initialBasisStatus == NULL)
03148 throw ErrorClass("initial basis was never set");
03149
03150 return this->optimization->constraints->initialBasisStatus->getIntVector(status, elem);
03151 }
03152 default:
03153 throw ErrorClass("target object not implemented in getInitialBasisElements");
03154 }
03155 }
03156
03157
03158
03159
03164 BranchingWeight** OSOption::getIntegerVariableBranchingWeightsSparse()
03165 {
03166 BranchingWeight** intVarVector;
03167 if (this->optimization != NULL)
03168 {
03169 if (this->optimization->variables != NULL)
03170 {
03171 if (this->optimization->variables->integerVariableBranchingWeights != NULL)
03172 intVarVector = this->optimization->variables->integerVariableBranchingWeights->var;
03173 else
03174 throw ErrorClass("<integerVariableBranchingWeights> object must be defined before getting the data");
03175 }
03176 else
03177 throw ErrorClass("<variables> object must be defined before getting the data");
03178 }
03179 else
03180 throw ErrorClass("<optimization> object must be defined before getting the data");
03181 return intVarVector;
03182 }
03183
03184
03190 double* OSOption::getIntegerVariableBranchingWeightsDense()
03191 {
03192 try
03193 {
03194 int numberOfVariables;
03195 numberOfVariables = this->getNumberOfVariables();
03196 if (numberOfVariables < 0)
03197 throw ErrorClass("\"numberOfVariables\" must be present to use dense methods");
03198
03199 if (this->optimization != NULL)
03200 {
03201 if (this->optimization->variables != NULL)
03202 {
03203 if (this->optimization->variables->integerVariableBranchingWeights != NULL)
03204 {
03205 int i,j,k;
03206 int num_var;
03207 num_var = this->getNumberOfIntegerVariableBranchingWeights();
03208
03209 if (m_mdIntegerVariableBranchingWeightsDense != NULL)
03210 delete [] m_mdIntegerVariableBranchingWeightsDense;
03211 m_mdIntegerVariableBranchingWeightsDense = new double[numberOfVariables];
03212 for (k = 0; k < numberOfVariables; k++) m_mdIntegerVariableBranchingWeightsDense[k] = OSNaN();
03213
03214 for (i = 0; i < num_var; i++)
03215 {
03216 j = this->optimization->variables->integerVariableBranchingWeights->var[i]->idx;
03217 if (j >= 0 && j < numberOfVariables)
03218 m_mdIntegerVariableBranchingWeightsDense[j]
03219 = this->optimization->variables->integerVariableBranchingWeights->var[i]->value;
03220 else
03221 throw ErrorClass("Variable index out of range");
03222 }
03223 return m_mdIntegerVariableBranchingWeightsDense;
03224 }
03225 }
03226 }
03227 }
03228 catch(const ErrorClass& eclass)
03229 {
03230 throw ErrorClass(eclass.errormsg);
03231 }
03232 return NULL;
03233 }
03234
03242 double* OSOption::getIntegerVariableBranchingWeightsDense(int numberOfVariables)
03243 {
03244 try
03245 {
03246 if (numberOfVariables < 0)
03247 throw ErrorClass("\"numberOfVariables\" must be present to use dense methods");
03248
03249 if (this->optimization != NULL)
03250 {
03251 if (this->optimization->variables != NULL)
03252 {
03253 if (this->optimization->variables->integerVariableBranchingWeights != NULL)
03254 {
03255 int i,j,k;
03256 int num_var;
03257 num_var = this->getNumberOfIntegerVariableBranchingWeights();
03258
03259 if (m_mdIntegerVariableBranchingWeightsDense != NULL)
03260 delete [] m_mdIntegerVariableBranchingWeightsDense;
03261 m_mdIntegerVariableBranchingWeightsDense = new double[numberOfVariables];
03262 for (k = 0; k < numberOfVariables; k++) m_mdIntegerVariableBranchingWeightsDense[k] = OSNaN();
03263
03264 for (i = 0; i < num_var; i++)
03265 {
03266 j = this->optimization->variables->integerVariableBranchingWeights->var[i]->idx;
03267 if (j >= 0 && j < numberOfVariables)
03268 m_mdIntegerVariableBranchingWeightsDense[j]
03269 = this->optimization->variables->integerVariableBranchingWeights->var[i]->value;
03270 else
03271 throw ErrorClass("Variable index out of range");
03272 }
03273 return m_mdIntegerVariableBranchingWeightsDense;
03274 }
03275 }
03276 }
03277 }
03278 catch(const ErrorClass& eclass)
03279 {
03280 throw ErrorClass(eclass.errormsg);
03281 }
03282 return NULL;
03283 }
03284
03289 SOSWeights** OSOption::getSOSVariableBranchingWeightsSparse()
03290 {
03291 SOSWeights** sosVarVector;
03292 if (this->optimization != NULL)
03293 {
03294 if (this->optimization->variables != NULL)
03295 {
03296 if (this->optimization->variables->sosVariableBranchingWeights != NULL)
03297 sosVarVector = this->optimization->variables->sosVariableBranchingWeights->sos;
03298 else
03299 throw ErrorClass("<sosVariableBranchingWeights> object must be defined before getting the data");
03300 }
03301 else
03302 throw ErrorClass("<variables> object must be defined before getting the data");
03303 }
03304 else
03305 throw ErrorClass("<optimization> object must be defined before getting the data");
03306 return sosVarVector;
03307 }
03308
03309
03315 std::vector<OtherVariableOption*> OSOption::getOtherVariableOptions( std::string solver_name)
03316 {
03317 std::vector<OtherVariableOption*> optionsVector;
03318 if (this->optimization != NULL)
03319 {
03320 if (this->optimization->variables != NULL)
03321 {
03322 int i;
03323 int num_options;
03324 num_options = this->getNumberOfOtherVariableOptions();
03325 for(i = 0; i < num_options; i++)
03326 if (solver_name == this->optimization->variables->other[ i]->solver)
03327 optionsVector.push_back( this->optimization->variables->other[ i]);
03328 }
03329 else
03330 throw ErrorClass("<variables> object must be defined before getting the data");
03331 }
03332 else
03333 throw ErrorClass("<optimization> object must be defined before getting the data");
03334 return optionsVector;
03335 }
03336
03341 OtherVariableOption** OSOption::getAllOtherVariableOptions()
03342 {
03343 OtherVariableOption** optionsVector;
03344 if (this->optimization != NULL)
03345 {
03346 if (this->optimization->variables != NULL)
03347 optionsVector = this->optimization->variables->other;
03348 else
03349 throw ErrorClass("<variables> object must be defined before getting the data");
03350 }
03351 else
03352 throw ErrorClass("<optimization> object must be defined before getting the data");
03353 return optionsVector;
03354 }
03355
03363 OtherVariableOption* OSOption::getOtherVariableOption(int optionNumber)
03364 {
03365 if (this->optimization != NULL)
03366 {
03367 if (this->optimization->variables != NULL)
03368 {
03369 int num_options;
03370 num_options = this->getNumberOfOtherVariableOptions();
03371 if (optionNumber < 0 || optionNumber >= num_options)
03372 throw ErrorClass("optionNumber not in legal range");
03373 return this->optimization->variables->other[optionNumber];
03374 }
03375 else
03376 throw ErrorClass("<variables> object must be defined before getting the data");
03377 }
03378 else
03379 throw ErrorClass("<optimization> object must be defined before getting the data");
03380 }
03381
03386 InitObjValue** OSOption::getInitObjValuesSparse()
03387 {
03388 InitObjValue** initObjVector;
03389 if (this->optimization != NULL)
03390 {
03391 if (this->optimization->objectives != NULL)
03392 {
03393 if (this->optimization->objectives->initialObjectiveValues != NULL)
03394 initObjVector = this->optimization->objectives->initialObjectiveValues->obj;
03395 else
03396 throw ErrorClass("<initialObjectiveValues> object must be defined before getting the data");
03397 }
03398 else
03399 throw ErrorClass("<objectives> object must be defined before getting the data");
03400 }
03401 else
03402 throw ErrorClass("<optimization> object must be defined before getting the data");
03403 return initObjVector;
03404 }
03405
03411 double* OSOption::getInitObjValuesDense()
03412 {
03413 try
03414 {
03415 int numberOfObjectives;
03416 numberOfObjectives = this->getNumberOfObjectives();
03417 if (numberOfObjectives < 0)
03418 throw ErrorClass("\"numberOfObjectives\" must be present to use dense methods");
03419
03420 if (this->optimization != NULL)
03421 {
03422 if (this->optimization->objectives != NULL)
03423 {
03424 if (this->optimization->objectives->initialObjectiveValues != NULL)
03425 {
03426 int i,j,k;
03427 int num_obj;
03428 num_obj = this->getNumberOfInitObjValues();
03429
03430 if (m_mdInitObjValuesDense != NULL)
03431 delete [] m_mdInitObjValuesDense;
03432 m_mdInitObjValuesDense = new double[numberOfObjectives];
03433 for (k = 0; k < numberOfObjectives; k++) m_mdInitObjValuesDense[k] = OSNaN();
03434
03435 for (i = 0; i < num_obj; i++)
03436 {
03437 j = this->optimization->objectives->initialObjectiveValues->obj[i]->idx;
03438 if (j < 0 && -j <= numberOfObjectives)
03439 m_mdInitObjValuesDense[-1-j]
03440 = this->optimization->objectives->initialObjectiveValues->obj[i]->value;
03441 else
03442 {
03443 throw ErrorClass("Objective index out of range");
03444 }
03445 }
03446 return m_mdInitObjValuesDense;
03447 }
03448 }
03449 }
03450 }
03451 catch(const ErrorClass& eclass)
03452 {
03453 throw ErrorClass(eclass.errormsg);
03454 }
03455 return NULL;
03456 }
03457
03464 double* OSOption::getInitObjValuesDense(int numberOfObjectives)
03465 {
03466 try
03467 {
03468 if (numberOfObjectives < 0)
03469 throw ErrorClass("\"numberOfObjectives\" must be present to use dense methods");
03470
03471 if (this->optimization != NULL)
03472 {
03473 if (this->optimization->objectives != NULL)
03474 {
03475 if (this->optimization->objectives->initialObjectiveValues != NULL)
03476 {
03477 int i,j,k;
03478 int num_obj;
03479 num_obj = this->getNumberOfInitObjValues();
03480
03481 if (m_mdInitObjValuesDense != NULL)
03482 delete [] m_mdInitObjValuesDense;
03483 m_mdInitObjValuesDense = new double[numberOfObjectives];
03484 for (k = 0; k < numberOfObjectives; k++) m_mdInitObjValuesDense[k] = OSNaN();
03485
03486 for (i = 0; i < num_obj; i++)
03487 {
03488 j = this->optimization->objectives->initialObjectiveValues->obj[i]->idx;
03489 if (j < 0 && -j <= numberOfObjectives)
03490 m_mdInitObjValuesDense[-1-j]
03491 = this->optimization->objectives->initialObjectiveValues->obj[i]->value;
03492 else
03493 {
03494 throw ErrorClass("Objective index out of range");
03495 }
03496 }
03497 return m_mdInitObjValuesDense;
03498 }
03499 }
03500 }
03501 }
03502 catch(const ErrorClass& eclass)
03503 {
03504 throw ErrorClass(eclass.errormsg);
03505 }
03506 return NULL;
03507 }
03508
03513 InitObjBound** OSOption::getInitObjBoundsSparse()
03514 {
03515 InitObjBound** initObjBounds;
03516 if (this->optimization != NULL)
03517 {
03518 if (this->optimization->objectives != NULL)
03519 {
03520 if (this->optimization->objectives->initialObjectiveBounds != NULL)
03521 initObjBounds = this->optimization->objectives->initialObjectiveBounds->obj;
03522 else
03523 throw ErrorClass("<initialObjectiveBounds> object must be defined before getting the data");
03524 }
03525 else
03526 throw ErrorClass("<objectives> object must be defined before getting the data");
03527 }
03528 else
03529 throw ErrorClass("<optimization> object must be defined before getting the data");
03530 return initObjBounds;
03531 }
03532
03538 double* OSOption::getInitObjLowerBoundsDense()
03539 {
03540 try
03541 {
03542 int numberOfObjectives;
03543 numberOfObjectives = this->getNumberOfObjectives();
03544 if (numberOfObjectives < 0)
03545 throw ErrorClass("\"numberOfObjectives\" must be present to use dense methods");
03546
03547 if (this->optimization != NULL)
03548 {
03549 if (this->optimization->objectives != NULL)
03550 {
03551 if (this->optimization->objectives->initialObjectiveBounds != NULL)
03552 {
03553 int i,j,k;
03554 int num_obj;
03555 num_obj = this->getNumberOfInitObjBounds();
03556
03557 if (m_mdInitObjLowerBoundsDense != NULL)
03558 delete [] m_mdInitObjLowerBoundsDense;
03559 m_mdInitObjLowerBoundsDense = new double[numberOfObjectives];
03560 for (k = 0; k < numberOfObjectives; k++) m_mdInitObjLowerBoundsDense[k] = OSNaN();
03561
03562 for (i = 0; i < num_obj; i++)
03563 {
03564 j = this->optimization->objectives->initialObjectiveBounds->obj[i]->idx;
03565 if (j < 0 && -j <= numberOfObjectives)
03566 m_mdInitObjLowerBoundsDense[-1-j]
03567 = this->optimization->objectives->initialObjectiveBounds->obj[i]->lbValue;
03568 else
03569 {
03570 throw ErrorClass("Objective index out of range");
03571 }
03572 }
03573 return m_mdInitObjLowerBoundsDense;
03574 }
03575 }
03576 }
03577 }
03578 catch(const ErrorClass& eclass)
03579 {
03580 throw ErrorClass(eclass.errormsg);
03581 }
03582 return NULL;
03583 }
03584
03591 double* OSOption::getInitObjLowerBoundsDense(int numberOfObjectives)
03592 {
03593 try
03594 {
03595 if (numberOfObjectives < 0)
03596 throw ErrorClass("\"numberOfObjectives\" must be present to use dense methods");
03597
03598 if (this->optimization != NULL)
03599 {
03600 if (this->optimization->objectives != NULL)
03601 {
03602 if (this->optimization->objectives->initialObjectiveBounds != NULL)
03603 {
03604 int i,j,k;
03605 int num_obj;
03606 num_obj = this->getNumberOfInitObjBounds();
03607
03608 if (m_mdInitObjLowerBoundsDense != NULL)
03609 delete [] m_mdInitObjLowerBoundsDense;
03610 m_mdInitObjLowerBoundsDense = new double[numberOfObjectives];
03611 for (k = 0; k < numberOfObjectives; k++) m_mdInitObjLowerBoundsDense[k] = OSNaN();
03612
03613 for (i = 0; i < num_obj; i++)
03614 {
03615 j = this->optimization->objectives->initialObjectiveBounds->obj[i]->idx;
03616 if (j < 0 && -j <= numberOfObjectives)
03617 m_mdInitObjLowerBoundsDense[-1-j]
03618 = this->optimization->objectives->initialObjectiveBounds->obj[i]->lbValue;
03619 else
03620 {
03621 throw ErrorClass("Objective index out of range");
03622 }
03623 }
03624 return m_mdInitObjLowerBoundsDense;
03625 }
03626 }
03627 }
03628 }
03629 catch(const ErrorClass& eclass)
03630 {
03631 throw ErrorClass(eclass.errormsg);
03632 }
03633 return NULL;
03634 }
03635
03641 double* OSOption::getInitObjUpperBoundsDense()
03642 {
03643 try
03644 {
03645 int numberOfObjectives;
03646 numberOfObjectives = this->getNumberOfObjectives();
03647 if (numberOfObjectives < 0)
03648 throw ErrorClass("\"numberOfObjectives\" must be present to use dense methods");
03649
03650 if (this->optimization != NULL)
03651 {
03652 if (this->optimization->objectives != NULL)
03653 {
03654 if (this->optimization->objectives->initialObjectiveBounds != NULL)
03655 {
03656 int i,j,k;
03657 int num_obj;
03658 num_obj = this->getNumberOfInitObjBounds();
03659
03660 if (m_mdInitObjUpperBoundsDense != NULL)
03661 delete [] m_mdInitObjUpperBoundsDense;
03662 m_mdInitObjUpperBoundsDense = new double[numberOfObjectives];
03663 for (k = 0; k < numberOfObjectives; k++) m_mdInitObjUpperBoundsDense[k] = OSNaN();
03664
03665 for (i = 0; i < num_obj; i++)
03666 {
03667 j = this->optimization->objectives->initialObjectiveBounds->obj[i]->idx;
03668 if (j < 0 && -j <= numberOfObjectives)
03669 m_mdInitObjUpperBoundsDense[-1-j]
03670 = this->optimization->objectives->initialObjectiveBounds->obj[i]->ubValue;
03671 else
03672 {
03673 throw ErrorClass("Objective index out of range");
03674 }
03675 }
03676 return m_mdInitObjUpperBoundsDense;
03677 }
03678 }
03679 }
03680 }
03681 catch(const ErrorClass& eclass)
03682 {
03683 throw ErrorClass(eclass.errormsg);
03684 }
03685 return NULL;
03686 }
03687
03694 double* OSOption::getInitObjUpperBoundsDense(int numberOfObjectives)
03695 {
03696 try
03697 {
03698 if (numberOfObjectives < 0)
03699 throw ErrorClass("\"numberOfObjectives\" must be present to use dense methods");
03700
03701 if (this->optimization != NULL)
03702 {
03703 if (this->optimization->objectives != NULL)
03704 {
03705 if (this->optimization->objectives->initialObjectiveBounds != NULL)
03706 {
03707 int i,j,k;
03708 int num_obj;
03709 num_obj = this->getNumberOfInitObjBounds();
03710
03711 if (m_mdInitObjUpperBoundsDense != NULL)
03712 delete [] m_mdInitObjUpperBoundsDense;
03713 m_mdInitObjUpperBoundsDense = new double[numberOfObjectives];
03714 for (k = 0; k < numberOfObjectives; k++) m_mdInitObjUpperBoundsDense[k] = OSNaN();
03715
03716 for (i = 0; i < num_obj; i++)
03717 {
03718 j = this->optimization->objectives->initialObjectiveBounds->obj[i]->idx;
03719 if (j < 0 && -j <= numberOfObjectives)
03720 m_mdInitObjUpperBoundsDense[-1-j]
03721 = this->optimization->objectives->initialObjectiveBounds->obj[i]->ubValue;
03722 else
03723 {
03724 throw ErrorClass("Objective index out of range");
03725 }
03726 }
03727 return m_mdInitObjUpperBoundsDense;
03728 }
03729 }
03730 }
03731 }
03732 catch(const ErrorClass& eclass)
03733 {
03734 throw ErrorClass(eclass.errormsg);
03735 }
03736 return NULL;
03737 }
03738
03745 std::string *OSOption::getInitVarValuesStringDense(int numberOfVariables)
03746 {
03747 try
03748 {
03749 if (numberOfVariables < 0)
03750 throw ErrorClass("\"numberOfVariables\" must be present to use dense methods");
03751
03752 if (this->optimization != NULL)
03753 {
03754 if (this->optimization->variables != NULL)
03755 {
03756 if (this->optimization->variables->initialVariableValuesString != NULL)
03757 {
03758 int i,j,k;
03759 int num_var;
03760 num_var = this->getNumberOfInitVarValuesString();
03761
03762 if (m_mdInitVarValuesStringDense != NULL)
03763 delete [] m_mdInitVarValuesStringDense;
03764 m_mdInitVarValuesStringDense = new std::string[numberOfVariables];
03765 for (k = 0; k < numberOfVariables; k++) m_mdInitVarValuesStringDense[k] = "";
03766
03767 for (i = 0; i < num_var; i++)
03768 {
03769 j = this->optimization->variables->initialVariableValuesString->var[i]->idx;
03770 if (j >= 0 && j < numberOfVariables)
03771 m_mdInitVarValuesStringDense[j]
03772 = this->optimization->variables->initialVariableValuesString->var[i]->value;
03773 else
03774 throw ErrorClass("Variable index out of range");
03775 }
03776 return m_mdInitVarValuesStringDense;
03777 }
03778 }
03779 }
03780 }
03781 catch(const ErrorClass& eclass)
03782 {
03783 throw ErrorClass(eclass.errormsg);
03784 }
03785 return NULL;
03786 }
03787
03788
03796 int* OSOption::getObjectiveInitialBasisStatusDense(int numberOfObjectives)
03797 {
03798 try
03799 {
03800 if (numberOfObjectives < 0)
03801 throw ErrorClass("\"numberOfObjectives\" must be set to use dense methods");
03802
03803 if (this->optimization == NULL)
03804 throw ErrorClass("<optimization> element was never set");
03805
03806 if (this->optimization->objectives == NULL)
03807 throw ErrorClass("<optimization> <objectives> element was never set");
03808
03809 if (this->optimization->objectives->initialBasisStatus == NULL)
03810 throw ErrorClass("initial basis was never set");
03811
03812 int i,j,k;
03813
03814 if (m_mdInitBasisStatusDense != NULL)
03815 delete [] m_mdInitBasisStatusDense;
03816 m_mdInitBasisStatusDense = new int[numberOfObjectives];
03817 for (k = 0; k < numberOfObjectives; k++) m_mdInitBasisStatusDense[k] = ENUM_BASIS_STATUS_unknown;
03818
03819 int num_obj;
03820
03821 if (this->optimization->objectives->initialBasisStatus->basic != NULL)
03822 {
03823 num_obj = this->optimization->objectives->initialBasisStatus->basic->numberOfEl;
03824 for (i = 0; i < num_obj; i++)
03825 {
03826 j = this->optimization->objectives->initialBasisStatus->basic->el[i];
03827 if (j >= 0 || j < -numberOfObjectives)
03828 throw ErrorClass("Objective index out of range");
03829 else
03830 m_mdInitBasisStatusDense[j] = ENUM_BASIS_STATUS_basic;
03831 }
03832 }
03833
03834 if (this->optimization->objectives->initialBasisStatus->atLower != NULL)
03835 {
03836 num_obj = this->optimization->objectives->initialBasisStatus->atLower->numberOfEl;
03837 for (i = 0; i < num_obj; i++)
03838 {
03839 j = this->optimization->objectives->initialBasisStatus->atLower->el[i];
03840 if (j >= 0 || j < -numberOfObjectives)
03841 throw ErrorClass("Objective index out of range");
03842 else
03843 m_mdInitBasisStatusDense[j] = ENUM_BASIS_STATUS_atLower;
03844 }
03845 }
03846
03847 if (this->optimization->objectives->initialBasisStatus->atUpper != NULL)
03848 {
03849 num_obj = this->optimization->objectives->initialBasisStatus->atUpper->numberOfEl;
03850 for (i = 0; i < num_obj; i++)
03851 {
03852 j = this->optimization->objectives->initialBasisStatus->atUpper->el[i];
03853 if (j >= 0 || j < -numberOfObjectives)
03854 throw ErrorClass("Objective index out of range");
03855 else
03856 m_mdInitBasisStatusDense[j] = ENUM_BASIS_STATUS_atUpper;
03857 }
03858 }
03859
03860 if (this->optimization->objectives->initialBasisStatus->isFree != NULL)
03861 {
03862 num_obj = this->optimization->objectives->initialBasisStatus->isFree->numberOfEl;
03863 for (i = 0; i < num_obj; i++)
03864 {
03865 j = this->optimization->objectives->initialBasisStatus->isFree->el[i];
03866 if (j >= 0 || j < -numberOfObjectives)
03867 throw ErrorClass("Objective index out of range");
03868 else
03869 m_mdInitBasisStatusDense[j] = ENUM_BASIS_STATUS_isFree;
03870 }
03871 }
03872
03873 if (this->optimization->objectives->initialBasisStatus->superbasic != NULL)
03874 {
03875 num_obj = this->optimization->objectives->initialBasisStatus->superbasic->numberOfEl;
03876 for (i = 0; i < num_obj; i++)
03877 {
03878 j = this->optimization->objectives->initialBasisStatus->superbasic->el[i];
03879 if (j >= 0 || j < -numberOfObjectives)
03880 throw ErrorClass("Objective index out of range");
03881 else
03882 m_mdInitBasisStatusDense[j] = ENUM_BASIS_STATUS_superbasic;
03883 }
03884 }
03885
03886 return m_mdInitBasisStatusDense;
03887 }
03888
03889 catch(const ErrorClass& eclass)
03890 {
03891 throw ErrorClass(eclass.errormsg);
03892
03893 }
03894 return NULL;
03895 }
03896
03897
03898
03899
03905 std::vector<OtherObjectiveOption*> OSOption::getOtherObjectiveOptions( std::string solver_name)
03906 {
03907 std::vector<OtherObjectiveOption*> optionsVector;
03908 if (this->optimization != NULL)
03909 {
03910 if (this->optimization->variables != NULL)
03911 {
03912 int i;
03913 int num_options;
03914 num_options = this->getNumberOfOtherObjectiveOptions();
03915 for(i = 0; i < num_options; i++)
03916 if (solver_name == this->optimization->objectives->other[ i]->solver)
03917 optionsVector.push_back( this->optimization->objectives->other[ i]);
03918 }
03919 else
03920 throw ErrorClass("<objectives> object must be defined before getting the data");
03921 }
03922 else
03923 throw ErrorClass("<optimization> object must be defined before getting the data");
03924 return optionsVector;
03925 }
03926
03934 OtherObjectiveOption* OSOption::getOtherObjectiveOption(int optionNumber)
03935 {
03936 if (this->optimization != NULL)
03937 {
03938 if (this->optimization->objectives != NULL)
03939 {
03940 int num_options;
03941 num_options = this->getNumberOfOtherObjectiveOptions();
03942 if (optionNumber < 0 || optionNumber >= num_options)
03943 throw ErrorClass("optionNumber not in legal range");
03944 return this->optimization->objectives->other[optionNumber];
03945 }
03946 else
03947 throw ErrorClass("<objectives> object must be defined before getting the data");
03948 }
03949 else
03950 throw ErrorClass("<optimization> object must be defined before getting the data");
03951 }
03952
03957 OtherObjectiveOption** OSOption::getAllOtherObjectiveOptions()
03958 {
03959 OtherObjectiveOption** optionsVector;
03960 if (this->optimization != NULL)
03961 {
03962 if (this->optimization->objectives != NULL)
03963 optionsVector = this->optimization->objectives->other;
03964 else
03965 throw ErrorClass("<objectives> object must be defined before getting the data");
03966 }
03967 else
03968 throw ErrorClass("<optimization> object must be defined before getting the data");
03969 return optionsVector;
03970 }
03971
03972
03977 InitConValue** OSOption::getInitConValuesSparse()
03978 {
03979 InitConValue** initConVector;
03980 if (this->optimization != NULL)
03981 {
03982 if (this->optimization->constraints != NULL)
03983 {
03984 if (this->optimization->constraints->initialConstraintValues != NULL)
03985 initConVector = this->optimization->constraints->initialConstraintValues->con;
03986 else
03987 throw ErrorClass("<initialConstraintValues> object must be defined before getting the data");
03988 }
03989 else
03990 throw ErrorClass("<constraints> object must be defined before getting the data");
03991 }
03992 else
03993 throw ErrorClass("<optimization> object must be defined before getting the data");
03994 return initConVector;
03995 }
03996
04002 double* OSOption::getInitConValuesDense()
04003 {
04004 try
04005 {
04006 int numberOfConstraints;
04007 numberOfConstraints = this->getNumberOfConstraints();
04008 if (numberOfConstraints < 0)
04009 throw ErrorClass("\"numberOfConstraints\" must be present to use dense methods");
04010
04011 if (this->optimization != NULL)
04012 {
04013 if (this->optimization->constraints != NULL)
04014 {
04015 if (this->optimization->constraints->initialConstraintValues != NULL)
04016 {
04017 int i,j,k;
04018 int num_con;
04019 num_con = this->getNumberOfInitConValues();
04020
04021 if (m_mdInitConValuesDense != NULL)
04022 delete [] m_mdInitConValuesDense;
04023 m_mdInitConValuesDense = new double[numberOfConstraints];
04024 for (k = 0; k < numberOfConstraints; k++) m_mdInitConValuesDense[k] = OSNaN();
04025
04026 for (i = 0; i < num_con; i++)
04027 {
04028 j = this->optimization->constraints->initialConstraintValues->con[i]->idx;
04029 if (j >= 0 && j < numberOfConstraints)
04030 m_mdInitConValuesDense[j]
04031 = this->optimization->constraints->initialConstraintValues->con[i]->value;
04032 else
04033 throw ErrorClass("Constraint index out of range");
04034 }
04035 return m_mdInitConValuesDense;
04036 }
04037 }
04038 }
04039 }
04040 catch(const ErrorClass& eclass)
04041 {
04042 throw ErrorClass(eclass.errormsg);
04043 }
04044 return NULL;
04045 }
04046
04053 double* OSOption::getInitConValuesDense(int numberOfConstraints)
04054 {
04055 try
04056 {
04057 if (numberOfConstraints < 0)
04058 throw ErrorClass("\"numberOfConstraints\" must be present to use dense methods");
04059
04060 if (this->optimization != NULL)
04061 {
04062 if (this->optimization->constraints != NULL)
04063 {
04064 if (this->optimization->constraints->initialConstraintValues != NULL)
04065 {
04066 int i,j,k;
04067 int num_con;
04068 num_con = this->getNumberOfInitConValues();
04069
04070 if (m_mdInitConValuesDense != NULL)
04071 delete [] m_mdInitConValuesDense;
04072 m_mdInitConValuesDense = new double[numberOfConstraints];
04073 for (k = 0; k < numberOfConstraints; k++) m_mdInitConValuesDense[k] = OSNaN();
04074
04075 for (i = 0; i < num_con; i++)
04076 {
04077 j = this->optimization->constraints->initialConstraintValues->con[i]->idx;
04078 if (j >= 0 && j < numberOfConstraints)
04079 m_mdInitConValuesDense[j]
04080 = this->optimization->constraints->initialConstraintValues->con[i]->value;
04081 else
04082 throw ErrorClass("Constraint index out of range");
04083 }
04084 return m_mdInitConValuesDense;
04085 }
04086 }
04087 }
04088 }
04089 catch(const ErrorClass& eclass)
04090 {
04091 throw ErrorClass(eclass.errormsg);
04092 }
04093 return NULL;
04094 }
04095
04100 InitDualVarValue** OSOption::getInitDualVarValuesSparse()
04101 {
04102 InitDualVarValue** initDualVector;
04103 if (this->optimization != NULL)
04104 {
04105 if (this->optimization->constraints != NULL)
04106 {
04107 if (this->optimization->constraints->initialDualValues != NULL)
04108 initDualVector = this->optimization->constraints->initialDualValues->con;
04109 else
04110 throw ErrorClass("<initialDualValues> object must be defined before getting the data");
04111 }
04112 else
04113 throw ErrorClass("<constraints> object must be defined before getting the data");
04114 }
04115 else
04116 throw ErrorClass("<optimization> object must be defined before getting the data");
04117 return initDualVector;
04118 }
04119
04125 double* OSOption::getInitDualVarLowerBoundsDense()
04126 {
04127 try
04128 {
04129 int numberOfConstraints;
04130 numberOfConstraints = this->getNumberOfConstraints();
04131 if (numberOfConstraints < 0)
04132 throw ErrorClass("\"numberOfConstraints\" must be present to use dense methods");
04133
04134 if (this->optimization != NULL)
04135 {
04136 if (this->optimization->constraints != NULL)
04137 {
04138 if (this->optimization->constraints->initialDualValues != NULL)
04139 {
04140
04141 int i,j,k;
04142
04143 int num_con;
04144 num_con = this->getNumberOfInitDualVarValues();
04145
04146 if (m_mdInitDualVarLowerBoundsDense != NULL)
04147 delete [] m_mdInitDualVarLowerBoundsDense;
04148 m_mdInitDualVarLowerBoundsDense = new double[numberOfConstraints];
04149 for (k = 0; k < numberOfConstraints; k++) m_mdInitDualVarLowerBoundsDense[k] = 0.0;
04150
04151 for (i = 0; i < num_con; i++)
04152 {
04153 j = this->optimization->constraints->initialDualValues->con[i]->idx;
04154 if (j >= 0 && j < numberOfConstraints)
04155 m_mdInitDualVarLowerBoundsDense[j]
04156 = this->optimization->constraints->initialDualValues->con[i]->lbDualValue;
04157 else
04158 throw ErrorClass("Constraint index out of range");
04159 }
04160 return m_mdInitDualVarLowerBoundsDense;
04161 }
04162 }
04163 }
04164 }
04165 catch(const ErrorClass& eclass)
04166 {
04167 throw ErrorClass(eclass.errormsg);
04168 }
04169 return NULL;
04170 }
04171
04178 double* OSOption::getInitDualVarLowerBoundsDense(int numberOfConstraints)
04179 {
04180 try
04181 {
04182 if (numberOfConstraints < 0)
04183 throw ErrorClass("\"numberOfConstraints\" must be present to use dense methods");
04184
04185 if (this->optimization != NULL)
04186 {
04187 if (this->optimization->constraints != NULL)
04188 {
04189 if (this->optimization->constraints->initialDualValues != NULL)
04190 {
04191 int i,j,k;
04192 int num_con;
04193 num_con = this->getNumberOfInitDualVarValues();
04194
04195 if (m_mdInitDualVarLowerBoundsDense != NULL)
04196 delete [] m_mdInitDualVarLowerBoundsDense;
04197 m_mdInitDualVarLowerBoundsDense = new double[numberOfConstraints];
04198 for (k = 0; k < numberOfConstraints; k++) m_mdInitDualVarLowerBoundsDense[k] = 0.0;
04199
04200 for (i = 0; i < num_con; i++)
04201 {
04202 j = this->optimization->constraints->initialDualValues->con[i]->idx;
04203 if (j >= 0 && j < numberOfConstraints)
04204 m_mdInitDualVarLowerBoundsDense[j]
04205 = this->optimization->constraints->initialDualValues->con[i]->lbDualValue;
04206 else
04207 throw ErrorClass("Constraint index out of range");
04208 }
04209 return m_mdInitDualVarLowerBoundsDense;
04210 }
04211 }
04212 }
04213 }
04214 catch(const ErrorClass& eclass)
04215 {
04216 throw ErrorClass(eclass.errormsg);
04217 }
04218 return NULL;
04219 }
04220
04226 double* OSOption::getInitDualVarUpperBoundsDense()
04227 {
04228 try
04229 {
04230 int numberOfConstraints;
04231 numberOfConstraints = this->getNumberOfConstraints();
04232 if (numberOfConstraints < 0)
04233 throw ErrorClass("\"numberOfConstraints\" must be present to use dense methods");
04234
04235 if (this->optimization != NULL)
04236 {
04237 if (this->optimization->constraints != NULL)
04238 {
04239 if (this->optimization->constraints->initialDualValues != NULL)
04240 {
04241 int i,j,k;
04242 int num_con;
04243 num_con = this->getNumberOfInitDualVarValues();
04244 numberOfConstraints = this->getNumberOfConstraints();
04245
04246 if (m_mdInitDualVarUpperBoundsDense != NULL)
04247 delete [] m_mdInitDualVarUpperBoundsDense;
04248 m_mdInitDualVarUpperBoundsDense = new double[numberOfConstraints];
04249 for (k = 0; k < numberOfConstraints; k++) m_mdInitDualVarUpperBoundsDense[k] = 0.0;
04250
04251 for (i = 0; i < num_con; i++)
04252 {
04253 j = this->optimization->constraints->initialDualValues->con[i]->idx;
04254 if (j >= 0 && j < numberOfConstraints)
04255 m_mdInitDualVarUpperBoundsDense[j]
04256 = this->optimization->constraints->initialDualValues->con[i]->ubDualValue;
04257 else
04258 throw ErrorClass("Constraint index out of range");
04259 }
04260 return m_mdInitDualVarUpperBoundsDense;
04261 }
04262 }
04263 }
04264 }
04265 catch(const ErrorClass& eclass)
04266 {
04267 throw ErrorClass(eclass.errormsg);
04268 }
04269 return NULL;
04270 }
04271
04278 double* OSOption::getInitDualVarUpperBoundsDense(int numberOfConstraints)
04279 {
04280 try
04281 {
04282 if (numberOfConstraints < 0)
04283 throw ErrorClass("\"numberOfConstraints\" must be present to use dense methods");
04284
04285 if (this->optimization != NULL)
04286 {
04287 if (this->optimization->constraints != NULL)
04288 {
04289 if (this->optimization->constraints->initialDualValues != NULL)
04290 {
04291 int i,j,k;
04292 int num_con;
04293 num_con = this->getNumberOfInitDualVarValues();
04294 numberOfConstraints = this->getNumberOfConstraints();
04295
04296 if (m_mdInitDualVarUpperBoundsDense != NULL)
04297 delete [] m_mdInitDualVarUpperBoundsDense;
04298 m_mdInitDualVarUpperBoundsDense = new double[numberOfConstraints];
04299 for (k = 0; k < numberOfConstraints; k++) m_mdInitDualVarUpperBoundsDense[k] = 0.0;
04300
04301 for (i = 0; i < num_con; i++)
04302 {
04303 j = this->optimization->constraints->initialDualValues->con[i]->idx;
04304 if (j >= 0 && j < numberOfConstraints)
04305 m_mdInitDualVarUpperBoundsDense[j]
04306 = this->optimization->constraints->initialDualValues->con[i]->ubDualValue;
04307 else
04308 throw ErrorClass("Constraint index out of range");
04309 }
04310 return m_mdInitDualVarUpperBoundsDense;
04311 }
04312 }
04313 }
04314 }
04315 catch(const ErrorClass& eclass)
04316 {
04317 throw ErrorClass(eclass.errormsg);
04318 }
04319 return NULL;
04320 }
04321
04322
04329 int* OSOption::getSlackVariableInitialBasisStatusDense(int numberOfConstraints)
04330 {
04331 try
04332 {
04333 if (numberOfConstraints < 0)
04334 throw ErrorClass("\"numberOfConstraints\" must be set to use dense methods");
04335
04336 if (this->optimization == NULL)
04337 throw ErrorClass("<optimization> element was never set");
04338
04339 if (this->optimization->constraints == NULL)
04340 throw ErrorClass("<optimization> <constraints> element was never set");
04341
04342 if (this->optimization->constraints->initialBasisStatus == NULL)
04343 throw ErrorClass("initial basis was never set");
04344
04345 int i,j,k;
04346
04347 if (m_mdInitBasisStatusDense != NULL)
04348 delete [] m_mdInitBasisStatusDense;
04349 m_mdInitBasisStatusDense = new int[numberOfConstraints];
04350 for (k = 0; k < numberOfConstraints; k++) m_mdInitBasisStatusDense[k] = ENUM_BASIS_STATUS_unknown;
04351
04352 int num_slack;
04353
04354 if (this->optimization->constraints->initialBasisStatus->basic != NULL)
04355 {
04356 num_slack = this->optimization->constraints->initialBasisStatus->basic->numberOfEl;
04357 for (i = 0; i < num_slack; i++)
04358 {
04359 j = this->optimization->constraints->initialBasisStatus->basic->el[i];
04360 if (j >= 0 && j < numberOfConstraints)
04361 m_mdInitBasisStatusDense[j] = ENUM_BASIS_STATUS_basic;
04362 else
04363 throw ErrorClass("Constraint index out of range");
04364 }
04365 }
04366
04367 if (this->optimization->constraints->initialBasisStatus->atLower != NULL)
04368 {
04369 num_slack = this->optimization->constraints->initialBasisStatus->atLower->numberOfEl;
04370 for (i = 0; i < num_slack; i++)
04371 {
04372 j = this->optimization->constraints->initialBasisStatus->atLower->el[i];
04373 if (j >= 0 && j < numberOfConstraints)
04374 m_mdInitBasisStatusDense[j] = ENUM_BASIS_STATUS_atLower;
04375 else
04376 throw ErrorClass("Constraint index out of range");
04377 }
04378 }
04379
04380 if (this->optimization->constraints->initialBasisStatus->atUpper != NULL)
04381 {
04382 num_slack = this->optimization->constraints->initialBasisStatus->atUpper->numberOfEl;
04383 for (i = 0; i < num_slack; i++)
04384 {
04385 j = this->optimization->constraints->initialBasisStatus->atUpper->el[i];
04386 if (j >= 0 && j < numberOfConstraints)
04387 m_mdInitBasisStatusDense[j] = ENUM_BASIS_STATUS_atUpper;
04388 else
04389 throw ErrorClass("Constraint index out of range");
04390 }
04391 }
04392
04393 if (this->optimization->constraints->initialBasisStatus->isFree != NULL)
04394 {
04395 num_slack = this->optimization->constraints->initialBasisStatus->isFree->numberOfEl;
04396 for (i = 0; i < num_slack; i++)
04397 {
04398 j = this->optimization->constraints->initialBasisStatus->isFree->el[i];
04399 if (j >= 0 && j < numberOfConstraints)
04400 m_mdInitBasisStatusDense[j] = ENUM_BASIS_STATUS_isFree;
04401 else
04402 throw ErrorClass("Constraint index out of range");
04403 }
04404 }
04405
04406 if (this->optimization->constraints->initialBasisStatus->superbasic != NULL)
04407 {
04408 num_slack = this->optimization->constraints->initialBasisStatus->superbasic->numberOfEl;
04409 for (i = 0; i < num_slack; i++)
04410 {
04411 j = this->optimization->constraints->initialBasisStatus->superbasic->el[i];
04412 if (j >= 0 && j < numberOfConstraints)
04413 m_mdInitBasisStatusDense[j] = ENUM_BASIS_STATUS_superbasic;
04414 else
04415 throw ErrorClass("Constraint index out of range");
04416 }
04417 }
04418
04419 return m_mdInitBasisStatusDense;
04420 }
04421
04422 catch(const ErrorClass& eclass)
04423 {
04424 throw ErrorClass(eclass.errormsg);
04425 }
04426 return NULL;
04427 }
04428
04429
04435 std::vector<OtherConstraintOption*> OSOption::getOtherConstraintOptions( std::string solver_name)
04436 {
04437 std::vector<OtherConstraintOption*> optionsVector;
04438 if (this->optimization != NULL)
04439 {
04440 if (this->optimization->constraints != NULL)
04441 {
04442 int i;
04443 int num_options;
04444 num_options = this->getNumberOfOtherConstraintOptions();
04445 for(i = 0; i < num_options; i++)
04446 if (solver_name == this->optimization->constraints->other[ i]->solver)
04447 optionsVector.push_back( this->optimization->constraints->other[ i]);
04448 }
04449 else
04450 throw ErrorClass("<constraints> object must be defined before getting the data");
04451 }
04452 else
04453 throw ErrorClass("<optimization> object must be defined before getting the data");
04454 return optionsVector;
04455 }
04456
04461 OtherConstraintOption** OSOption::getAllOtherConstraintOptions()
04462 {
04463 OtherConstraintOption** optionsVector;
04464 if (this->optimization != NULL)
04465 {
04466 if (this->optimization->constraints != NULL)
04467 optionsVector = this->optimization->constraints->other;
04468 else
04469 throw ErrorClass("<constraints> object must be defined before getting the data");
04470 }
04471 else
04472 throw ErrorClass("<optimization> object must be defined before getting the data");
04473 return optionsVector;
04474 }
04475
04483 OtherConstraintOption* OSOption::getOtherConstraintOption(int optionNumber)
04484 {
04485 if (this->optimization != NULL)
04486 {
04487 if (this->optimization->constraints != NULL)
04488 {
04489 int num_options;
04490 num_options = this->getNumberOfOtherConstraintOptions();
04491 if (optionNumber < 0 || optionNumber >= num_options)
04492 throw ErrorClass("optionNumber not in legal range");
04493 return this->optimization->constraints->other[optionNumber];
04494 }
04495 else
04496 throw ErrorClass("<constraints> object must be defined before getting the data");
04497 }
04498 else
04499 throw ErrorClass("<optimization> object must be defined before getting the data");
04500 }
04501
04502
04508 std::vector<SolverOption*> OSOption::getSolverOptions( std::string solver_name)
04509 {
04510 std::vector<SolverOption*> optionsVector;
04511 if (this->optimization != NULL)
04512 {
04513 if (this->optimization->solverOptions != NULL)
04514 {
04515 int i;
04516 int num_options;
04517 num_options = this->getNumberOfSolverOptions();
04518 for(i = 0; i < num_options; i++)
04519 if (solver_name == this->optimization->solverOptions->solverOption[ i]->solver)
04520 optionsVector.push_back( this->optimization->solverOptions->solverOption[ i]);
04521 }
04522 else
04523 throw ErrorClass("<solverOptions> object must be defined before getting the data");
04524 }
04525 else
04526 throw ErrorClass("<optimization> object must be defined before getting the data");
04527 return optionsVector;
04528 }
04529
04530
04539 std::vector<SolverOption*> OSOption::getSolverOptions( std::string solver_name, bool getFreeOptions)
04540 {
04541 std::vector<SolverOption*> optionsVector;
04542 if (this->optimization != NULL)
04543 {
04544 if (this->optimization->solverOptions != NULL)
04545 {
04546 int i;
04547 int num_options;
04548 num_options = this->getNumberOfSolverOptions();
04549 for (i = 0; i < num_options; i++)
04550 {
04551 if (this->optimization->solverOptions->solverOption[i]->solver == solver_name ||
04552 (this->optimization->solverOptions->solverOption[i]->solver == "" && getFreeOptions))
04553 optionsVector.push_back( this->optimization->solverOptions->solverOption[i]);
04554 }
04555 }
04556 else
04557 throw ErrorClass("<solverOptions> object must be defined before getting the data");
04558 }
04559 else
04560 throw ErrorClass("<optimization> object must be defined before getting the data");
04561 return optionsVector;
04562 }
04567 SolverOption** OSOption::getAllSolverOptions()
04568 {
04569 SolverOption** optionsVector;
04570 if (this->optimization != NULL)
04571 {
04572 if (this->optimization->solverOptions != NULL)
04573 optionsVector = this->optimization->solverOptions->solverOption;
04574 else
04575 throw ErrorClass("<solverOptions> object must be defined before getting the data");
04576 }
04577 else
04578 throw ErrorClass("<optimization> object must be defined before getting the data");
04579 return optionsVector;
04580 }
04581
04582
04583
04590
04591
04592
04593
04594
04595
04599 bool OtherOptions::setOther(int numberOfOptions, OtherOption** other)
04600 {
04601 try
04602 {
04603 if (this->other != NULL)
04604 throw ErrorClass( "otherOptions array previously used.");
04605
04606 if (numberOfOptions < 0)
04607 throw ErrorClass( "length of otherOptions array cannot be negative.");
04608
04609 this->numberOfOtherOptions = numberOfOptions;
04610 if (numberOfOptions == 0)
04611 return true;
04612
04613 this->other = new OtherOption*[numberOfOptions];
04614
04615 int i;
04616 for (i = 0; i < numberOfOptions; i++)
04617 {
04618 this->other[i] = new OtherOption();
04619 *this->other[i] = *other[i];
04620 }
04621 return true;
04622 }
04623 catch(const ErrorClass& eclass)
04624 {
04625 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_error, eclass.errormsg);
04626 return false;
04627 }
04628 }
04629
04633 bool OtherOptions::addOther(std::string name, std::string value, std::string description)
04634 {
04635 try
04636 {
04637 int nopt;
04638 int i;
04639 if (name.empty() )
04640 throw ErrorClass( "the name of an option cannot be empty." );
04641
04642 if (this->other == NULL)
04643 nopt = 0;
04644 else
04645 nopt = this->numberOfOtherOptions;
04646
04647 OtherOption** temp = new OtherOption*[nopt+1];
04648 for (i = 0; i < nopt; i++)
04649 temp[i] = this->other[i];
04650
04651 delete[] this->other;
04652
04653
04654 temp[ nopt] = new OtherOption();
04655
04656 temp[ nopt]->name = name;
04657 temp[ nopt]->value = value;
04658 temp[ nopt]->description = description;
04659
04660 this->other = temp;
04661 this->numberOfOtherOptions = ++nopt;
04662
04663 return true;
04664 }
04665 catch(const ErrorClass& eclass)
04666 {
04667 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_error, eclass.errormsg);
04668 return false;
04669 }
04670 }
04671
04677 bool JobDependencies::setJobID(int numberOfJobIDs, std::string *jobID)
04678 {
04679 try
04680 {
04681 if (this->jobID != NULL)
04682
04683 return false;
04684
04685 if (numberOfJobIDs < 0)
04686
04687 return false;
04688
04689 this->numberOfJobIDs = numberOfJobIDs;
04690 if (numberOfJobIDs == 0)
04691 return true;
04692
04693 this->jobID = new std::string[numberOfJobIDs];
04694 int i;
04695 for (i = 0; i < numberOfJobIDs; i++)
04696 this->jobID[i] = jobID[i];
04697
04698 return true;
04699 }
04700 catch(const ErrorClass& eclass)
04701 {
04702 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_error, eclass.errormsg);
04703 return false;
04704 }
04705 }
04706
04712 bool JobDependencies::addJobID(std::string jobID)
04713 {
04714 try
04715 {
04716 int nopt;
04717 if (jobID.empty() )
04718
04719 return false;
04720
04721 if (this->jobID == NULL)
04722 nopt = 0;
04723 else
04724 nopt = this->numberOfJobIDs;
04725
04726 std::string* temp = new std::string[nopt+1];
04727 int i;
04728 for (i = 0; i < nopt; i++)
04729 temp[i] = this->jobID[i];
04730
04731 delete[] this->jobID;
04732
04733 temp[nopt] = jobID;
04734
04735 this->jobID = temp;
04736 this->numberOfJobIDs = ++nopt;
04737 return true;
04738 }
04739 catch(const ErrorClass& eclass)
04740 {
04741 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_error, eclass.errormsg);
04742 return false;
04743 }
04744 }
04745
04752 bool DirectoriesAndFiles::setPath(int numberOfPaths, std::string *path)
04753 {
04754 try
04755 {
04756 if (this->path != NULL)
04757
04758 return false;
04759
04760 if (numberOfPaths < 0)
04761
04762 return false;
04763
04764 this->numberOfPaths = numberOfPaths;
04765 if (numberOfPaths == 0)
04766 return true;
04767
04768 this->path = new std::string[numberOfPaths];
04769 int i;
04770 for (i = 0; i < numberOfPaths; i++)
04771 this->path[i] = path[i];
04772
04773 return true;
04774 }
04775 catch(const ErrorClass& eclass)
04776 {
04777 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_error, eclass.errormsg);
04778 return false;
04779 }
04780 }
04781
04787 bool DirectoriesAndFiles::addPath(std::string path)
04788 {
04789 try
04790 {
04791 int nopt;
04792 if (path.empty() )
04793
04794 return false;
04795
04796 if (this->path == NULL)
04797 nopt = 0;
04798 else
04799 nopt = this->numberOfPaths;
04800
04801 std::string* temp = new std::string[nopt+1];
04802 int i;
04803 for (i = 0; i < nopt; i++)
04804 temp[i] = this->path[i];
04805
04806 delete[] this->path;
04807
04808 temp[nopt] = path;
04809
04810 this->path = temp;
04811 this->numberOfPaths = ++nopt;
04812 return true;
04813 }
04814 catch(const ErrorClass& eclass)
04815 {
04816 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_error, eclass.errormsg);
04817 return false;
04818 }
04819 }
04820
04827 bool PathPairs::setPathPair(int numberOfPathPairs, PathPair **pathPair)
04828 {
04829 try
04830 {
04831 if (this->pathPair != NULL)
04832
04833 return false;
04834
04835 if (numberOfPathPairs < 0)
04836
04837 return false;
04838
04839 this->numberOfPathPairs = numberOfPathPairs;
04840 if (numberOfPathPairs == 0)
04841 return true;
04842
04843 this->pathPair = new PathPair*[numberOfPathPairs];
04844
04845 int i;
04846 for (i = 0; i < numberOfPathPairs; i++)
04847 {
04848 this->pathPair[i] = new PathPair();
04849 *this->pathPair[i] = *pathPair[i];
04850 }
04851 return true;
04852 }
04853 catch(const ErrorClass& eclass)
04854 {
04855 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_error, eclass.errormsg);
04856 return false;
04857 }
04858 }
04859
04860
04861 bool PathPairs::setPathPair(std::string *from, std::string *to, bool *makeCopy, int numberOfPathPairs)
04862 {
04863
04864
04865
04866 this->numberOfPathPairs = numberOfPathPairs;
04867 if (numberOfPathPairs == 0)
04868 return true;
04869
04870 this->pathPair = new PathPair*[numberOfPathPairs];
04871
04872 int i;
04873 for (i = 0; i < numberOfPathPairs; i++)
04874 {
04875 this->pathPair[i] = new PathPair();
04876 this->pathPair[i]->from = from[i];
04877 this->pathPair[i]->to = to[i];
04878 this->pathPair[i]->makeCopy = makeCopy[i];
04879 }
04880 return true;
04881 }
04882
04890 bool PathPairs::addPathPair(std::string fromPath, std::string toPath, bool makeCopy)
04891 {
04892 try
04893 {
04894 int nopt;
04895 int i;
04896 if (fromPath.empty() )
04897
04898 return false;
04899 if (toPath.empty() )
04900
04901 return false;
04902
04903 if (this->pathPair == NULL)
04904 nopt = 0;
04905 else
04906 nopt = this->numberOfPathPairs;
04907
04908 PathPair** temp = new PathPair*[nopt+1];
04909 for (i = 0; i < nopt; i++)
04910 temp[i] = this->pathPair[i];
04911
04912 delete[] this->pathPair;
04913
04914
04915 temp[ nopt] = new PathPair();
04916
04917 temp[ nopt]->from = fromPath;
04918 temp[ nopt]->to = toPath;
04919 temp[ nopt]->makeCopy = makeCopy;
04920
04921 this->pathPair = temp;
04922 this->numberOfPathPairs = ++nopt;
04923
04924 return true;
04925 }
04926 catch(const ErrorClass& eclass)
04927 {
04928 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_error, eclass.errormsg);
04929 return false;
04930 }
04931 }
04932
04939 bool Processes::setProcess(int numberOfProcesses, std::string *process)
04940 {
04941 try
04942 {
04943 if (this->process != NULL)
04944
04945 return false;
04946
04947 if (numberOfProcesses < 0)
04948
04949 return false;
04950
04951 this->numberOfProcesses= numberOfProcesses;
04952 if (numberOfProcesses == 0)
04953 return true;
04954
04955 this->process = new std::string[numberOfProcesses];
04956 int i;
04957 for (i = 0; i < numberOfProcesses; i++)
04958 this->process[i] = process[i];
04959
04960 return true;
04961 }
04962 catch(const ErrorClass& eclass)
04963 {
04964 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_error, eclass.errormsg);
04965 return false;
04966 }
04967 }
04968
04974 bool Processes::addProcess(std::string process)
04975 {
04976 try
04977 {
04978 int nopt;
04979 if (process.empty() )
04980 throw ErrorClass( "the name of a process cannot be empty." );
04981
04982 if (this->process == NULL)
04983 nopt = 0;
04984 else
04985 nopt = this->numberOfProcesses;
04986
04987 std::string* temp = new std::string[nopt+1];
04988 int i;
04989 for (i = 0; i < nopt; i++)
04990 temp[i] = this->process[i];
04991
04992 delete[] this->process;
04993
04994 temp[nopt] = process;
04995
04996 this->process = temp;
04997 this->numberOfProcesses = ++nopt;
04998 return true;
04999 }
05000 catch(const ErrorClass& eclass)
05001 {
05002 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_error, eclass.errormsg);
05003 return false;
05004 }
05005 }
05006
05013 bool InitVariableValues::setVar(int numberOfVar, InitVarValue **var)
05014 {
05015 try
05016 {
05017 if (this->var != NULL)
05018 throw ErrorClass( "InitVarValue array previously used.");
05019
05020 if (numberOfVar < 0)
05021 throw ErrorClass( "length of var array cannot be negative.");
05022
05023 this->numberOfVar = numberOfVar;
05024 if (numberOfVar == 0)
05025 return true;
05026
05027 this->var = new InitVarValue*[numberOfVar];
05028
05029 int i;
05030 for (i = 0; i < numberOfVar; i++)
05031 {
05032 this->var[i] = new InitVarValue();
05033 *this->var[i] = *var[i];
05034 }
05035 return true;
05036 }
05037 catch(const ErrorClass& eclass)
05038 {
05039 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_error, eclass.errormsg);
05040 return false;
05041 }
05042 }
05043
05051 bool InitVariableValues::setVar(int numberOfVar, InitVarValue **var, ENUM_COMBINE_ARRAYS disp)
05052 {
05053 try
05054 {
05055 if (this->var != NULL)
05056 {
05057 if (disp == ENUM_COMBINE_ARRAYS_throw)
05058 throw ErrorClass( "InitVarValue array previously used.");
05059 if (disp == ENUM_COMBINE_ARRAYS_ignore)
05060 return true;
05061
05062 if (disp == ENUM_COMBINE_ARRAYS_merge)
05063 return this->addVar(numberOfVar, var);
05064
05065
05066 for (int i = 0; i < this->numberOfVar; i++)
05067 delete this->var[i];
05068 delete [] this->var;
05069 this->var = NULL;
05070 }
05071
05072 if (numberOfVar < 0)
05073 throw ErrorClass( "length of var array cannot be negative.");
05074
05075 this->numberOfVar = numberOfVar;
05076 if (numberOfVar == 0)
05077 return true;
05078
05079 this->var = new InitVarValue*[numberOfVar];
05080
05081 int i;
05082 for (i = 0; i < numberOfVar; i++)
05083 {
05084 this->var[i] = new InitVarValue();
05085 *this->var[i] = *var[i];
05086 }
05087 return true;
05088 }
05089 catch(const ErrorClass& eclass)
05090 {
05091 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_error, eclass.errormsg);
05092 return false;
05093 }
05094 }
05095
05096
05105 bool InitVariableValues::setVar(int numberOfVar, int *idx, double *value, std::string *name)
05106 {
05107 if (this->var != NULL)
05108 return false;
05109
05110 if (numberOfVar < 0)
05111 return false;
05112
05113 this->numberOfVar = numberOfVar;
05114 if (numberOfVar == 0)
05115 return true;
05116
05117 this->var = new InitVarValue*[numberOfVar];
05118
05119 int i;
05120 for (i = 0; i < numberOfVar; i++)
05121 {
05122 this->var[i] = new InitVarValue();
05123 this->var[i]->idx = idx[i];
05124 this->var[i]->name = name[i];
05125 this->var[i]->value = value[i];
05126 }
05127 return true;
05128 }
05129
05136 bool InitVariableValues::addVar(int idx, double value)
05137 {
05138 try
05139 {
05140 int nopt;
05141 int i;
05142 if (idx < 0)
05143 throw ErrorClass( "the index of a variable cannot be negative." );
05144
05145 if (this->var == NULL)
05146 nopt = 0;
05147 else
05148 nopt = this->numberOfVar;
05149
05150 InitVarValue** temp = new InitVarValue*[nopt+1];
05151 for (i = 0; i < nopt; i++)
05152 temp[i] = this->var[i];
05153
05154 delete[] this->var;
05155
05156
05157 temp[ nopt] = new InitVarValue();
05158
05159 temp[ nopt]->idx = idx;
05160 temp[ nopt]->value = value;
05161
05162 this->var = temp;
05163 this->numberOfVar = ++nopt;
05164
05165 return true;
05166 }
05167 catch(const ErrorClass& eclass)
05168 {
05169 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_error, eclass.errormsg);
05170 return false;
05171 }
05172 }
05173
05179 bool InitVariableValues::addVar(int numberOfVar, InitVarValue **var)
05180 {
05181 try
05182 {
05183 if (numberOfVar < 0)
05184 throw ErrorClass( "length of var array cannot be negative.");
05185
05186 if (numberOfVar == 0)
05187 return true;
05188
05189 int nprev = this->numberOfVar;
05190
05191 InitVarValue** temp = new InitVarValue*[nprev+numberOfVar];
05192 for (int i = 0; i < nprev; i++)
05193 temp[i] = this->var[i];
05194
05195 delete[] this->var;
05196
05197
05198 for (int i=0; i < numberOfVar; i++)
05199 {
05200 temp[nprev+i] = new InitVarValue();
05201 *temp[nprev+i] = *var[i];
05202 }
05203
05204 this->var = temp;
05205 this->numberOfVar = nprev + numberOfVar;
05206
05207 return true;
05208 }
05209 catch(const ErrorClass& eclass)
05210 {
05211 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_error, eclass.errormsg);
05212 return false;
05213 }
05214 }
05215
05222 bool InitVariableValuesString::setVar(int numberOfVar, InitVarValueString **var)
05223 {
05224 try
05225 {
05226 if (this->var != NULL)
05227 throw ErrorClass( "InitVarValueString array previously used.");
05228
05229 if (numberOfVar < 0)
05230 throw ErrorClass( "length of var array cannot be negative.");
05231
05232 this->numberOfVar = numberOfVar;
05233 if (numberOfVar == 0)
05234 return true;
05235
05236 this->var = new InitVarValueString*[numberOfVar];
05237
05238 int i;
05239 for (i = 0; i < numberOfVar; i++)
05240 {
05241 this->var[i] = new InitVarValueString();
05242 *this->var[i] = *var[i];
05243 }
05244 return true;
05245 }
05246 catch(const ErrorClass& eclass)
05247 {
05248 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_error, eclass.errormsg);
05249 return false;
05250 }
05251 }
05252
05259 bool InitVariableValuesString::setVar(int numberOfVar, InitVarValueString **var, ENUM_COMBINE_ARRAYS disp)
05260 {
05261 try
05262 {
05263 if (this->var != NULL)
05264 {
05265 if (disp == ENUM_COMBINE_ARRAYS_throw)
05266 throw ErrorClass( "InitVarValueString array previously used.");
05267 if (disp == ENUM_COMBINE_ARRAYS_ignore)
05268 return true;
05269 if (disp == ENUM_COMBINE_ARRAYS_merge)
05270 return this->addVar(numberOfVar, var);
05271
05272
05273 for (int i = 0; i < this->numberOfVar; i++)
05274 delete this->var[i];
05275 delete [] this->var;
05276 this->var = NULL;
05277 }
05278
05279 if (numberOfVar < 0)
05280 throw ErrorClass( "length of var array cannot be negative.");
05281
05282 this->numberOfVar = numberOfVar;
05283 if (numberOfVar == 0)
05284 return true;
05285
05286 this->var = new InitVarValueString*[numberOfVar];
05287
05288 int i;
05289 for (i = 0; i < numberOfVar; i++)
05290 {
05291 this->var[i] = new InitVarValueString();
05292 *this->var[i] = *var[i];
05293 }
05294 return true;
05295 }
05296 catch(const ErrorClass& eclass)
05297 {
05298 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_error, eclass.errormsg);
05299 return false;
05300 }
05301 }
05302
05311 bool InitVariableValuesString::setVar(int numberOfVar, int *idx, std::string *value, std::string *name)
05312 {
05313 if (this->var != NULL)
05314 return false;
05315
05316
05317 if (numberOfVar < 0)
05318 return false;
05319
05320 this->numberOfVar = numberOfVar;
05321 if (numberOfVar == 0)
05322 return true;
05323
05324 this->var = new InitVarValueString*[numberOfVar];
05325
05326 int i;
05327 for (i = 0; i < numberOfVar; i++)
05328 {
05329 this->var[i] = new InitVarValueString();
05330 this->var[i]->idx = idx[i];
05331 this->var[i]->name = name[i];
05332 this->var[i]->value = value[i];
05333 }
05334 return true;
05335 }
05336
05343 bool InitVariableValuesString::addVar(int idx, std::string value)
05344 {
05345 try
05346 {
05347 int nopt;
05348 int i;
05349 if (idx < 0)
05350 throw ErrorClass( "the index of a variable cannot be negative." );
05351
05352 if (this->var == NULL)
05353 nopt = 0;
05354 else
05355 nopt = this->numberOfVar;
05356
05357 InitVarValueString** temp = new InitVarValueString*[nopt+1];
05358 for (i = 0; i < nopt; i++)
05359 temp[i] = this->var[i];
05360
05361 delete[] this->var;
05362
05363
05364 temp[ nopt] = new InitVarValueString();
05365
05366 temp[ nopt]->idx = idx;
05367 temp[ nopt]->value = value;
05368
05369 this->var = temp;
05370 this->numberOfVar = ++nopt;
05371
05372 return true;
05373 }
05374 catch(const ErrorClass& eclass)
05375 {
05376 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_error, eclass.errormsg);
05377 return false;
05378 }
05379 }
05380
05387 bool InitVariableValuesString::addVar(int numberOfVar, InitVarValueString **var)
05388 {
05389 try
05390 {
05391 if (numberOfVar < 0)
05392 throw ErrorClass( "length of var array cannot be negative.");
05393
05394 if (numberOfVar == 0)
05395 return true;
05396
05397 int nprev = this->numberOfVar;
05398
05399 InitVarValueString** temp = new InitVarValueString*[nprev+numberOfVar];
05400 for (int i = 0; i < nprev; i++)
05401 temp[i] = this->var[i];
05402
05403 delete[] this->var;
05404
05405
05406 for (int i=0; i < numberOfVar; i++)
05407 {
05408 temp[nprev+i] = new InitVarValueString();
05409 *temp[nprev+i] = *var[i];
05410 }
05411
05412 this->var = temp;
05413 this->numberOfVar = nprev + numberOfVar;
05414
05415 return true;
05416 }
05417 catch(const ErrorClass& eclass)
05418 {
05419 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_error, eclass.errormsg);
05420 return false;
05421 }
05422 }
05423
05430 bool InitialBasisStatus::setVar(int numberOfVar, InitBasStatus **var)
05431 {
05432 try
05433 {
05434 if (this->var != NULL)
05435 throw ErrorClass( "InitBasStatus array previously used.");
05436
05437 if (numberOfVar < 0)
05438 throw ErrorClass( "length of var array cannot be negative.");
05439
05440 this->numberOfVar = numberOfVar;
05441 if (numberOfVar == 0)
05442 return true;
05443
05444 this->var = new InitBasStatus*[numberOfVar];
05445
05446 int i;
05447 for (i = 0; i < numberOfVar; i++)
05448 {
05449 this->var[i] = new InitBasStatus();
05450 *this->var[i] = *var[i];
05451 }
05452 return true;
05453 }
05454 catch(const ErrorClass& eclass)
05455 {
05456 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_error, eclass.errormsg);
05457 return false;
05458 }
05459 }
05460
05467 bool InitialBasisStatus::addVar(int idx, std::string value)
05468 {
05469 try
05470 {
05471 int nopt;
05472 int i;
05473 if (idx < 0)
05474 throw ErrorClass( "the index of a variable cannot be negative." );
05475 if (value != "atLower" && value != "basic" && value != "unknown" &&
05476 value != "atUpper" && value != "superbasic" )
05477 throw ErrorClass( "Illegal basis status " + value );
05478
05479 if (this->var == NULL)
05480 nopt = 0;
05481 else
05482 nopt = this->numberOfVar;
05483
05484 InitBasStatus** temp = new InitBasStatus*[nopt+1];
05485 for (i = 0; i < nopt; i++)
05486 temp[i] = this->var[i];
05487
05488 delete[] this->var;
05489
05490
05491 temp[ nopt] = new InitBasStatus();
05492
05493 temp[ nopt]->idx = idx;
05494 temp[ nopt]->value = value;
05495
05496 this->var = temp;
05497 this->numberOfVar = ++nopt;
05498
05499 return true;
05500 }
05501 catch(const ErrorClass& eclass)
05502 {
05503 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_error, eclass.errormsg);
05504 return false;
05505 }
05506 }
05507
05514 bool IntegerVariableBranchingWeights::setVar(int numberOfVar, BranchingWeight **var)
05515 {
05516 try
05517 {
05518 if (this->var != NULL)
05519 return false;
05520
05521 if (numberOfVar < 0)
05522 return false;
05523
05524 this->numberOfVar = numberOfVar;
05525 if (numberOfVar == 0)
05526 return true;
05527
05528 this->var = new BranchingWeight*[numberOfVar];
05529
05530 int i;
05531 for (i = 0; i < numberOfVar; i++)
05532 {
05533 this->var[i] = new BranchingWeight();
05534 *this->var[i] = *var[i];
05535 }
05536 return true;
05537 }
05538 catch(const ErrorClass& eclass)
05539 {
05540 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_error, eclass.errormsg);
05541 return false;
05542 }
05543 }
05544
05551 bool IntegerVariableBranchingWeights::setVar(int numberOfVar, BranchingWeight **var, ENUM_COMBINE_ARRAYS disp)
05552 {
05553 try
05554 {
05555 if (this->var != NULL)
05556 {
05557 if (disp == ENUM_COMBINE_ARRAYS_throw)
05558 throw ErrorClass( "BranchingWeight array previously used.");
05559 if (disp == ENUM_COMBINE_ARRAYS_ignore)
05560 return true;
05561 if (disp == ENUM_COMBINE_ARRAYS_merge)
05562 return this->addVar(numberOfVar, var);
05563
05564
05565 for (int i = 0; i < this->numberOfVar; i++)
05566 delete this->var[i];
05567 delete [] this->var;
05568 this->var = NULL;
05569 }
05570
05571 if (numberOfVar < 0)
05572 throw ErrorClass( "length of var array cannot be negative.");
05573
05574 this->numberOfVar = numberOfVar;
05575 if (numberOfVar == 0)
05576 return true;
05577
05578 this->var = new BranchingWeight*[numberOfVar];
05579
05580 int i;
05581 for (i = 0; i < numberOfVar; i++)
05582 {
05583 this->var[i] = new BranchingWeight();
05584 *this->var[i] = *var[i];
05585 }
05586 return true;
05587 }
05588 catch(const ErrorClass& eclass)
05589 {
05590 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_error, eclass.errormsg);
05591 return false;
05592 }
05593 }
05594
05603 bool IntegerVariableBranchingWeights::setVar(int numberOfVar, int *idx, double *value, std::string *name)
05604 {
05605 if (this->var != NULL)
05606 return false;
05607
05608 if (numberOfVar < 0)
05609 return false;
05610
05611 this->numberOfVar = numberOfVar;
05612 if (numberOfVar == 0)
05613 return true;
05614
05615 this->var = new BranchingWeight*[numberOfVar];
05616
05617 int i;
05618 for (i = 0; i < numberOfVar; i++)
05619 {
05620 this->var[i] = new BranchingWeight();
05621 this->var[i]->idx = idx[i];
05622 this->var[i]->name = name[i];
05623 this->var[i]->value = value[i];
05624 }
05625 return true;
05626 }
05627
05628
05629
05630
05637 bool IntegerVariableBranchingWeights::addVar(int idx, double value)
05638 {
05639 try
05640 {
05641 int nopt;
05642 int i;
05643 if (idx < 0)
05644 throw ErrorClass( "the index of a variable cannot be negative." );
05645
05646 if (this->var == NULL)
05647 nopt = 0;
05648 else
05649 nopt = this->numberOfVar;
05650
05651 BranchingWeight** temp = new BranchingWeight*[nopt+1];
05652 for (i = 0; i < nopt; i++)
05653 temp[i] = this->var[i];
05654
05655 delete[] this->var;
05656
05657
05658 temp[ nopt] = new BranchingWeight();
05659
05660 temp[ nopt]->idx = idx;
05661 temp[ nopt]->value = value;
05662
05663 this->var = temp;
05664 this->numberOfVar = ++nopt;
05665
05666 return true;
05667 }
05668 catch(const ErrorClass& eclass)
05669 {
05670 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_error, eclass.errormsg);
05671 return false;
05672 }
05673 }
05674
05680 bool IntegerVariableBranchingWeights::addVar(int numberOfVar, BranchingWeight **var)
05681 {
05682 try
05683 {
05684 if (numberOfVar < 0)
05685 throw ErrorClass( "length of var array cannot be negative.");
05686
05687 if (numberOfVar == 0)
05688 return true;
05689
05690 int nprev = this->numberOfVar;
05691
05692 BranchingWeight** temp = new BranchingWeight*[nprev+numberOfVar];
05693 for (int i = 0; i < nprev; i++)
05694 temp[i] = this->var[i];
05695
05696 delete[] this->var;
05697
05698
05699 for (int i=0; i < numberOfVar; i++)
05700 {
05701 temp[nprev+i] = new BranchingWeight();
05702 *temp[nprev+i] = *var[i];
05703 }
05704
05705 this->var = temp;
05706 this->numberOfVar = nprev + numberOfVar;
05707
05708 return true;
05709 }
05710 catch(const ErrorClass& eclass)
05711 {
05712 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_error, eclass.errormsg);
05713 return false;
05714 }
05715 }
05716
05723 bool SOSWeights::setVar(int numberOfVar, BranchingWeight **var)
05724 {
05725 try
05726 {
05727 if (this->var != NULL)
05728 throw ErrorClass( "BranchingWeight array previously used.");
05729
05730 if (numberOfVar < 0)
05731 throw ErrorClass( "length of var array cannot be negative.");
05732
05733 this->numberOfVar = numberOfVar;
05734 if (numberOfVar == 0)
05735 return true;
05736
05737 this->var = new BranchingWeight*[numberOfVar];
05738
05739 int i;
05740 for (i = 0; i < numberOfVar; i++)
05741 {
05742 this->var[i] = new BranchingWeight();
05743 *this->var[i] = *var[i];
05744 }
05745 return true;
05746 }
05747 catch(const ErrorClass& eclass)
05748 {
05749 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_error, eclass.errormsg);
05750 return false;
05751 }
05752 }
05753
05760 bool SOSWeights::addVar(int idx, double value)
05761 {
05762 try
05763 {
05764 int nopt;
05765 int i;
05766 if (idx < 0)
05767 throw ErrorClass( "the index of a variable cannot be negative." );
05768
05769 if (this->var == NULL)
05770 nopt = 0;
05771 else
05772 nopt = this->numberOfVar;
05773
05774 BranchingWeight** temp = new BranchingWeight*[nopt+1];
05775 for (i = 0; i < nopt; i++)
05776 temp[i] = this->var[i];
05777
05778 delete[] this->var;
05779
05780
05781 temp[ nopt] = new BranchingWeight();
05782
05783 temp[ nopt]->idx = idx;
05784 temp[ nopt]->value = value;
05785
05786 this->var = temp;
05787 this->numberOfVar = ++nopt;
05788
05789 return true;
05790 }
05791 catch(const ErrorClass& eclass)
05792 {
05793 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_error, eclass.errormsg);
05794 return false;
05795 }
05796 }
05797
05804 bool SOSVariableBranchingWeights::setSOS(int numberOfSOS, SOSWeights **sos)
05805 {
05806 try
05807 {
05808 if (this->sos != NULL)
05809 throw ErrorClass( "SOS array previously used.");
05810
05811 if (numberOfSOS < 0)
05812 throw ErrorClass( "length of sos array cannot be negative.");
05813
05814 this->numberOfSOS = numberOfSOS;
05815 if (numberOfSOS == 0) return true;
05816
05817 this->sos = new SOSWeights*[numberOfSOS];
05818
05819 int i, j;
05820 for (i = 0; i < numberOfSOS; i++)
05821 {
05822 this->sos[i] = new SOSWeights();
05823 this->sos[i]->sosIdx = sos[i]->sosIdx;
05824 this->sos[i]->groupWeight = sos[i]->groupWeight;
05825
05826 if (sos[i]->numberOfVar < 0)
05827 throw ErrorClass( "the number of variables in the SOS cannot be negative.");
05828
05829 this->sos[i]->numberOfVar = sos[i]->numberOfVar;
05830
05831 if (sos[i]->numberOfVar > 0)
05832 {
05833 this->sos[i]->var = new BranchingWeight*[sos[i]->numberOfVar];
05834 for (j = 0; j < sos[i]->numberOfVar; j++)
05835 {
05836 this->sos[i]->var[j] = new BranchingWeight();
05837 *this->sos[i]->var[j] = *sos[i]->var[j];
05838 }
05839 }
05840 }
05841 return true;
05842 }
05843 catch(const ErrorClass& eclass)
05844 {
05845 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_error, eclass.errormsg);
05846 return false;
05847 }
05848 }
05849
05855 bool SOSVariableBranchingWeights::addSOS(int sosIdx, int nvar, double weight, int* idx, double* value, std::string* name)
05856 {
05857 try
05858 {
05859 int nopt;
05860 int i;
05861 if (sosIdx < 0)
05862 throw ErrorClass( "the index of the SOS cannot be negative." );
05863 if (nvar < 0)
05864 throw ErrorClass( "the number of variables in the SOS cannot be negative." );
05865
05866 if (this->sos == NULL)
05867 nopt = 0;
05868 else
05869 nopt = this->numberOfSOS;
05870
05871 SOSWeights** temp = new SOSWeights*[nopt+1];
05872 for (i = 0; i < nopt; i++)
05873 temp[i] = this->sos[i];
05874
05875 delete[] this->sos;
05876
05877
05878 temp[ nopt] = new SOSWeights();
05879
05880 temp[ nopt]->sosIdx = sosIdx;
05881 temp[ nopt]->groupWeight = weight;
05882 temp[ nopt]->numberOfVar = nvar;
05883 temp[ nopt]->var = new BranchingWeight*[nvar];
05884 for (i = 0; i < nvar; i++)
05885 {
05886 temp[nopt]->var[i] = new BranchingWeight();
05887 temp[nopt]->var[i]->idx = idx[i];
05888 temp[nopt]->var[i]->name = name[i];
05889 temp[nopt]->var[i]->value = value[i];
05890 }
05891
05892 this->sos = temp;
05893 this->numberOfSOS = ++nopt;
05894
05895 return true;
05896 }
05897 catch(const ErrorClass& eclass)
05898 {
05899 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_error, eclass.errormsg);
05900 return false;
05901 }
05902 }
05903
05910 bool OtherVariableOption::setVar(int numberOfVar, OtherVarOption **var)
05911 {
05912 try
05913 {
05914 if (this->var != NULL)
05915 throw ErrorClass( "OtherVarOption array previously used.");
05916
05917 if (numberOfVar < 0)
05918 throw ErrorClass( "length of <var> array cannot be negative.");
05919
05920 this->numberOfVar = numberOfVar;
05921 if (numberOfVar == 0) return true;
05922
05923 this->var = new OtherVarOption*[numberOfVar];
05924
05925 int i;
05926 for (i = 0; i < numberOfVar; i++)
05927 {
05928 this->var[i] = new OtherVarOption();
05929 *this->var[i] = *var[i];
05930 }
05931 return true;
05932 }
05933 catch(const ErrorClass& eclass)
05934 {
05935 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_error, eclass.errormsg);
05936 return false;
05937 }
05938 }
05939
05948 bool OtherVariableOption::addVar(int idx, std::string value, std::string lbValue, std::string ubValue)
05949 {
05950 try
05951 {
05952 int nopt;
05953 int i;
05954 if (idx < 0)
05955 throw ErrorClass( "the index of a variable cannot be negative." );
05956
05957 if (this->var == NULL)
05958 nopt = 0;
05959 else
05960 nopt = this->numberOfVar;
05961
05962 OtherVarOption** temp = new OtherVarOption*[nopt+1];
05963 for (i = 0; i < nopt; i++)
05964 temp[i] = this->var[i];
05965
05966 delete[] this->var;
05967
05968
05969 temp[ nopt] = new OtherVarOption();
05970
05971 temp[ nopt]->idx = idx;
05972 temp[ nopt]->value = value;
05973 temp[ nopt]->lbValue = lbValue;
05974 temp[ nopt]->ubValue = ubValue;
05975
05976 this->var = temp;
05977 this->numberOfVar = ++nopt;
05978
05979 return true;
05980 }
05981 catch(const ErrorClass& eclass)
05982 {
05983 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_error, eclass.errormsg);
05984 return false;
05985 }
05986 }
05987
05994 bool VariableOption::setOther(int numberOfOptions, OtherVariableOption **other)
05995 {
05996 try
05997 {
05998 if (this->other != NULL)
05999 throw ErrorClass( "otherVariableOptions array previously used.");
06000
06001 if (numberOfOptions < 0)
06002 throw ErrorClass( "length of <other> array cannot be negative.");
06003
06004 this->numberOfOtherVariableOptions = numberOfOptions;
06005 if (numberOfOptions == 0) return true;
06006
06007 this->other = new OtherVariableOption*[numberOfOptions];
06008
06009 int i, j;
06010 for (i = 0; i < numberOfOptions; i++)
06011 {
06012 this->other[i] = new OtherVariableOption();
06013 this->other[i]->name = other[i]->name;
06014 this->other[i]->value = other[i]->value;
06015 this->other[i]->solver = other[i]->solver;
06016 this->other[i]->category = other[i]->category;
06017 this->other[i]->type = other[i]->type;
06018 this->other[i]->description = other[i]->description;
06019
06020 if (other[i]->numberOfVar < 0)
06021 throw ErrorClass( "the number of variables in otherVariableOption cannot be negative.");
06022
06023 this->other[i]->numberOfVar = other[i]->numberOfVar;
06024
06025 if (other[i]->numberOfVar > 0)
06026 {
06027 this->other[i]->var = new OtherVarOption*[other[i]->numberOfVar];
06028 for (j = 0; j < other[i]->numberOfVar; j++)
06029 {
06030 this->other[i]->var[j] = new OtherVarOption();
06031 *this->other[i]->var[j] = *other[i]->var[j];
06032 }
06033 }
06034 this->other[i]->numberOfEnumerations = other[i]->numberOfEnumerations;
06035
06036 if (this->other[i]->numberOfEnumerations > 0)
06037 {
06038 this->other[i]->enumeration = new OtherOptionEnumeration*[this->other[i]->numberOfEnumerations];
06039 for (j = 0; j < this->other[i]->numberOfEnumerations; j++)
06040 {
06041 this->other[i]->enumeration[j] = new OtherOptionEnumeration();
06042 this->other[i]->enumeration[j]->setOtherOptionEnumeration(
06043 other[i]->enumeration[j]->value,
06044 other[i]->enumeration[j]->description,
06045 other[i]->enumeration[j]->el,
06046 other[i]->enumeration[j]->numberOfEl);
06047 }
06048 }
06049 }
06050 return true;
06051 }
06052 catch(const ErrorClass& eclass)
06053 {
06054 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_error, eclass.errormsg);
06055 return false;
06056 }
06057 }
06058
06064 bool VariableOption::addOther(OtherVariableOption *other)
06065 {
06066 try
06067 {
06068 int nopt, i, j;
06069 if (this->other == NULL)
06070 nopt = 0;
06071 else
06072 nopt = this->numberOfOtherVariableOptions;
06073
06074 OtherVariableOption** temp = new OtherVariableOption*[nopt+1];
06075 for (i = 0; i < nopt; i++)
06076 temp[i] = this->other[i];
06077
06078 delete[] this->other;
06079
06080
06081 temp[ nopt] = new OtherVariableOption();
06082 temp[ nopt]->name = other->name;
06083 temp[ nopt]->value = other->value;
06084 temp[ nopt]->solver = other->solver;
06085 temp[ nopt]->category = other->category;
06086 temp[ nopt]->type = other->type;
06087 temp[ nopt]->varType = other->varType;
06088 temp[ nopt]->enumType = other->enumType;
06089 temp[ nopt]->description = other->description;
06090
06091 if (other->numberOfVar < 0)
06092 throw ErrorClass( "the number of variables in otherVariableOption cannot be negative.");
06093
06094 temp[ nopt]->numberOfVar = other->numberOfVar;
06095
06096 if (other->numberOfVar > 0)
06097 {
06098 temp[ nopt]->var = new OtherVarOption*[other->numberOfVar];
06099 for (j = 0; j < other->numberOfVar; j++)
06100 {
06101 temp[nopt]->var[j] = new OtherVarOption();
06102 *temp[nopt]->var[j] = *other->var[j];
06103 }
06104 }
06105
06106 temp[ nopt]->numberOfEnumerations = other->numberOfEnumerations;
06107
06108 if (other->numberOfEnumerations > 0)
06109 {
06110 temp[ nopt]->enumeration = new OtherOptionEnumeration*[other->numberOfEnumerations];
06111 for (j = 0; j < other->numberOfEnumerations; j++)
06112 {
06113 temp[ nopt]->enumeration[j] = new OtherOptionEnumeration();
06114 temp[ nopt]->enumeration[j]->setOtherOptionEnumeration(
06115 other->enumeration[j]->value,
06116 other->enumeration[j]->description,
06117 other->enumeration[j]->el,
06118 other->enumeration[j]->numberOfEl);
06119 }
06120 }
06121
06122
06123 this->other = temp;
06124 this->numberOfOtherVariableOptions = ++nopt;
06125
06126 return true;
06127 }
06128 catch(const ErrorClass& eclass)
06129 {
06130 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_error, eclass.errormsg);
06131 return false;
06132 }
06133 }
06134
06141 bool InitObjectiveValues::setObj(int numberOfObj, InitObjValue **obj)
06142 {
06143 try
06144 {
06145 if (this->obj != NULL)
06146 throw ErrorClass( "InitObjValue array previously used.");
06147
06148 if (numberOfObj < 0)
06149 throw ErrorClass( "length of obj array cannot be negative.");
06150
06151 this->numberOfObj = numberOfObj;
06152 if (numberOfObj == 0)
06153 return true;
06154
06155 this->obj = new InitObjValue*[numberOfObj];
06156
06157 int i;
06158 for (i = 0; i < numberOfObj; i++)
06159 {
06160 this->obj[i] = new InitObjValue();
06161 *this->obj[i] = *obj[i];
06162 }
06163 return true;
06164 }
06165 catch(const ErrorClass& eclass)
06166 {
06167 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_error, eclass.errormsg);
06168 return false;
06169 }
06170 }
06171
06179 bool InitObjectiveValues::setObj(int numberOfObj, InitObjValue **obj, ENUM_COMBINE_ARRAYS disp)
06180 {
06181 try
06182 {
06183 if (this->obj != NULL)
06184 {
06185 if (disp == ENUM_COMBINE_ARRAYS_throw)
06186 throw ErrorClass( "InitObjValue array previously used.");
06187 if (disp == ENUM_COMBINE_ARRAYS_ignore)
06188 return true;
06189 if (disp == ENUM_COMBINE_ARRAYS_merge)
06190 return this->addObj(numberOfObj, obj);
06191
06192
06193 for (int i = 0; i < this->numberOfObj; i++)
06194 delete this->obj[i];
06195 delete [] this->obj;
06196 this->obj = NULL;
06197 }
06198
06199 if (numberOfObj < 0)
06200 throw ErrorClass( "length of obj array cannot be negative.");
06201
06202 this->numberOfObj = numberOfObj;
06203 if (numberOfObj == 0)
06204 return true;
06205
06206 this->obj = new InitObjValue*[numberOfObj];
06207
06208 int i;
06209 for (i = 0; i < numberOfObj; i++)
06210 {
06211 this->obj[i] = new InitObjValue();
06212 *this->obj[i] = *obj[i];
06213 }
06214 return true;
06215 }
06216 catch(const ErrorClass& eclass)
06217 {
06218 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_error, eclass.errormsg);
06219 return false;
06220 }
06221 }
06222
06223 bool InitObjectiveValues::setObj(int numberOfObj, int *idx, double *value, std::string *name)
06224 {
06225 if (this->obj != NULL) return false;
06226
06227 if (numberOfObj < 0) return false;
06228
06229 this->numberOfObj = numberOfObj;
06230 if (numberOfObj == 0) return true;
06231
06232 this->obj = new InitObjValue*[numberOfObj];
06233
06234 int i;
06235 for (i = 0; i < numberOfObj; i++)
06236 {
06237 this->obj[i] = new InitObjValue();
06238 this->obj[i]->idx = idx[i];
06239 this->obj[i]->name = name[i];
06240 this->obj[i]->value = value[i];
06241 }
06242 return true;
06243 }
06244
06245
06252 bool InitObjectiveValues::addObj(int idx, double value)
06253 {
06254 try
06255 {
06256 int nopt;
06257 int i;
06258 if (idx >= 0)
06259 throw ErrorClass( "the index of an objective must be negative." );
06260
06261 if (this->obj == NULL)
06262 nopt = 0;
06263 else
06264 nopt = this->numberOfObj;
06265
06266 InitObjValue** temp = new InitObjValue*[nopt+1];
06267 for (i = 0; i < nopt; i++)
06268 temp[i] = this->obj[i];
06269
06270 delete[] this->obj;
06271
06272
06273 temp[ nopt] = new InitObjValue();
06274
06275 temp[ nopt]->idx = idx;
06276 temp[ nopt]->value = value;
06277
06278 this->obj = temp;
06279 this->numberOfObj = ++nopt;
06280
06281 return true;
06282 }
06283 catch(const ErrorClass& eclass)
06284 {
06285 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_error, eclass.errormsg);
06286 return false;
06287 }
06288 }
06289
06295 bool InitObjectiveValues::addObj(int numberOfObj, InitObjValue **obj)
06296 {
06297 try
06298 {
06299 if (numberOfObj < 0)
06300 throw ErrorClass( "length of obj array cannot be negative.");
06301
06302 if (numberOfObj == 0)
06303 return true;
06304
06305 int nprev = this->numberOfObj;
06306
06307 InitObjValue** temp = new InitObjValue*[nprev+numberOfObj];
06308 for (int i = 0; i < nprev; i++)
06309 temp[i] = this->obj[i];
06310
06311 delete[] this->obj;
06312
06313
06314 for (int i=0; i < numberOfObj; i++)
06315 {
06316 temp[nprev+i] = new InitObjValue();
06317 *temp[nprev+i] = *obj[i];
06318 }
06319
06320 this->obj = temp;
06321 this->numberOfObj = nprev + numberOfObj;
06322
06323 return true;
06324 }
06325 catch(const ErrorClass& eclass)
06326 {
06327 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_error, eclass.errormsg);
06328 return false;
06329 }
06330 }
06331
06338 bool InitObjectiveBounds::setObj(int numberOfObj, InitObjBound **obj)
06339 {
06340 try
06341 {
06342 if (this->obj != NULL)
06343 throw ErrorClass( "InitObjBound array previously used.");
06344
06345 if (numberOfObj < 0)
06346 throw ErrorClass( "length of obj array cannot be negative.");
06347
06348 this->numberOfObj = numberOfObj;
06349 if (numberOfObj == 0)
06350 return true;
06351
06352 this->obj = new InitObjBound*[numberOfObj];
06353
06354 int i;
06355 for (i = 0; i < numberOfObj; i++)
06356 {
06357 this->obj[i] = new InitObjBound();
06358 *this->obj[i] = *obj[i];
06359 }
06360 return true;
06361 }
06362 catch(const ErrorClass& eclass)
06363 {
06364 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_error, eclass.errormsg);
06365 return false;
06366 }
06367 }
06368
06376 bool InitObjectiveBounds::setObj(int numberOfObj, InitObjBound **obj, ENUM_COMBINE_ARRAYS disp)
06377 {
06378 try
06379 {
06380 if (this->obj != NULL)
06381 {
06382 if (disp == ENUM_COMBINE_ARRAYS_throw)
06383 throw ErrorClass( "InitObjBound array previously used.");
06384 if (disp == ENUM_COMBINE_ARRAYS_ignore)
06385 return true;
06386 if (disp == ENUM_COMBINE_ARRAYS_merge)
06387 return this->addObj(numberOfObj, obj);
06388
06389
06390 for (int i = 0; i < this->numberOfObj; i++)
06391 delete this->obj[i];
06392 delete [] this->obj;
06393 this->obj = NULL;
06394 }
06395
06396 if (numberOfObj < 0)
06397 throw ErrorClass( "length of obj array cannot be negative.");
06398
06399 this->numberOfObj = numberOfObj;
06400 if (numberOfObj == 0)
06401 return true;
06402
06403 this->obj = new InitObjBound*[numberOfObj];
06404
06405 int i;
06406 for (i = 0; i < numberOfObj; i++)
06407 {
06408 this->obj[i] = new InitObjBound();
06409 *this->obj[i] = *obj[i];
06410 }
06411 return true;
06412 }
06413 catch(const ErrorClass& eclass)
06414 {
06415 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_error, eclass.errormsg);
06416 return false;
06417 }
06418 }
06419
06420 bool InitObjectiveBounds::setObj(int numberOfObj, int *idx, double *lbValue, double *ubValue, std::string *name)
06421 {
06422 if (this->obj != NULL)
06423 return false;
06424
06425 if (numberOfObj < 0)
06426 return false;
06427
06428 this->numberOfObj = numberOfObj;
06429 if (numberOfObj == 0)
06430 return true;
06431
06432 this->obj = new InitObjBound*[numberOfObj];
06433
06434 int i;
06435 for (i = 0; i < numberOfObj; i++)
06436 {
06437 this->obj[i] = new InitObjBound();
06438 this->obj[i]->idx = idx[i];
06439 this->obj[i]->name = name[i];
06440 this->obj[i]->lbValue = lbValue[i];
06441 this->obj[i]->ubValue = ubValue[i];
06442 }
06443 return true;
06444 }
06445
06446
06454 bool InitObjectiveBounds::addObj(int idx, double lbValue, double ubValue)
06455 {
06456 try
06457 {
06458 int nopt;
06459 int i;
06460 if (idx >= 0)
06461 throw ErrorClass( "the index of an objective must be negative." );
06462
06463 if (this->obj == NULL)
06464 nopt = 0;
06465 else
06466 nopt = this->numberOfObj;
06467
06468 InitObjBound** temp = new InitObjBound*[nopt+1];
06469 for (i = 0; i < nopt; i++)
06470 temp[i] = this->obj[i];
06471
06472 delete[] this->obj;
06473
06474
06475 temp[ nopt] = new InitObjBound();
06476
06477 temp[ nopt]->idx = idx;
06478 temp[ nopt]->lbValue = lbValue;
06479 temp[ nopt]->ubValue = ubValue;
06480
06481 this->obj = temp;
06482 this->numberOfObj = ++nopt;
06483
06484 return true;
06485 }
06486 catch(const ErrorClass& eclass)
06487 {
06488 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_error, eclass.errormsg);
06489 return false;
06490 }
06491 }
06492
06498 bool InitObjectiveBounds::addObj(int numberOfObj, InitObjBound **obj)
06499 {
06500 try
06501 {
06502 if (numberOfObj < 0)
06503 throw ErrorClass( "length of obj array cannot be negative.");
06504
06505 if (numberOfObj == 0)
06506 return true;
06507
06508 int nprev = this->numberOfObj;
06509
06510 InitObjBound** temp = new InitObjBound*[nprev+numberOfObj];
06511 for (int i = 0; i < nprev; i++)
06512 temp[i] = this->obj[i];
06513
06514 delete[] this->obj;
06515
06516
06517 for (int i=0; i < numberOfObj; i++)
06518 {
06519 temp[nprev+i] = new InitObjBound();
06520 *temp[nprev+i] = *obj[i];
06521 }
06522
06523 this->obj = temp;
06524 this->numberOfObj = nprev + numberOfObj;
06525
06526 return true;
06527 }
06528 catch(const ErrorClass& eclass)
06529 {
06530 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_error, eclass.errormsg);
06531 return false;
06532 }
06533 }
06534
06544 bool OtherObjectiveOption::setObj(int numberOfObj, OtherObjOption **obj)
06545 {
06546 try
06547 {
06548 if (this->obj != NULL)
06549 throw ErrorClass( "OtherObjOption array previously used.");
06550
06551 if (numberOfObj < 0)
06552 throw ErrorClass( "length of <obj> array cannot be negative.");
06553
06554 this->numberOfObj= numberOfObj;
06555 if (numberOfObj == 0)
06556 return true;
06557
06558 this->obj = new OtherObjOption*[numberOfObj];
06559
06560 int i;
06561 for (i = 0; i < numberOfObj; i++)
06562 {
06563 this->obj[i] = new OtherObjOption();
06564 *this->obj[i] = *obj[i];
06565 }
06566 return true;
06567 }
06568 catch(const ErrorClass& eclass)
06569 {
06570 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_error, eclass.errormsg);
06571 return false;
06572 }
06573 }
06574
06583 bool OtherObjectiveOption::addObj(int idx, std::string value, std::string lbValue, std::string ubValue)
06584 {
06585 try
06586 {
06587 int nopt;
06588 int i;
06589 if (idx >= 0)
06590 throw ErrorClass( "the index of an objective must be negative." );
06591
06592 if (this->obj == NULL)
06593 nopt = 0;
06594 else
06595 nopt = this->numberOfObj;
06596
06597 OtherObjOption** temp = new OtherObjOption*[nopt+1];
06598 for (i = 0; i < nopt; i++)
06599 temp[i] = this->obj[i];
06600
06601 delete[] this->obj;
06602
06603
06604 temp[ nopt] = new OtherObjOption();
06605
06606 temp[ nopt]->idx = idx;
06607 temp[ nopt]->value = value;
06608 temp[ nopt]->lbValue = lbValue;
06609 temp[ nopt]->ubValue = ubValue;
06610
06611 this->obj = temp;
06612 this->numberOfObj = ++nopt;
06613
06614 return true;
06615 }
06616 catch(const ErrorClass& eclass)
06617 {
06618 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_error, eclass.errormsg);
06619 return false;
06620 }
06621 }
06622
06629 bool ObjectiveOption::setOther(int numberOfOptions, OtherObjectiveOption **other)
06630 {
06631 try
06632 {
06633 if (this->other != NULL)
06634 throw ErrorClass( "otherObjectiveOptions array previously used.");
06635
06636 if (numberOfOptions < 0)
06637 throw ErrorClass( "length of <other> array cannot be negative.");
06638
06639 this->numberOfOtherObjectiveOptions = numberOfOptions;
06640 if (numberOfOptions == 0) return true;
06641
06642 this->other = new OtherObjectiveOption*[numberOfOptions];
06643
06644 int i, j;
06645 for (i = 0; i < numberOfOptions; i++)
06646 {
06647 this->other[i] = new OtherObjectiveOption();
06648 this->other[i]->name = other[i]->name;
06649 this->other[i]->value = other[i]->value;
06650 this->other[i]->solver = other[i]->solver;
06651 this->other[i]->category = other[i]->category;
06652 this->other[i]->type = other[i]->type;
06653 this->other[i]->description = other[i]->description;
06654
06655 if (other[i]->numberOfObj < 0)
06656 throw ErrorClass( "the number of objectives in otherObjectiveOption cannot be negative.");
06657
06658 this->other[i]->numberOfObj = other[i]->numberOfObj;
06659
06660 if (other[i]->numberOfObj > 0)
06661 {
06662 this->other[i]->obj = new OtherObjOption*[other[i]->numberOfObj];
06663 for (j = 0; j < other[i]->numberOfObj; j++)
06664 {
06665 this->other[i]->obj[j] = new OtherObjOption();
06666 *this->other[i]->obj[j] = *other[i]->obj[j];
06667 }
06668 }
06669 this->other[i]->numberOfEnumerations = other[i]->numberOfEnumerations;
06670
06671 if (this->other[i]->numberOfEnumerations > 0)
06672 {
06673 this->other[i]->enumeration = new OtherOptionEnumeration*[this->other[i]->numberOfEnumerations];
06674 for (j = 0; j < this->other[i]->numberOfEnumerations; j++)
06675 {
06676 this->other[i]->enumeration[j] = new OtherOptionEnumeration();
06677 this->other[i]->enumeration[j]->setOtherOptionEnumeration(
06678 other[i]->enumeration[j]->value,
06679 other[i]->enumeration[j]->description,
06680 other[i]->enumeration[j]->el,
06681 other[i]->enumeration[j]->numberOfEl);
06682 }
06683 }
06684 }
06685 return true;
06686 }
06687 catch(const ErrorClass& eclass)
06688 {
06689 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_error, eclass.errormsg);
06690 return false;
06691 }
06692 }
06693
06699 bool ObjectiveOption::addOther(OtherObjectiveOption *other)
06700 {
06701 try
06702 {
06703 int nopt, i, j;
06704 if (this->other == NULL)
06705 nopt = 0;
06706 else
06707 nopt = this->numberOfOtherObjectiveOptions;
06708
06709 OtherObjectiveOption** temp = new OtherObjectiveOption*[nopt+1];
06710 for (i = 0; i < nopt; i++)
06711 temp[i] = this->other[i];
06712
06713 delete[] this->other;
06714
06715
06716 temp[ nopt] = new OtherObjectiveOption();
06717 temp[ nopt]->name = other->name;
06718 temp[ nopt]->value = other->value;
06719 temp[ nopt]->solver = other->solver;
06720 temp[ nopt]->category = other->category;
06721 temp[ nopt]->type = other->type;
06722 temp[ nopt]->objType = other->objType;
06723 temp[ nopt]->enumType = other->enumType;
06724 temp[ nopt]->description = other->description;
06725
06726 if (other->numberOfObj < 0)
06727 throw ErrorClass( "the number of objectives in otherObjectiveOption cannot be negative.");
06728
06729 temp[ nopt]->numberOfObj = other->numberOfObj;
06730
06731 if (other->numberOfObj > 0)
06732 {
06733 temp[ nopt]->obj = new OtherObjOption*[other->numberOfObj];
06734 for (j = 0; j < other->numberOfObj; j++)
06735 {
06736 temp[nopt]->obj[j] = new OtherObjOption();
06737 *temp[nopt]->obj[j] = *other->obj[j];
06738 }
06739 }
06740
06741 if (other->numberOfEnumerations < 0)
06742 throw ErrorClass( "the number of enumerations in otherObjectiveOption cannot be negative.");
06743
06744 temp[ nopt]->numberOfEnumerations = other->numberOfEnumerations;
06745
06746 if (other->numberOfEnumerations > 0)
06747 {
06748 temp[ nopt]->enumeration = new OtherOptionEnumeration*[other->numberOfEnumerations];
06749 for (j = 0; j < other->numberOfEnumerations; j++)
06750 {
06751 temp[ nopt]->enumeration[j] = new OtherOptionEnumeration();
06752 temp[ nopt]->enumeration[j]->setOtherOptionEnumeration(
06753 other->enumeration[j]->value,
06754 other->enumeration[j]->description,
06755 other->enumeration[j]->el,
06756 other->enumeration[j]->numberOfEl);
06757 }
06758 }
06759
06760
06761 this->other = temp;
06762 this->numberOfOtherObjectiveOptions = ++nopt;
06763
06764 return true;
06765 }
06766 catch(const ErrorClass& eclass)
06767 {
06768 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_error, eclass.errormsg);
06769 return false;
06770 }
06771 }
06772
06773
06774
06781 bool InitConstraintValues::setCon(int numberOfCon, InitConValue **con)
06782 {
06783 try
06784 {
06785 if (this->con != NULL)
06786 throw ErrorClass( "InitConValue array previously used.");
06787
06788 if (numberOfCon < 0)
06789 throw ErrorClass( "length of con array cannot be negative.");
06790
06791 this->numberOfCon = numberOfCon;
06792 if (numberOfCon == 0)
06793 return true;
06794
06795 this->con = new InitConValue*[numberOfCon];
06796
06797 int i;
06798 for (i = 0; i < numberOfCon; i++)
06799 {
06800 this->con[i] = new InitConValue();
06801 *this->con[i] = *con[i];
06802 }
06803 return true;
06804 }
06805 catch(const ErrorClass& eclass)
06806 {
06807 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_error, eclass.errormsg);
06808 return false;
06809 }
06810 }
06811
06819 bool InitConstraintValues::setCon(int numberOfCon, InitConValue **con, ENUM_COMBINE_ARRAYS disp)
06820 {
06821 try
06822 {
06823 if (this->con != NULL)
06824 {
06825 if (disp == ENUM_COMBINE_ARRAYS_throw)
06826 throw ErrorClass( "InitConValue array previously used.");
06827 if (disp == ENUM_COMBINE_ARRAYS_ignore)
06828 return true;
06829 if (disp == ENUM_COMBINE_ARRAYS_merge)
06830 return this->addCon(numberOfCon, con);
06831
06832
06833 for (int i = 0; i < this->numberOfCon; i++)
06834 delete this->con[i];
06835 delete [] this->con;
06836 this->con = NULL;
06837 }
06838
06839 if (numberOfCon < 0)
06840 throw ErrorClass( "length of con array cannot be negative.");
06841
06842 this->numberOfCon = numberOfCon;
06843 if (numberOfCon == 0)
06844 return true;
06845
06846 this->con = new InitConValue*[numberOfCon];
06847
06848 int i;
06849 for (i = 0; i < numberOfCon; i++)
06850 {
06851 this->con[i] = new InitConValue();
06852 *this->con[i] = *con[i];
06853 }
06854
06855 return true;
06856 }
06857 catch(const ErrorClass& eclass)
06858 {
06859 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_error, eclass.errormsg);
06860 return false;
06861 }
06862 }
06863
06864 bool InitConstraintValues::setCon(int numberOfCon, int *idx, double *value, std::string *name)
06865 {
06866 if (this->con != NULL)
06867 return false;
06868
06869 if (numberOfCon < 0)
06870 return false;
06871
06872 this->numberOfCon = numberOfCon;
06873 if (numberOfCon == 0)
06874 return true;
06875
06876 this->con = new InitConValue*[numberOfCon];
06877
06878 int i;
06879 for (i = 0; i < numberOfCon; i++)
06880 {
06881 this->con[i] = new InitConValue();
06882 this->con[i]->idx = idx[i];
06883 this->con[i]->name = name[i];
06884 this->con[i]->value = value[i];
06885 }
06886 return true;
06887 }
06888
06889
06890
06897 bool InitConstraintValues::addCon(int idx, double value)
06898 {
06899 try
06900 {
06901 int nopt;
06902 int i;
06903 if (idx < 0)
06904 throw ErrorClass( "the index of a constraint cannot be negative." );
06905
06906 if (this->con == NULL)
06907 nopt = 0;
06908 else
06909 nopt = this->numberOfCon;
06910
06911 InitConValue** temp = new InitConValue*[nopt+1];
06912 for (i = 0; i < nopt; i++)
06913 temp[i] = this->con[i];
06914
06915 delete[] this->con;
06916
06917
06918 temp[ nopt] = new InitConValue();
06919
06920 temp[ nopt]->idx = idx;
06921 temp[ nopt]->value = value;
06922
06923 this->con = temp;
06924 this->numberOfCon = ++nopt;
06925
06926 return true;
06927 }
06928 catch(const ErrorClass& eclass)
06929 {
06930 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_error, eclass.errormsg);
06931 return false;
06932 }
06933 }
06934
06940 bool InitConstraintValues::addCon(int numberOfCon, InitConValue **con)
06941 {
06942 try
06943 {
06944 if (numberOfCon < 0)
06945 throw ErrorClass( "length of con array cannot be negative.");
06946
06947 if (numberOfCon == 0)
06948 return true;
06949
06950 int nprev = this->numberOfCon;
06951
06952 InitConValue** temp = new InitConValue*[nprev+numberOfCon];
06953 for (int i = 0; i < nprev; i++)
06954 temp[i] = this->con[i];
06955
06956 delete[] this->con;
06957
06958
06959 for (int i=0; i < numberOfCon; i++)
06960 {
06961 temp[nprev+i] = new InitConValue();
06962 *temp[nprev+i] = *con[i];
06963 }
06964
06965 this->con = temp;
06966 this->numberOfCon = nprev + numberOfCon;
06967
06968 return true;
06969 }
06970 catch(const ErrorClass& eclass)
06971 {
06972 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_error, eclass.errormsg);
06973 return false;
06974 }
06975 }
06976
06977
06984 bool InitDualVariableValues::setCon(int numberOfCon, InitDualVarValue **con)
06985 {
06986 try
06987 {
06988 if (this->con != NULL)
06989 throw ErrorClass( "InitDualVarValue array previously used.");
06990
06991 if (numberOfCon < 0)
06992 throw ErrorClass( "length of con array cannot be negative.");
06993
06994 this->numberOfCon = numberOfCon;
06995 if (numberOfCon == 0)
06996 return true;
06997
06998 this->con = new InitDualVarValue*[numberOfCon];
06999
07000 int i;
07001 for (i = 0; i < numberOfCon; i++)
07002 {
07003 this->con[i] = new InitDualVarValue();
07004 *this->con[i] = *con[i];
07005 }
07006 return true;
07007 }
07008 catch(const ErrorClass& eclass)
07009 {
07010 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_error, eclass.errormsg);
07011 return false;
07012 }
07013 }
07021 bool InitDualVariableValues::setCon(int numberOfCon, InitDualVarValue **con, ENUM_COMBINE_ARRAYS disp)
07022 {
07023 try
07024 {
07025 if (this->con != NULL)
07026 {
07027 if (disp == ENUM_COMBINE_ARRAYS_throw)
07028 throw ErrorClass( "InitDualVarValue array previously used.");
07029 if (disp == ENUM_COMBINE_ARRAYS_ignore)
07030 return true;
07031 if (disp == ENUM_COMBINE_ARRAYS_merge)
07032 return this->addCon(numberOfCon, con);
07033
07034
07035 for (int i = 0; i < this->numberOfCon; i++)
07036 delete this->con[i];
07037 delete [] this->con;
07038 this->con = NULL;
07039 }
07040
07041 if (numberOfCon < 0)
07042 throw ErrorClass( "length of con array cannot be negative.");
07043
07044 this->numberOfCon = numberOfCon;
07045 if (numberOfCon == 0)
07046 return true;
07047
07048 this->con = new InitDualVarValue*[numberOfCon];
07049
07050 int i;
07051 for (i = 0; i < numberOfCon; i++)
07052 {
07053 this->con[i] = new InitDualVarValue();
07054 *this->con[i] = *con[i];
07055 }
07056 return true;
07057 }
07058 catch(const ErrorClass& eclass)
07059 {
07060 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_error, eclass.errormsg);
07061 return false;
07062 }
07063 }
07064
07065 bool InitDualVariableValues::setCon(int numberOfCon, int *idx, double *lbValue, double *ubValue, std::string *name)
07066 {
07067 if (this->con != NULL)
07068 return false;
07069
07070 if (numberOfCon < 0)
07071 return false;
07072
07073 this->numberOfCon = numberOfCon;
07074 if (numberOfCon == 0)
07075 return true;
07076
07077 this->con = new InitDualVarValue*[numberOfCon];
07078
07079 int i;
07080 for (i = 0; i < numberOfCon; i++)
07081 {
07082 this->con[i] = new InitDualVarValue();
07083 this->con[i]->idx = idx[i];
07084 this->con[i]->name = name[i];
07085 this->con[i]->lbDualValue = lbValue[i];
07086 this->con[i]->ubDualValue = ubValue[i];
07087 }
07088 return true;
07089 }
07090
07091
07099 bool InitDualVariableValues::addCon(int idx, double lbDualValue, double ubDualValue)
07100 {
07101 try
07102 {
07103 int nopt;
07104 int i;
07105 if (idx < 0)
07106 throw ErrorClass( "the index of a constraint cannot be negative." );
07107
07108 if (this->con == NULL)
07109 nopt = 0;
07110 else
07111 nopt = this->numberOfCon;
07112
07113 InitDualVarValue** temp = new InitDualVarValue*[nopt+1];
07114 for (i = 0; i < nopt; i++)
07115 temp[i] = this->con[i];
07116
07117 delete[] this->con;
07118
07119
07120 temp[ nopt] = new InitDualVarValue();
07121
07122 temp[ nopt]->idx = idx;
07123 temp[ nopt]->lbDualValue = lbDualValue;
07124 temp[ nopt]->ubDualValue = ubDualValue;
07125
07126 this->con = temp;
07127 this->numberOfCon = ++nopt;
07128
07129 return true;
07130 }
07131 catch(const ErrorClass& eclass)
07132 {
07133 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_error, eclass.errormsg);
07134 return false;
07135 }
07136 }
07137
07143 bool InitDualVariableValues::addCon(int numberOfCon, InitDualVarValue **con)
07144 {
07145 try
07146 {
07147 if (numberOfCon < 0)
07148 throw ErrorClass( "length of con array cannot be negative.");
07149
07150 if (numberOfCon == 0)
07151 return true;
07152
07153 int nprev = this->numberOfCon;
07154
07155 InitDualVarValue** temp = new InitDualVarValue*[nprev+numberOfCon];
07156 for (int i = 0; i < nprev; i++)
07157 temp[i] = this->con[i];
07158
07159 delete[] this->con;
07160
07161
07162 for (int i=0; i < numberOfCon; i++)
07163 {
07164 temp[nprev+i] = new InitDualVarValue();
07165 *temp[nprev+i] = *con[i];
07166 }
07167
07168 this->con = temp;
07169 this->numberOfCon = nprev + numberOfCon;
07170
07171 return true;
07172 }
07173 catch(const ErrorClass& eclass)
07174 {
07175 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_error, eclass.errormsg);
07176 return false;
07177 }
07178 }
07179
07186 bool OtherConstraintOption::setCon(int numberOfCon, OtherConOption **con)
07187 {
07188 try
07189 {
07190 if (this->con != NULL)
07191 throw ErrorClass( "OtherConOption array previously used.");
07192
07193 if (numberOfCon < 0)
07194 throw ErrorClass( "length of <con> array cannot be negative.");
07195
07196 this->numberOfCon = numberOfCon;
07197 if (numberOfCon == 0)
07198 return true;
07199
07200 this->con = new OtherConOption*[numberOfCon];
07201
07202 int i;
07203 for (i = 0; i < numberOfCon; i++)
07204 {
07205 this->con[i] = new OtherConOption();
07206 *this->con[i] = *con[i];
07207 }
07208 return true;
07209 }
07210 catch(const ErrorClass& eclass)
07211 {
07212 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_error, eclass.errormsg);
07213 return false;
07214 }
07215 }
07216
07225 bool OtherConstraintOption::addCon(int idx, std::string value, std::string lbValue, std::string ubValue)
07226 {
07227 try
07228 {
07229 int nopt;
07230 int i;
07231 if (idx < 0)
07232 throw ErrorClass( "the index of a variable cannot be negative." );
07233
07234 if (this->con == NULL)
07235 nopt = 0;
07236 else
07237 nopt = this->numberOfCon;
07238
07239 OtherConOption** temp = new OtherConOption*[nopt+1];
07240 for (i = 0; i < nopt; i++)
07241 temp[i] = this->con[i];
07242
07243 delete[] this->con;
07244
07245
07246 temp[ nopt] = new OtherConOption();
07247
07248 temp[ nopt]->idx = idx;
07249 temp[ nopt]->value = value;
07250 temp[ nopt]->lbValue = lbValue;
07251 temp[ nopt]->ubValue = ubValue;
07252
07253 this->con = temp;
07254 this->numberOfCon = ++nopt;
07255
07256 return true;
07257 }
07258 catch(const ErrorClass& eclass)
07259 {
07260 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_error, eclass.errormsg);
07261 return false;
07262 }
07263 }
07264
07271 bool ConstraintOption::setOther(int numberOfOptions, OtherConstraintOption **other)
07272 {
07273 try
07274 {
07275 if (this->other != NULL)
07276 throw ErrorClass( "otherConstraintOptions array previously used.");
07277
07278 if (numberOfOptions < 0)
07279 throw ErrorClass( "length of <other> array cannot be negative.");
07280
07281 this->numberOfOtherConstraintOptions = numberOfOptions;
07282 if (numberOfOptions == 0)
07283 return true;
07284
07285 this->other = new OtherConstraintOption*[numberOfOptions];
07286
07287 int i, j;
07288 for (i = 0; i < numberOfOptions; i++)
07289 {
07290 this->other[i] = new OtherConstraintOption();
07291 this->other[i]->name = other[i]->name;
07292 this->other[i]->value = other[i]->value;
07293 this->other[i]->solver = other[i]->solver;
07294 this->other[i]->category = other[i]->category;
07295 this->other[i]->type = other[i]->type;
07296 this->other[i]->description = other[i]->description;
07297
07298 if (other[i]->numberOfCon < 0)
07299 throw ErrorClass( "the number of constraints in otherConstraintOption cannot be negative.");
07300
07301 this->other[i]->numberOfCon = other[i]->numberOfCon;
07302
07303
07304 if (other[i]->numberOfCon > 0)
07305 {
07306 this->other[i]->con = new OtherConOption*[other[i]->numberOfCon];
07307 for (j = 0; j < other[i]->numberOfCon; j++)
07308 {
07309 this->other[i]->con[j] = new OtherConOption();
07310
07311 *this->other[i]->con[j] = *other[i]->con[j];
07312 }
07313 }
07314
07315 this->other[i]->numberOfEnumerations = other[i]->numberOfEnumerations;
07316
07317 if (this->other[i]->numberOfEnumerations > 0)
07318 {
07319 this->other[i]->enumeration = new OtherOptionEnumeration*[this->other[i]->numberOfEnumerations];
07320 for (j = 0; j < this->other[i]->numberOfEnumerations; j++)
07321 {
07322 this->other[i]->enumeration[j] = new OtherOptionEnumeration();
07323 this->other[i]->enumeration[j]->setOtherOptionEnumeration(
07324 other[i]->enumeration[j]->value,
07325 other[i]->enumeration[j]->description,
07326 other[i]->enumeration[j]->el,
07327 other[i]->enumeration[j]->numberOfEl);
07328 }
07329 }
07330
07331 }
07332 return true;
07333 }
07334 catch(const ErrorClass& eclass)
07335 {
07336 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_error, eclass.errormsg);
07337 return false;
07338 }
07339 }
07340
07346 bool ConstraintOption::addOther(OtherConstraintOption *other)
07347 {
07348 try
07349 {
07350 int nopt, i, j;
07351 if (this->other == NULL)
07352 nopt = 0;
07353 else
07354 nopt = this->numberOfOtherConstraintOptions;
07355
07356 OtherConstraintOption** temp = new OtherConstraintOption*[nopt+1];
07357 for (i = 0; i < nopt; i++)
07358 temp[i] = this->other[i];
07359
07360 delete[] this->other;
07361
07362
07363 temp[ nopt] = new OtherConstraintOption();
07364 temp[ nopt]->name = other->name;
07365 temp[ nopt]->value = other->value;
07366 temp[ nopt]->solver = other->solver;
07367 temp[ nopt]->category = other->category;
07368 temp[ nopt]->type = other->type;
07369 temp[ nopt]->conType = other->conType;
07370 temp[ nopt]->enumType = other->enumType;
07371 temp[ nopt]->description = other->description;
07372
07373 if (other->numberOfCon < 0)
07374 throw ErrorClass( "the number of constraints in otherConstraintOption cannot be negative.");
07375
07376 temp[ nopt]->numberOfCon = other->numberOfCon;
07377 temp[ nopt]->numberOfEnumerations = other->numberOfEnumerations;
07378
07379 if (other->numberOfCon > 0)
07380 {
07381 temp[ nopt]->con = new OtherConOption*[other->numberOfCon];
07382 for (j = 0; j < other->numberOfCon; j++)
07383 {
07384 temp[nopt]->con[j] = new OtherConOption();
07385 *temp[nopt]->con[j] = *other->con[j];
07386 }
07387 }
07388
07389 if (other->numberOfEnumerations < 0)
07390 throw ErrorClass( "the number of enumerations in otherObjectiveOption cannot be negative.");
07391
07392 if (other->numberOfEnumerations > 0)
07393 {
07394 temp[ nopt]->enumeration = new OtherOptionEnumeration*[other->numberOfEnumerations];
07395 for (j = 0; j < other->numberOfEnumerations; j++)
07396 {
07397 temp[ nopt]->enumeration[j] = new OtherOptionEnumeration();
07398 temp[ nopt]->enumeration[j]->setOtherOptionEnumeration(
07399 other->enumeration[j]->value,
07400 other->enumeration[j]->description,
07401 other->enumeration[j]->el,
07402 other->enumeration[j]->numberOfEl);
07403 }
07404 }
07405
07406 this->other = temp;
07407 this->numberOfOtherConstraintOptions = ++nopt;
07408
07409 return true;
07410 }
07411 catch(const ErrorClass& eclass)
07412 {
07413 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_error, eclass.errormsg);
07414 return false;
07415 }
07416 }
07417
07424 bool SolverOptions::setSolverOptions(int numberOfOptions, SolverOption **solverOption)
07425 {
07426 try
07427 {
07428 if (this->solverOption != NULL)
07429 throw ErrorClass( "solverOptions array previously used.");
07430
07431 if (numberOfOptions < 0)
07432 throw ErrorClass( "length of <solverOption> array cannot be negative.");
07433
07434 this->numberOfSolverOptions = numberOfOptions;
07435 if (numberOfOptions == 0)
07436 return true;
07437
07438 this->solverOption = new SolverOption*[numberOfOptions];
07439
07440 int i;
07441 for (i = 0; i < numberOfOptions; i++)
07442 {
07443 this->solverOption[i] = new SolverOption();
07444
07445 this->solverOption[i]->numberOfItems = solverOption[i]->numberOfItems;
07446 this->solverOption[i]->name = solverOption[i]->name;
07447 this->solverOption[i]->value = solverOption[i]->value;
07448 this->solverOption[i]->solver = solverOption[i]->solver;
07449 this->solverOption[i]->category = solverOption[i]->category;
07450 this->solverOption[i]->type = solverOption[i]->type;
07451 this->solverOption[i]->description = solverOption[i]->description;
07452
07453 if (solverOption[i]->numberOfItems > 0)
07454 {
07455 this->solverOption[i]->item = new std::string[solverOption[i]->numberOfItems];
07456 for (int j=0; j<solverOption[i]->numberOfItems; j++)
07457 this->solverOption[i]->item[j] = solverOption[i]->item[j];
07458 }
07459 }
07460 return true;
07461 }
07462 catch(const ErrorClass& eclass)
07463 {
07464 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_error, eclass.errormsg);
07465 return false;
07466 }
07467 }
07468
07469
07480 bool SolverOptions::addSolverOption(std::string name, std::string value, std::string solver,
07481 std::string category, std::string type, std::string description)
07482 {
07483 try
07484 {
07485 int nopt;
07486 int i;
07487 if (name.empty() )
07488 throw ErrorClass( "the name of a solver option cannot be empty." );
07489
07490 if (this->solverOption == NULL)
07491 nopt = 0;
07492 else
07493 nopt = this->numberOfSolverOptions;
07494
07495 SolverOption** temp = new SolverOption*[nopt+1];
07496 for (i = 0; i < nopt; i++)
07497 temp[i] = this->solverOption[i];
07498
07499 delete[] this->solverOption;
07500
07501
07502 temp[ nopt] = new SolverOption();
07503
07504 temp[ nopt]->numberOfItems = 0;
07505 temp[ nopt]->name = name;
07506 temp[ nopt]->value = value;
07507 temp[ nopt]->solver = solver;
07508 temp[ nopt]->type = type;
07509 temp[ nopt]->category = category;
07510 temp[ nopt]->description = description;
07511
07512 this->solverOption = temp;
07513 this->numberOfSolverOptions = ++nopt;
07514
07515 return true;
07516 }
07517 catch(const ErrorClass& eclass)
07518 {
07519 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_error, eclass.errormsg);
07520 return false;
07521 }
07522 }
07523
07528 bool OSOption::setOptionHeader(std::string name, std::string source,
07529 std::string description, std::string fileCreator, std::string licence)
07530 {
07531 if (this->optionHeader == NULL)
07532 this->optionHeader = new GeneralFileHeader();
07533 return this->optionHeader->setHeader(name, source, description, fileCreator, licence);
07534 }
07535
07540 bool OSOption::setServiceURI( std::string serviceURI)
07541 {
07542 if (this->general == NULL)
07543 this->general = new GeneralOption();
07544 this->general->serviceURI = serviceURI;
07545 return true;
07546 }
07547
07548 bool OSOption::setServiceName( std::string serviceName)
07549 {
07550 if (this->general == NULL)
07551 this->general = new GeneralOption();
07552 this->general->serviceName = serviceName;
07553 return true;
07554 }
07555
07556 bool OSOption::setInstanceName( std::string instanceName)
07557 {
07558 if (this->general == NULL)
07559 this->general = new GeneralOption();
07560 this->general->instanceName = instanceName;
07561 return true;
07562 }
07563
07564 bool OSOption::setInstanceLocation( std::string instanceLocation)
07565 {
07566 if (this->general == NULL)
07567 this->general = new GeneralOption();
07568 if (this->general->instanceLocation == NULL)
07569 this->general->instanceLocation = new InstanceLocationOption();
07570 this->general->instanceLocation->value = instanceLocation;
07571 return true;
07572 }
07573
07574 bool OSOption::setInstanceLocation( std::string instanceLocation, std::string locationType)
07575 {
07576 if (verifyLocationType(locationType) == 0)
07577 return false;
07578
07579 if (this->general == NULL)
07580 this->general = new GeneralOption();
07581 if (this->general->instanceLocation == NULL)
07582 this->general->instanceLocation = new InstanceLocationOption();
07583 this->general->instanceLocation->value = instanceLocation;
07584 this->general->instanceLocation->locationType = locationType;
07585 return true;
07586 }
07587
07588 bool OSOption::setInstanceLocationType( std::string locationType)
07589 {
07590 try
07591 {
07592 if (this->general == NULL)
07593 this->general = new GeneralOption();
07594 if (this->general->instanceLocation == NULL)
07595 this->general->instanceLocation = new InstanceLocationOption();
07596
07597 if (verifyLocationType(locationType) == 0)
07598 return false;
07599
07600 this->general->instanceLocation->locationType = locationType;
07601 return true;
07602 }
07603 catch(const ErrorClass& eclass)
07604 {
07605 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_error, eclass.errormsg);
07606 return false;
07607 }
07608 }
07609
07610 bool OSOption::setJobID( std::string jobID)
07611 {
07612 if (this->general == NULL)
07613 this->general = new GeneralOption();
07614 this->general->jobID = jobID;
07615 return true;
07616 }
07617
07618 bool OSOption::setSolverToInvoke( std::string solverToInvoke)
07619 {
07620 if (this->general == NULL)
07621 this->general = new GeneralOption();
07622 this->general->solverToInvoke = solverToInvoke;
07623 return true;
07624 }
07625
07626 bool OSOption::setLicense( std::string license)
07627 {
07628 if (this->general == NULL)
07629 this->general = new GeneralOption();
07630 this->general->license = license;
07631 return true;
07632 }
07633
07634 bool OSOption::setUserName( std::string userName)
07635 {
07636 if (this->general == NULL)
07637 this->general = new GeneralOption();
07638 this->general->userName = userName;
07639 return true;
07640 }
07641
07642 bool OSOption::setPassword( std::string password)
07643 {
07644 if (this->general == NULL)
07645 this->general = new GeneralOption();
07646 this->general->password = password;
07647 return true;
07648 }
07649
07650 bool OSOption::setContact( std::string contact)
07651 {
07652 if (this->general == NULL)
07653 this->general = new GeneralOption();
07654 if (this->general->contact == NULL)
07655 this->general->contact = new ContactOption();
07656 this->general->contact->value = contact;
07657 return true;
07658 }
07659
07660 bool OSOption::setContact(std::string contact,std::string transportType)
07661 {
07662 if (verifyTransportType(transportType) == 0)
07663 return false;
07664
07665 if (this->general == NULL)
07666 this->general = new GeneralOption();
07667 if (this->general->contact == NULL)
07668 this->general->contact = new ContactOption();
07669 this->general->contact->value = contact;
07670 this->general->contact->transportType = transportType;
07671 return true;
07672 }
07673
07674 bool OSOption::setContactTransportType( std::string transportType)
07675 {
07676 try
07677 {
07678 if (this->general == NULL)
07679 this->general = new GeneralOption();
07680 if (this->general->contact == NULL)
07681 this->general->contact = new ContactOption();
07682
07683 if (verifyTransportType(transportType) == 0)
07684 throw ErrorClass( "transport type not recognized.");
07685
07686 this->general->contact->transportType = transportType;
07687 return true;
07688 }
07689 catch(const ErrorClass& eclass)
07690 {
07691 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_error, eclass.errormsg);
07692 return false;
07693 }
07694 }
07695
07696 bool OSOption::setOtherGeneralOptions(int numberOfOptions, OtherOption** other)
07697 {
07698 if (this->general == NULL)
07699 this->general = new GeneralOption();
07700 if (this->general->otherOptions == NULL)
07701 this->general->otherOptions = new OtherOptions();
07702 else
07703 {
07704 int i;
07705 for (i = 0; i < this->general->otherOptions->numberOfOtherOptions; i++)
07706 delete this->general->otherOptions->other[i];
07707 delete[] this->general->otherOptions->other;
07708 this->general->otherOptions->other = NULL;
07709 }
07710 return this->general->otherOptions->setOther(numberOfOptions, other);
07711 }
07712
07713 bool OSOption::setAnOtherGeneralOption(std::string name, std::string value, std::string description)
07714 {
07715 if (this->general == NULL)
07716 this->general = new GeneralOption();
07717 if (this->general->otherOptions == NULL)
07718 this->general->otherOptions = new OtherOptions();
07719 return this->general->otherOptions->addOther(name, value, description);
07720 }
07721
07722
07723
07728 bool OSOption::setMinDiskSpace(std::string unit, std::string description, double value)
07729 {
07730 if (verifyStorageUnit(unit) == 0)
07731 return false;
07732
07733 if (this->system == NULL)
07734 this->system = new SystemOption();
07735 if (this->system->minDiskSpace == NULL)
07736 this->system->minDiskSpace = new StorageCapacity();
07737 this->system->minDiskSpace->unit = unit;
07738 this->system->minDiskSpace->value = value;
07739 this->system->minDiskSpace->description = description;
07740 return true;
07741 }
07742
07743 bool OSOption::setMinDiskSpace(double value)
07744 {
07745 if (this->system == NULL)
07746 this->system = new SystemOption();
07747 if (this->system->minDiskSpace == NULL)
07748 this->system->minDiskSpace = new StorageCapacity();
07749 this->system->minDiskSpace->value = value;
07750 return true;
07751 }
07752
07753 bool OSOption::setMinDiskSpaceUnit(std::string unit)
07754 {
07755 try
07756 {
07757 if (this->system == NULL)
07758 this->system = new SystemOption();
07759 if (this->system->minDiskSpace == NULL)
07760 this->system->minDiskSpace = new StorageCapacity();
07761
07762 if (verifyStorageUnit(unit) == 0)
07763 throw ErrorClass( "disk space unit not recognized.");
07764
07765 this->system->minDiskSpace->unit = unit;
07766 return true;
07767 }
07768 catch(const ErrorClass& eclass)
07769 {
07770 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_error, eclass.errormsg);
07771 return false;
07772 }
07773 }
07774
07775 bool OSOption::setMinMemorySize(std::string unit, std::string description, double value)
07776 {
07777 if (verifyStorageUnit(unit) == 0)
07778 return false;
07779
07780 if (this->system == NULL)
07781 this->system = new SystemOption();
07782 if (this->system->minMemorySize == NULL)
07783 this->system->minMemorySize = new StorageCapacity();
07784 this->system->minMemorySize->unit = unit;
07785 this->system->minMemorySize->value = value;
07786 this->system->minMemorySize->description = description;
07787 return true;
07788 }
07789
07790 bool OSOption::setMinMemorySize(double value)
07791 {
07792 if (this->system == NULL)
07793 this->system = new SystemOption();
07794 if (this->system->minMemorySize == NULL)
07795 this->system->minMemorySize = new StorageCapacity();
07796 this->system->minMemorySize->value = value;
07797 return true;
07798 }
07799
07800 bool OSOption::setMinMemoryUnit(std::string unit)
07801 {
07802 try
07803 {
07804 if (this->system == NULL)
07805 this->system = new SystemOption();
07806 if (this->system->minMemorySize == NULL)
07807 this->system->minMemorySize = new StorageCapacity();
07808
07809 if (verifyStorageUnit(unit) == 0)
07810 throw ErrorClass( "memory size unit not recognized.");
07811
07812 this->system->minMemorySize->unit = unit;
07813 return true;
07814 }
07815 catch(const ErrorClass& eclass)
07816 {
07817 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_error, eclass.errormsg);
07818 return false;
07819 }
07820 }
07821
07822 bool OSOption::setMinCPUSpeed(double value)
07823 {
07824 if (this->system == NULL)
07825 this->system = new SystemOption();
07826 if (this->system->minCPUSpeed == NULL)
07827 this->system->minCPUSpeed = new CPUSpeed();
07828 this->system->minCPUSpeed->value = value;
07829 return true;
07830 }
07831
07832 bool OSOption::setMinCPUSpeed(std::string unit, std::string description, double value)
07833 {
07834 if (verifyCPUSpeedUnit(unit) == 0)
07835 return false;
07836
07837 if (this->system == NULL)
07838 this->system = new SystemOption();
07839 if (this->system->minCPUSpeed == NULL)
07840 this->system->minCPUSpeed = new CPUSpeed();
07841 this->system->minCPUSpeed->unit = unit;
07842 this->system->minCPUSpeed->value = value;
07843 this->system->minCPUSpeed->description = description;
07844 return true;
07845 }
07846
07847 bool OSOption::setMinCPUSpeedUnit(std::string unit)
07848 {
07849 try
07850 {
07851 if (this->system == NULL)
07852 this->system = new SystemOption();
07853 if (this->system->minCPUSpeed == NULL)
07854 this->system->minCPUSpeed = new CPUSpeed();
07855
07856 if (verifyCPUSpeedUnit(unit) == 0)
07857 throw ErrorClass( "CPU speed unit not recognized.");
07858
07859 this->system->minCPUSpeed->unit = unit;
07860 return true;
07861 }
07862 catch(const ErrorClass& eclass)
07863 {
07864 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_error, eclass.errormsg);
07865 return false;
07866 }
07867 }
07868
07869 bool OSOption::setMinCPUNumber(int number)
07870 {
07871 if (this->system == NULL)
07872 this->system = new SystemOption();
07873 if (this->system->minCPUNumber == NULL)
07874 this->system->minCPUNumber = new CPUNumber();
07875 this->system->minCPUNumber->value = number;
07876 return true;
07877 }
07878
07879 bool OSOption::setMinCPUNumber(int number, std::string description)
07880 {
07881 if (this->system == NULL)
07882 this->system = new SystemOption();
07883 if (this->system->minCPUNumber == NULL)
07884 this->system->minCPUNumber = new CPUNumber();
07885 this->system->minCPUNumber->value = number;
07886 this->system->minCPUNumber->description = description;
07887 return true;
07888 }
07889
07890 bool OSOption::setOtherSystemOptions(int numberOfOptions, OtherOption** other)
07891 {
07892 if (this->system == NULL)
07893 this->system = new SystemOption();
07894 if (this->system->otherOptions == NULL)
07895 this->system->otherOptions = new OtherOptions();
07896 else
07897 {
07898 int i;
07899 for (i = 0; i < this->system->otherOptions->numberOfOtherOptions; i++)
07900 delete this->system->otherOptions->other[i];
07901 delete[] this->system->otherOptions->other;
07902 this->system->otherOptions->other = NULL;
07903 this->system->otherOptions->numberOfOtherOptions = 0;
07904 }
07905 return this->system->otherOptions->setOther(numberOfOptions, other);
07906 }
07907
07908 bool OSOption::setAnOtherSystemOption(std::string name, std::string value, std::string description)
07909 {
07910 if (this->system == NULL)
07911 this->system = new SystemOption();
07912 if (this->system->otherOptions == NULL)
07913 this->system->otherOptions = new OtherOptions();
07914 return this->system->otherOptions->addOther(name, value, description);
07915 }
07916
07917
07922 bool OSOption::setServiceType( std::string serviceType)
07923 {
07924 try
07925 {
07926 if (this->service == NULL)
07927 this->service = new ServiceOption();
07928
07929 if (verifyServiceType(serviceType) == 0)
07930 throw ErrorClass( "service type not recognized.");
07931
07932 this->service->type = serviceType;
07933 return true;
07934 }
07935 catch(const ErrorClass& eclass)
07936 {
07937 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_error, eclass.errormsg);
07938 return false;
07939 }
07940 }
07941
07942 bool OSOption::setOtherServiceOptions(int numberOfOptions, OtherOption** other)
07943 {
07944 if (this->service == NULL)
07945 this->service = new ServiceOption();
07946 if (this->service->otherOptions == NULL)
07947 this->service->otherOptions = new OtherOptions();
07948 else
07949 {
07950 int i;
07951 for (i = 0; i < this->service->otherOptions->numberOfOtherOptions; i++)
07952 delete this->service->otherOptions->other[i];
07953 delete[] this->service->otherOptions->other;
07954 this->service->otherOptions->other = NULL;
07955 }
07956 return this->service->otherOptions->setOther(numberOfOptions, other);
07957 }
07958
07959 bool OSOption::setAnOtherServiceOption(std::string name, std::string value, std::string description)
07960 {
07961 if (this->service == NULL)
07962 this->service = new ServiceOption();
07963 if (this->service->otherOptions == NULL)
07964 this->service->otherOptions = new OtherOptions();
07965 return this->service->otherOptions->addOther(name, value, description);
07966 }
07967
07972 bool OSOption::setMaxTime(double value)
07973 {
07974 if (this->job == NULL)
07975 this->job = new JobOption();
07976 if (this->job->maxTime == NULL)
07977 this->job->maxTime = new TimeSpan();
07978 this->job->maxTime->value = value;
07979 return true;
07980 }
07981
07982 bool OSOption::setMaxTime(double value, std::string unit)
07983 {
07984 if (verifyTimeUnit(unit) == 0)
07985 return false;
07986
07987 if (this->job == NULL)
07988 this->job = new JobOption();
07989
07990 if (this->job->maxTime == NULL)
07991 this->job->maxTime = new TimeSpan();
07992 this->job->maxTime->value = value;
07993 this->job->maxTime->unit = unit;
07994 return true;
07995 }
07996
07997 bool OSOption::setMaxTimeUnit(std::string unit)
07998 {
07999 try
08000 {
08001 if (this->job == NULL)
08002 this->job = new JobOption();
08003 if (this->job->maxTime == NULL)
08004 this->job->maxTime = new TimeSpan();
08005
08006 if (verifyTimeUnit(unit) == 0)
08007 throw ErrorClass( "time unit not recognized.");
08008
08009 this->job->maxTime->unit = unit;
08010 return true;
08011 }
08012 catch(const ErrorClass& eclass)
08013 {
08014 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_error, eclass.errormsg);
08015 return false;
08016 }
08017 }
08018
08019 bool OSOption::setRequestedStartTime(std::string time)
08020 {
08021 if (this->job == NULL)
08022 this->job = new JobOption();
08023 this->job->requestedStartTime = time;
08024 return true;
08025 }
08026
08027
08028 bool OSOption::setJobDependencies(int numberOfDependencies, std::string* jobDependencies)
08029 {
08030 if (this->job == NULL)
08031 this->job = new JobOption();
08032 if (this->job->dependencies == NULL)
08033 this->job->dependencies = new JobDependencies();
08034 else
08035 delete[] this->job->dependencies->jobID;
08036 this->job->dependencies->jobID = NULL;
08037 return this->job->dependencies->setJobID(numberOfDependencies, jobDependencies);
08038 }
08039
08040 bool OSOption::setAnotherJobDependency(std::string jobID)
08041 {
08042 if (this->job == NULL)
08043 this->job = new JobOption();
08044 if (this->job->dependencies == NULL)
08045 this->job->dependencies = new JobDependencies();
08046 return this->job->dependencies->addJobID(jobID);
08047 }
08048
08049
08050 bool OSOption::setRequiredDirectories(int numberOfPaths, std::string* paths)
08051 {
08052 if (this->job == NULL)
08053 this->job = new JobOption();
08054 if (this->job->requiredDirectories == NULL)
08055 this->job->requiredDirectories = new DirectoriesAndFiles();
08056 else
08057 delete[] this->job->requiredDirectories->path;
08058 this->job->requiredDirectories->path = NULL;
08059 return this->job->requiredDirectories->setPath(numberOfPaths, paths);
08060 }
08061
08062 bool OSOption::setAnotherRequiredDirectory(std::string path)
08063 {
08064 if (this->job == NULL)
08065 this->job = new JobOption();
08066 if (this->job->requiredDirectories == NULL)
08067 this->job->requiredDirectories = new DirectoriesAndFiles();
08068 return this->job->requiredDirectories->addPath(path);
08069 }
08070
08071
08072 bool OSOption::setRequiredFiles(int numberOfPaths, std::string* paths)
08073 {
08074 if (this->job == NULL)
08075 this->job = new JobOption();
08076 if (this->job->requiredFiles == NULL)
08077 this->job->requiredFiles = new DirectoriesAndFiles();
08078 else
08079 delete[] this->job->requiredFiles->path;
08080 this->job->requiredFiles->path = NULL;
08081 return this->job->requiredFiles->setPath(numberOfPaths, paths);
08082 }
08083
08084 bool OSOption::setAnotherRequiredFile(std::string path)
08085 {
08086 if (this->job == NULL)
08087 this->job = new JobOption();
08088 if (this->job->requiredFiles == NULL)
08089 this->job->requiredFiles = new DirectoriesAndFiles();
08090 return this->job->requiredFiles->addPath(path);
08091 }
08092
08093
08094 bool OSOption::setDirectoriesToMake(int numberOfPaths, std::string* paths)
08095 {
08096 if (this->job == NULL)
08097 this->job = new JobOption();
08098 if (this->job->directoriesToMake == NULL)
08099 this->job->directoriesToMake = new DirectoriesAndFiles();
08100 else
08101 delete[] this->job->directoriesToMake->path;
08102 this->job->directoriesToMake->path = NULL;
08103 return this->job->directoriesToMake->setPath(numberOfPaths, paths);
08104 }
08105
08106 bool OSOption::setAnotherDirectoryToMake(std::string path)
08107 {
08108 if (this->job == NULL)
08109 this->job = new JobOption();
08110 if (this->job->directoriesToMake == NULL)
08111 this->job->directoriesToMake = new DirectoriesAndFiles();
08112 return this->job->directoriesToMake->addPath(path);
08113 }
08114
08115
08116 bool OSOption::setFilesToMake(int numberOfPaths, std::string* paths)
08117 {
08118 if (this->job == NULL)
08119 this->job = new JobOption();
08120 if (this->job->filesToMake == NULL)
08121 this->job->filesToMake = new DirectoriesAndFiles();
08122 else
08123 delete[] this->job->filesToMake->path;
08124 this->job->filesToMake->path = NULL;
08125 return this->job->filesToMake->setPath(numberOfPaths, paths);
08126 }
08127
08128 bool OSOption::setAnotherFileToMake(std::string path)
08129 {
08130 if (this->job == NULL)
08131 this->job = new JobOption();
08132 if (this->job->filesToMake == NULL)
08133 this->job->filesToMake = new DirectoriesAndFiles();
08134 return this->job->filesToMake->addPath(path);
08135 }
08136
08137 bool OSOption::setPathPairs(int object, std::string *from, std::string *to, bool *makeCopy, int numberOfPathPairs)
08138 {
08139 if (numberOfPathPairs < 0) return false;
08140 if (this->job == NULL)
08141 this->job = new JobOption();
08142 switch (object)
08143 {
08144 case ENUM_PATHPAIR_input_dir:
08145 {
08146 if (this->job->inputDirectoriesToMove == NULL)
08147 this->job->inputDirectoriesToMove = new PathPairs();
08148 return this->job->inputDirectoriesToMove->setPathPair(from, to, makeCopy, numberOfPathPairs);
08149 }
08150 case ENUM_PATHPAIR_input_file:
08151 {
08152 if (this->job->inputFilesToMove == NULL)
08153 this->job->inputFilesToMove = new PathPairs();
08154 return this->job->inputFilesToMove->setPathPair(from, to, makeCopy, numberOfPathPairs);
08155 }
08156 case ENUM_PATHPAIR_output_file:
08157 {
08158 if (this->job->outputFilesToMove == NULL)
08159 this->job->outputFilesToMove = new PathPairs();
08160 return this->job->outputFilesToMove->setPathPair(from, to, makeCopy, numberOfPathPairs);
08161 }
08162 case ENUM_PATHPAIR_output_dir:
08163 {
08164 if (this->job->outputDirectoriesToMove == NULL)
08165 this->job->outputDirectoriesToMove = new PathPairs();
08166 return this->job->outputDirectoriesToMove->setPathPair(from, to, makeCopy, numberOfPathPairs);
08167 }
08168 default:
08169 throw ErrorClass("target object not implemented in setPathPairs");
08170 }
08171
08172 }
08173
08174
08175 bool OSOption::setInputDirectoriesToMove(int numberOfPathPairs, PathPair** pathPair)
08176 {
08177 if (this->job == NULL)
08178 this->job = new JobOption();
08179 if (this->job->inputDirectoriesToMove == NULL)
08180 this->job->inputDirectoriesToMove = new PathPairs();
08181 else
08182 delete[] this->job->inputDirectoriesToMove->pathPair;
08183 this->job->inputDirectoriesToMove->pathPair = NULL;
08184 return this->job->inputDirectoriesToMove->setPathPair(numberOfPathPairs, pathPair);
08185 }
08186
08187 bool OSOption::setAnotherInputDirectoryToMove(std::string fromPath, std::string toPath, bool makeCopy)
08188 {
08189 if (this->job == NULL)
08190 this->job = new JobOption();
08191 if (this->job->inputDirectoriesToMove == NULL)
08192 this->job->inputDirectoriesToMove = new PathPairs();
08193 return this->job->inputDirectoriesToMove->addPathPair(fromPath, toPath, makeCopy);
08194 }
08195
08196
08197 bool OSOption::setInputFilesToMove(int numberOfPathPairs, PathPair** pathPair)
08198 {
08199 if (this->job == NULL)
08200 this->job = new JobOption();
08201 if (this->job->inputFilesToMove == NULL)
08202 this->job->inputFilesToMove = new PathPairs();
08203 else
08204 delete[] this->job->inputFilesToMove->pathPair;
08205 this->job->inputFilesToMove->pathPair = NULL;
08206 return this->job->inputFilesToMove->setPathPair(numberOfPathPairs, pathPair);
08207 }
08208
08209 bool OSOption::setAnotherInputFileToMove(std::string fromPath, std::string toPath, bool makeCopy)
08210 {
08211 if (this->job == NULL)
08212 this->job = new JobOption();
08213 if (this->job->inputFilesToMove == NULL)
08214 this->job->inputFilesToMove = new PathPairs();
08215 return this->job->inputFilesToMove->addPathPair(fromPath, toPath, makeCopy);
08216 }
08217
08218
08219 bool OSOption::setOutputFilesToMove(int numberOfPathPairs, PathPair** pathPair)
08220 {
08221 if (this->job == NULL)
08222 this->job = new JobOption();
08223 if (this->job->outputFilesToMove == NULL)
08224 this->job->outputFilesToMove = new PathPairs();
08225 else
08226 delete[] this->job->outputFilesToMove->pathPair;
08227 this->job->outputFilesToMove->pathPair = NULL;
08228 return this->job->outputFilesToMove->setPathPair(numberOfPathPairs, pathPair);
08229 }
08230
08231 bool OSOption::setAnotherOutputFileToMove(std::string fromPath, std::string toPath, bool makeCopy)
08232 {
08233 if (this->job == NULL)
08234 this->job = new JobOption();
08235 if (this->job->outputFilesToMove == NULL)
08236 this->job->outputFilesToMove = new PathPairs();
08237 return this->job->outputFilesToMove->addPathPair(fromPath, toPath, makeCopy);
08238 }
08239
08240
08241 bool OSOption::setOutputDirectoriesToMove(int numberOfPathPairs, PathPair** pathPair)
08242 {
08243 if (this->job == NULL)
08244 this->job = new JobOption();
08245 if (this->job->outputDirectoriesToMove == NULL)
08246 this->job->outputDirectoriesToMove = new PathPairs();
08247 else
08248 delete[] this->job->outputDirectoriesToMove->pathPair;
08249 this->job->outputDirectoriesToMove->pathPair = NULL;
08250 return this->job->outputDirectoriesToMove->setPathPair(numberOfPathPairs, pathPair);
08251 }
08252
08253 bool OSOption::setAnotherOutputDirectoryToMove(std::string fromPath, std::string toPath, bool makeCopy)
08254 {
08255 if (this->job == NULL)
08256 this->job = new JobOption();
08257 if (this->job->outputDirectoriesToMove == NULL)
08258 this->job->outputDirectoriesToMove = new PathPairs();
08259 return this->job->outputDirectoriesToMove->addPathPair(fromPath, toPath, makeCopy);
08260 }
08261
08262
08263 bool OSOption::setFilesToDelete(int numberOfPaths, std::string* paths)
08264 {
08265 if (this->job == NULL)
08266 this->job = new JobOption();
08267 if (this->job->filesToDelete == NULL)
08268 this->job->filesToDelete = new DirectoriesAndFiles();
08269 else
08270 delete[] this->job->filesToDelete->path;
08271 this->job->filesToDelete->path = NULL;
08272 return this->job->filesToDelete->setPath(numberOfPaths, paths);
08273 }
08274
08275 bool OSOption::setAnotherFileToDelete(std::string path)
08276 {
08277 if (this->job == NULL)
08278 this->job = new JobOption();
08279 if (this->job->filesToDelete == NULL)
08280 this->job->filesToDelete = new DirectoriesAndFiles();
08281 return this->job->filesToDelete->addPath(path);
08282 }
08283
08284
08285 bool OSOption::setDirectoriesToDelete(int numberOfPaths, std::string* paths)
08286 {
08287 if (this->job == NULL)
08288 this->job = new JobOption();
08289 if (this->job->directoriesToDelete == NULL)
08290 this->job->directoriesToDelete = new DirectoriesAndFiles();
08291 else
08292 delete[] this->job->directoriesToDelete->path;
08293 this->job->directoriesToDelete->path = NULL;
08294 return this->job->directoriesToDelete->setPath(numberOfPaths, paths);
08295 }
08296
08297 bool OSOption::setAnotherDirectoryToDelete(std::string path)
08298 {
08299 if (this->job == NULL)
08300 this->job = new JobOption();
08301 if (this->job->directoriesToDelete == NULL)
08302 this->job->directoriesToDelete = new DirectoriesAndFiles();
08303 return this->job->directoriesToDelete->addPath(path);
08304 }
08305
08306
08307 bool OSOption::setProcessesToKill(int numberOfProcesses, std::string* processes)
08308 {
08309 if (this->job == NULL)
08310 this->job = new JobOption();
08311 if (this->job->processesToKill == NULL)
08312 this->job->processesToKill = new Processes();
08313 else
08314 delete[] this->job->processesToKill->process;
08315 this->job->processesToKill->process = NULL;
08316 return this->job->processesToKill->setProcess(numberOfProcesses, processes);
08317 }
08318
08319 bool OSOption::setAnotherProcessToKill(std::string process)
08320 {
08321 if (this->job == NULL)
08322 this->job = new JobOption();
08323 if (this->job->processesToKill == NULL)
08324 this->job->processesToKill = new Processes();
08325 return this->job->processesToKill->addProcess(process);
08326 }
08327
08328
08329 bool OSOption::setOtherJobOptions(int numberOfOptions, OtherOption** other)
08330 {
08331 if (this->job == NULL)
08332 this->job = new JobOption();
08333 if (this->job->otherOptions == NULL)
08334 this->job->otherOptions = new OtherOptions();
08335 else
08336 {
08337 int i;
08338 for (i = 0; i < this->job->otherOptions->numberOfOtherOptions; i++)
08339 delete this->job->otherOptions->other[i];
08340 delete[] this->job->otherOptions->other;
08341 this->job->otherOptions->other = NULL;
08342 }
08343 return this->job->otherOptions->setOther(numberOfOptions, other);
08344 }
08345
08346 bool OSOption::setAnOtherJobOption(std::string name, std::string value, std::string description)
08347 {
08348 if (this->job == NULL)
08349 this->job = new JobOption();
08350 if (this->job->otherOptions == NULL)
08351 this->job->otherOptions = new OtherOptions();
08352 return this->job->otherOptions->addOther(name, value, description);
08353 }
08354
08355
08356
08357 bool OSOption::setNumberOfVariables(int numberOfVariables)
08358 {
08359 if (this->optimization == NULL)
08360 this->optimization = new OptimizationOption();
08361 this->optimization->numberOfVariables = numberOfVariables;
08362 return true;
08363 }
08364
08365 bool OSOption::setNumberOfObjectives(int numberOfObjectives)
08366 {
08367 if (this->optimization == NULL)
08368 this->optimization = new OptimizationOption();
08369 this->optimization->numberOfObjectives = numberOfObjectives;
08370 return true;
08371 }
08372
08373 bool OSOption::setNumberOfConstraints(int numberOfConstraints)
08374 {
08375 if (this->optimization == NULL)
08376 this->optimization = new OptimizationOption();
08377 this->optimization->numberOfConstraints = numberOfConstraints;
08378 return true;
08379 }
08380
08381
08382 bool OSOption::setInitVarValues(int numberOfVar, int* idx, double* value, std::string* name)
08383 {
08384 if (this->optimization == NULL)
08385 this->optimization = new OptimizationOption();
08386 if (this->optimization->variables == NULL)
08387 this->optimization->variables = new VariableOption();
08388 if (this->optimization->variables->initialVariableValues != NULL)
08389 return false;
08390
08391 this->optimization->variables->initialVariableValues = new InitVariableValues();
08392
08393 return this->optimization->variables->initialVariableValues->setVar(numberOfVar, idx, value, name);
08394 }
08395
08396 bool OSOption::setInitVarValuesSparse(int numberOfVar, InitVarValue** var)
08397 {
08398 if (this->optimization == NULL)
08399 this->optimization = new OptimizationOption();
08400 if (this->optimization->variables == NULL)
08401 this->optimization->variables = new VariableOption();
08402 if (this->optimization->variables->initialVariableValues == NULL)
08403 this->optimization->variables->initialVariableValues = new InitVariableValues();
08404 else
08405 {
08406 int i;
08407 for (i = 0; i < this->optimization->variables->initialVariableValues->numberOfVar; i++)
08408 delete this->optimization->variables->initialVariableValues->var[i];
08409 delete[] this->optimization->variables->initialVariableValues->var;
08410 this->optimization->variables->initialVariableValues->var = NULL;
08411 }
08412 return this->optimization->variables->initialVariableValues->setVar(numberOfVar, var);
08413 }
08414
08415 bool OSOption::setInitVarValuesSparse(int numberOfVar, InitVarValue** var, ENUM_COMBINE_ARRAYS disp)
08416 {
08417 if (this->optimization == NULL)
08418 this->optimization = new OptimizationOption();
08419 if (this->optimization->variables == NULL)
08420 this->optimization->variables = new VariableOption();
08421 if (this->optimization->variables->initialVariableValues == NULL)
08422 this->optimization->variables->initialVariableValues = new InitVariableValues();
08423 return this->optimization->variables->initialVariableValues->setVar(numberOfVar, var, disp);
08424 }
08425
08426 bool OSOption::setInitVarValuesDense(int numberOfVar, double *value)
08427 {
08428 if (this->optimization == NULL)
08429 this->optimization = new OptimizationOption();
08430 if (this->optimization->variables == NULL)
08431 this->optimization->variables = new VariableOption();
08432 if (this->optimization->variables->initialVariableValues == NULL)
08433 this->optimization->variables->initialVariableValues = new InitVariableValues();
08434 else
08435 {
08436 delete[] this->optimization->variables->initialVariableValues->var;
08437 this->optimization->variables->initialVariableValues->var = NULL;
08438 }
08439
08440 int i;
08441 for (i = 0; i < numberOfVar; i++)
08442 {
08443
08444 if (!this->optimization->variables->initialVariableValues->addVar(i, value[i]))
08445 return false;
08446 }
08447 return true;
08448 }
08449
08450 bool OSOption::setAnotherInitVarValue(int idx, double value)
08451 {
08452 if (this->optimization == NULL)
08453 this->optimization = new OptimizationOption();
08454 if (this->optimization->variables == NULL)
08455 this->optimization->variables = new VariableOption();
08456 if (this->optimization->variables->initialVariableValues == NULL)
08457 this->optimization->variables->initialVariableValues = new InitVariableValues();
08458 return this->optimization->variables->initialVariableValues->addVar(idx, value);
08459 }
08460
08461 bool OSOption::setInitVarValuesString(int numberOfVar, int* idx, std::string* value, std::string* name)
08462 {
08463 if (this->optimization == NULL)
08464 this->optimization = new OptimizationOption();
08465 if (this->optimization->variables == NULL)
08466 this->optimization->variables = new VariableOption();
08467 if (this->optimization->variables->initialVariableValuesString != NULL)
08468 return false;
08469
08470 this->optimization->variables->initialVariableValuesString = new InitVariableValuesString();
08471
08472 return this->optimization->variables->initialVariableValuesString->setVar(numberOfVar, idx, value, name);
08473 }
08474
08475 bool OSOption::setInitVarValuesStringSparse(int numberOfVar, InitVarValueString** var)
08476 {
08477 if (this->optimization == NULL)
08478 this->optimization = new OptimizationOption();
08479 if (this->optimization->variables == NULL)
08480 this->optimization->variables = new VariableOption();
08481 if (this->optimization->variables->initialVariableValuesString == NULL)
08482 this->optimization->variables->initialVariableValuesString = new InitVariableValuesString();
08483 else
08484
08485
08486 {
08487 int i;
08488 for (i = 0; i < this->optimization->variables->initialVariableValuesString->numberOfVar; i++)
08489 delete this->optimization->variables->initialVariableValuesString->var[i];
08490 delete[] this->optimization->variables->initialVariableValuesString->var;
08491 this->optimization->variables->initialVariableValuesString->var = NULL;
08492 }
08493 return this->optimization->variables->initialVariableValuesString->setVar(numberOfVar, var);
08494 }
08495
08496 bool OSOption::setInitVarValuesStringSparse(int numberOfVar, InitVarValueString** var, ENUM_COMBINE_ARRAYS disp)
08497 {
08498 if (this->optimization == NULL)
08499 this->optimization = new OptimizationOption();
08500 if (this->optimization->variables == NULL)
08501 this->optimization->variables = new VariableOption();
08502 if (this->optimization->variables->initialVariableValuesString == NULL)
08503 this->optimization->variables->initialVariableValuesString = new InitVariableValuesString();
08504 return this->optimization->variables->initialVariableValuesString->setVar(numberOfVar, var, disp);
08505 }
08506
08507 bool OSOption::setInitVarValuesStringDense(int numberOfVar, std::string *value)
08508 {
08509 if (this->optimization == NULL)
08510 this->optimization = new OptimizationOption();
08511 if (this->optimization->variables == NULL)
08512 this->optimization->variables = new VariableOption();
08513 if (this->optimization->variables->initialVariableValuesString == NULL)
08514 this->optimization->variables->initialVariableValuesString = new InitVariableValuesString();
08515 else
08516 {
08517 delete[] this->optimization->variables->initialVariableValuesString->var;
08518 this->optimization->variables->initialVariableValuesString->var = NULL;
08519 }
08520 int i;
08521 for (i = 0; i < numberOfVar; i++)
08522 {
08523 if (value[i] != "")
08524 if (!this->optimization->variables->initialVariableValuesString->addVar(i, value[i]))
08525 return false;
08526 }
08527 return true;
08528 }
08529
08530 bool OSOption::setAnotherInitVarValueString(int idx, std::string value)
08531 {
08532 if (this->optimization == NULL)
08533 this->optimization = new OptimizationOption();
08534 if (this->optimization->variables == NULL)
08535 this->optimization->variables = new VariableOption();
08536 if (this->optimization->variables->initialVariableValuesString == NULL)
08537 this->optimization->variables->initialVariableValuesString = new InitVariableValuesString();
08538 return this->optimization->variables->initialVariableValuesString->addVar(idx, value);
08539 }
08540
08541 bool OSOption::setInitBasisStatus(int object, int status, int *i, int ni)
08542 {
08543 if (optimization == NULL) return false;
08544
08545 switch (object)
08546 {
08547 case ENUM_PROBLEM_COMPONENT_variables:
08548 {
08549 if (optimization->variables == NULL)
08550 optimization->variables = new VariableOption();
08551 if (optimization->variables->initialBasisStatus == NULL)
08552 optimization->variables->initialBasisStatus = new BasisStatus();
08553
08554 for (int j=0; j<ni; j++)
08555 {
08556 if (i[j] < 0)
08557 return false;
08558 }
08559 return optimization->variables->initialBasisStatus->setIntVector(status, i, ni);
08560 }
08561 case ENUM_PROBLEM_COMPONENT_objectives:
08562 {
08563 if (optimization->objectives == NULL)
08564 optimization->objectives = new ObjectiveOption();
08565 if (optimization->objectives->initialBasisStatus == NULL)
08566 optimization->objectives->initialBasisStatus = new BasisStatus();
08567 for (int j=0; j<ni; j++)
08568 {
08569 if (i[j] >= 0)
08570 return false;
08571 }
08572 return optimization->objectives->initialBasisStatus->setIntVector(status, i, ni);
08573 }
08574 case ENUM_PROBLEM_COMPONENT_constraints:
08575 {
08576 if (optimization->constraints == NULL)
08577 optimization->constraints = new ConstraintOption();
08578 if (optimization->constraints->initialBasisStatus == NULL)
08579 optimization->constraints->initialBasisStatus = new BasisStatus();
08580 for (int j=0; j<ni; j++)
08581 {
08582 if (i[j] < 0)
08583 return false;
08584 }
08585 return optimization->constraints->initialBasisStatus->setIntVector(status, i, ni);
08586 }
08587 default:
08588 throw ErrorClass("target object not implemented in setInitBasisStatus");
08589 }
08590 }
08591
08592 bool OSOption::setAnotherInitBasisStatus(int object, int idx, int status)
08593 {
08594 if (optimization == NULL) return false;
08595
08596 switch (object)
08597 {
08598 case ENUM_PROBLEM_COMPONENT_variables:
08599 {
08600 if (optimization->variables == NULL)
08601 optimization->variables = new VariableOption();
08602 if (optimization->variables->initialBasisStatus == NULL)
08603 optimization->variables->initialBasisStatus = new BasisStatus();
08604 if (idx < 0) return false;
08605 return optimization->variables->initialBasisStatus->addIdx(status, idx);
08606 }
08607 case ENUM_PROBLEM_COMPONENT_objectives:
08608 {
08609 if (optimization->objectives == NULL)
08610 optimization->objectives = new ObjectiveOption();
08611 if (optimization->objectives->initialBasisStatus == NULL)
08612 optimization->objectives->initialBasisStatus = new BasisStatus();
08613 if (idx >= 0) return false;
08614 return optimization->objectives->initialBasisStatus->addIdx(status, idx);
08615 }
08616 case ENUM_PROBLEM_COMPONENT_constraints:
08617 {
08618 if (optimization->constraints == NULL)
08619 optimization->constraints = new ConstraintOption();
08620 if (optimization->constraints->initialBasisStatus == NULL)
08621 optimization->constraints->initialBasisStatus = new BasisStatus();
08622 if (idx < 0) return false;
08623 return optimization->constraints->initialBasisStatus->addIdx(status, idx);
08624 }
08625 default:
08626 throw ErrorClass("target object not implemented in setAnotherInitBasisStatus");
08627 }
08628 }
08629
08630 bool OSOption::setIntegerVariableBranchingWeights(int numberOfVar, int* idx, double* value, std::string* name)
08631 {
08632 if (this->optimization == NULL)
08633 this->optimization = new OptimizationOption();
08634 if (this->optimization->variables == NULL)
08635 this->optimization->variables = new VariableOption();
08636 if (this->optimization->variables->integerVariableBranchingWeights != NULL)
08637 return false;
08638
08639 this->optimization->variables->integerVariableBranchingWeights = new IntegerVariableBranchingWeights();
08640
08641 return this->optimization->variables->integerVariableBranchingWeights->setVar(numberOfVar, idx, value, name);
08642 }
08643
08644 bool OSOption::setIntegerVariableBranchingWeightsSparse(int numberOfVar, BranchingWeight** var)
08645 {
08646 if (this->optimization == NULL)
08647 this->optimization = new OptimizationOption();
08648 if (this->optimization->variables == NULL)
08649 this->optimization->variables = new VariableOption();
08650 if (this->optimization->variables->integerVariableBranchingWeights == NULL)
08651 this->optimization->variables->integerVariableBranchingWeights = new IntegerVariableBranchingWeights();
08652 else
08653 {
08654 int i;
08655 for (i = 0; i < this->optimization->variables->integerVariableBranchingWeights->numberOfVar; i++)
08656 delete this->optimization->variables->integerVariableBranchingWeights->var[i];
08657 delete[] this->optimization->variables->integerVariableBranchingWeights->var;
08658 this->optimization->variables->integerVariableBranchingWeights->var = NULL;
08659 }
08660 return this->optimization->variables->integerVariableBranchingWeights->setVar(numberOfVar, var);
08661 }
08662
08663 bool OSOption::setIntegerVariableBranchingWeightsSparse(int numberOfVar, BranchingWeight** var, ENUM_COMBINE_ARRAYS disp)
08664 {
08665 if (this->optimization == NULL)
08666 this->optimization = new OptimizationOption();
08667 if (this->optimization->variables == NULL)
08668 this->optimization->variables = new VariableOption();
08669 if (this->optimization->variables->integerVariableBranchingWeights == NULL)
08670 this->optimization->variables->integerVariableBranchingWeights = new IntegerVariableBranchingWeights();
08671 return this->optimization->variables->integerVariableBranchingWeights->setVar(numberOfVar, var, disp);
08672 }
08673
08674 bool OSOption::setIntegerVariableBranchingWeightsDense(int numberOfVar, double *value)
08675 {
08676 if (this->optimization == NULL)
08677 this->optimization = new OptimizationOption();
08678 if (this->optimization->variables == NULL)
08679 this->optimization->variables = new VariableOption();
08680 if (this->optimization->variables->integerVariableBranchingWeights == NULL)
08681 this->optimization->variables->integerVariableBranchingWeights = new IntegerVariableBranchingWeights();
08682 else
08683 {
08684 delete[] this->optimization->variables->integerVariableBranchingWeights->var;
08685 this->optimization->variables->integerVariableBranchingWeights->var = NULL;
08686 }
08687 int i;
08688 for (i = 0; i < numberOfVar; i++)
08689 {
08690
08691 if (!this->optimization->variables->integerVariableBranchingWeights->addVar(i, value[i]))
08692 return false;
08693 }
08694 return true;
08695 }
08696
08697 bool OSOption::setAnotherIntegerVariableBranchingWeight(int idx, double value)
08698 {
08699 if (this->optimization == NULL)
08700 this->optimization = new OptimizationOption();
08701 if (this->optimization->variables == NULL)
08702 this->optimization->variables = new VariableOption();
08703 if (this->optimization->variables->integerVariableBranchingWeights == NULL)
08704 this->optimization->variables->integerVariableBranchingWeights = new IntegerVariableBranchingWeights();
08705 return this->optimization->variables->integerVariableBranchingWeights->addVar(idx, value);
08706 }
08707
08708
08709 bool OSOption::setSOSVariableBranchingWeights(int numberOfSOS, SOSWeights** sos)
08710 {
08711 if (this->optimization == NULL)
08712 this->optimization = new OptimizationOption();
08713 if (this->optimization->variables == NULL)
08714 this->optimization->variables = new VariableOption();
08715 if (this->optimization->variables->sosVariableBranchingWeights == NULL)
08716 this->optimization->variables->sosVariableBranchingWeights = new SOSVariableBranchingWeights();
08717 else
08718 {
08719 int i;
08720 for (i = 0; i < this->optimization->variables->sosVariableBranchingWeights->numberOfSOS; i++)
08721 delete this->optimization->variables->sosVariableBranchingWeights->sos[i];
08722 delete[] this->optimization->variables->sosVariableBranchingWeights->sos;
08723 this->optimization->variables->sosVariableBranchingWeights->sos = NULL;
08724 }
08725 return this->optimization->variables->sosVariableBranchingWeights->setSOS(numberOfSOS, sos);
08726 }
08727
08728 bool OSOption::setAnotherSOSVariableBranchingWeight(int sosIdx, int nvar, double weight, int* idx, double* value, std::string* name)
08729 {
08730 if (this->optimization == NULL)
08731 this->optimization = new OptimizationOption();
08732 if (this->optimization->variables == NULL)
08733 this->optimization->variables = new VariableOption();
08734 if (this->optimization->variables->sosVariableBranchingWeights == NULL)
08735 this->optimization->variables->sosVariableBranchingWeights = new SOSVariableBranchingWeights();
08736 return this->optimization->variables->sosVariableBranchingWeights->addSOS(sosIdx, nvar, weight, idx, value, name);
08737 }
08738
08739 bool OSOption::setNumberOfOtherVariableOptions(int numberOfOther)
08740 {
08741 if (optimization == NULL)
08742 optimization = new OptimizationOption();
08743 if (optimization->variables == NULL)
08744 optimization->variables = new VariableOption();
08745 if(optimization->variables->numberOfOtherVariableOptions < 0) return false;
08746
08747 optimization->variables->numberOfOtherVariableOptions = numberOfOther;
08748
08749 if (numberOfOther > 0)
08750 {
08751 optimization->variables->other = new OtherVariableOption*[numberOfOther];
08752
08753 for (int j=0; j < numberOfOther; j++)
08754 optimization->variables->other[j] = new OtherVariableOption();
08755 }
08756
08757 return true;
08758 }
08759
08760 bool OSOption::setOtherVariableOptionAttributes(int iOther, int numberOfVar,
08761 int numberOfEnumerations, std::string name,
08762 std::string value, std::string solver,
08763 std::string category, std::string type,
08764 std::string varType, std::string enumType,
08765 std::string description)
08766 {
08767 if (optimization == NULL) return false;
08768 if (optimization->variables == NULL) return false;
08769 if (optimization->variables->other == NULL) return false;
08770
08771 if (iOther < 0 || iOther >= optimization->variables->numberOfOtherVariableOptions) return false;
08772
08773
08774 optimization->variables->other[iOther]->numberOfVar = numberOfVar;
08775 optimization->variables->other[iOther]->numberOfEnumerations = numberOfEnumerations;
08776 optimization->variables->other[iOther]->name = name;
08777 optimization->variables->other[iOther]->value = value;
08778 optimization->variables->other[iOther]->solver = solver;
08779 optimization->variables->other[iOther]->category = category;
08780 optimization->variables->other[iOther]->type = type;
08781 optimization->variables->other[iOther]->varType = varType;
08782 optimization->variables->other[iOther]->enumType = enumType;
08783 optimization->variables->other[iOther]->description = description;
08784
08785 if (numberOfVar > 0)
08786 {
08787 optimization->variables->other[iOther]->var = new OtherVarOption*[numberOfVar];
08788 for (int j=0; j<numberOfVar; j++)
08789 optimization->variables->other[iOther]->var[j] = new OtherVarOption();
08790 }
08791
08792 if (numberOfEnumerations > 0)
08793 {
08794 optimization->variables->other[iOther]->enumeration = new OtherOptionEnumeration*[numberOfEnumerations];
08795 for (int j=0; j<numberOfEnumerations; j++)
08796 optimization->variables->other[iOther]->enumeration[j] = new OtherOptionEnumeration();
08797 }
08798 return true;
08799 }
08800
08801 bool OSOption::setOtherOptionEnumeration(int object, int otherOptionNumber, int enumerationNumber,
08802 int numberOfEl, std::string value, std::string description, int* idxArray)
08803 {
08804 if (optimization == NULL) return false;
08805 if (numberOfEl < 0) return false;
08806
08807 switch (object)
08808 {
08809 case ENUM_PROBLEM_COMPONENT_variables:
08810 {
08811 if (optimization->variables == NULL) return false;
08812 if (optimization->variables->other == NULL) return false;
08813 if (otherOptionNumber < 0 || otherOptionNumber >= optimization->variables->numberOfOtherVariableOptions) return false;
08814 if (optimization->variables->other[otherOptionNumber] == NULL) return false;
08815 for (int j=0; j<numberOfEl; j++) if (idxArray[j] < 0) return false;
08816
08817 if (optimization->variables->other[otherOptionNumber]->enumeration == NULL) return false;
08818 if (enumerationNumber < 0 || enumerationNumber >= optimization->variables->other[otherOptionNumber]->numberOfEnumerations) return false;
08819 if (optimization->variables->other[otherOptionNumber]->enumeration[enumerationNumber] == NULL) return false;
08820
08821 return optimization->variables->other[otherOptionNumber]->enumeration[enumerationNumber]->setOtherOptionEnumeration(value, description, idxArray, numberOfEl);
08822 }
08823
08824 case ENUM_PROBLEM_COMPONENT_objectives:
08825 {
08826 if (optimization->objectives == NULL) return false;
08827 if (optimization->objectives->other == NULL) return false;
08828 if (otherOptionNumber < 0 || otherOptionNumber >= optimization->objectives->numberOfOtherObjectiveOptions) return false;
08829 if (optimization->objectives->other[otherOptionNumber] == NULL) return false;
08830 for (int j=0; j<numberOfEl; j++) if (idxArray[j] >= 0) return false;
08831
08832 if (optimization->objectives->other[otherOptionNumber]->enumeration == NULL) return false;
08833 if (enumerationNumber < 0 || enumerationNumber >= optimization->objectives->other[otherOptionNumber]->numberOfEnumerations) return false;
08834 if (optimization->objectives->other[otherOptionNumber]->enumeration[enumerationNumber] == NULL) return false;
08835
08836 return optimization->objectives->other[otherOptionNumber]->enumeration[enumerationNumber]->setOtherOptionEnumeration(value, description, idxArray, numberOfEl);
08837 }
08838
08839 case ENUM_PROBLEM_COMPONENT_constraints:
08840 {
08841 if (optimization->constraints == NULL) return false;
08842 if (optimization->constraints->other == NULL) return false;
08843 if (otherOptionNumber < 0 || otherOptionNumber >= optimization->constraints->numberOfOtherConstraintOptions) return false;
08844 if (optimization->constraints->other[otherOptionNumber] == NULL) return false;
08845 for (int j=0; j<numberOfEl; j++) if (idxArray[j] < 0) return false;
08846
08847
08848 if (optimization->constraints->other[otherOptionNumber]->enumeration == NULL) return false;
08849 if (enumerationNumber < 0 || enumerationNumber >= optimization->constraints->other[otherOptionNumber]->numberOfEnumerations) return false;
08850 if (optimization->constraints->other[otherOptionNumber]->enumeration[enumerationNumber] == NULL) return false;
08851
08852 return optimization->constraints->other[otherOptionNumber]->enumeration[enumerationNumber]->setOtherOptionEnumeration(value, description, idxArray, numberOfEl);
08853 }
08854 default:
08855 throw ErrorClass("target object not implemented in setOtherOptionEnumeration");
08856 }
08857
08858 }
08859
08860 bool OSOption::setOtherVariableOptionVar(int otherOptionNumber, int varNumber,
08861 int idx, std::string name, std::string value, std::string lbValue, std::string ubValue)
08862 {
08863 if (optimization == NULL) return false;
08864
08865 if (optimization->variables == NULL) return false;
08866 if (optimization->variables->other == NULL) return false;
08867 if (otherOptionNumber < 0 || otherOptionNumber >= optimization->variables->numberOfOtherVariableOptions) return false;
08868 if (optimization->variables->other[otherOptionNumber] == NULL) return false;
08869 if (idx < 0) return false;
08870
08871 if (optimization->variables->other[otherOptionNumber]->var == NULL) return false;
08872 if (varNumber < 0 || varNumber >= optimization->variables->other[otherOptionNumber]->numberOfVar) return false;
08873 if (optimization->variables->other[otherOptionNumber]->var[varNumber] == NULL) return false;
08874
08875 optimization->variables->other[otherOptionNumber]->var[varNumber]->idx = idx;
08876 optimization->variables->other[otherOptionNumber]->var[varNumber]->name = name;
08877 optimization->variables->other[otherOptionNumber]->var[varNumber]->value = value;
08878 optimization->variables->other[otherOptionNumber]->var[varNumber]->lbValue = lbValue;
08879 optimization->variables->other[otherOptionNumber]->var[varNumber]->ubValue = ubValue;
08880 return true;
08881 }
08882
08883
08884 bool OSOption::setOtherVariableOptions(int numberOfOptions, OtherVariableOption** other)
08885 {
08886 if (this->optimization == NULL)
08887 this->optimization = new OptimizationOption();
08888 if (this->optimization->variables == NULL)
08889 this->optimization->variables = new VariableOption();
08890 else
08891 {
08892 int i;
08893 for (i = 0; i < this->optimization->variables->numberOfOtherVariableOptions; i++)
08894 delete this->optimization->variables->other[i];
08895 delete[] this->optimization->variables->other;
08896 this->optimization->variables->other = NULL;
08897 }
08898 return this->optimization->variables->setOther(numberOfOptions, other);
08899 }
08900
08901 bool OSOption::setAnOtherVariableOption(OtherVariableOption* optionValue)
08902 {
08903 if (this->optimization == NULL)
08904 this->optimization = new OptimizationOption();
08905 if (this->optimization->variables == NULL)
08906 this->optimization->variables = new VariableOption();
08907 return this->optimization->variables->addOther(optionValue);
08908 }
08909
08910 bool OSOption::setInitObjValues(int numberOfObj, int* idx, double* value, std::string* name)
08911 {
08912 if (this->optimization == NULL)
08913 this->optimization = new OptimizationOption();
08914 if (this->optimization->objectives == NULL)
08915 this->optimization->objectives = new ObjectiveOption();
08916 if (this->optimization->objectives->initialObjectiveValues != NULL)
08917 return false;
08918
08919 this->optimization->objectives->initialObjectiveValues = new InitObjectiveValues();
08920
08921 return this->optimization->objectives->initialObjectiveValues->setObj(numberOfObj, idx, value, name);
08922 }
08923
08924 bool OSOption::setInitObjValuesSparse(int numberOfObj, InitObjValue** obj)
08925 {
08926 if (this->optimization == NULL)
08927 this->optimization = new OptimizationOption();
08928 if (this->optimization->objectives == NULL)
08929 this->optimization->objectives = new ObjectiveOption();
08930 if (this->optimization->objectives->initialObjectiveValues == NULL)
08931 this->optimization->objectives->initialObjectiveValues = new InitObjectiveValues();
08932 else
08933 {
08934 int i;
08935 for (i = 0; i < this->optimization->objectives->initialObjectiveValues->numberOfObj; i++)
08936 delete this->optimization->objectives->initialObjectiveValues->obj[i];
08937 delete[] this->optimization->objectives->initialObjectiveValues->obj;
08938 this->optimization->objectives->initialObjectiveValues->obj = NULL;
08939 }
08940 return this->optimization->objectives->initialObjectiveValues->setObj(numberOfObj, obj);
08941 }
08942
08943 bool OSOption::setInitObjValuesSparse(int numberOfObj, InitObjValue** obj, ENUM_COMBINE_ARRAYS disp)
08944 {
08945 if (this->optimization == NULL)
08946 this->optimization = new OptimizationOption();
08947 if (this->optimization->objectives == NULL)
08948 this->optimization->objectives = new ObjectiveOption();
08949 if (this->optimization->objectives->initialObjectiveValues == NULL)
08950 this->optimization->objectives->initialObjectiveValues = new InitObjectiveValues();
08951 return this->optimization->objectives->initialObjectiveValues->setObj(numberOfObj, obj, disp);
08952 }
08953
08954 bool OSOption::setInitObjValuesDense(int numberOfObj, double *value)
08955 {
08956 if (this->optimization == NULL)
08957 this->optimization = new OptimizationOption();
08958 if (this->optimization->objectives == NULL)
08959 this->optimization->objectives = new ObjectiveOption();
08960 if (this->optimization->objectives->initialObjectiveValues == NULL)
08961 this->optimization->objectives->initialObjectiveValues = new InitObjectiveValues();
08962 else
08963 {
08964 delete[] this->optimization->objectives->initialObjectiveValues->obj;
08965 this->optimization->objectives->initialObjectiveValues->obj = NULL;
08966 }
08967 int i;
08968 for (i = 0; i < numberOfObj; i++)
08969 {
08970
08971 if (!this->optimization->objectives->initialObjectiveValues->addObj(-1-i, value[i]))
08972 return false;
08973 }
08974 return true;
08975 }
08976
08977 bool OSOption::setAnotherInitObjValue(int idx, double value)
08978 {
08979 if (this->optimization == NULL)
08980 this->optimization = new OptimizationOption();
08981 if (this->optimization->objectives == NULL)
08982 this->optimization->objectives = new ObjectiveOption();
08983 if (this->optimization->objectives->initialObjectiveValues == NULL)
08984 this->optimization->objectives->initialObjectiveValues = new InitObjectiveValues();
08985 return this->optimization->objectives->initialObjectiveValues->addObj(idx, value);
08986 }
08987
08988 bool OSOption::setInitObjBounds(int numberOfObj, int* idx, double* lbValue, double* ubValue, std::string* name)
08989 {
08990 if (this->optimization == NULL)
08991 this->optimization = new OptimizationOption();
08992 if (this->optimization->objectives == NULL)
08993 this->optimization->objectives = new ObjectiveOption();
08994 if (this->optimization->objectives->initialObjectiveBounds != NULL)
08995 return false;
08996
08997 this->optimization->objectives->initialObjectiveBounds = new InitObjectiveBounds();
08998
08999 return this->optimization->objectives->initialObjectiveBounds->setObj(numberOfObj, idx, lbValue, ubValue, name);
09000 }
09001
09002 bool OSOption::setInitObjBoundsSparse(int numberOfObj, InitObjBound** obj)
09003 {
09004 if (this->optimization == NULL)
09005 this->optimization = new OptimizationOption();
09006 if (this->optimization->objectives == NULL)
09007 this->optimization->objectives = new ObjectiveOption();
09008 if (this->optimization->objectives->initialObjectiveBounds == NULL)
09009 this->optimization->objectives->initialObjectiveBounds = new InitObjectiveBounds();
09010 else
09011 {
09012 int i;
09013 for (i = 0; i < this->optimization->objectives->initialObjectiveBounds->numberOfObj; i++)
09014 delete this->optimization->objectives->initialObjectiveBounds->obj[i];
09015 delete[] this->optimization->objectives->initialObjectiveBounds->obj;
09016 this->optimization->objectives->initialObjectiveBounds->obj = NULL;
09017 }
09018 return this->optimization->objectives->initialObjectiveBounds->setObj(numberOfObj, obj);
09019 }
09020
09021 bool OSOption::setInitObjBoundsSparse(int numberOfObj, InitObjBound** obj, ENUM_COMBINE_ARRAYS disp)
09022 {
09023 if (this->optimization == NULL)
09024 this->optimization = new OptimizationOption();
09025 if (this->optimization->objectives == NULL)
09026 this->optimization->objectives = new ObjectiveOption();
09027 if (this->optimization->objectives->initialObjectiveBounds == NULL)
09028 this->optimization->objectives->initialObjectiveBounds = new InitObjectiveBounds();
09029 return this->optimization->objectives->initialObjectiveBounds->setObj(numberOfObj, obj, disp);
09030 }
09031
09032 bool OSOption::setInitObjBoundsDense(int numberOfObj, double* lb, double* ub)
09033 {
09034 if (this->optimization == NULL)
09035 this->optimization = new OptimizationOption();
09036 if (this->optimization->objectives == NULL)
09037 this->optimization->objectives = new ObjectiveOption();
09038 if (this->optimization->objectives->initialObjectiveBounds == NULL)
09039 this->optimization->objectives->initialObjectiveBounds = new InitObjectiveBounds();
09040 else
09041 {
09042 delete[] this->optimization->objectives->initialObjectiveBounds->obj;
09043 this->optimization->objectives->initialObjectiveBounds->obj = NULL;
09044 }
09045 int i;
09046 for (i = 0; i < numberOfObj; i++)
09047 {
09048 if (!this->optimization->objectives->initialObjectiveBounds->addObj(-1-i, lb[i], ub[i]))
09049 return false;
09050 }
09051 return true;
09052 }
09053
09054 bool OSOption::setAnotherInitObjBound(int idx, double lb, double ub)
09055 {
09056 if (this->optimization == NULL)
09057 this->optimization = new OptimizationOption();
09058 if (this->optimization->objectives == NULL)
09059 this->optimization->objectives = new ObjectiveOption();
09060 if (this->optimization->objectives->initialObjectiveBounds == NULL)
09061 this->optimization->objectives->initialObjectiveBounds = new InitObjectiveBounds();
09062 return this->optimization->objectives->initialObjectiveBounds->addObj(idx, lb, ub);
09063 }
09064
09065 bool OSOption::setOtherObjectiveOptionObj(int otherOptionNumber, int objNumber,
09066 int idx, std::string name, std::string value, std::string lbValue, std::string ubValue)
09067 {
09068 if (optimization == NULL) return false;
09069
09070 if (optimization->objectives == NULL) return false;
09071 if (optimization->objectives->other == NULL) return false;
09072 if (otherOptionNumber < 0 || otherOptionNumber >= optimization->objectives->numberOfOtherObjectiveOptions) return false;
09073 if (optimization->objectives->other[otherOptionNumber] == NULL) return false;
09074 if (idx >= 0) return false;
09075
09076 if (optimization->objectives->other[otherOptionNumber]->obj == NULL) return false;
09077 if (objNumber < 0 || objNumber >= optimization->objectives->other[otherOptionNumber]->numberOfObj) return false;
09078 if (optimization->objectives->other[otherOptionNumber]->obj[objNumber] == NULL) return false;
09079
09080 optimization->objectives->other[otherOptionNumber]->obj[objNumber]->idx = idx;
09081 optimization->objectives->other[otherOptionNumber]->obj[objNumber]->name = name;
09082 optimization->objectives->other[otherOptionNumber]->obj[objNumber]->value = value;
09083 optimization->objectives->other[otherOptionNumber]->obj[objNumber]->lbValue = lbValue;
09084 optimization->objectives->other[otherOptionNumber]->obj[objNumber]->ubValue = ubValue;
09085 return true;
09086 }
09087
09088 bool OSOption::setNumberOfOtherObjectiveOptions(int numberOfOther)
09089 {
09090 if (optimization == NULL) return false;
09091 if (optimization->objectives == NULL)
09092 optimization->objectives = new ObjectiveOption();
09093 if (optimization->objectives->numberOfOtherObjectiveOptions < 0) return false;
09094
09095 optimization->objectives->numberOfOtherObjectiveOptions = numberOfOther;
09096
09097 if (numberOfOther > 0)
09098 {
09099 optimization->objectives->other = new OtherObjectiveOption*[numberOfOther];
09100
09101 for (int j=0; j < numberOfOther; j++)
09102 optimization->objectives->other[j] = new OtherObjectiveOption();
09103 }
09104 return true;
09105
09106 }
09107
09108 bool OSOption::setOtherObjectiveOptionAttributes(int iOther, int numberOfObj,
09109 int numberOfEnumerations, std::string name,
09110 std::string value, std::string solver,
09111 std::string category, std::string type,
09112 std::string objType, std::string enumType,
09113 std::string description)
09114 {
09115 if (optimization == NULL) return false;
09116 if (optimization->objectives == NULL) return false;
09117 if (optimization->objectives->other == NULL) return false;
09118
09119 if (iOther < 0 || iOther >= optimization->objectives->numberOfOtherObjectiveOptions) return false;
09120
09121 optimization->objectives->other[iOther]->numberOfObj = numberOfObj;
09122 optimization->objectives->other[iOther]->numberOfEnumerations = numberOfEnumerations;
09123 optimization->objectives->other[iOther]->name = name;
09124 optimization->objectives->other[iOther]->value = value;
09125 optimization->objectives->other[iOther]->solver = solver;
09126 optimization->objectives->other[iOther]->category = category;
09127 optimization->objectives->other[iOther]->type = type;
09128 optimization->objectives->other[iOther]->objType = objType;
09129 optimization->objectives->other[iOther]->enumType = enumType;
09130 optimization->objectives->other[iOther]->description = description;
09131
09132 if (numberOfObj > 0)
09133 {
09134 optimization->objectives->other[iOther]->obj = new OtherObjOption*[numberOfObj];
09135 for (int j=0; j<numberOfObj; j++)
09136 optimization->objectives->other[iOther]->obj[j] = new OtherObjOption();
09137 }
09138
09139 if (numberOfEnumerations > 0)
09140 {
09141 optimization->objectives->other[iOther]->enumeration = new OtherOptionEnumeration*[numberOfEnumerations];
09142 for (int j=0; j<numberOfEnumerations; j++)
09143 optimization->objectives->other[iOther]->enumeration[j] = new OtherOptionEnumeration();
09144 }
09145 return true;
09146 }
09147
09148 bool OSOption::setOtherObjectiveOptions(int numberOfOptions, OtherObjectiveOption** other)
09149 {
09150 if (this->optimization == NULL)
09151 this->optimization = new OptimizationOption();
09152 if (this->optimization->objectives == NULL)
09153 this->optimization->objectives = new ObjectiveOption();
09154 else
09155 {
09156 int i;
09157 for (i = 0; i < this->optimization->objectives->numberOfOtherObjectiveOptions; i++)
09158 delete this->optimization->objectives->other[i];
09159 delete[] this->optimization->objectives->other;
09160 this->optimization->objectives->other = NULL;
09161 }
09162 return this->optimization->objectives->setOther(numberOfOptions, other);
09163 }
09164
09165 bool OSOption::setAnOtherObjectiveOption(OtherObjectiveOption* optionValue)
09166 {
09167 if (this->optimization == NULL)
09168 this->optimization = new OptimizationOption();
09169 if (this->optimization->objectives == NULL)
09170 this->optimization->objectives = new ObjectiveOption();
09171 return this->optimization->objectives->addOther(optionValue);
09172 }
09173
09174
09175 bool OSOption::setInitConValues(int numberOfCon, int* idx, double* value, std::string* name)
09176 {
09177 if (this->optimization == NULL)
09178 this->optimization = new OptimizationOption();
09179 if (this->optimization->constraints == NULL)
09180 this->optimization->constraints = new ConstraintOption();
09181 if (this->optimization->constraints->initialConstraintValues != NULL)
09182 return false;
09183
09184 this->optimization->constraints->initialConstraintValues = new InitConstraintValues();
09185
09186 return this->optimization->constraints->initialConstraintValues->setCon(numberOfCon, idx, value, name);
09187 }
09188
09189
09190 bool OSOption::setInitConValuesSparse(int numberOfCon, InitConValue** con)
09191 {
09192 if (this->optimization == NULL)
09193 this->optimization = new OptimizationOption();
09194 if (this->optimization->constraints == NULL)
09195 this->optimization->constraints = new ConstraintOption();
09196 if (this->optimization->constraints->initialConstraintValues == NULL)
09197 this->optimization->constraints->initialConstraintValues = new InitConstraintValues();
09198 else
09199 {
09200 int i;
09201 for (i = 0; i < this->optimization->constraints->initialConstraintValues->numberOfCon; i++)
09202 delete this->optimization->constraints->initialConstraintValues->con[i];
09203 delete[] this->optimization->constraints->initialConstraintValues->con;
09204 this->optimization->constraints->initialConstraintValues->con = NULL;
09205 }
09206 return this->optimization->constraints->initialConstraintValues->setCon(numberOfCon, con);
09207 }
09208
09209 bool OSOption::setInitConValuesSparse(int numberOfCon, InitConValue** con, ENUM_COMBINE_ARRAYS disp)
09210 {
09211 if (this->optimization == NULL)
09212 this->optimization = new OptimizationOption();
09213 if (this->optimization->constraints == NULL)
09214 this->optimization->constraints = new ConstraintOption();
09215 if (this->optimization->constraints->initialConstraintValues == NULL)
09216 this->optimization->constraints->initialConstraintValues = new InitConstraintValues();
09217 return this->optimization->constraints->initialConstraintValues->setCon(numberOfCon, con, disp);
09218 }
09219
09220 bool OSOption::setInitConValuesDense(int numberOfCon, double *value)
09221 {
09222 if (this->optimization == NULL)
09223 this->optimization = new OptimizationOption();
09224 if (this->optimization->constraints == NULL)
09225 this->optimization->constraints = new ConstraintOption();
09226 if (this->optimization->constraints->initialConstraintValues == NULL)
09227 this->optimization->constraints->initialConstraintValues = new InitConstraintValues();
09228 else
09229 {
09230 delete[] this->optimization->constraints->initialConstraintValues->con;
09231 this->optimization->constraints->initialConstraintValues->con = NULL;
09232 }
09233 int i;
09234 for (i = 0; i < numberOfCon; i++)
09235 {
09236
09237 if (!this->optimization->constraints->initialConstraintValues->addCon(i, value[i]))
09238 return false;
09239 }
09240 return true;
09241 }
09242
09243 bool OSOption::setAnotherInitConValue(int idx, double value)
09244 {
09245 if (this->optimization == NULL)
09246 this->optimization = new OptimizationOption();
09247 if (this->optimization->constraints == NULL)
09248 this->optimization->constraints = new ConstraintOption();
09249 if (this->optimization->constraints->initialConstraintValues == NULL)
09250 this->optimization->constraints->initialConstraintValues = new InitConstraintValues();
09251 return this->optimization->constraints->initialConstraintValues->addCon(idx, value);
09252 }
09253
09254 bool OSOption::setInitDualValues(int numberOfCon, int* idx, double* lbValue, double* ubValue, std::string* name)
09255 {
09256 if (this->optimization == NULL)
09257 this->optimization = new OptimizationOption();
09258 if (this->optimization->constraints == NULL)
09259 this->optimization->constraints = new ConstraintOption();
09260 if (this->optimization->constraints->initialDualValues != NULL)
09261 return false;
09262
09263 this->optimization->constraints->initialDualValues = new InitDualVariableValues();
09264
09265 return this->optimization->constraints->initialDualValues->setCon(numberOfCon, idx, lbValue, ubValue, name);
09266 }
09267
09268 bool OSOption::setInitDualVarValuesSparse(int numberOfCon, InitDualVarValue** con)
09269 {
09270 if (this->optimization == NULL)
09271 this->optimization = new OptimizationOption();
09272 if (this->optimization->constraints == NULL)
09273 this->optimization->constraints = new ConstraintOption();
09274 if (this->optimization->constraints->initialDualValues == NULL)
09275 this->optimization->constraints->initialDualValues = new InitDualVariableValues();
09276 else
09277 {
09278 int i;
09279 for (i = 0; i < this->optimization->constraints->initialDualValues->numberOfCon; i++)
09280 delete this->optimization->constraints->initialDualValues->con[i];
09281 delete[] this->optimization->constraints->initialDualValues->con;
09282 this->optimization->constraints->initialDualValues->con = NULL;
09283 }
09284 return this->optimization->constraints->initialDualValues->setCon(numberOfCon, con);
09285 }
09286
09287 bool OSOption::setInitDualVarValuesSparse(int numberOfCon, InitDualVarValue** con, ENUM_COMBINE_ARRAYS disp)
09288 {
09289 if (this->optimization == NULL)
09290 this->optimization = new OptimizationOption();
09291 if (this->optimization->constraints == NULL)
09292 this->optimization->constraints = new ConstraintOption();
09293 if (this->optimization->constraints->initialDualValues == NULL)
09294 this->optimization->constraints->initialDualValues = new InitDualVariableValues();
09295 return this->optimization->constraints->initialDualValues->setCon(numberOfCon, con, disp);
09296 }
09297
09298 bool OSOption::setInitDualVarValuesDense(int numberOfCon, double* lb, double* ub)
09299 {
09300 if (this->optimization == NULL)
09301 this->optimization = new OptimizationOption();
09302 if (this->optimization->constraints == NULL)
09303 this->optimization->constraints = new ConstraintOption();
09304 if (this->optimization->constraints->initialDualValues == NULL)
09305 this->optimization->constraints->initialDualValues = new InitDualVariableValues();
09306 else
09307 {
09308 delete[] this->optimization->constraints->initialDualValues->con;
09309 this->optimization->constraints->initialDualValues->con = NULL;
09310 }
09311 int i;
09312 for (i = 0; i < numberOfCon; i++)
09313 {
09314 if ((lb[i] != 0.0) || (ub[i] != 0.0))
09315 if (!this->optimization->constraints->initialDualValues->addCon(i, lb[i], ub[i]))
09316 return false;
09317 }
09318 return true;
09319 }
09320
09321 bool OSOption::setAnotherInitDualVarValue(int idx, double lbValue, double ubValue)
09322 {
09323 if (this->optimization == NULL)
09324 this->optimization = new OptimizationOption();
09325 if (this->optimization->constraints == NULL)
09326 this->optimization->constraints = new ConstraintOption();
09327 if (this->optimization->constraints->initialDualValues == NULL)
09328 this->optimization->constraints->initialDualValues = new InitDualVariableValues();
09329 return this->optimization->constraints->initialDualValues->addCon(idx, lbValue, ubValue);
09330 }
09331
09332 bool OSOption::setNumberOfOtherConstraintOptions(int numberOfOther)
09333 {
09334 if (optimization == NULL) return false;
09335 if (optimization->constraints == NULL)
09336 optimization->constraints = new ConstraintOption();
09337 if (optimization->constraints->numberOfOtherConstraintOptions < 0) return false;
09338
09339 optimization->constraints->numberOfOtherConstraintOptions = numberOfOther;
09340
09341 if (numberOfOther > 0)
09342 {
09343 optimization->constraints->other = new OtherConstraintOption*[numberOfOther];
09344
09345 for (int j=0; j < numberOfOther; j++)
09346 optimization->constraints->other[j] = new OtherConstraintOption();
09347 }
09348
09349 return true;
09350 }
09351
09352 bool OSOption::setOtherConstraintOptionAttributes(int iOther, int numberOfCon,
09353 int numberOfEnumerations, std::string name,
09354 std::string value, std::string solver,
09355 std::string category, std::string type,
09356 std::string conType, std::string enumType,
09357 std::string description)
09358 {
09359 if (optimization == NULL) return false;
09360 if (optimization->constraints == NULL) return false;
09361 if (optimization->constraints->other == NULL) return false;
09362 if (iOther < 0 || iOther >= optimization->constraints->numberOfOtherConstraintOptions) return false;
09363
09364 optimization->constraints->other[iOther]->numberOfCon = numberOfCon;
09365 optimization->constraints->other[iOther]->numberOfEnumerations = numberOfEnumerations;
09366 optimization->constraints->other[iOther]->name = name;
09367 optimization->constraints->other[iOther]->value = value;
09368 optimization->constraints->other[iOther]->solver = solver;
09369 optimization->constraints->other[iOther]->category = category;
09370 optimization->constraints->other[iOther]->type = type;
09371 optimization->constraints->other[iOther]->conType = conType;
09372 optimization->constraints->other[iOther]->enumType = enumType;
09373 optimization->constraints->other[iOther]->description = description;
09374
09375 if (numberOfCon > 0)
09376 {
09377 optimization->constraints->other[iOther]->con = new OtherConOption*[numberOfCon];
09378 for (int j=0; j<numberOfCon; j++)
09379 optimization->constraints->other[iOther]->con[j] = new OtherConOption();
09380 }
09381
09382 if (numberOfEnumerations > 0)
09383 {
09384 optimization->constraints->other[iOther]->enumeration = new OtherOptionEnumeration*[numberOfEnumerations];
09385 for (int j=0; j<numberOfEnumerations; j++)
09386 optimization->constraints->other[iOther]->enumeration[j] = new OtherOptionEnumeration();
09387 }
09388 return true;
09389 }
09390
09391
09392 bool OSOption::setOtherConstraintOptionCon(int otherOptionNumber, int conNumber,
09393 int idx, std::string name, std::string value, std::string lbValue, std::string ubValue)
09394 {
09395 if (optimization == NULL) return false;
09396
09397 if (optimization->constraints == NULL) return false;
09398 if (optimization->constraints->other == NULL) return false;
09399 if (otherOptionNumber < 0 || otherOptionNumber >= optimization->constraints->numberOfOtherConstraintOptions) return false;
09400 if (optimization->constraints->other[otherOptionNumber] == NULL) return false;
09401 if (idx < 0) return false;
09402
09403 if (optimization->constraints->other[otherOptionNumber]->con == NULL) return false;
09404 if (conNumber < 0 || conNumber >= optimization->constraints->other[otherOptionNumber]->numberOfCon) return false;
09405 if (optimization->constraints->other[otherOptionNumber]->con[conNumber] == NULL) return false;
09406
09407 optimization->constraints->other[otherOptionNumber]->con[conNumber]->idx = idx;
09408 optimization->constraints->other[otherOptionNumber]->con[conNumber]->name = name;
09409 optimization->constraints->other[otherOptionNumber]->con[conNumber]->value = value;
09410 optimization->constraints->other[otherOptionNumber]->con[conNumber]->lbValue = lbValue;
09411 optimization->constraints->other[otherOptionNumber]->con[conNumber]->ubValue = ubValue;
09412 return true;
09413 }
09414
09415
09416
09417 bool OSOption::setOtherConstraintOptions(int numberOfOptions, OtherConstraintOption** other)
09418 {
09419 if (this->optimization == NULL)
09420 this->optimization = new OptimizationOption();
09421 if (this->optimization->constraints == NULL)
09422 this->optimization->constraints = new ConstraintOption();
09423 else
09424 {
09425 int i;
09426 for (i = 0; i < this->optimization->constraints->numberOfOtherConstraintOptions; i++)
09427 delete this->optimization->constraints->other[i];
09428 delete[] this->optimization->constraints->other;
09429 this->optimization->constraints->other = NULL;
09430 }
09431 return this->optimization->constraints->setOther(numberOfOptions, other);
09432 }
09433
09434 bool OSOption::setAnOtherConstraintOption(OtherConstraintOption* optionValue)
09435 {
09436 if (this->optimization == NULL)
09437 this->optimization = new OptimizationOption();
09438 if (this->optimization->constraints == NULL)
09439 this->optimization->constraints = new ConstraintOption();
09440 return this->optimization->constraints->addOther(optionValue);
09441 }
09442
09443
09444 bool OSOption::setNumberOfSolverOptions(int numberOfOptions)
09445 {
09446 if (optimization == NULL) return false;
09447 if (optimization->solverOptions != NULL) return false;
09448
09449 optimization->solverOptions = new SolverOptions();
09450 optimization->solverOptions->numberOfSolverOptions = numberOfOptions;
09451 optimization->solverOptions->solverOption = new SolverOption*[numberOfOptions];
09452
09453 for (int j=0; j < numberOfOptions; j++)
09454 optimization->solverOptions->solverOption[j] = new SolverOption();
09455 return true;
09456 }
09457
09458 bool OSOption::setSolverOptionContent(int iOption, int numberOfItems,
09459 std::string name,
09460 std::string value, std::string solver,
09461 std::string category, std::string type,
09462 std::string description, std::string *itemList)
09463 {
09464 if (optimization == NULL) return false;
09465 if (optimization->solverOptions == NULL) return false;
09466 if (optimization->solverOptions->solverOption == NULL) return false;
09467
09468 if (iOption < 0 || iOption >= optimization->solverOptions->numberOfSolverOptions) return false;
09469
09470 optimization->solverOptions->solverOption[iOption]->numberOfItems = numberOfItems;
09471 optimization->solverOptions->solverOption[iOption]->name = name;
09472 optimization->solverOptions->solverOption[iOption]->value = value;
09473 optimization->solverOptions->solverOption[iOption]->solver = solver;
09474 optimization->solverOptions->solverOption[iOption]->category = category;
09475 optimization->solverOptions->solverOption[iOption]->type = type;
09476 optimization->solverOptions->solverOption[iOption]->description = description;
09477
09478 if (numberOfItems > 0)
09479 {
09480 optimization->solverOptions->solverOption[iOption]->item = new std::string[numberOfItems];
09481 for (int j=0; j<numberOfItems; j++)
09482 optimization->solverOptions->solverOption[iOption]->item[j] = itemList[j];
09483 }
09484
09485 return true;
09486 }
09487
09488 bool OSOption::setSolverOptions(int numberOfSolverOptions, SolverOption** solverOption)
09489 {
09490 if (this->optimization == NULL)
09491 this->optimization = new OptimizationOption();
09492 if (this->optimization->solverOptions == NULL)
09493 this->optimization->solverOptions = new SolverOptions();
09494 else
09495 {
09496 int i;
09497 for (i = 0; i < this->optimization->solverOptions->numberOfSolverOptions; i++)
09498 delete this->optimization->solverOptions->solverOption[i];
09499 delete[] this->optimization->solverOptions->solverOption;
09500 this->optimization->solverOptions->solverOption = NULL;
09501 }
09502 return this->optimization->solverOptions->setSolverOptions(numberOfSolverOptions, solverOption);
09503 }
09504
09505 bool OSOption::setAnotherSolverOption(std::string name, std::string value, std::string solver,
09506 std::string category, std::string type, std::string description)
09507 {
09508 if (this->optimization == NULL)
09509 this->optimization = new OptimizationOption();
09510 if (this->optimization->solverOptions == NULL)
09511 this->optimization->solverOptions = new SolverOptions();
09512 return this->optimization->solverOptions->addSolverOption(name, value, solver, category, type, description);
09513 }
09514
09515
09516 bool OSOption::setOptionStr(std::string optionName, std::string optionValue)
09517 {
09518 if (optionName == "serviceURI")
09519 return this->setServiceURI(optionValue);
09520
09521 if (optionName == "serviceName")
09522 return this->setServiceName(optionValue);
09523
09524 if (optionName == "instanceName")
09525 return this->setInstanceName(optionValue);
09526
09527 if (optionName == "instanceLocation")
09528 return this->setInstanceLocation(optionValue);
09529
09530 if (optionName == "locationType")
09531 return this->setInstanceLocationType(optionValue);
09532
09533 if (optionName == "jobID")
09534 return this->setJobID(optionValue);
09535
09536 if (optionName == "solverName")
09537 return this->setSolverToInvoke(optionValue);
09538
09539 if (optionName == "solverToInvoke")
09540 return this->setSolverToInvoke(optionValue);
09541
09542 if (optionName == "license")
09543 return this->setLicense(optionValue);
09544
09545 if (optionName == "userName")
09546 return this->setUserName(optionValue);
09547
09548 if (optionName == "password")
09549 return this->setPassword(optionValue);
09550
09551 if (optionName == "contact")
09552 return this->setContact(optionValue);
09553
09554 if (optionName == "transportType")
09555 return this->setContactTransportType(optionValue);
09556
09557 if (optionName == "minDiskSpaceUnit")
09558 return this->setMinDiskSpaceUnit(optionValue);
09559
09560 if (optionName == "minMemoryUnit")
09561 return this->setMinMemoryUnit(optionValue);
09562
09563 if (optionName == "minCPUSpeedUnit")
09564 return this->setMinCPUSpeedUnit(optionValue);
09565
09566 if (optionName == "serviceType")
09567 return this->setServiceType(optionValue);
09568
09569 if (optionName == "maxTimeUnit")
09570 return this->setMaxTimeUnit(optionValue);
09571
09572 if (optionName == "requestedStartTime")
09573 return this->setRequestedStartTime(optionValue);
09574
09575 return false;
09576 }
09577
09578
09579 bool OSOption::setOptionInt(std::string optionName, int optionValue)
09580 {
09581 if (optionName == "minCPUNumber")
09582 return this->setMinCPUNumber(optionValue);
09583
09584 return false;
09585 }
09586
09587
09588 bool OSOption::setOptionDbl(std::string optionName, double value)
09589 {
09590 if (optionName == "minDiskSpaceValue")
09591 return this->setMinDiskSpace(value);
09592
09593 if (optionName == "minMemoryValue")
09594 return this->setMinMemorySize(value);
09595
09596 if (optionName == "minCPUSpeedValue")
09597
09598 return this->setMinCPUSpeed(value);
09599
09600 if (optionName == "maxTime")
09601 return this->setMaxTime(value);
09602
09603 return false;
09604 }
09605
09606
09607
09608
09609
09610 bool OSOption::IsEqual(OSOption *that)
09611 {
09612 #ifndef NDEBUG
09613 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in OSOption");
09614 #endif
09615 if (this == NULL)
09616 {
09617 if (that == NULL)
09618 return true;
09619 else
09620 {
09621 #ifndef NDEBUG
09622 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
09623 #endif
09624 return false;
09625 }
09626 }
09627 else
09628 {
09629 if (that == NULL)
09630 {
09631 #ifndef NDEBUG
09632 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
09633 #endif
09634 return false;
09635 }
09636 else
09637 {
09638 if (!this->optionHeader->IsEqual(that->optionHeader))
09639 return false;
09640 if (!this->general->IsEqual(that->general))
09641 return false;
09642 if (!this->system->IsEqual(that->system))
09643
09644 return false;
09645 if (!this->service->IsEqual(that->service))
09646 return false;
09647 if (!this->job->IsEqual(that->job))
09648 return false;
09649 if (!this->optimization->IsEqual(that->optimization))
09650 return false;
09651 return true;
09652 }
09653 }
09654 }
09655
09656
09657 bool GeneralOption::IsEqual(GeneralOption *that)
09658 {
09659 std::ostringstream outStr;
09660
09661 #ifndef NDEBUG
09662 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in OSOption");
09663 #endif
09664 if (this == NULL)
09665 {
09666 if (that == NULL)
09667 return true;
09668 else
09669 {
09670 #ifndef NDEBUG
09671 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
09672 #endif
09673 return false;
09674 }
09675 }
09676 else
09677 {
09678 if (that == NULL)
09679 {
09680 #ifndef NDEBUG
09681 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
09682 #endif
09683 return false;
09684 }
09685 else
09686 {
09687 bool same;
09688 same = (this->serviceURI == that->serviceURI);
09689 same = ((this->serviceName == that->serviceName ) && same);
09690 same = ((this->instanceName == that->instanceName ) && same);
09691 same = ((this->jobID == that->jobID ) && same);
09692 same = ((this->solverToInvoke == that->solverToInvoke) && same);
09693 same = ((this->license == that->license ) && same);
09694 same = ((this->userName == that->userName ) && same);
09695 same = ((this->password == that->password ) && same);
09696 if (!same)
09697 {
09698 #ifndef NDEBUG
09699 outStr.str("");
09700 outStr.clear();
09701 outStr << "serviceURI: " << this->serviceURI << " vs. " << that->serviceURI << endl;
09702 outStr << "serviceName: " << this->serviceName << " vs. " << that->serviceName << endl;
09703 outStr << "instanceName: " << this->instanceName << " vs. " << that->instanceName << endl;
09704 outStr << "jobID: " << this->jobID << " vs. " << that->jobID << endl;
09705 outStr << "solverToInvoke:" << this->solverToInvoke << " vs. " << that->solverToInvoke << endl;
09706 outStr << "license: " << this->license << " vs. " << that->license << endl;
09707 outStr << "userName: " << this->userName << " vs. " << that->userName << endl;
09708 outStr << "password: " << this->password << " vs. " << that->password << endl;
09709 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
09710 #endif
09711 return false;
09712 }
09713 if (!this->instanceLocation->IsEqual(that->instanceLocation))
09714 return false;
09715 if (!this->contact->IsEqual(that->contact))
09716 return false;
09717 if (!this->otherOptions->IsEqual(that->otherOptions))
09718 return false;
09719 return true;
09720 }
09721 }
09722 }
09723
09724
09725 bool SystemOption::IsEqual(SystemOption *that)
09726 {
09727 #ifndef NDEBUG
09728 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in OSOption");
09729 #endif
09730 if (this == NULL)
09731 {
09732 if (that == NULL)
09733 return true;
09734 else
09735 {
09736 #ifndef NDEBUG
09737 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
09738 #endif
09739 return false;
09740 }
09741 }
09742 else
09743 {
09744 if (that == NULL)
09745 {
09746 #ifndef NDEBUG
09747 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
09748 #endif
09749 return false;
09750 }
09751 else
09752 {
09753 if (!this->minDiskSpace->IsEqual(that->minDiskSpace))
09754 return false;
09755 if (!this->minMemorySize->IsEqual(that->minMemorySize))
09756 return false;
09757 if (!this->minCPUSpeed->IsEqual(that->minCPUSpeed))
09758 return false;
09759 if (!this->minCPUNumber->IsEqual(that->minCPUNumber))
09760 return false;
09761 if (!this->otherOptions->IsEqual(that->otherOptions))
09762 return false;
09763 return true;
09764 }
09765 }
09766 }
09767
09768
09769 bool ServiceOption::IsEqual(ServiceOption *that)
09770 {
09771 std::ostringstream outStr;
09772
09773 #ifndef NDEBUG
09774 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in OSOption");
09775 #endif
09776 if (this == NULL)
09777 {
09778 if (that == NULL)
09779 return true;
09780 else
09781 {
09782 #ifndef NDEBUG
09783 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
09784 #endif
09785 return false;
09786 }
09787 }
09788 else
09789 {
09790 if (that == NULL)
09791 {
09792 #ifndef NDEBUG
09793 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
09794 #endif
09795 return false;
09796 }
09797 else
09798 {
09799 if (this->type != that->type)
09800 {
09801 #ifndef NDEBUG
09802 outStr.str("");
09803 outStr.clear();
09804 outStr << "service type: " << this->type << " vs. " << that->type << endl;
09805 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
09806 #endif
09807 return false;
09808 }
09809
09810 if (!this->otherOptions->IsEqual(that->otherOptions))
09811 return false;
09812 return true;
09813 }
09814 }
09815 }
09816
09817
09818 bool JobOption::IsEqual(JobOption *that)
09819 {
09820 std::ostringstream outStr;
09821
09822 #ifndef NDEBUG
09823 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in OSOption");
09824 #endif
09825 if (this == NULL)
09826 {
09827 if (that == NULL)
09828 return true;
09829 else
09830 {
09831 #ifndef NDEBUG
09832 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
09833 #endif
09834 return false;
09835 }
09836 }
09837 else
09838 {
09839 if (that == NULL)
09840 {
09841 #ifndef NDEBUG
09842 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
09843 #endif
09844
09845 return false;
09846 }
09847 else
09848 {
09849 if (this->requestedStartTime != that->requestedStartTime)
09850 {
09851 #ifndef NDEBUG
09852 outStr.str("");
09853 outStr.clear();
09854 outStr << "requestedStartTime: " << this->requestedStartTime << " vs. " << that->requestedStartTime << endl;
09855 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
09856 #endif
09857 return false;
09858 }
09859
09860
09861 if (!this->maxTime->IsEqual(that->maxTime))
09862 return false;
09863 if (!this->dependencies->IsEqual(that->dependencies))
09864 return false;
09865 if (!this->requiredDirectories->IsEqual(that->requiredDirectories))
09866 return false;
09867 if (!this->requiredFiles->IsEqual(that->requiredFiles))
09868 return false;
09869 if (!this->directoriesToMake->IsEqual(that->directoriesToMake))
09870 return false;
09871 if (!this->filesToMake->IsEqual(that->filesToMake))
09872 return false;
09873 if (!this->inputDirectoriesToMove->IsEqual(that->inputDirectoriesToMove))
09874 return false;
09875 if (!this->inputFilesToMove->IsEqual(that->inputFilesToMove))
09876 return false;
09877 if (!this->outputFilesToMove->IsEqual(that->outputFilesToMove))
09878 return false;
09879 if (!this->outputDirectoriesToMove->IsEqual(that->outputDirectoriesToMove))
09880 return false;
09881 if (!this->filesToDelete->IsEqual(that->filesToDelete))
09882 return false;
09883 if (!this->directoriesToDelete->IsEqual(that->directoriesToDelete))
09884 return false;
09885 if (!this->processesToKill->IsEqual(that->processesToKill))
09886 return false;
09887 if (!this->otherOptions->IsEqual(that->otherOptions))
09888 return false;
09889 return true;
09890 }
09891 }
09892 }
09893
09894 bool OptimizationOption::IsEqual(OptimizationOption *that)
09895 {
09896 std::ostringstream outStr;
09897
09898 #ifndef NDEBUG
09899 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in OSOption");
09900 #endif
09901 if (this == NULL)
09902 {
09903 if (that == NULL)
09904 return true;
09905 else
09906 {
09907 #ifndef NDEBUG
09908 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
09909 #endif
09910 return false;
09911 }
09912 }
09913 else
09914 {
09915 if (that == NULL)
09916 {
09917 #ifndef NDEBUG
09918 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
09919 #endif
09920 return false;
09921 }
09922 else
09923 {
09924 if ((this->numberOfVariables != that->numberOfVariables) &&
09925 (this->numberOfVariables * that->numberOfVariables) != 0)
09926 {
09927 #ifndef NDEBUG
09928 outStr.str("");
09929 outStr.clear();
09930 outStr << "numberOfVariables: "
09931 << this->numberOfVariables << " vs. " << that->numberOfVariables << endl;
09932 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
09933 #endif
09934 return false;
09935 }
09936 if ((this->numberOfObjectives != that->numberOfObjectives) &&
09937 (this->numberOfObjectives * that->numberOfObjectives) != 0)
09938 {
09939 #ifndef NDEBUG
09940 outStr.str("");
09941 outStr.clear();
09942 outStr << "numberOfObjectives: "
09943 << this->numberOfObjectives << " vs. " << that->numberOfObjectives << endl;
09944 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
09945 #endif
09946 return false;
09947 }
09948 if ((this->numberOfConstraints != that->numberOfConstraints) &&
09949 (this->numberOfConstraints * that->numberOfConstraints) != 0)
09950 {
09951 #ifndef NDEBUG
09952 outStr.str("");
09953 outStr.clear();
09954 outStr << "numberOfConstraints: "
09955 << this->numberOfConstraints << " vs. " << that->numberOfConstraints << endl;
09956 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
09957 #endif
09958 return false;
09959 }
09960
09961 if (!this->variables->IsEqual(that->variables))
09962 return false;
09963 if (!this->objectives->IsEqual(that->objectives))
09964 return false;
09965 if (!this->constraints->IsEqual(that->constraints))
09966 return false;
09967 if (!this->solverOptions->IsEqual(that->solverOptions))
09968 return false;
09969 return true;
09970 }
09971 }
09972 }
09973
09974 bool InstanceLocationOption::IsEqual(InstanceLocationOption *that)
09975 {
09976 std::ostringstream outStr;
09977
09978 #ifndef NDEBUG
09979 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in OSOption");
09980 #endif
09981 if (this == NULL)
09982 {
09983 if (that == NULL)
09984 return true;
09985 else
09986 {
09987 #ifndef NDEBUG
09988 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
09989 #endif
09990 return false;
09991 }
09992 }
09993 else
09994 {
09995 if (that == NULL)
09996 {
09997 #ifndef NDEBUG
09998 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
09999 #endif
10000 return false;
10001 }
10002 else
10003 {
10004 if ((this->locationType != that->locationType) || (this->value != that->value))
10005 {
10006 #ifndef NDEBUG
10007 outStr.str("");
10008 outStr.clear();
10009 outStr << "location type: " << this->locationType << " vs. " << that->locationType << endl;
10010 outStr << "value: " << this->value << " vs. " << that->value << endl;
10011 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
10012 #endif
10013 return false;
10014 }
10015 return true;
10016 }
10017 }
10018 }
10019
10020 bool ContactOption::IsEqual(ContactOption *that)
10021 {
10022 std::ostringstream outStr;
10023
10024 #ifndef NDEBUG
10025 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in OSOption");
10026 #endif
10027 if (this == NULL)
10028 {
10029 if (that == NULL)
10030 return true;
10031 else
10032 {
10033 #ifndef NDEBUG
10034 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
10035 #endif
10036 return false;
10037 }
10038 }
10039 else
10040 {
10041 if (that == NULL)
10042 {
10043 #ifndef NDEBUG
10044 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
10045 #endif
10046 return false;
10047 }
10048 else
10049 {
10050 if ((this->transportType != that->transportType) || (this->value != that->value))
10051 {
10052 #ifndef NDEBUG
10053 outStr.str("");
10054 outStr.clear();
10055 outStr << "transport type: " << this->transportType << " vs. " << that->transportType << endl;
10056 outStr << "value: " << this->value << " vs. " << that->value << endl;
10057 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
10058 #endif
10059 return false;
10060 }
10061 return true;
10062 }
10063 }
10064 }
10065
10066 bool OtherOptions::IsEqual(OtherOptions *that)
10067 {
10068 std::ostringstream outStr;
10069
10070 #ifndef NDEBUG
10071 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in OSOption");
10072 #endif
10073 if (this == NULL)
10074 {
10075 if (that == NULL)
10076 return true;
10077 else
10078 {
10079 #ifndef NDEBUG
10080 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
10081 #endif
10082 return false;
10083 }
10084 }
10085 else
10086 {
10087 if (that == NULL)
10088 {
10089 #ifndef NDEBUG
10090 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
10091 #endif
10092 return false;
10093 }
10094 else
10095 {
10096 if (this->numberOfOtherOptions != that->numberOfOtherOptions)
10097 {
10098 #ifndef NDEBUG
10099 outStr.str("");
10100 outStr.clear();
10101 outStr << "numberOfOtherOptions: " << this->numberOfOtherOptions << " vs. " << that->numberOfOtherOptions << endl;
10102 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
10103 #endif
10104 return false;
10105 }
10106 int i;
10107 for (i = 0; i < this->numberOfOtherOptions; i++)
10108 if (!this->other[i]->IsEqual(that->other[i]))
10109 return false;
10110 return true;
10111 }
10112 }
10113 }
10114
10115
10116 bool OtherOption::IsEqual(OtherOption *that)
10117 {
10118 std::ostringstream outStr;
10119
10120 #ifndef NDEBUG
10121 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in OSOption");
10122 #endif
10123 if (this == NULL)
10124 {
10125 if (that == NULL)
10126 return true;
10127 else
10128 {
10129 #ifndef NDEBUG
10130 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
10131 #endif
10132 return false;
10133 }
10134 }
10135 else
10136 {
10137 if (that == NULL)
10138 {
10139 #ifndef NDEBUG
10140 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
10141 #endif
10142 return false;
10143 }
10144 else
10145 {
10146 if ((this->name != that->name) ||
10147 (this->value != that->value) ||
10148 (this->description != that->description) )
10149 {
10150 #ifndef NDEBUG
10151 outStr.str("");
10152 outStr.clear();
10153 outStr << "name: " << this->name << " vs. " << that->name << endl;
10154 outStr << "value: " << this->value << " vs. " << that->value << endl;
10155 outStr << "description: " << this->description << " vs. " << that->description << endl;
10156 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
10157 #endif
10158 return false;
10159 }
10160 return true;
10161 }
10162 }
10163 }
10164
10165 bool MinDiskSpace::IsEqual(MinDiskSpace *that)
10166 {
10167 std::ostringstream outStr;
10168
10169 #ifndef NDEBUG
10170 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in OSOption");
10171 #endif
10172 if (this == NULL)
10173 {
10174 if (that == NULL)
10175 return true;
10176 else
10177 {
10178 #ifndef NDEBUG
10179 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
10180 #endif
10181 return false;
10182 }
10183 }
10184 else
10185 {
10186 if (that == NULL)
10187 {
10188 #ifndef NDEBUG
10189 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
10190 #endif
10191 return false;
10192 }
10193 else
10194 {
10195 if ((this->unit != that->unit) ||
10196 !isEqual(this->value, that->value) ||
10197 (this->description != that->description) )
10198 {
10199 #ifndef NDEBUG
10200 outStr.str("");
10201 outStr.clear();
10202 outStr << "unit: " << this->unit << " vs. " << that->unit << endl;
10203 outStr << "value: " << this->value << " vs. " << that->value << endl;
10204 outStr << "description: " << this->description << " vs. " << that->description << endl;
10205 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
10206 #endif
10207 return false;
10208 }
10209 return true;
10210 }
10211 }
10212 }
10213
10214 bool MinMemorySize::IsEqual(MinMemorySize *that)
10215 {
10216 std::ostringstream outStr;
10217
10218 #ifndef NDEBUG
10219 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in OSOption");
10220 #endif
10221 if (this == NULL)
10222 {
10223 if (that == NULL)
10224 return true;
10225 else
10226 {
10227 #ifndef NDEBUG
10228 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
10229 #endif
10230 return false;
10231 }
10232 }
10233 else
10234 {
10235 if (that == NULL)
10236 {
10237 #ifndef NDEBUG
10238 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
10239 #endif
10240 return false;
10241 }
10242 else
10243 {
10244 if ((this->unit != that->unit) ||
10245 !isEqual(this->value, that->value) ||
10246 (this->description != that->description) )
10247 {
10248 #ifndef NDEBUG
10249 outStr.str("");
10250 outStr.clear();
10251 outStr << "unit: " << this->unit << " vs. " << that->unit << endl;
10252 outStr << "value: " << this->value << " vs. " << that->value << endl;
10253 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
10254 #endif
10255 return false;
10256 }
10257 return true;
10258 }
10259 }
10260 }
10261
10262 bool MinCPUSpeed::IsEqual(MinCPUSpeed *that)
10263 {
10264 std::ostringstream outStr;
10265
10266 #ifndef NDEBUG
10267 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in OSOption");
10268 #endif
10269 if (this == NULL)
10270 {
10271 if (that == NULL)
10272 return true;
10273 else
10274 {
10275 #ifndef NDEBUG
10276 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
10277 #endif
10278 return false;
10279 }
10280 }
10281 else
10282 {
10283 if (that == NULL)
10284 {
10285 #ifndef NDEBUG
10286 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
10287 #endif
10288 return false;
10289 }
10290 else
10291 {
10292 if ((this->unit != that->unit) ||
10293 !isEqual(this->value, that->value) ||
10294 (this->description != that->description) )
10295 {
10296 #ifndef NDEBUG
10297 outStr.str("");
10298 outStr.clear();
10299 outStr << "unit: " << this->unit << " vs. " << that->unit << endl;
10300 outStr << "value: " << this->value << " vs. " << that->value << endl;
10301 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
10302 #endif
10303 return false;
10304 }
10305 return true;
10306 }
10307 }
10308 }
10309
10310 bool MinCPUNumber::IsEqual(MinCPUNumber *that)
10311 {
10312 std::ostringstream outStr;
10313
10314 #ifndef NDEBUG
10315 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in OSOption");
10316 #endif
10317 if (this == NULL)
10318 {
10319 if (that == NULL)
10320 return true;
10321 else
10322 {
10323 #ifndef NDEBUG
10324 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
10325 #endif
10326 return false;
10327 }
10328 }
10329 else
10330 {
10331 if (that == NULL)
10332 {
10333 #ifndef NDEBUG
10334 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
10335 #endif
10336 return false;
10337 }
10338 else
10339 {
10340 if ((this->description != that->description) ||
10341 (this->value != that->value) )
10342 {
10343 #ifndef NDEBUG
10344 outStr.str("");
10345 outStr.clear();
10346 outStr << "description: " << this->description << " vs. " << that->description << endl;
10347 outStr << "value: " << this->value << " vs. " << that->value << endl;
10348 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
10349 #endif
10350 return false;
10351 }
10352 return true;
10353 }
10354 }
10355 }
10356
10357 bool JobDependencies::IsEqual(JobDependencies *that)
10358 {
10359 std::ostringstream outStr;
10360
10361 #ifndef NDEBUG
10362 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in OSOption");
10363 #endif
10364 if (this == NULL)
10365 {
10366 if (that == NULL)
10367 return true;
10368 else
10369 {
10370 #ifndef NDEBUG
10371 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
10372 #endif
10373 return false;
10374 }
10375 }
10376 else
10377 {
10378 if (that == NULL)
10379 {
10380 #ifndef NDEBUG
10381 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
10382 #endif
10383 return false;
10384 }
10385 else
10386 {
10387 if (this->numberOfJobIDs != that->numberOfJobIDs)
10388 {
10389 #ifndef NDEBUG
10390 outStr.str("");
10391 outStr.clear();
10392 outStr << "numberOfJobIDs: " << this->numberOfJobIDs << " vs. " << that->numberOfJobIDs << endl;
10393 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
10394 #endif
10395 return false;
10396 }
10397 int i;
10398 for (i = 0; i < numberOfJobIDs; i++)
10399 if (this->jobID[i] != that->jobID[i])
10400 {
10401 #ifndef NDEBUG
10402 outStr.str("");
10403 outStr.clear();
10404 outStr << "jobID[" << i << "]: " << this->jobID[i] << " vs. " << that->jobID[i] << endl;
10405 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
10406 #endif
10407 return false;
10408 }
10409 return true;
10410 }
10411 }
10412 }
10413
10414 bool DirectoriesAndFiles::IsEqual(DirectoriesAndFiles *that)
10415 {
10416 std::ostringstream outStr;
10417
10418 #ifndef NDEBUG
10419 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in OSOption");
10420 #endif
10421 if (this == NULL)
10422 {
10423 if (that == NULL)
10424 return true;
10425 else
10426 {
10427 #ifndef NDEBUG
10428 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
10429 #endif
10430 return false;
10431 }
10432 }
10433 else
10434 {
10435 if (that == NULL)
10436 {
10437 #ifndef NDEBUG
10438 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
10439 #endif
10440 return false;
10441 }
10442 else
10443 {
10444 if (this->numberOfPaths != that->numberOfPaths)
10445 {
10446 #ifndef NDEBUG
10447 outStr.str("");
10448 outStr.clear();
10449 outStr << "numberOfPaths: " << this->numberOfPaths << " vs. " << that->numberOfPaths << endl;
10450 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
10451 #endif
10452 return false;
10453 }
10454 int i;
10455 for (i = 0; i < numberOfPaths; i++)
10456 if (this->path[i] != that->path[i])
10457 {
10458 #ifndef NDEBUG
10459 outStr.str("");
10460 outStr.clear();
10461 outStr << "path[" << i << "]: \'" << this->path[i] << "\' vs. \'" << that->path[i] << "\'" << endl;
10462 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
10463 #endif
10464 return false;
10465 }
10466 return true;
10467 }
10468 }
10469 }
10470
10471 bool PathPairs::IsEqual(PathPairs *that)
10472 {
10473 std::ostringstream outStr;
10474
10475 #ifndef NDEBUG
10476 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in OSOption");
10477 #endif
10478 if (this == NULL)
10479 {
10480 if (that == NULL)
10481 return true;
10482 else
10483 {
10484 #ifndef NDEBUG
10485 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
10486 #endif
10487 return false;
10488 }
10489 }
10490 else
10491 {
10492 if (that == NULL)
10493 {
10494 #ifndef NDEBUG
10495 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
10496 #endif
10497 return false;
10498 }
10499 else
10500 {
10501 if (this->numberOfPathPairs != that->numberOfPathPairs)
10502 {
10503 #ifndef NDEBUG
10504 outStr.str("");
10505 outStr.clear();
10506 outStr << "numberOfPathPairs: " << this->numberOfPathPairs << " vs. " << that->numberOfPathPairs << endl;
10507 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
10508 #endif
10509 return false;
10510 }
10511 int i;
10512 for (i = 0; i < numberOfPathPairs; i++)
10513 if (!this->pathPair[i]->IsEqual(that->pathPair[i]))
10514 return false;
10515 return true;
10516 }
10517 }
10518 }
10519
10520
10521 bool PathPair::IsEqual(PathPair *that)
10522 {
10523 std::ostringstream outStr;
10524
10525 #ifndef NDEBUG
10526 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in OSOption");
10527 #endif
10528 if (this == NULL)
10529 {
10530 if (that == NULL)
10531 return true;
10532
10533 else
10534 {
10535 #ifndef NDEBUG
10536 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
10537 #endif
10538 return false;
10539 }
10540 }
10541 else
10542 {
10543 if (that == NULL)
10544 {
10545 #ifndef NDEBUG
10546 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
10547 #endif
10548 return false;
10549 }
10550 else
10551 {
10552 if ((this->from != that->from) || (this->to != that->to) ||
10553 (this->makeCopy != that->makeCopy))
10554 {
10555 #ifndef NDEBUG
10556 outStr.str("");
10557 outStr.clear();
10558 outStr << "from: " << this->from << " vs. " << that->from << endl;
10559 outStr << "to: " << this->to << " vs. " << that->to << endl;
10560 outStr << "makeCopy: " << this->makeCopy << " vs. " << that->makeCopy << endl;
10561 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
10562 #endif
10563 return false;
10564 }
10565 return true;
10566 }
10567 }
10568 }
10569
10570 bool Processes::IsEqual(Processes *that)
10571 {
10572 std::ostringstream outStr;
10573
10574 #ifndef NDEBUG
10575 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in OSOption");
10576 #endif
10577 if (this == NULL)
10578 {
10579 if (that == NULL)
10580 return true;
10581 else
10582 {
10583 #ifndef NDEBUG
10584 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
10585 #endif
10586 return false;
10587 }
10588 }
10589 else
10590 {
10591 if (that == NULL)
10592 {
10593 #ifndef NDEBUG
10594 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
10595 #endif
10596 return false;
10597 }
10598 else
10599 {
10600 if (this->numberOfProcesses != that->numberOfProcesses)
10601 {
10602 #ifndef NDEBUG
10603 outStr.str("");
10604 outStr.clear();
10605 outStr << "numberOfProcesses: " << this->numberOfProcesses << " vs. " << that->numberOfProcesses << endl;
10606 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
10607 #endif
10608 return false;
10609 }
10610 int i;
10611 for (i = 0; i < numberOfProcesses; i++)
10612 if (this->process[i] != that->process[i])
10613 {
10614 #ifndef NDEBUG
10615 outStr.str("");
10616 outStr.clear();
10617 outStr << "process[" << i << "]: " << this->process[i] << " vs. " << that->process[i] << endl;
10618 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
10619 #endif
10620 return false;
10621 }
10622 return true;
10623 }
10624 }
10625 }
10626
10627
10628 bool VariableOption::IsEqual(VariableOption *that)
10629 {
10630 std::ostringstream outStr;
10631
10632 #ifndef NDEBUG
10633 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in OSOption");
10634 #endif
10635 if (this == NULL)
10636 {
10637 if (that == NULL)
10638 return true;
10639 else
10640 {
10641 #ifndef NDEBUG
10642 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
10643 #endif
10644 return false;
10645 }
10646 }
10647 else
10648 {
10649 if (that == NULL)
10650 {
10651 #ifndef NDEBUG
10652 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
10653 #endif
10654 return false;
10655 }
10656 else
10657 {
10658 if (!this->initialVariableValues->IsEqual(that->initialVariableValues))
10659 return false;
10660 if (!this->initialVariableValuesString->IsEqual(that->initialVariableValuesString))
10661 return false;
10662 if (!this->initialBasisStatus->IsEqual(that->initialBasisStatus))
10663 return false;
10664 if (!this->integerVariableBranchingWeights->IsEqual(that->integerVariableBranchingWeights))
10665 return false;
10666 if (!this->sosVariableBranchingWeights->IsEqual(that->sosVariableBranchingWeights))
10667 return false;
10668
10669 if (this->numberOfOtherVariableOptions != that->numberOfOtherVariableOptions)
10670 {
10671 #ifndef NDEBUG
10672 outStr.str("");
10673 outStr.clear();
10674 outStr << "numberOfOtherVariableOptions: " << this->numberOfOtherVariableOptions << " vs. " << that->numberOfOtherVariableOptions << endl;
10675 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
10676 #endif
10677 return false;
10678 }
10679
10680 int i;
10681 for (i = 0; i < numberOfOtherVariableOptions; i++)
10682 if (!this->other[i]->IsEqual(that->other[i]))
10683 {
10684 #ifndef NDEBUG
10685 outStr.str("");
10686 outStr.clear();
10687 outStr << "other[" << i << "]: " << this->other[i] << " vs. " << that->other[i] << endl;
10688 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
10689 #endif
10690 return false;
10691 }
10692
10693 return true;
10694 }
10695 }
10696 }
10697
10698 bool InitVariableValues::IsEqual(InitVariableValues *that)
10699 {
10700 std::ostringstream outStr;
10701
10702 #ifndef NDEBUG
10703 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in OSOption");
10704 #endif
10705 if (this == NULL)
10706 {
10707 if (that == NULL)
10708 return true;
10709 else
10710 {
10711 #ifndef NDEBUG
10712 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
10713 #endif
10714 return false;
10715 }
10716 }
10717 else
10718 {
10719 if (that == NULL)
10720 {
10721 #ifndef NDEBUG
10722 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
10723 #endif
10724 return false;
10725 }
10726 else
10727 {
10728 if (this->numberOfVar != that->numberOfVar)
10729 {
10730 #ifndef NDEBUG
10731 outStr.str("");
10732 outStr.clear();
10733 outStr << "numberOfVar: " << this->numberOfVar << " vs. " << that->numberOfVar << endl;
10734 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
10735 #endif
10736 return false;
10737 }
10738 int i;
10739 for (i = 0; i < numberOfVar; i++)
10740 if (!this->var[i]->IsEqual(that->var[i]))
10741 return false;
10742 return true;
10743 }
10744 }
10745 }
10746
10747 bool InitVarValue::IsEqual(InitVarValue *that)
10748 {
10749 std::ostringstream outStr;
10750
10751 #ifndef NDEBUG
10752 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in OSOption");
10753 #endif
10754 if (this == NULL)
10755 {
10756 if (that == NULL)
10757 return true;
10758 else
10759 {
10760 #ifndef NDEBUG
10761 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
10762 #endif
10763 return false;
10764 }
10765 }
10766 else
10767 {
10768 if (that == NULL)
10769 {
10770 #ifndef NDEBUG
10771 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
10772 #endif
10773 return false;
10774 }
10775 else
10776 {
10777 if ((this->idx != that->idx) || this->name != that->name || !isEqual(this->value, that->value))
10778
10779 {
10780 #ifndef NDEBUG
10781 outStr.str("");
10782 outStr.clear();
10783 outStr << "idx: " << this->idx << " vs. " << that->idx << endl;
10784 outStr << "value: " << this->value << " vs. " << that->value << endl;
10785 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
10786 #endif
10787 return false;
10788 }
10789 return true;
10790 }
10791 }
10792 }
10793
10794
10795 bool InitVariableValuesString::IsEqual(InitVariableValuesString *that)
10796 {
10797 std::ostringstream outStr;
10798
10799 #ifndef NDEBUG
10800 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in OSOption");
10801 #endif
10802 if (this == NULL)
10803 {
10804 if (that == NULL)
10805 return true;
10806 else
10807 {
10808 #ifndef NDEBUG
10809 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
10810 #endif
10811 return false;
10812 }
10813 }
10814 else
10815 {
10816 if (that == NULL)
10817 {
10818 #ifndef NDEBUG
10819 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
10820 #endif
10821 return false;
10822 }
10823 else
10824 {
10825 if (this->numberOfVar != that->numberOfVar)
10826 {
10827 #ifndef NDEBUG
10828 outStr.str("");
10829 outStr.clear();
10830 outStr << "numberOfVar: " << this->numberOfVar << " vs. " << that->numberOfVar << endl;
10831 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
10832 #endif
10833 return false;
10834 }
10835 int i;
10836 for (i = 0; i < numberOfVar; i++)
10837 if (!this->var[i]->IsEqual(that->var[i]))
10838 return false;
10839 return true;
10840 }
10841 }
10842 }
10843
10844 bool InitVarValueString::IsEqual(InitVarValueString *that)
10845 {
10846 std::ostringstream outStr;
10847
10848 #ifndef NDEBUG
10849 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in OSOption");
10850 #endif
10851 if (this == NULL)
10852 {
10853 if (that == NULL)
10854 return true;
10855 else
10856 {
10857 #ifndef NDEBUG
10858 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
10859 #endif
10860 return false;
10861 }
10862 }
10863 else
10864 {
10865 if (that == NULL)
10866 {
10867 #ifndef NDEBUG
10868 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
10869 #endif
10870 return false;
10871 }
10872 else
10873 {
10874 if ((this->idx != that->idx) || this->name != that->name || (this->value != that->value))
10875 {
10876 #ifndef NDEBUG
10877 outStr.str("");
10878 outStr.clear();
10879 outStr << "idx: " << this->idx << " vs. " << that->idx << endl;
10880 outStr << "value: " << this->value << " vs. " << that->value << endl;
10881 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
10882 #endif
10883 return false;
10884 }
10885 return true;
10886 }
10887 }
10888 }
10889
10890 bool InitialBasisStatus::IsEqual(InitialBasisStatus *that)
10891 {
10892 std::ostringstream outStr;
10893
10894 #ifndef NDEBUG
10895 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in OSOption");
10896 #endif
10897 if (this == NULL)
10898 {
10899 if (that == NULL)
10900 return true;
10901 else
10902 {
10903 #ifndef NDEBUG
10904 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
10905 #endif
10906 return false;
10907 }
10908 }
10909 else
10910 {
10911 if (that == NULL)
10912 {
10913 #ifndef NDEBUG
10914 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
10915 #endif
10916 return false;
10917 }
10918 else
10919 {
10920 if (this->numberOfVar != that->numberOfVar)
10921 {
10922 #ifndef NDEBUG
10923 outStr.str("");
10924 outStr.clear();
10925 outStr << "numberOfVar: " << this->numberOfVar << " vs. " << that->numberOfVar << endl;
10926 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
10927 #endif
10928 return false;
10929 }
10930 int i;
10931 for (i = 0; i < numberOfVar; i++)
10932 if (!this->var[i]->IsEqual(that->var[i]))
10933 return false;
10934 return true;
10935 }
10936 }
10937 }
10938
10939 bool InitBasStatus::IsEqual(InitBasStatus *that)
10940 {
10941 std::ostringstream outStr;
10942
10943 #ifndef NDEBUG
10944 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in OSOption");
10945 #endif
10946 if (this == NULL)
10947 {
10948 if (that == NULL)
10949 return true;
10950 else
10951 {
10952 #ifndef NDEBUG
10953 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
10954 #endif
10955 return false;
10956 }
10957 }
10958 else
10959 {
10960 if (that == NULL)
10961 {
10962 #ifndef NDEBUG
10963 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
10964 #endif
10965 return false;
10966 }
10967 else
10968 {
10969 if ((this->idx != that->idx) || (this->value != that->value))
10970 if ((this->value != "unknown" && that->value != "") ||
10971 (that->value != "unknown" && this->value != "") )
10972 {
10973 #ifndef NDEBUG
10974 outStr.str("");
10975 outStr.clear();
10976 outStr << "idx: " << this->idx << " vs. " << that->idx << endl;
10977 outStr << "value: " << this->value << " vs. " << that->value << endl;
10978 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
10979 #endif
10980 return false;
10981 }
10982 return true;
10983 }
10984 }
10985 }
10986
10987
10988 bool IntegerVariableBranchingWeights::IsEqual(IntegerVariableBranchingWeights *that)
10989 {
10990 std::ostringstream outStr;
10991
10992 #ifndef NDEBUG
10993 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in OSOption");
10994 #endif
10995 if (this == NULL)
10996 {
10997 if (that == NULL)
10998 return true;
10999 else
11000 {
11001 #ifndef NDEBUG
11002 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
11003 #endif
11004 return false;
11005 }
11006 }
11007 else
11008 {
11009 if (that == NULL)
11010 {
11011 #ifndef NDEBUG
11012 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
11013 #endif
11014 return false;
11015 }
11016 else
11017 {
11018 if (this->numberOfVar != that->numberOfVar)
11019 {
11020 #ifndef NDEBUG
11021 outStr.str("");
11022 outStr.clear();
11023 outStr << "numberOfVar: " << this->numberOfVar << " vs. " << that->numberOfVar << endl;
11024 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
11025 #endif
11026 return false;
11027 }
11028 int i;
11029 for (i = 0; i < numberOfVar; i++)
11030 if (!this->var[i]->IsEqual(that->var[i]))
11031 return false;
11032 return true;
11033 }
11034 }
11035 }
11036
11037 bool SOSVariableBranchingWeights::IsEqual(SOSVariableBranchingWeights *that)
11038 {
11039 std::ostringstream outStr;
11040
11041 #ifndef NDEBUG
11042 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in OSOption");
11043 #endif
11044 if (this == NULL)
11045 {
11046 if (that == NULL)
11047 return true;
11048 else
11049 {
11050 #ifndef NDEBUG
11051 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
11052 #endif
11053 return false;
11054 }
11055 }
11056 else
11057 {
11058 if (that == NULL)
11059 {
11060 #ifndef NDEBUG
11061 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
11062 #endif
11063 return false;
11064 }
11065 else
11066 {
11067 if (this->numberOfSOS != that->numberOfSOS)
11068 {
11069 #ifndef NDEBUG
11070 outStr.str("");
11071 outStr.clear();
11072 outStr << "numberOfSOS: " << this->numberOfSOS << " vs. " << that->numberOfSOS << endl;
11073 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
11074 #endif
11075 return false;
11076 }
11077 int i;
11078 for (i = 0; i < numberOfSOS; i++)
11079 {
11080 if (!this->sos[i]->IsEqual(that->sos[i]))
11081 return false;
11082 }
11083 return true;
11084 }
11085 }
11086 }
11087
11088
11089 bool SOSWeights::IsEqual(SOSWeights *that)
11090 {
11091 std::ostringstream outStr;
11092
11093 #ifndef NDEBUG
11094 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in OSOption");
11095 #endif
11096 if (this == NULL)
11097 {
11098 if (that == NULL)
11099 return true;
11100 else
11101 {
11102 #ifndef NDEBUG
11103 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
11104 #endif
11105 return false;
11106 }
11107 }
11108 else
11109 {
11110 if (that == NULL)
11111 {
11112 #ifndef NDEBUG
11113 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
11114 #endif
11115 return false;
11116 }
11117 else
11118 {
11119 if ((this->sosIdx != that->sosIdx) ||
11120 !isEqual(this->groupWeight, that->groupWeight))
11121 {
11122 #ifndef NDEBUG
11123 outStr.str("");
11124 outStr.clear();
11125 outStr << "sosIdx: " << this->sosIdx << " vs. " << that->sosIdx << endl;
11126 outStr << "groupWeight: " << this->groupWeight << " vs. " << that->groupWeight << endl;
11127 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
11128 #endif
11129 return false;
11130 }
11131
11132 if (this->numberOfVar != that->numberOfVar)
11133 {
11134 #ifndef NDEBUG
11135 outStr.str("");
11136 outStr.clear();
11137 outStr << "numberOfVar: " << this->numberOfVar << " vs. " << that->numberOfVar << endl;
11138 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
11139 #endif
11140 return false;
11141 }
11142 int i;
11143 for (i = 0; i < numberOfVar; i++)
11144 {
11145
11146 if (!this->var[i]->IsEqual(that->var[i]))
11147 return false;
11148 }
11149 return true;
11150 }
11151 }
11152 }
11153
11154
11155 bool BranchingWeight::IsEqual(BranchingWeight *that)
11156 {
11157 std::ostringstream outStr;
11158
11159 #ifndef NDEBUG
11160 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in OSOption");
11161 #endif
11162 if (this == NULL)
11163 {
11164 if (that == NULL)
11165 return true;
11166 else
11167 {
11168 #ifndef NDEBUG
11169 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
11170 #endif
11171 return false;
11172 }
11173 }
11174 else
11175 {
11176 if (that == NULL)
11177 {
11178 #ifndef NDEBUG
11179 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
11180 #endif
11181 return false;
11182 }
11183 else
11184 {
11185 if ((this->idx != that->idx) || this->name != that->name || !isEqual(this->value, that->value))
11186 {
11187 #ifndef NDEBUG
11188 outStr.str("");
11189 outStr.clear();
11190 outStr << "idx: " << this->idx << " vs. " << that->idx << endl;
11191 outStr << "value: " << this->value << " vs. " << that->value << endl;
11192 outStr << "name: -" << this->name << "- vs. -" << that->name << "-" << endl;
11193 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
11194 #endif
11195 return false;
11196 }
11197 return true;
11198 }
11199 }
11200 }
11201
11202 bool OtherVariableOption::IsEqual(OtherVariableOption *that)
11203 {
11204 std::ostringstream outStr;
11205
11206 #ifndef NDEBUG
11207 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in OSOption");
11208 #endif
11209 if (this == NULL)
11210 {
11211 if (that == NULL)
11212 return true;
11213 else
11214 {
11215 #ifndef NDEBUG
11216 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
11217 #endif
11218 return false;
11219 }
11220 }
11221 else
11222 {
11223 if (that == NULL)
11224 {
11225 #ifndef NDEBUG
11226 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
11227 #endif
11228 return false;
11229 }
11230 else
11231 {
11232 if ((this->name != that->name) ||
11233 (this->value != that->value) ||
11234 (this->solver != that->solver) ||
11235 (this->category != that->category) ||
11236 (this->type != that->type) ||
11237 (this->description != that->description))
11238 {
11239 #ifndef NDEBUG
11240 outStr.str("");
11241 outStr.clear();
11242 outStr << "name: " << this->name << " vs. " << that->name << endl;
11243 outStr << "value: " << this->value << " vs. " << that->value << endl;
11244 outStr << "solver: " << this->solver << " vs. " << that->solver << endl;
11245 outStr << "category: " << this->category << " vs. " << that->category << endl;
11246 outStr << "type: " << this->type << " vs. " << that->type << endl;
11247 outStr << "description: " << this->description << " vs. " << that->description << endl;
11248 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
11249 #endif
11250 return false;
11251 }
11252
11253 if (this->numberOfVar != that->numberOfVar)
11254 {
11255 #ifndef NDEBUG
11256 outStr.str("");
11257 outStr.clear();
11258 outStr << "numberOfVar: " << this->numberOfVar << " vs. " << that->numberOfVar << endl;
11259 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
11260 #endif
11261 return false;
11262 }
11263 int i;
11264 for (i = 0; i < numberOfVar; i++)
11265 if (!this->var[i]->IsEqual(that->var[i]))
11266 return false;
11267
11268 if (this->numberOfEnumerations != that->numberOfEnumerations)
11269 {
11270 #ifndef NDEBUG
11271 outStr.str("");
11272 outStr.clear();
11273 outStr << "numberOfEnumerations: " << this->numberOfEnumerations << " vs. " << that->numberOfEnumerations << endl;
11274 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
11275 #endif
11276 return false;
11277 }
11278 for (i = 0; i < numberOfEnumerations; i++)
11279 if (!this->enumeration[i]->IsEqual(that->enumeration[i]))
11280 return false;
11281 return true;
11282 }
11283 }
11284 }
11285
11286 bool OtherVarOption::IsEqual(OtherVarOption *that)
11287 {
11288 std::ostringstream outStr;
11289
11290 #ifndef NDEBUG
11291 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in OSOption");
11292 #endif
11293 if (this == NULL)
11294 {
11295 if (that == NULL)
11296 return true;
11297 else
11298 {
11299 #ifndef NDEBUG
11300 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
11301 #endif
11302 return false;
11303 }
11304 }
11305 else
11306 {
11307 if (that == NULL)
11308 {
11309 #ifndef NDEBUG
11310 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
11311 #endif
11312 return false;
11313 }
11314 else
11315 {
11316 if ((this->idx != that->idx) || this->name != that->name || (this->value != that->value) ||
11317 (this->lbValue != that->lbValue) || (this->ubValue != that->ubValue))
11318 {
11319 #ifndef NDEBUG
11320 outStr.str("");
11321 outStr.clear();
11322 outStr << "idx: " << this->idx << " vs. " << that->idx << endl;
11323 outStr << "value: " << this->value << " vs. " << that->value << endl;
11324 outStr << "lbValue: " << this->lbValue << " vs. " << that->lbValue << endl;
11325 outStr << "ubValue: " << this->ubValue << " vs. " << that->ubValue << endl;
11326 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
11327 #endif
11328 return false;
11329 }
11330 return true;
11331 }
11332 }
11333 }
11334
11335 bool ObjectiveOption::IsEqual(ObjectiveOption *that)
11336 {
11337 std::ostringstream outStr;
11338
11339 #ifndef NDEBUG
11340 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in OSOption");
11341 #endif
11342 if (this == NULL)
11343 {
11344 if (that == NULL)
11345 return true;
11346 else
11347 {
11348 #ifndef NDEBUG
11349 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
11350 #endif
11351 return false;
11352 }
11353 }
11354 else
11355 {
11356 if (that == NULL)
11357 {
11358 #ifndef NDEBUG
11359 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
11360 #endif
11361 return false;
11362 }
11363 else
11364 {
11365 if (!this->initialObjectiveValues->IsEqual(that->initialObjectiveValues))
11366 return false;
11367 if (!this->initialObjectiveBounds->IsEqual(that->initialObjectiveBounds))
11368 return false;
11369 if (!this->initialBasisStatus->IsEqual(that->initialBasisStatus))
11370 return false;
11371
11372 if (this->numberOfOtherObjectiveOptions != that->numberOfOtherObjectiveOptions)
11373 {
11374 #ifndef NDEBUG
11375 outStr.str("");
11376 outStr.clear();
11377 outStr << "numberOfOtherObjectiveOptions: " << this->numberOfOtherObjectiveOptions << " vs. " << that->numberOfOtherObjectiveOptions << endl;
11378 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
11379 #endif
11380 return false;
11381 }
11382 int i;
11383 for (i = 0; i < numberOfOtherObjectiveOptions; i++)
11384 if (!this->other[i]->IsEqual(that->other[i]))
11385 return false;
11386
11387 return true;
11388 }
11389 }
11390 }
11391
11392 bool InitObjectiveValues::IsEqual(InitObjectiveValues *that)
11393 {
11394 std::ostringstream outStr;
11395
11396 #ifndef NDEBUG
11397 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in OSOption");
11398 #endif
11399 if (this == NULL)
11400 {
11401 if (that == NULL)
11402 return true;
11403 else
11404 {
11405 #ifndef NDEBUG
11406 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
11407 #endif
11408 return false;
11409 }
11410 }
11411 else
11412 {
11413 if (that == NULL)
11414 {
11415 #ifndef NDEBUG
11416 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
11417 #endif
11418 return false;
11419 }
11420 else
11421 {
11422 if (this->numberOfObj != that->numberOfObj)
11423 {
11424 #ifndef NDEBUG
11425 outStr.str("");
11426 outStr.clear();
11427 outStr << "numberOfObj: " << this->numberOfObj << " vs. " << that->numberOfObj << endl;
11428 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
11429 #endif
11430 return false;
11431 }
11432 int i;
11433 for (i = 0; i < numberOfObj; i++)
11434 if (!this->obj[i]->IsEqual(that->obj[i]))
11435 return false;
11436 return true;
11437 }
11438 }
11439 }
11440
11441 bool InitObjValue::IsEqual(InitObjValue *that)
11442 {
11443 std::ostringstream outStr;
11444
11445 #ifndef NDEBUG
11446 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in OSOption");
11447 #endif
11448 if (this == NULL)
11449 {
11450 if (that == NULL)
11451 return true;
11452 else
11453 {
11454 #ifndef NDEBUG
11455 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
11456 #endif
11457 return false;
11458 }
11459 }
11460 else
11461 {
11462 if (that == NULL)
11463 {
11464 #ifndef NDEBUG
11465 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
11466 #endif
11467 return false;
11468 }
11469 else
11470 {
11471 if ((this->idx != that->idx) || this->name != that->name || !isEqual(this->value, that->value))
11472 {
11473 #ifndef NDEBUG
11474 outStr.str("");
11475 outStr.clear();
11476 outStr << "idx: " << this->idx << " vs. " << that->idx << endl;
11477 outStr << "value: " << this->value << " vs. " << that->value << endl;
11478 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
11479 #endif
11480 return false;
11481 }
11482 return true;
11483 }
11484 }
11485 }
11486
11487 bool InitObjectiveBounds::IsEqual(InitObjectiveBounds *that)
11488 {
11489 std::ostringstream outStr;
11490
11491 #ifndef NDEBUG
11492 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in OSOption");
11493 #endif
11494 if (this == NULL)
11495 {
11496 if (that == NULL)
11497 return true;
11498 else
11499 {
11500 #ifndef NDEBUG
11501 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
11502 #endif
11503 return false;
11504 }
11505 }
11506 else
11507 {
11508 if (that == NULL)
11509 {
11510 #ifndef NDEBUG
11511 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
11512 #endif
11513 return false;
11514 }
11515 else
11516 {
11517 if (this->numberOfObj != that->numberOfObj)
11518 {
11519 #ifndef NDEBUG
11520 outStr.str("");
11521 outStr.clear();
11522 outStr << "numberOfObj: " << this->numberOfObj << " vs. " << that->numberOfObj << endl;
11523 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
11524 #endif
11525 return false;
11526 }
11527 int i;
11528 for (i = 0; i < numberOfObj; i++)
11529 if (!this->obj[i]->IsEqual(that->obj[i]))
11530 return false;
11531 return true;
11532 }
11533 }
11534 }
11535
11536 bool InitObjBound::IsEqual(InitObjBound *that)
11537 {
11538 std::ostringstream outStr;
11539
11540 #ifndef NDEBUG
11541 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in OSOption");
11542 #endif
11543 if (this == NULL)
11544 {
11545 if (that == NULL)
11546 return true;
11547 else
11548 {
11549 #ifndef NDEBUG
11550 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
11551 #endif
11552 return false;
11553 }
11554 }
11555 else
11556 {
11557 if (that == NULL)
11558 {
11559 #ifndef NDEBUG
11560 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
11561 #endif
11562 return false;
11563 }
11564 else
11565 {
11566 if ((this->idx != that->idx) ||
11567 this->name != that->name ||
11568 !isEqual(this->lbValue, that->lbValue) ||
11569 !isEqual(this->ubValue, that->ubValue) )
11570 {
11571 #ifndef NDEBUG
11572 outStr.str("");
11573 outStr.clear();
11574 outStr << "idx: " << this->idx << " vs. " << that->idx << endl;
11575 outStr << "lbValue: " << this->lbValue << " vs. " << that->lbValue << endl;
11576 outStr << "ubValue: " << this->ubValue << " vs. " << that->ubValue << endl;
11577 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
11578 #endif
11579 return false;
11580 }
11581 return true;
11582 }
11583 }
11584 }
11585
11586 bool OtherObjectiveOption::IsEqual(OtherObjectiveOption *that)
11587 {
11588 std::ostringstream outStr;
11589
11590 #ifndef NDEBUG
11591 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in OSOption");
11592 #endif
11593 if (this == NULL)
11594 {
11595 if (that == NULL)
11596 return true;
11597 else
11598 {
11599 #ifndef NDEBUG
11600 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
11601 #endif
11602 return false;
11603 }
11604 }
11605 else
11606 {
11607 if (that == NULL)
11608 {
11609 #ifndef NDEBUG
11610 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
11611 #endif
11612 return false;
11613 }
11614 else
11615 {
11616 if ((this->name != that->name) ||
11617 (this->value != that->value) ||
11618 (this->solver != that->solver) ||
11619 (this->category != that->category) ||
11620 (this->type != that->type) ||
11621 (this->description != that->description))
11622 {
11623 #ifndef NDEBUG
11624 outStr.str("");
11625 outStr.clear();
11626 outStr << "name: " << this->name << " vs. " << that->name << endl;
11627 outStr << "value: " << this->value << " vs. " << that->value << endl;
11628 outStr << "solver: " << this->solver << " vs. " << that->solver << endl;
11629 outStr << "category: " << this->category << " vs. " << that->category << endl;
11630 outStr << "type: " << this->type << " vs. " << that->type << endl;
11631 outStr << "description: " << this->description << " vs. " << that->description << endl;
11632 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
11633 #endif
11634 return false;
11635 }
11636
11637 if (this->numberOfObj != that->numberOfObj)
11638 {
11639 #ifndef NDEBUG
11640 outStr.str("");
11641 outStr.clear();
11642 outStr << "numberOfObj: " << this->numberOfObj << " vs. " << that->numberOfObj << endl;
11643 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
11644 #endif
11645 return false;
11646 }
11647 int i;
11648 for (i = 0; i < numberOfObj; i++)
11649 if (!this->obj[i]->IsEqual(that->obj[i]))
11650 return false;
11651 return true;
11652 }
11653 }
11654 }
11655
11656 bool OtherObjOption::IsEqual(OtherObjOption *that)
11657 {
11658 std::ostringstream outStr;
11659
11660 #ifndef NDEBUG
11661 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in OSOption");
11662 #endif
11663 if (this == NULL)
11664 {
11665 if (that == NULL)
11666 return true;
11667 else
11668 {
11669 #ifndef NDEBUG
11670 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
11671 #endif
11672 return false;
11673 }
11674 }
11675 else
11676 {
11677 if (that == NULL)
11678 {
11679 #ifndef NDEBUG
11680 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
11681 #endif
11682 return false;
11683 }
11684 else
11685 {
11686 if ((this->idx != that->idx) || this->name != that->name || (this->value != that->value) ||
11687 (this->lbValue != that->lbValue) || (this->ubValue != that->ubValue))
11688 {
11689 #ifndef NDEBUG
11690 outStr.str("");
11691 outStr.clear();
11692 outStr << "idx: " << this->idx << " vs. " << that->idx << endl;
11693 outStr << "value: " << this->value << " vs. " << that->value << endl;
11694 outStr << "lbValue: " << this->lbValue << " vs. " << that->lbValue << endl;
11695 outStr << "ubValue: " << this->ubValue << " vs. " << that->ubValue << endl;
11696 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
11697 #endif
11698 return false;
11699 }
11700 return true;
11701 }
11702 }
11703 }
11704
11705 bool ConstraintOption::IsEqual(ConstraintOption *that)
11706 {
11707 std::ostringstream outStr;
11708
11709 #ifndef NDEBUG
11710 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in OSOption");
11711 #endif
11712 if (this == NULL)
11713 {
11714 if (that == NULL)
11715 return true;
11716 else
11717 {
11718 #ifndef NDEBUG
11719 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
11720 #endif
11721 return false;
11722 }
11723 }
11724 else
11725 {
11726 if (that == NULL)
11727 {
11728 #ifndef NDEBUG
11729 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
11730 #endif
11731 return false;
11732 }
11733 else
11734 {
11735 if (!this->initialConstraintValues->IsEqual(that->initialConstraintValues))
11736 return false;
11737 if (!this->initialDualValues->IsEqual(that->initialDualValues))
11738 return false;
11739 if (!this->initialBasisStatus->IsEqual(that->initialBasisStatus))
11740 return false;
11741
11742 if (this->numberOfOtherConstraintOptions != that->numberOfOtherConstraintOptions)
11743 {
11744 #ifndef NDEBUG
11745 outStr.str("");
11746 outStr.clear();
11747 outStr << "numberOfOtherConstraintOptions: " << this->numberOfOtherConstraintOptions << " vs. " << that->numberOfOtherConstraintOptions << endl;
11748 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
11749 #endif
11750 return false;
11751 }
11752 int i;
11753 for (i = 0; i < numberOfOtherConstraintOptions; i++)
11754 if (!this->other[i]->IsEqual(that->other[i]))
11755 return false;
11756
11757 return true;
11758 }
11759 }
11760 }
11761
11762 bool InitConstraintValues::IsEqual(InitConstraintValues *that)
11763 {
11764 std::ostringstream outStr;
11765
11766 #ifndef NDEBUG
11767 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in OSOption");
11768 #endif
11769 if (this == NULL)
11770 {
11771 if (that == NULL)
11772 return true;
11773 else
11774 {
11775 #ifndef NDEBUG
11776 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
11777 #endif
11778 return false;
11779 }
11780 }
11781 else
11782 {
11783 if (that == NULL)
11784 {
11785 #ifndef NDEBUG
11786 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
11787 #endif
11788 return false;
11789 }
11790 else
11791 {
11792 if (this->numberOfCon != that->numberOfCon)
11793 {
11794 #ifndef NDEBUG
11795 outStr.str("");
11796 outStr.clear();
11797 outStr << "numberOfCon: " << this->numberOfCon << " vs. " << that->numberOfCon << endl;
11798 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
11799 #endif
11800 return false;
11801 }
11802 int i;
11803 for (i = 0; i < numberOfCon; i++)
11804 if (!this->con[i]->IsEqual(that->con[i]))
11805 return false;
11806 return true;
11807 }
11808 }
11809 }
11810
11811 bool InitConValue::IsEqual(InitConValue *that)
11812 {
11813 std::ostringstream outStr;
11814
11815 #ifndef NDEBUG
11816 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in OSOption");
11817 #endif
11818 if (this == NULL)
11819 {
11820 if (that == NULL)
11821 return true;
11822 else
11823 {
11824 #ifndef NDEBUG
11825 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
11826 #endif
11827 return false;
11828 }
11829 }
11830 else
11831 {
11832 if (that == NULL)
11833 {
11834 #ifndef NDEBUG
11835 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
11836 #endif
11837 return false;
11838 }
11839 else
11840 {
11841 if ((this->idx != that->idx) || this->name != that->name || !isEqual(this->value, that->value))
11842 {
11843 #ifndef NDEBUG
11844 outStr.str("");
11845 outStr.clear();
11846 outStr << "idx: " << this->idx << " vs. " << that->idx << endl;
11847 outStr << "value: " << this->value << " vs. " << that->value << endl;
11848 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
11849 #endif
11850 return false;
11851 }
11852 return true;
11853 }
11854 }
11855 }
11856
11857 bool InitDualVariableValues::IsEqual(InitDualVariableValues *that)
11858 {
11859 std::ostringstream outStr;
11860
11861 #ifndef NDEBUG
11862 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in OSOption");
11863 #endif
11864 if (this == NULL)
11865 {
11866 if (that == NULL)
11867 return true;
11868 else
11869 {
11870 #ifndef NDEBUG
11871 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
11872 #endif
11873 return false;
11874 }
11875 }
11876 else
11877 {
11878 if (that == NULL)
11879 {
11880 #ifndef NDEBUG
11881 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
11882 #endif
11883 return false;
11884 }
11885 else
11886 {
11887 if (this->numberOfCon != that->numberOfCon)
11888 {
11889 #ifndef NDEBUG
11890 outStr.str("");
11891 outStr.clear();
11892 outStr << "numberOfCon: " << this->numberOfCon << " vs. " << that->numberOfCon << endl;
11893 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
11894 #endif
11895 return false;
11896 }
11897 int i;
11898 for (i = 0; i < numberOfCon; i++)
11899 if (!this->con[i]->IsEqual(that->con[i]))
11900 return false;
11901 return true;
11902 }
11903 }
11904 }
11905
11906 bool InitDualVarValue::IsEqual(InitDualVarValue *that)
11907 {
11908 std::ostringstream outStr;
11909
11910 #ifndef NDEBUG
11911 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in OSOption");
11912 #endif
11913 if (this == NULL)
11914 {
11915 if (that == NULL)
11916 return true;
11917 else
11918 {
11919 #ifndef NDEBUG
11920 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
11921 #endif
11922 return false;
11923 }
11924 }
11925 else
11926 {
11927 if (that == NULL)
11928 {
11929 #ifndef NDEBUG
11930 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
11931 #endif
11932 return false;
11933 }
11934 else
11935 {
11936 if ((this->idx != that->idx) || this->name != that->name ||
11937 !isEqual(this->lbDualValue, that->lbDualValue) ||
11938 !isEqual(this->ubDualValue, that->ubDualValue))
11939 {
11940 #ifndef NDEBUG
11941 outStr.str("");
11942 outStr.clear();
11943 outStr << "idx: " << this->idx << " vs. " << that->idx << endl;
11944 outStr << "lbDualValue: " << this->lbDualValue << " vs. " << that->lbDualValue << endl;
11945 outStr << "ubDualValue: " << this->ubDualValue << " vs. " << that->ubDualValue << endl;
11946 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
11947 #endif
11948 return false;
11949 }
11950 return true;
11951 }
11952 }
11953 }
11954
11955 bool OtherConstraintOption::IsEqual(OtherConstraintOption *that)
11956 {
11957 std::ostringstream outStr;
11958
11959 #ifndef NDEBUG
11960 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in OSOption");
11961 #endif
11962 if (this == NULL)
11963 {
11964 if (that == NULL)
11965 return true;
11966 else
11967 {
11968 #ifndef NDEBUG
11969 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
11970 #endif
11971 return false;
11972 }
11973 }
11974 else
11975 {
11976 if (that == NULL)
11977 {
11978 #ifndef NDEBUG
11979 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
11980 #endif
11981 return false;
11982 }
11983 else
11984 {
11985 if ((this->name != that->name) ||
11986 (this->value != that->value) ||
11987 (this->solver != that->solver) ||
11988 (this->category != that->category) ||
11989 (this->type != that->type) ||
11990 (this->description != that->description))
11991 {
11992 #ifndef NDEBUG
11993 outStr.str("");
11994 outStr.clear();
11995 outStr << "name: " << this->name << " vs. " << that->name << endl;
11996 outStr << "value: " << this->value << " vs. " << that->value << endl;
11997 outStr << "solver: " << this->solver << " vs. " << that->solver << endl;
11998 outStr << "category: " << this->category << " vs. " << that->category << endl;
11999 outStr << "type: " << this->type << " vs. " << that->type << endl;
12000 outStr << "description: " << this->description << " vs. " << that->description << endl;
12001 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
12002 #endif
12003 return false;
12004 }
12005
12006 if (this->numberOfCon != that->numberOfCon)
12007 {
12008 #ifndef NDEBUG
12009 outStr.str("");
12010 outStr.clear();
12011 outStr << "numberOfCon: " << this->numberOfCon << " vs. " << that->numberOfCon << endl;
12012 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
12013 #endif
12014 return false;
12015 }
12016 int i;
12017 for (i = 0; i < numberOfCon; i++)
12018 if (!this->con[i]->IsEqual(that->con[i]))
12019 return false;
12020 return true;
12021 }
12022 }
12023 }
12024
12025 bool OtherConOption::IsEqual(OtherConOption *that)
12026 {
12027 std::ostringstream outStr;
12028
12029 #ifndef NDEBUG
12030 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in OSOption");
12031 #endif
12032 if (this == NULL)
12033 {
12034 if (that == NULL)
12035 return true;
12036 else
12037 {
12038 #ifndef NDEBUG
12039 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
12040 #endif
12041 return false;
12042 }
12043 }
12044 else
12045 {
12046 if (that == NULL)
12047 {
12048 #ifndef NDEBUG
12049 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
12050 #endif
12051 return false;
12052 }
12053
12054 else
12055 {
12056 if ((this->idx != that->idx) || this->name != that->name || (this->value != that->value) ||
12057 (this->lbValue != that->lbValue) || (this->ubValue != that->ubValue))
12058 {
12059 #ifndef NDEBUG
12060 outStr.str("");
12061 outStr.clear();
12062 outStr << "idx: " << this->idx << " vs. " << that->idx << endl;
12063 outStr << "value: " << this->value << " vs. " << that->value << endl;
12064 outStr << "lbValue: " << this->lbValue << " vs. " << that->lbValue << endl;
12065 outStr << "ubValue: " << this->ubValue << " vs. " << that->ubValue << endl;
12066 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
12067 #endif
12068 return false;
12069 }
12070 return true;
12071 }
12072 }
12073 }
12074
12075
12076 bool SolverOptions::IsEqual(SolverOptions *that)
12077 {
12078 std::ostringstream outStr;
12079
12080 #ifndef NDEBUG
12081 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in OSOption");
12082 #endif
12083 if (this == NULL)
12084 {
12085 if (that == NULL)
12086 return true;
12087 else
12088 {
12089 #ifndef NDEBUG
12090 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
12091 #endif
12092 return false;
12093 }
12094 }
12095 else
12096 {
12097 if (that == NULL)
12098 {
12099 #ifndef NDEBUG
12100 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
12101 #endif
12102 return false;
12103 }
12104 else
12105 {
12106 if (this->numberOfSolverOptions != that->numberOfSolverOptions)
12107 {
12108 #ifndef NDEBUG
12109 outStr.str("");
12110 outStr.clear();
12111 outStr << "numberOfSolverOptions: " << this->numberOfSolverOptions << " vs. " << that->numberOfSolverOptions << endl;
12112 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
12113 #endif
12114 return false;
12115 }
12116
12117 int i;
12118 for (i = 0; i < numberOfSolverOptions; i++)
12119 if (!this->solverOption[i]->IsEqual(that->solverOption[i]))
12120 return false;
12121
12122 return true;
12123 }
12124 }
12125 }
12126
12127 bool SolverOption::IsEqual(SolverOption *that )
12128 {
12129 std::ostringstream outStr;
12130
12131 #ifndef NDEBUG
12132 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in OSOption");
12133 #endif
12134 if (this == NULL)
12135 {
12136 if (that == NULL)
12137 return true;
12138 else
12139 {
12140 #ifndef NDEBUG
12141 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
12142 #endif
12143 return false;
12144 }
12145 }
12146 else
12147 {
12148 if (that == NULL)
12149 {
12150 #ifndef NDEBUG
12151 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
12152 #endif
12153 return false;
12154 }
12155 else
12156 {
12157 if ((this->name != that->name) ||
12158 (this->value != that->value) ||
12159 (this->solver != that->solver) ||
12160 (this->category != that->category) ||
12161 (this->type != that->type) ||
12162 (this->description != that->description))
12163 {
12164 #ifndef NDEBUG
12165 outStr.str("");
12166 outStr.clear();
12167 outStr << "name: " << this->name << " vs. " << that->name << endl;
12168 outStr << "value: " << this->value << " vs. " << that->value << endl;
12169 outStr << "solver: " << this->solver << " vs. " << that->solver << endl;
12170 outStr << "category: " << this->category << " vs. " << that->category << endl;
12171 outStr << "type: " << this->type << " vs. " << that->type << endl;
12172 outStr << "description: " << this->description << " vs. " << that->description << endl;
12173 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
12174 #endif
12175 return false;
12176 }
12177 return true;
12178 }
12179 }
12180 }
12181
12182
12183
12184
12185
12186
12187
12188
12189
12190
12191
12192
12193
12194
12195 bool OSOption::setRandom( double density, bool conformant )
12196 {
12197 #ifndef NDEBUG
12198 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random OSOption");
12199 #endif
12200 if (OSRand() <= density)
12201 {
12202 optionHeader = new GeneralFileHeader();
12203 optionHeader->setRandom(density, conformant);
12204 }
12205 if (OSRand() <= density)
12206 {
12207 general = new GeneralOption();
12208 general->setRandom(density, conformant);
12209 }
12210 if (OSRand() <= density)
12211 {
12212 system = new SystemOption();
12213 system->setRandom(density, conformant);
12214 }
12215 if (OSRand() <= density)
12216 {
12217 service = new ServiceOption();
12218 service->setRandom(density, conformant);
12219 }
12220 if (OSRand() <= density)
12221 {
12222 job = new JobOption();
12223 job->setRandom(density, conformant);
12224 }
12225 if (OSRand() <= density)
12226 {
12227 optimization = new OptimizationOption();
12228 optimization->setRandom(density, conformant);
12229 }
12230 return true;
12231 }
12232
12233
12234 bool GeneralOption::setRandom( double density, bool conformant )
12235 {
12236 #ifndef NDEBUG
12237 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random GeneralOption");
12238 #endif
12239 if (OSRand() <= density) this->serviceURI = "random string";
12240 if (OSRand() <= density) this->serviceName = "random string";
12241 if (OSRand() <= density) this->instanceName = "random string";
12242 if (OSRand() <= density) this->jobID = "random string";
12243 if (OSRand() <= density) this->solverToInvoke = "random string";
12244 if (OSRand() <= density) this->license = "random string";
12245 if (OSRand() <= density) this->userName = "random string";
12246 if (OSRand() <= density) this->password = "random string";
12247
12248 if (OSRand() <= density)
12249 {
12250 instanceLocation = new InstanceLocationOption();
12251 instanceLocation->setRandom(density, conformant);
12252 }
12253 if (OSRand() <= density)
12254 {
12255 contact = new ContactOption();
12256 contact->setRandom(density, conformant);
12257 }
12258 if (OSRand() <= density)
12259 {
12260 otherOptions = new OtherOptions();
12261 otherOptions->setRandom(density, conformant);
12262 }
12263 return true;
12264 }
12265
12266
12267 bool SystemOption::setRandom( double density, bool conformant )
12268 {
12269 #ifndef NDEBUG
12270 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random SystemOption");
12271 #endif
12272 if (OSRand() <= density)
12273 {
12274 minDiskSpace = new StorageCapacity();
12275 minDiskSpace->setRandom(density, conformant);
12276 }
12277 if (OSRand() <= density)
12278 {
12279 minMemorySize = new StorageCapacity();
12280 minMemorySize->setRandom(density, conformant);
12281 }
12282 if (OSRand() <= density)
12283 {
12284 minCPUSpeed = new CPUSpeed();
12285 minCPUSpeed->setRandom(density, conformant);
12286 }
12287 if (OSRand() <= density)
12288 {
12289 minCPUNumber = new CPUNumber();
12290 minCPUNumber->setRandom(density, conformant);
12291 }
12292 if (OSRand() <= density)
12293 {
12294 otherOptions = new OtherOptions();
12295 otherOptions->setRandom(density, conformant);
12296 }
12297 return true;
12298 }
12299
12300
12301 bool ServiceOption::setRandom( double density, bool conformant )
12302 {
12303 #ifndef NDEBUG
12304 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random ServiceOption");
12305 #endif
12306 if (OSRand() <= density)
12307 {
12308 double temp = OSRand();
12309 if (conformant) temp = 0.5*temp;
12310
12311 if (temp <= 0.25) this->type = "solver";
12312 else if (temp <= 0.50) this->type = "agent";
12313 else if (temp <= 0.75) this->type = "";
12314 else this->type = "spy";
12315 }
12316
12317 if (OSRand() <= density)
12318 {
12319 otherOptions = new OtherOptions();
12320 otherOptions->setRandom(density, conformant);
12321 }
12322
12323 return true;
12324 }
12325
12326
12327 bool JobOption::setRandom( double density, bool conformant )
12328 {
12329 #ifndef NDEBUG
12330 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random JobOption");
12331 #endif
12332 if (OSRand() <= density) this->requestedStartTime = "1997-08-11T01:23:45-09:13";
12333
12334 if (OSRand() <= density)
12335 {
12336 maxTime = new TimeSpan();
12337 maxTime->setRandom(density, conformant);
12338 }
12339 if (OSRand() <= density)
12340 {
12341 dependencies = new JobDependencies();
12342 dependencies->setRandom(density, conformant);
12343 }
12344 if (OSRand() <= density)
12345 {
12346 requiredDirectories = new DirectoriesAndFiles();
12347 requiredDirectories->setRandom(density, conformant);
12348 }
12349 if (OSRand() <= density)
12350 {
12351 requiredFiles = new DirectoriesAndFiles();
12352 requiredFiles->setRandom(density, conformant);
12353 }
12354 if (OSRand() <= density)
12355 {
12356 directoriesToMake = new DirectoriesAndFiles();
12357 directoriesToMake->setRandom(density, conformant);
12358 }
12359 if (OSRand() <= density)
12360 {
12361 filesToMake = new DirectoriesAndFiles();
12362 filesToMake->setRandom(density, conformant);
12363 }
12364 if (OSRand() <= density)
12365 {
12366 inputDirectoriesToMove = new PathPairs();
12367 inputDirectoriesToMove->setRandom(density, conformant);
12368 }
12369 if (OSRand() <= density)
12370 {
12371 inputFilesToMove = new PathPairs();
12372 inputFilesToMove->setRandom(density, conformant);
12373 }
12374 if (OSRand() <= density)
12375 {
12376 outputFilesToMove = new PathPairs();
12377 outputFilesToMove->setRandom(density, conformant);
12378 }
12379 if (OSRand() <= density)
12380 {
12381 outputDirectoriesToMove = new PathPairs();
12382 outputDirectoriesToMove->setRandom(density, conformant);
12383 }
12384 if (OSRand() <= density)
12385 {
12386 filesToDelete = new DirectoriesAndFiles();
12387 filesToDelete->setRandom(density, conformant);
12388 }
12389 if (OSRand() <= density)
12390 {
12391 directoriesToDelete = new DirectoriesAndFiles();
12392 directoriesToDelete->setRandom(density, conformant);
12393 }
12394 if (OSRand() <= density)
12395 {
12396 processesToKill = new Processes();
12397 processesToKill->setRandom(density, conformant);
12398 }
12399 if (OSRand() <= density)
12400 {
12401 otherOptions = new OtherOptions();
12402 otherOptions->setRandom(density, conformant);
12403 }
12404 return true;
12405 }
12406
12407 bool OptimizationOption::setRandom( double density, bool conformant )
12408 {
12409 #ifndef NDEBUG
12410 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random OptimizationOption");
12411 #endif
12412 if (OSRand() <= density && !conformant) this->numberOfVariables = (int)(1+9*OSRand());
12413 if (OSRand() <= density && !conformant) this->numberOfObjectives = (int)(1+9*OSRand());
12414 if (OSRand() <= density && !conformant) this->numberOfConstraints = (int)(1+9*OSRand());
12415
12416 if (OSRand() <= density)
12417 {
12418 variables = new VariableOption();
12419 variables->setRandom(density, conformant);
12420 }
12421 if (OSRand() <= density)
12422 {
12423 objectives = new ObjectiveOption();
12424 objectives->setRandom(density, conformant);
12425 }
12426 if (OSRand() <= density)
12427 {
12428 constraints = new ConstraintOption();
12429 constraints->setRandom(density, conformant);
12430 }
12431 if (OSRand() <= density)
12432 {
12433 solverOptions = new SolverOptions();
12434 solverOptions->setRandom(density, conformant);
12435 }
12436
12437 return true;
12438 }
12439
12440 bool InstanceLocationOption::setRandom( double density, bool conformant )
12441 {
12442 #ifndef NDEBUG
12443 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random InstanceLocationOption");
12444 #endif
12445 if (OSRand() <= density) this->value = "http://www.google.com";
12446 if (OSRand() <= density)
12447 {
12448 double temp = OSRand();
12449 if (conformant) temp = 0.5*temp;
12450
12451 if (temp <= 0.25) this->locationType = "local";
12452 else if (temp <= 0.50) this->locationType = "ftp";
12453 else if (temp <= 0.75) this->locationType = "";
12454 else this->locationType = "global";
12455 }
12456 return true;
12457 }
12458
12459 bool ContactOption::setRandom( double density, bool conformant )
12460 {
12461 #ifndef NDEBUG
12462 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random ContactOption");
12463 #endif
12464 if (OSRand() <= density) this->value = "http://www.google.com";
12465 if (OSRand() <= density)
12466 {
12467 double temp = OSRand();
12468 if (conformant) temp = 0.5*temp;
12469
12470 if (temp <= 0.25) this->transportType = "osp";
12471 else if (temp <= 0.50) this->transportType = "ftp";
12472 else if (temp <= 0.75) this->transportType = "";
12473 else this->transportType = "nlp";
12474 }
12475 return true;
12476 }
12477
12478 bool OtherOptions::setRandom( double density, bool conformant )
12479 {
12480 #ifndef NDEBUG
12481 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random OtherOptions");
12482 #endif
12483 int n;
12484
12485 this->numberOfOtherOptions = (int)(1+4*OSRand());
12486
12487 if (conformant) n = this->numberOfOtherOptions;
12488 else n = (int)(1+4*OSRand());
12489
12490 other = new OtherOption*[n];
12491
12492 for (int i = 0; i < n; i++)
12493 {
12494 other[i] = new OtherOption();
12495 other[i]->setRandom(density, conformant);
12496 }
12497
12498 return true;
12499 }
12500
12501 bool OtherOption::setRandom( double density, bool conformant )
12502 {
12503 #ifndef NDEBUG
12504 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random OtherOption");
12505 #endif
12506 if (OSRand() <= density || conformant) this->name = "random string";
12507 if (OSRand() <= density) this->value = "random string";
12508 if (OSRand() <= density) this->description = "random string";
12509 return true;
12510 }
12511
12512
12513
12514 bool JobDependencies::setRandom( double density, bool conformant )
12515 {
12516 #ifndef NDEBUG
12517 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random JobDependencies");
12518 #endif
12519 int n;
12520
12521 this->numberOfJobIDs = (int)(1+4*OSRand());
12522
12523 if (conformant) n = this->numberOfJobIDs;
12524 else n = (int)(1+4*OSRand());
12525
12526 jobID = new std::string[n];
12527 for (int i = 0; i < n; i++)
12528 jobID[i] = "random string";
12529
12530 return true;
12531 }
12532
12533 bool DirectoriesAndFiles::setRandom( double density, bool conformant )
12534 {
12535 #ifndef NDEBUG
12536 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random DirectoriesAndFiles");
12537 #endif
12538 int n;
12539
12540 this->numberOfPaths = (int)(1+4*OSRand());
12541
12542 if (conformant) n = this->numberOfPaths;
12543 else n = (int)(1+4*OSRand());
12544
12545 path = new std::string[n];
12546 for (int i = 0; i < n; i++)
12547 path[i] = "random string";
12548
12549 return true;
12550 }
12551
12552 bool PathPairs::setRandom( double density, bool conformant )
12553 {
12554 #ifndef NDEBUG
12555 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random PathPairs");
12556 #endif
12557 int n;
12558
12559 this->numberOfPathPairs = (int)(1+4*OSRand());
12560
12561 if (conformant) n = this->numberOfPathPairs;
12562 else n =(int)(1+4*OSRand());
12563
12564 pathPair = new PathPair*[n];
12565 for (int i = 0; i < n; i++)
12566 {
12567 this->pathPair[i] = new PathPair();
12568 this->pathPair[i]->setRandom(density, conformant);
12569 }
12570
12571 return true;
12572 }
12573
12574 bool PathPair::setRandom( double density, bool conformant )
12575 {
12576 #ifndef NDEBUG
12577 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random PathPair");
12578 #endif
12579 this->from = "random string";
12580 this->to = "random string";
12581 if (OSRand() <= density) this->makeCopy = (OSRand() <= 0.5);
12582 return true;
12583 }
12584
12585 bool Processes::setRandom( double density, bool conformant )
12586 {
12587 #ifndef NDEBUG
12588 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random Processes");
12589 #endif
12590 int n;
12591
12592 this->numberOfProcesses = (int)(1+4*OSRand());
12593
12594 if (conformant) n = this->numberOfProcesses;
12595 else n = (int)(1+4*OSRand());
12596
12597 process = new std::string[n];
12598 for (int i = 0; i < n; i++)
12599 process[i] = "random string";
12600
12601 return true;
12602 }
12603
12604 bool VariableOption::setRandom( double density, bool conformant )
12605 {
12606 #ifndef NDEBUG
12607 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random VariableOption");
12608 #endif
12609 if (OSRand() <= density)
12610 {
12611 this->initialVariableValues = new InitVariableValues();
12612 this->initialVariableValues->setRandom(density, conformant);
12613 }
12614 return false;
12615 if (OSRand() <= density)
12616 {
12617 this->initialVariableValuesString = new InitVariableValuesString();
12618 this->initialVariableValuesString->setRandom(density, conformant);
12619 }
12620 if (OSRand() <= density)
12621 {
12622 this->initialBasisStatus = new BasisStatus();
12623 this->initialBasisStatus->setRandom(density, conformant, 0, 9);
12624 }
12625 if (OSRand() <= density)
12626 {
12627 this->integerVariableBranchingWeights = new IntegerVariableBranchingWeights();
12628 this->integerVariableBranchingWeights->setRandom(density, conformant);
12629 }
12630 if (OSRand() <= density)
12631 {
12632 this->sosVariableBranchingWeights = new SOSVariableBranchingWeights();
12633 this->sosVariableBranchingWeights->setRandom(density, conformant);
12634 }
12635
12636
12637 this->numberOfOtherVariableOptions = (int)(4*OSRand());
12638
12639 int n;
12640
12641 if (conformant) n = this->numberOfOtherVariableOptions;
12642 else n = (int)(4*OSRand());
12643
12644 other = new OtherVariableOption*[n];
12645 for (int i = 0; i < n; i++)
12646 {
12647 other[i] = new OtherVariableOption();
12648 other[i]->setRandom(density, conformant);
12649 }
12650 return true;
12651 }
12652
12653 bool InitVariableValues::setRandom( double density, bool conformant )
12654 {
12655 #ifndef NDEBUG
12656 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random InitVariableValues");
12657 #endif
12658 this->numberOfVar = (int)(1+4*OSRand());
12659
12660 int n;
12661
12662 if (conformant) n = this->numberOfVar;
12663 else n = (int)(1+4*OSRand());
12664
12665 var = new InitVarValue*[n];
12666 for (int i = 0; i < n; i++)
12667 {
12668 var[i] = new InitVarValue();
12669 var[i]->setRandom(density, conformant);
12670 }
12671 return true;
12672 }
12673
12674 bool InitVarValue::setRandom( double density, bool conformant )
12675 {
12676 #ifndef NDEBUG
12677 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random InitVarValue");
12678 #endif
12679 this->idx = (int)(4*OSRand());
12680
12681 if (OSRand() <= density)
12682 this->name = "random string";
12683
12684 if (OSRand() <= density)
12685 {
12686 if (OSRand() <= 0.5) this->value = 3.14156;
12687 else this->value = 2.71828;
12688 }
12689 return true;
12690 }
12691
12692
12693 bool InitVariableValuesString::setRandom( double density, bool conformant )
12694 {
12695 #ifndef NDEBUG
12696 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random InitVariableValuesString");
12697 #endif
12698 this->numberOfVar = (int)(1+4*OSRand());
12699
12700 int n;
12701
12702 if (conformant) n = this->numberOfVar;
12703 else n = (int)(1+4*OSRand());
12704
12705 var = new InitVarValueString*[n];
12706 for (int i = 0; i < n; i++)
12707 {
12708 var[i] = new InitVarValueString();
12709 var[i]->setRandom(density, conformant);
12710 }
12711 return true;
12712 }
12713
12714 bool InitVarValueString::setRandom( double density, bool conformant )
12715 {
12716 #ifndef NDEBUG
12717 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random InitVarValueString");
12718 #endif
12719 this->idx = (int)(4*OSRand());
12720
12721 if (OSRand() <= density) this->name = "random string";
12722 if (OSRand() <= density) this->value = "random string";
12723
12724 return true;
12725 }
12726
12727
12728 bool IntegerVariableBranchingWeights::setRandom( double density, bool conformant )
12729 {
12730 #ifndef NDEBUG
12731 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random IntegerVariableBranchingWeights");
12732 #endif
12733 this->numberOfVar = (int)(1+4*OSRand());
12734
12735 int n;
12736
12737 if (conformant) n = this->numberOfVar;
12738 else n = (int)(1+4*OSRand());
12739
12740 var = new BranchingWeight*[n];
12741 for (int i = 0; i < n; i++)
12742 {
12743 var[i] = new BranchingWeight();
12744 var[i]->setRandom(density, conformant);
12745 }
12746 return true;
12747 }
12748
12749 bool SOSVariableBranchingWeights::setRandom( double density, bool conformant )
12750 {
12751 #ifndef NDEBUG
12752 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random SOSVariableBranchingWeights");
12753 #endif
12754 this->numberOfSOS = (int)(1+4*OSRand());
12755
12756 int n;
12757
12758 if (conformant) n = this->numberOfSOS;
12759 else n = (int)(1+4*OSRand());
12760
12761 sos = new SOSWeights*[n];
12762 for (int i = 0; i < n; i++)
12763 {
12764 sos[i] = new SOSWeights();
12765 sos[i]->setRandom(density, conformant);
12766 }
12767 return true;
12768 }
12769
12770
12771 bool SOSWeights::setRandom( double density, bool conformant )
12772 {
12773 #ifndef NDEBUG
12774 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random SOSWeights");
12775 #endif
12776 this->sosIdx = (int)(4*OSRand());
12777 this->numberOfVar = (int)(4*OSRand());
12778
12779 if (OSRand() <= density) this->groupWeight = OSRand();
12780
12781
12782 int n;
12783
12784 if (conformant) n = this->numberOfVar;
12785 else n = (int)(4*OSRand());
12786
12787 var = new BranchingWeight*[n];
12788 for (int i = 0; i < n; i++)
12789 {
12790 var[i] = new BranchingWeight();
12791 var[i]->setRandom(density, conformant);
12792 }
12793 return true;
12794 }
12795
12796
12797 bool BranchingWeight::setRandom( double density, bool conformant )
12798 {
12799 #ifndef NDEBUG
12800 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random BranchingWeight");
12801 #endif
12802 this->idx = (int)(4*OSRand());
12803
12804 if (OSRand() <= density) this->name = "random string";
12805
12806 if (OSRand() <= density)
12807 this->value = OSRand();
12808 return true;
12809 }
12810
12811 bool OtherVariableOption::setRandom( double density, bool conformant )
12812 {
12813 #ifndef NDEBUG
12814 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random OtherVariableOption");
12815 #endif
12816 this->name = "random string";
12817 if (OSRand() <= density) this->value = "random string";
12818 if (OSRand() <= density) this->solver = "random string";
12819 if (OSRand() <= density) this->category = "random string";
12820 if (OSRand() <= density) this->type = "random string";
12821 if (OSRand() <= density) this->description = "random string";
12822
12823 if (OSRand() <= density)
12824 {
12825 if (OSRand() <= 0.5)
12826 {
12827 this->numberOfVar = (int)(4*OSRand());
12828
12829 int n;
12830
12831 if (conformant) n = this->numberOfVar;
12832 else n = (int)(4*OSRand());
12833
12834 var = new OtherVarOption*[n];
12835 for (int i = 0; i < n; i++)
12836 {
12837 var[i] = new OtherVarOption();
12838 var[i]->setRandom(density, conformant);
12839 }
12840 }
12841 else
12842 {
12843 this->numberOfEnumerations = (int)(4*OSRand());
12844
12845 int n;
12846
12847 if (conformant) n = this->numberOfEnumerations;
12848 else n = (int)(4*OSRand());
12849
12850 enumeration = new OtherOptionEnumeration*[n];
12851 for (int i = 0; i < n; i++)
12852 {
12853 enumeration[i] = new OtherOptionEnumeration();
12854 enumeration[i]->setRandom(density, conformant, 0, 9);
12855 }
12856 }
12857 }
12858 return true;
12859 }
12860
12861 bool OtherVarOption::setRandom( double density, bool conformant )
12862 {
12863 #ifndef NDEBUG
12864 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random OtherVarOption");
12865 #endif
12866 this->idx = (int)(4*OSRand());
12867 if (OSRand() <= density) this->name = "random string";
12868 if (OSRand() <= density) this->value = "random string";
12869 if (OSRand() <= density) this->lbValue = "random string";
12870 if (OSRand() <= density) this->ubValue = "random string";
12871 return true;
12872 }
12873
12874 bool ObjectiveOption::setRandom( double density, bool conformant )
12875 {
12876 #ifndef NDEBUG
12877 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random ObjectiveOption");
12878 #endif
12879 if (OSRand() <= density)
12880 {
12881 this->initialObjectiveValues = new InitObjectiveValues();
12882 this->initialObjectiveValues->setRandom(density, conformant);
12883 }
12884 return false;
12885 if (OSRand() <= density)
12886 {
12887 this->initialObjectiveBounds = new InitObjectiveBounds();
12888 this->initialObjectiveBounds->setRandom(density, conformant);
12889 }
12890 if (OSRand() <= density)
12891 {
12892 this->initialBasisStatus = new BasisStatus();
12893 this->initialBasisStatus->setRandom(density, conformant, -2, -1);
12894 }
12895
12896 if (OSRand() <= density)
12897 {
12898 this->numberOfOtherObjectiveOptions = (int)(4*OSRand());
12899
12900 int n;
12901
12902 if (conformant) n = this->numberOfOtherObjectiveOptions;
12903 else n = (int)(4*OSRand());
12904
12905 other = new OtherObjectiveOption*[n];
12906 for (int i = 0; i < n; i++)
12907 {
12908 other[i] = new OtherObjectiveOption();
12909 other[i]->setRandom(density, conformant);
12910 }
12911 }
12912 return true;
12913 }
12914
12915 bool InitObjectiveValues::setRandom( double density, bool conformant )
12916 {
12917 #ifndef NDEBUG
12918 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random InitObjectiveValues");
12919 #endif
12920 this->numberOfObj = (int)(1+4*OSRand());
12921
12922 int n;
12923
12924 if (conformant) n = this->numberOfObj;
12925 else n = (int)(1+4*OSRand());
12926
12927 obj = new InitObjValue*[n];
12928 for (int i = 0; i < n; i++)
12929 {
12930 obj[i] = new InitObjValue();
12931 obj[i]->setRandom(density, conformant);
12932 }
12933 return true;
12934 }
12935
12936 bool InitObjValue::setRandom( double density, bool conformant )
12937 {
12938 #ifndef NDEBUG
12939 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random InitObjValue");
12940 #endif
12941 if (OSRand() <= 0.5) idx = -1;
12942 else idx = -2;
12943
12944 if (OSRand() <= density) this->name = "random string";
12945
12946 if (OSRand() <= density)
12947 {
12948 if (OSRand() <= 0.5) this->value = 3.14156;
12949 else this->value = 2.71828;
12950 }
12951 return true;
12952 }
12953
12954 bool InitObjectiveBounds::setRandom( double density, bool conformant )
12955 {
12956
12957 #ifndef NDEBUG
12958 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random InitObjectiveBounds");
12959 #endif
12960 this->numberOfObj = (int)(1+4*OSRand());
12961
12962 int n;
12963
12964 if (conformant) n = this->numberOfObj;
12965 else n = (int)(1+4*OSRand());
12966
12967 obj = new InitObjBound*[n];
12968 for (int i = 0; i < n; i++)
12969 {
12970 obj[i] = new InitObjBound();
12971 obj[i]->setRandom(density, conformant);
12972 }
12973 return true;
12974 }
12975
12976 bool InitObjBound::setRandom( double density, bool conformant )
12977 {
12978 #ifndef NDEBUG
12979 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random InitObjBound");
12980 #endif
12981 if (OSRand() <= 0.5) idx = -1;
12982 else idx = -2;
12983
12984 if (OSRand() <= density) this->name = "random string";
12985
12986 if (OSRand() <= density)
12987 {
12988 if (OSRand() <= 0.5) this->lbValue = 3.14156;
12989 else this->lbValue = 2.71828;
12990 if (OSRand() <= 0.5) this->ubValue = 3.14156;
12991 else this->ubValue = 2.71828;
12992 }
12993 return true;
12994 }
12995
12996 bool OtherObjectiveOption::setRandom( double density, bool conformant )
12997 {
12998 #ifndef NDEBUG
12999 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random OtherObjectiveOption");
13000 #endif
13001 this->name = "random string";
13002 if (OSRand() <= density) this->value = "random string";
13003 if (OSRand() <= density) this->solver = "random string";
13004 if (OSRand() <= density) this->category = "random string";
13005 if (OSRand() <= density) this->type = "random string";
13006 if (OSRand() <= density) this->description = "random string";
13007
13008 if (OSRand() <= density)
13009 {
13010 if (OSRand() <= 0.5)
13011 {
13012 this->numberOfObj = (int)(4*OSRand());
13013
13014 int n;
13015
13016 if (conformant) n = this->numberOfObj;
13017 else n = (int)(4*OSRand());
13018
13019 obj = new OtherObjOption*[n];
13020 for (int i = 0; i < n; i++)
13021 {
13022 obj[i] = new OtherObjOption();
13023 obj[i]->setRandom(density, conformant);
13024 }
13025 }
13026 else
13027 {
13028 this->numberOfEnumerations = (int)(4*OSRand());
13029
13030 int n;
13031
13032 if (conformant) n = this->numberOfEnumerations;
13033 else n = (int)(4*OSRand());
13034
13035 enumeration = new OtherOptionEnumeration*[n];
13036 for (int i = 0; i < n; i++)
13037 {
13038 enumeration[i] = new OtherOptionEnumeration();
13039 enumeration[i]->setRandom(density, conformant, -2, -1);
13040 }
13041 }
13042 }
13043 return true;
13044 }
13045
13046 bool OtherObjOption::setRandom( double density, bool conformant )
13047 {
13048 #ifndef NDEBUG
13049 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random OtherObjOption");
13050 #endif
13051 if (OSRand() <= 0.5) this->idx = -1;
13052 else this->idx = -2;
13053 if (OSRand() <= density) this->name = "random string";
13054 if (OSRand() <= density) this->value = "random string";
13055 if (OSRand() <= density) this->lbValue = "random string";
13056 if (OSRand() <= density) this->ubValue = "random string";
13057 return true;
13058 }
13059
13060 bool ConstraintOption::setRandom( double density, bool conformant )
13061 {
13062 #ifndef NDEBUG
13063 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random ConstraintOption");
13064 #endif
13065 if (OSRand() <= density)
13066 {
13067 this->initialConstraintValues = new InitConstraintValues();
13068 this->initialConstraintValues->setRandom(density, conformant);
13069 }
13070 return false;
13071 if (OSRand() <= density)
13072 {
13073 this->initialDualValues = new InitDualVariableValues();
13074 this->initialDualValues->setRandom(density, conformant);
13075 }
13076 if (OSRand() <= density)
13077 {
13078 this->initialBasisStatus = new BasisStatus();
13079 this->initialBasisStatus->setRandom(density, conformant, 0, 4);
13080 }
13081
13082 if (OSRand() <= density)
13083 {
13084 this->numberOfOtherConstraintOptions = (int)(4*OSRand());
13085
13086 int n;
13087
13088 if (conformant) n = this->numberOfOtherConstraintOptions;
13089 else n = (int)(4*OSRand());
13090
13091 other = new OtherConstraintOption*[n];
13092 for (int i = 0; i < n; i++)
13093 {
13094 other[i] = new OtherConstraintOption();
13095 other[i]->setRandom(density, conformant);
13096 }
13097 }
13098 return true;
13099 }
13100
13101 bool InitConstraintValues::setRandom( double density, bool conformant )
13102 {
13103 #ifndef NDEBUG
13104 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random InitConstraintValues");
13105 #endif
13106 this->numberOfCon = (int)(1+4*OSRand());
13107
13108 int n;
13109
13110 if (conformant) n = this->numberOfCon;
13111 else n = (int)(1+4*OSRand());
13112
13113 con = new InitConValue*[n];
13114 for (int i = 0; i < n; i++)
13115 {
13116 con[i] = new InitConValue();
13117 con[i]->setRandom(density, conformant);
13118 }
13119 return true;
13120 }
13121
13122 bool InitConValue::setRandom( double density, bool conformant )
13123 {
13124 #ifndef NDEBUG
13125 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random InitConValue");
13126 #endif
13127 this->idx = (int)(4*OSRand());
13128
13129 if (OSRand() <= density) this->name = "random string";
13130
13131 if (OSRand() <= density)
13132
13133 {
13134 if (OSRand() <= 0.5) this->value = 3.14156;
13135 else this->value = 2.71828;
13136 }
13137 return true;
13138 }
13139
13140 bool InitDualVariableValues::setRandom( double density, bool conformant )
13141 {
13142 #ifndef NDEBUG
13143 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random InitDualVariableValues");
13144 #endif
13145 this->numberOfCon = (int)(1+4*OSRand());
13146
13147 int n;
13148
13149 if (conformant) n = this->numberOfCon;
13150 else n = (int)(1+4*OSRand());
13151
13152 con = new InitDualVarValue*[n];
13153 for (int i = 0; i < n; i++)
13154 {
13155 con[i] = new InitDualVarValue();
13156 con[i]->setRandom(density, conformant);
13157 }
13158 return true;
13159 }
13160
13161 bool InitDualVarValue::setRandom( double density, bool conformant )
13162 {
13163 #ifndef NDEBUG
13164 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random InitDualVarValue");
13165 #endif
13166 this->idx = (int)(4*OSRand());
13167
13168 if (OSRand() <= density) this->name = "random string";
13169
13170 if (OSRand() <= density)
13171 {
13172 if (OSRand() <= 0.5) this->lbDualValue = 3.14156;
13173 else this->lbDualValue = 2.71828;
13174 if (OSRand() <= 0.5) this->ubDualValue = 3.14156;
13175 else this->ubDualValue = 2.71828;
13176 }
13177 return true;
13178 }
13179
13180 bool OtherConstraintOption::setRandom( double density, bool conformant )
13181 {
13182 #ifndef NDEBUG
13183 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random OtherConstraintOption");
13184 #endif
13185 this->name = "random string";
13186 if (OSRand() <= density) this->value = "random string";
13187 if (OSRand() <= density) this->solver = "random string";
13188 if (OSRand() <= density) this->category = "random string";
13189 if (OSRand() <= density) this->type = "random string";
13190 if (OSRand() <= density) this->description = "random string";
13191
13192 if (OSRand() <= density)
13193 {
13194 if (OSRand() <= 0.5)
13195 {
13196 this->numberOfCon = (int)(4*OSRand());
13197
13198 int n;
13199
13200 if (conformant) n = this->numberOfCon;
13201 else n = (int)(4*OSRand());
13202
13203 con = new OtherConOption*[n];
13204 for (int i = 0; i < n; i++)
13205 {
13206 con[i] = new OtherConOption();
13207 con[i]->setRandom(density, conformant);
13208 }
13209 }
13210 else
13211 {
13212 this->numberOfEnumerations = (int)(4*OSRand());
13213
13214 int n;
13215
13216 if (conformant) n = this->numberOfEnumerations;
13217 else n = (int)(4*OSRand());
13218
13219 enumeration = new OtherOptionEnumeration*[n];
13220 for (int i = 0; i < n; i++)
13221 {
13222 enumeration[i] = new OtherOptionEnumeration();
13223 enumeration[i]->setRandom(density, conformant, 0, 4);
13224 }
13225 }
13226 }
13227 return true;
13228 }
13229
13230 bool OtherConOption::setRandom( double density, bool conformant )
13231 {
13232 #ifndef NDEBUG
13233 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random OtherConOption");
13234 #endif
13235 this->idx = (int)(4*OSRand());
13236 if (OSRand() <= density) this->name = "random string";
13237 if (OSRand() <= density) this->value = "random string";
13238 if (OSRand() <= density) this->lbValue = "random string";
13239 if (OSRand() <= density) this->ubValue = "random string";
13240 return true;
13241 }
13242
13243
13244 bool SolverOptions::setRandom( double density, bool conformant )
13245 {
13246 #ifndef NDEBUG
13247 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random SolverOptions");
13248 #endif
13249 this->numberOfSolverOptions = (int)(1+4*OSRand());
13250
13251 int n;
13252
13253 if (conformant) n = this->numberOfSolverOptions;
13254 else n = (int)(1+4*OSRand());
13255
13256 solverOption = new SolverOption*[n];
13257 for (int i = 0; i < n; i++)
13258 {
13259 solverOption[i] = new SolverOption();
13260 solverOption[i]->setRandom(density, conformant);
13261 }
13262 return true;
13263 }
13264
13265 bool SolverOption::setRandom( double density, bool conformant )
13266 {
13267 #ifndef NDEBUG
13268 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random SolverOption");
13269 #endif
13270 if (OSRand() <= density || conformant) this->name = "random string";
13271
13272 if (OSRand() <= density) this->value = "random string";
13273 if (OSRand() <= density) this->solver = "random string";
13274 if (OSRand() <= density) this->category = "random string";
13275 if (OSRand() <= density) this->type = "random string";
13276 if (OSRand() <= density) this->description = "random string";
13277
13278 if (OSRand() <= density)
13279 {
13280 this->numberOfItems = (int)(4*OSRand());
13281
13282 int n;
13283
13284 if (conformant) n = this->numberOfItems;
13285 else n = (int)(4*OSRand());
13286
13287 item = new std::string[n];
13288 for (int i = 0; i < n; i++)
13289 item[i] = "random string";
13290 }
13291 return true;
13292 }
13293
13294
13295
13296
13297
13298
13299
13300
13301
13302
13303 bool OSOption::deepCopyFrom(OSOption *that)
13304 {
13305 #ifndef NDEBUG
13306 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of OSOption");
13307 #endif
13308 if (that->optionHeader != NULL)
13309 {
13310 this->optionHeader = new GeneralFileHeader();
13311 if (!this->optionHeader->deepCopyFrom(that->optionHeader))
13312 return false;
13313 }
13314 if (that->general != NULL)
13315 {
13316 this->general = new GeneralOption();
13317 if (!this->general->deepCopyFrom(that->general))
13318 return false;
13319 }
13320 if (that->system != NULL)
13321 {
13322 this->system = new SystemOption();
13323 if (!this->system->deepCopyFrom(that->system))
13324 return false;
13325 }
13326 if (that->service != NULL)
13327 {
13328 this->service = new ServiceOption();
13329 if (!this->service->deepCopyFrom(that->service))
13330 return false;
13331 }
13332 if (that->job != NULL)
13333 {
13334 this->job = new JobOption();
13335 if (!this->job->deepCopyFrom(that->job))
13336 return false;
13337 }
13338 if (that->optimization != NULL)
13339 {
13340 this->optimization = new OptimizationOption();
13341 if (!this->optimization->deepCopyFrom(that->optimization))
13342 return false;
13343 }
13344 return true;
13345 }
13346
13347
13348 bool GeneralOption::deepCopyFrom(GeneralOption *that)
13349 {
13350 #ifndef NDEBUG
13351 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of GeneralOption");
13352 #endif
13353 this->serviceURI = that->serviceURI;
13354 this->serviceName = that->serviceName;
13355 this->instanceName = that->instanceName;
13356 this->jobID = that->jobID;
13357 this->solverToInvoke = that->solverToInvoke;
13358 this->license = that->license;
13359 this->userName = that->userName;
13360 this->password = that->password;
13361
13362 if (that->instanceLocation != NULL)
13363 {
13364 this->instanceLocation = new InstanceLocationOption();
13365 if (!this->instanceLocation->deepCopyFrom(that->instanceLocation))
13366 return false;
13367 }
13368 if (that->contact != NULL)
13369 {
13370 this->contact = new ContactOption();
13371 if (!this->contact->deepCopyFrom(that->contact))
13372 return false;
13373 }
13374 if (that->otherOptions != NULL)
13375 {
13376 this->otherOptions = new OtherOptions();
13377 if (!this->otherOptions->deepCopyFrom(that->otherOptions))
13378 return false;
13379 }
13380 return true;
13381 }
13382
13383
13384 bool SystemOption::deepCopyFrom(SystemOption *that)
13385 {
13386 #ifndef NDEBUG
13387 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of SystemOption");
13388 #endif
13389 if (that->minDiskSpace != NULL)
13390 {
13391 this->minDiskSpace = new StorageCapacity();
13392 if (!this->minDiskSpace->deepCopyFrom(that->minDiskSpace))
13393 return false;
13394 }
13395 if (that->minMemorySize != NULL)
13396 {
13397 this->minMemorySize = new StorageCapacity();
13398 if (!this->minMemorySize->deepCopyFrom(that->minMemorySize))
13399 return false;
13400 }
13401 if (that->minCPUSpeed != NULL)
13402 {
13403 this->minCPUSpeed = new CPUSpeed();
13404 if (!this->minCPUSpeed->deepCopyFrom(that->minCPUSpeed))
13405 return false;
13406 }
13407 if (that->minCPUNumber != NULL)
13408 {
13409 this->minCPUNumber = new CPUNumber();
13410 if (!this->minCPUNumber->deepCopyFrom(that->minCPUNumber))
13411 return false;
13412 }
13413 if (that->otherOptions != NULL)
13414 {
13415 this->otherOptions = new OtherOptions();
13416 if (!this->otherOptions->deepCopyFrom(that->otherOptions))
13417 return false;
13418 }
13419 return true;
13420 }
13421
13422
13423 bool ServiceOption::deepCopyFrom(ServiceOption *that)
13424 {
13425 #ifndef NDEBUG
13426 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of ServiceOption");
13427 #endif
13428 this->type = that->type;
13429
13430 if (that->otherOptions != NULL)
13431 {
13432 otherOptions = new OtherOptions();
13433 if (!otherOptions->deepCopyFrom(that->otherOptions))
13434 return false;
13435 }
13436
13437 return true;
13438 }
13439
13440
13441 bool JobOption::deepCopyFrom(JobOption *that)
13442 {
13443 #ifndef NDEBUG
13444 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of JobOption");
13445 #endif
13446 this->requestedStartTime = that->requestedStartTime;
13447
13448 if (that->maxTime != NULL)
13449 {
13450 maxTime = new TimeSpan();
13451 if (!maxTime->deepCopyFrom(that->maxTime))
13452 return false;
13453 }
13454 if (that->dependencies != NULL)
13455 {
13456 dependencies = new JobDependencies();
13457 if (!dependencies->deepCopyFrom(that->dependencies))
13458 return false;
13459 }
13460 if (that->requiredDirectories != NULL)
13461 {
13462 requiredDirectories = new DirectoriesAndFiles();
13463 if (!requiredDirectories->deepCopyFrom(that->requiredDirectories))
13464 return false;
13465 }
13466 if (that->requiredFiles != NULL)
13467 {
13468 requiredFiles = new DirectoriesAndFiles();
13469 if (!requiredFiles->deepCopyFrom(that->requiredFiles))
13470 return false;
13471 }
13472 if (that->directoriesToMake != NULL)
13473 {
13474 directoriesToMake = new DirectoriesAndFiles();
13475 if (!directoriesToMake->deepCopyFrom(that->directoriesToMake))
13476 return false;
13477 }
13478 if (that->filesToMake != NULL)
13479 {
13480 filesToMake = new DirectoriesAndFiles();
13481 if (!filesToMake->deepCopyFrom(that->filesToMake))
13482 return false;
13483 }
13484 if (that->inputDirectoriesToMove != NULL)
13485 {
13486 inputDirectoriesToMove = new PathPairs();
13487 if (!inputDirectoriesToMove->deepCopyFrom(that->inputDirectoriesToMove))
13488 return false;
13489 }
13490 if (that->inputFilesToMove != NULL)
13491 {
13492 inputFilesToMove = new PathPairs();
13493 if (!inputFilesToMove->deepCopyFrom(that->inputFilesToMove))
13494 return false;
13495 }
13496 if (that->outputFilesToMove != NULL)
13497 {
13498 outputFilesToMove = new PathPairs();
13499 if (!outputFilesToMove->deepCopyFrom(that->outputFilesToMove))
13500 return false;
13501 }
13502 if (that->outputDirectoriesToMove != NULL)
13503 {
13504 outputDirectoriesToMove = new PathPairs();
13505 if (!outputDirectoriesToMove->deepCopyFrom(that->outputDirectoriesToMove))
13506 return false;
13507 }
13508 if (that->filesToDelete != NULL)
13509 {
13510 filesToDelete = new DirectoriesAndFiles();
13511 if (!filesToDelete->deepCopyFrom(that->filesToDelete))
13512 return false;
13513 }
13514 if (that->directoriesToDelete != NULL)
13515 {
13516 directoriesToDelete = new DirectoriesAndFiles();
13517 if (!directoriesToDelete->deepCopyFrom(that->directoriesToDelete))
13518 return false;
13519 }
13520 if (that->processesToKill != NULL)
13521 {
13522 processesToKill = new Processes();
13523 if (!processesToKill->deepCopyFrom(that->processesToKill))
13524 return false;
13525 }
13526 if (that->otherOptions != NULL)
13527 {
13528 otherOptions = new OtherOptions();
13529 if (!otherOptions->deepCopyFrom(that->otherOptions))
13530 return false;
13531 }
13532 return true;
13533 }
13534
13535 bool OptimizationOption::deepCopyFrom(OptimizationOption *that)
13536 {
13537 #ifndef NDEBUG
13538 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of OptimizationOption");
13539 #endif
13540 this->numberOfVariables = that->numberOfVariables;
13541 this->numberOfObjectives = that->numberOfObjectives;
13542 this->numberOfConstraints = that->numberOfConstraints;
13543
13544 if (that->variables != NULL)
13545 {
13546 variables = new VariableOption();
13547 if (!variables->deepCopyFrom(that->variables))
13548 return false;
13549 }
13550 if (that->objectives != NULL)
13551 {
13552 objectives = new ObjectiveOption();
13553 if (!objectives->deepCopyFrom(that->objectives))
13554 return false;
13555 }
13556 if (that->constraints != NULL)
13557 {
13558 constraints = new ConstraintOption();
13559 if (!constraints->deepCopyFrom(that->constraints))
13560 return false;
13561 }
13562 if (that->solverOptions != NULL)
13563 {
13564 solverOptions = new SolverOptions();
13565 if (!solverOptions->deepCopyFrom(that->solverOptions))
13566 return false;
13567 }
13568
13569 return true;
13570 }
13571
13572 bool InstanceLocationOption::deepCopyFrom(InstanceLocationOption *that)
13573 {
13574 #ifndef NDEBUG
13575 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of InstanceLocationOption");
13576 #endif
13577 this->value = that->value;
13578 this->locationType = that->locationType;
13579 return true;
13580 }
13581
13582 bool ContactOption::deepCopyFrom(ContactOption *that)
13583 {
13584 #ifndef NDEBUG
13585 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of ContactOption");
13586 #endif
13587 this->value = that->value;
13588 this->transportType = that->transportType;
13589 return true;
13590 }
13591
13592 bool OtherOptions::deepCopyFrom(OtherOptions *that)
13593 {
13594 #ifndef NDEBUG
13595 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of OtherOptions");
13596 #endif
13597 int n;
13598
13599 n = that->numberOfOtherOptions;
13600 this->numberOfOtherOptions = n;
13601
13602 if (n < 0) return false;
13603 if (n == 0) return true;
13604
13605 this->other = new OtherOption*[n];
13606
13607 for (int i = 0; i < n; i++)
13608 {
13609 this->other[i] = new OtherOption();
13610 if (!this->other[i]->deepCopyFrom(that->other[i]))
13611 return false;
13612 }
13613
13614 return true;
13615 }
13616
13617 bool OtherOption::deepCopyFrom(OtherOption *that)
13618 {
13619 #ifndef NDEBUG
13620 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of OtherOption");
13621 #endif
13622 this->name = that->name;
13623 this->value = that->value;
13624 this->description = that->description;
13625 return true;
13626 }
13627
13628
13629 bool JobDependencies::deepCopyFrom(JobDependencies *that)
13630 {
13631 #ifndef NDEBUG
13632 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of JobDependencies");
13633 #endif
13634 int n;
13635
13636 this->numberOfJobIDs = that->numberOfJobIDs;
13637 n = this->numberOfJobIDs;
13638
13639 if (n < 0) return false;
13640 if (n == 0) return true;
13641
13642 this->jobID = new std::string[n];
13643 for (int i = 0; i < n; i++)
13644 this->jobID[i] = that->jobID[i];
13645
13646 return true;
13647 }
13648
13649 bool DirectoriesAndFiles::deepCopyFrom(DirectoriesAndFiles *that)
13650 {
13651 #ifndef NDEBUG
13652 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of DirectoriesAndFiles");
13653 #endif
13654 int n;
13655
13656 this->numberOfPaths = that->numberOfPaths;
13657 n = this->numberOfPaths;
13658
13659 if (n < 0) return false;
13660 if (n == 0) return true;
13661
13662 this->path = new std::string[n];
13663 for (int i = 0; i < n; i++)
13664 this->path[i] = that->path[i];
13665
13666 return true;
13667 }
13668
13669 bool PathPairs::deepCopyFrom(PathPairs *that)
13670 {
13671 #ifndef NDEBUG
13672 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of PathPairs");
13673 #endif
13674 int n;
13675
13676 this->numberOfPathPairs = that->numberOfPathPairs;
13677 n = this->numberOfPathPairs;
13678
13679 if (n < 0) return false;
13680 if (n == 0) return true;
13681
13682 pathPair = new PathPair*[n];
13683 for (int i = 0; i < n; i++)
13684 {
13685 this->pathPair[i] = new PathPair();
13686 if (!this->pathPair[i]->deepCopyFrom(that->pathPair[i]))
13687 return false;
13688 }
13689
13690 return true;
13691 }
13692
13693 bool PathPair::deepCopyFrom(PathPair *that)
13694 {
13695 #ifndef NDEBUG
13696 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of PathPair");
13697 #endif
13698 this->from = that->from;
13699 this->to = that->to;
13700 this->makeCopy = that->makeCopy;
13701 return true;
13702 }
13703
13704 bool Processes::deepCopyFrom(Processes *that)
13705 {
13706 #ifndef NDEBUG
13707 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of Processes");
13708 #endif
13709 int n;
13710
13711 this->numberOfProcesses = that->numberOfProcesses;
13712 n = this->numberOfProcesses;
13713
13714 if (n < 0) return false;
13715 if (n == 0) return true;
13716
13717 process = new std::string[n];
13718 for (int i = 0; i < n; i++)
13719 this->process[i] = that->process[i];
13720
13721 return true;
13722 }
13723
13724
13725 bool VariableOption::deepCopyFrom(VariableOption *that)
13726 {
13727 #ifndef NDEBUG
13728 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of VariableOption");
13729 #endif
13730 if (that->initialVariableValues != NULL)
13731 {
13732 this->initialVariableValues = new InitVariableValues();
13733 if (!this->initialVariableValues->deepCopyFrom(that->initialVariableValues))
13734 return false;
13735 }
13736 if (that->initialVariableValuesString != NULL)
13737 {
13738 this->initialVariableValuesString = new InitVariableValuesString();
13739 if (!this->initialVariableValuesString->deepCopyFrom(that->initialVariableValuesString))
13740 return false;
13741 }
13742 if (that->initialBasisStatus != NULL)
13743 {
13744 this->initialBasisStatus = new BasisStatus();
13745 if (!this->initialBasisStatus->deepCopyFrom(that->initialBasisStatus))
13746 return false;
13747 }
13748 if (that->integerVariableBranchingWeights != NULL)
13749 {
13750 this->integerVariableBranchingWeights = new IntegerVariableBranchingWeights();
13751 if (!this->integerVariableBranchingWeights->deepCopyFrom(that->integerVariableBranchingWeights))
13752 return false;
13753 }
13754 if (that->sosVariableBranchingWeights != NULL)
13755 {
13756 this->sosVariableBranchingWeights = new SOSVariableBranchingWeights();
13757 if (!this->sosVariableBranchingWeights->deepCopyFrom(that->sosVariableBranchingWeights))
13758 return false;
13759 }
13760
13761 this->numberOfOtherVariableOptions = that->numberOfOtherVariableOptions;
13762 int n = this->numberOfOtherVariableOptions;
13763
13764 if (n < 0) return false;
13765 if (n == 0) return true;
13766
13767 this->other = new OtherVariableOption*[n];
13768 for (int i = 0; i < n; i++)
13769 {
13770 this->other[i] = new OtherVariableOption();
13771 if (!this->other[i]->deepCopyFrom(that->other[i]))
13772 return false;
13773 }
13774 return true;
13775 }
13776
13777 bool InitVariableValues::deepCopyFrom(InitVariableValues *that)
13778 {
13779 #ifndef NDEBUG
13780 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of InitVariableValues");
13781 #endif
13782 this->numberOfVar = that->numberOfVar;
13783
13784 int n = this->numberOfVar;
13785
13786 if (n < 0) return false;
13787 if (n == 0) return true;
13788
13789 this->var = new InitVarValue*[n];
13790 for (int i = 0; i < n; i++)
13791 {
13792 this->var[i] = new InitVarValue();
13793 if (!this->var[i]->deepCopyFrom(that->var[i]))
13794 return false;
13795 }
13796 return true;
13797 }
13798
13799 bool InitVarValue::deepCopyFrom(InitVarValue *that)
13800 {
13801 #ifndef NDEBUG
13802 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of InitVarValue");
13803 #endif
13804 this->idx = that->idx;
13805 this->name = that->name;
13806 this->value = that->value;
13807 return true;
13808 }
13809
13810
13811 bool InitVariableValuesString::deepCopyFrom(InitVariableValuesString *that)
13812 {
13813 #ifndef NDEBUG
13814 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of InitVariableValuesString");
13815 #endif
13816 this->numberOfVar = that->numberOfVar;
13817 int n = this->numberOfVar;
13818
13819 if (n < 0) return false;
13820 if (n == 0) return true;
13821
13822 this->var = new InitVarValueString*[n];
13823 for (int i = 0; i < n; i++)
13824 {
13825 this->var[i] = new InitVarValueString();
13826 if (!this->var[i]->deepCopyFrom(that->var[i]))
13827 return false;
13828 }
13829 return true;
13830 }
13831
13832 bool InitVarValueString::deepCopyFrom(InitVarValueString *that)
13833 {
13834 #ifndef NDEBUG
13835 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of InitVarValueString");
13836 #endif
13837 this->idx = that->idx;
13838 this->name = that->name;
13839 this->value = that->value;
13840 return true;
13841 }
13842
13843
13844 bool IntegerVariableBranchingWeights::deepCopyFrom(IntegerVariableBranchingWeights *that)
13845 {
13846 #ifndef NDEBUG
13847 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of IntegerVariableBranchingWeights");
13848 #endif
13849 this->numberOfVar = that->numberOfVar;
13850 int n = this->numberOfVar;
13851
13852 if (n < 0) return false;
13853 if (n == 0) return true;
13854
13855 this->var = new BranchingWeight*[n];
13856 for (int i = 0; i < n; i++)
13857 {
13858 this->var[i] = new BranchingWeight();
13859 if (!this->var[i]->deepCopyFrom(that->var[i]))
13860 return false;
13861 }
13862 return true;
13863 }
13864
13865 bool SOSVariableBranchingWeights::deepCopyFrom(SOSVariableBranchingWeights *that)
13866 {
13867 #ifndef NDEBUG
13868 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of SOSVariableBranchingWeights");
13869 #endif
13870 this->numberOfSOS = that->numberOfSOS;
13871 int n = this->numberOfSOS;
13872
13873 if (n < 0) return false;
13874 if (n == 0) return true;
13875
13876 this->sos = new SOSWeights*[n];
13877 for (int i = 0; i < n; i++)
13878 {
13879 this->sos[i] = new SOSWeights();
13880 if (!this->sos[i]->deepCopyFrom(that->sos[i]))
13881 return false;
13882 }
13883 return true;
13884 }
13885
13886
13887 bool SOSWeights::deepCopyFrom(SOSWeights *that)
13888 {
13889 #ifndef NDEBUG
13890 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of SOSWeights");
13891 #endif
13892 this->sosIdx = that->sosIdx;
13893 this->groupWeight = that->groupWeight;
13894
13895 this->numberOfVar = that->numberOfVar;
13896 int n = this->numberOfVar;
13897
13898 if (n < 0) return false;
13899 if (n == 0) return true;
13900
13901 this->var = new BranchingWeight*[n];
13902 for (int i = 0; i < n; i++)
13903 {
13904 this->var[i] = new BranchingWeight();
13905 if (!this->var[i]->deepCopyFrom(that->var[i]))
13906 return false;
13907 }
13908 return true;
13909 }
13910
13911
13912 bool BranchingWeight::deepCopyFrom(BranchingWeight *that)
13913 {
13914 #ifndef NDEBUG
13915 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of BranchingWeight");
13916 #endif
13917 this->idx = that->idx;
13918 this->name = that->name;
13919 this->value = that->value;
13920 return true;
13921 }
13922
13923 bool OtherVariableOption::deepCopyFrom(OtherVariableOption *that)
13924 {
13925 #ifndef NDEBUG
13926 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of OtherVariableOption");
13927 #endif
13928 this->name = that->name;
13929 this->value = that->value;
13930 this->solver = that->solver;
13931 this->category = that->category;
13932 this->type = that->type;
13933 this->varType = that->varType;
13934 this->enumType = that->enumType;
13935 this->description = that->description;
13936
13937 int n;
13938 this->numberOfVar = that->numberOfVar;
13939 n = this->numberOfVar;
13940
13941 if (n < 0) return false;
13942 if (n > 0)
13943 {
13944 this->var = new OtherVarOption*[n];
13945 for (int i = 0; i < n; i++)
13946 {
13947 this->var[i] = new OtherVarOption();
13948 if (!this->var[i]->deepCopyFrom(that->var[i]))
13949 return false;
13950 }
13951 }
13952
13953 this->numberOfEnumerations = that->numberOfEnumerations;
13954 n = this->numberOfEnumerations;
13955
13956 if (n < 0) return false;
13957 if (n == 0) return true;
13958
13959 this->enumeration = new OtherOptionEnumeration*[n];
13960 for (int i = 0; i < n; i++)
13961 {
13962 this->enumeration[i] = new OtherOptionEnumeration();
13963 if (!this->enumeration[i]->deepCopyFrom(that->enumeration[i]))
13964 return false;
13965 }
13966 return true;
13967 }
13968
13969 bool OtherVarOption::deepCopyFrom(OtherVarOption *that)
13970 {
13971 #ifndef NDEBUG
13972 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of OtherVarOption");
13973 #endif
13974 this->idx = that->idx;
13975 this->name = that->name;
13976 this->value = that->value;
13977 this->lbValue = that->lbValue;
13978 this->ubValue = that->ubValue;
13979 return true;
13980 }
13981
13982 bool ObjectiveOption::deepCopyFrom(ObjectiveOption *that)
13983 {
13984 #ifndef NDEBUG
13985 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of ObjectiveOption");
13986 #endif
13987 if (that->initialObjectiveValues != NULL)
13988 {
13989 this->initialObjectiveValues = new InitObjectiveValues();
13990 if (!this->initialObjectiveValues->deepCopyFrom(that->initialObjectiveValues))
13991 return false;
13992 }
13993 if (that->initialObjectiveBounds != NULL)
13994 {
13995 this->initialObjectiveBounds = new InitObjectiveBounds();
13996 if (!this->initialObjectiveBounds->deepCopyFrom(that->initialObjectiveBounds))
13997 return false;
13998 }
13999 if (that->initialBasisStatus != NULL)
14000 {
14001 this->initialBasisStatus = new BasisStatus();
14002 if (!this->initialBasisStatus->deepCopyFrom(that->initialBasisStatus))
14003 return false;
14004 }
14005
14006 this->numberOfOtherObjectiveOptions = that->numberOfOtherObjectiveOptions;
14007 int n = this->numberOfOtherObjectiveOptions;
14008
14009 if (n < 0) return false;
14010 if (n == 0) return true;
14011
14012 this->other = new OtherObjectiveOption*[n];
14013 for (int i = 0; i < n; i++)
14014 {
14015 this->other[i] = new OtherObjectiveOption();
14016 if (!this->other[i]->deepCopyFrom(that->other[i]))
14017 return false;
14018 }
14019 return true;
14020 }
14021
14022 bool InitObjectiveValues::deepCopyFrom(InitObjectiveValues *that)
14023 {
14024 #ifndef NDEBUG
14025 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of InitObjectiveValues");
14026 #endif
14027 this->numberOfObj = that->numberOfObj;
14028 int n = this->numberOfObj;
14029
14030 if (n < 0) return false;
14031 if (n == 0) return true;
14032
14033 this->obj = new InitObjValue*[n];
14034 for (int i = 0; i < n; i++)
14035 {
14036 this->obj[i] = new InitObjValue();
14037 if (!this->obj[i]->deepCopyFrom(that->obj[i]))
14038 return false;
14039 }
14040 return true;
14041 }
14042
14043 bool InitObjValue::deepCopyFrom(InitObjValue *that)
14044 {
14045 #ifndef NDEBUG
14046 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of InitObjValue");
14047 #endif
14048 this->idx = that->idx;
14049 this->name = that->name;
14050 this->value = that->value;
14051 return true;
14052 }
14053
14054 bool InitObjectiveBounds::deepCopyFrom(InitObjectiveBounds *that)
14055 {
14056 #ifndef NDEBUG
14057 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of InitObjectiveBounds");
14058 #endif
14059 this->numberOfObj = that->numberOfObj;
14060 int n = this->numberOfObj;
14061
14062 if (n < 0) return false;
14063 if (n == 0) return true;
14064
14065 this->obj = new InitObjBound*[n];
14066 for (int i = 0; i < n; i++)
14067 {
14068 this->obj[i] = new InitObjBound();
14069 if (!this->obj[i]->deepCopyFrom(that->obj[i]))
14070 return false;
14071 }
14072 return true;
14073 }
14074
14075 bool InitObjBound::deepCopyFrom(InitObjBound *that)
14076 {
14077 #ifndef NDEBUG
14078 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of InitObjBound");
14079 #endif
14080 this->idx = that->idx;
14081 this->name = that->name;
14082 this->lbValue = that->lbValue;
14083 this->ubValue = that->ubValue;
14084 return true;
14085 }
14086
14087 bool OtherObjectiveOption::deepCopyFrom(OtherObjectiveOption *that)
14088 {
14089 #ifndef NDEBUG
14090 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of OtherObjectiveOption");
14091 #endif
14092 this->name = that->name;
14093 this->value = that->value;
14094 this->solver = that->solver;
14095 this->category = that->category;
14096 this->type = that->type;
14097 this->objType = that->objType;
14098 this->enumType = that->enumType;
14099 this->description = that->description;
14100
14101 int n;
14102
14103 this->numberOfObj = that->numberOfObj;
14104
14105 n = this->numberOfObj;
14106
14107 if (n < 0) return false;
14108 if (n > 0)
14109 {
14110 this->obj = new OtherObjOption*[n];
14111 for (int i = 0; i < n; i++)
14112 {
14113 this->obj[i] = new OtherObjOption();
14114 if (!this->obj[i]->deepCopyFrom(that->obj[i]))
14115 return false;
14116 }
14117 }
14118
14119 this->numberOfEnumerations = that->numberOfEnumerations;
14120 n = this->numberOfEnumerations;
14121
14122 if (n < 0) return false;
14123 if (n > 0)
14124 {
14125 this->enumeration = new OtherOptionEnumeration*[n];
14126 for (int i = 0; i < n; i++)
14127 {
14128 this->enumeration[i] = new OtherOptionEnumeration();
14129 if (!this->enumeration[i]->deepCopyFrom(that->enumeration[i]))
14130 return false;
14131 }
14132 }
14133 return true;
14134 }
14135
14136 bool OtherObjOption::deepCopyFrom(OtherObjOption *that)
14137 {
14138 #ifndef NDEBUG
14139 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of OtherObjOption");
14140 #endif
14141 this->idx = that->idx;
14142 this->name = that->name;
14143 this->value = that->value;
14144 this->lbValue = that->lbValue;
14145 this->ubValue = that->ubValue;
14146 return true;
14147 }
14148
14149 bool ConstraintOption::deepCopyFrom(ConstraintOption *that)
14150 {
14151 #ifndef NDEBUG
14152 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of ConstraintOption");
14153 #endif
14154 if (that->initialConstraintValues != NULL)
14155 {
14156 this->initialConstraintValues = new InitConstraintValues();
14157 if (!this->initialConstraintValues->deepCopyFrom(that->initialConstraintValues))
14158 return false;
14159 }
14160 if (that->initialDualValues != NULL)
14161 {
14162 this->initialDualValues = new InitDualVariableValues();
14163 if (!this->initialDualValues->deepCopyFrom(that->initialDualValues))
14164 return false;
14165 }
14166 if (that->initialBasisStatus != NULL)
14167 {
14168 this->initialBasisStatus = new BasisStatus();
14169 if (!this->initialBasisStatus->deepCopyFrom(that->initialBasisStatus))
14170 return false;
14171 }
14172
14173 this->numberOfOtherConstraintOptions = that->numberOfOtherConstraintOptions;
14174 int n = this->numberOfOtherConstraintOptions;
14175
14176 if (n < 0) return false;
14177 if (n == 0) return true;
14178
14179 this->other = new OtherConstraintOption*[n];
14180 for (int i = 0; i < n; i++)
14181 {
14182 this->other[i] = new OtherConstraintOption();
14183 if (!this->other[i]->deepCopyFrom(that->other[i]))
14184 return false;
14185 }
14186 return true;
14187 }
14188
14189 bool InitConstraintValues::deepCopyFrom(InitConstraintValues *that)
14190 {
14191 #ifndef NDEBUG
14192 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of InitConstraintValues");
14193 #endif
14194 this->numberOfCon = that->numberOfCon;
14195 int n = this->numberOfCon;
14196
14197 if (n < 0) return false;
14198 if (n == 0) return true;
14199
14200 this->con = new InitConValue*[n];
14201 for (int i = 0; i < n; i++)
14202 {
14203 this->con[i] = new InitConValue();
14204 if (!this->con[i]->deepCopyFrom(that->con[i]))
14205 return false;
14206 }
14207 return true;
14208 }
14209
14210 bool InitConValue::deepCopyFrom(InitConValue *that)
14211 {
14212 #ifndef NDEBUG
14213 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of InitConValue");
14214 #endif
14215 this->idx = that->idx;
14216 this->name = that->name;
14217 this->value = that->value;
14218 return true;
14219 }
14220
14221 bool InitDualVariableValues::deepCopyFrom(InitDualVariableValues *that)
14222 {
14223 #ifndef NDEBUG
14224 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of InitDualVariableValues");
14225 #endif
14226 this->numberOfCon = that->numberOfCon;
14227 int n = this->numberOfCon;
14228
14229 if (n < 0) return false;
14230 if (n == 0) return true;
14231
14232 this->con = new InitDualVarValue*[n];
14233 for (int i = 0; i < n; i++)
14234 {
14235 this->con[i] = new InitDualVarValue();
14236 if (!this->con[i]->deepCopyFrom(that->con[i]))
14237 return false;
14238 }
14239 return true;
14240 }
14241
14242 bool InitDualVarValue::deepCopyFrom(InitDualVarValue *that)
14243 {
14244 #ifndef NDEBUG
14245 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of InitDualVarValue");
14246 #endif
14247 this->idx = that->idx;
14248 this->name = that->name;
14249 this->lbDualValue = that->lbDualValue;
14250 this->ubDualValue = that->ubDualValue;
14251 return true;
14252 }
14253
14254 bool OtherConstraintOption::deepCopyFrom(OtherConstraintOption *that)
14255 {
14256 #ifndef NDEBUG
14257 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of OtherConstraintOption");
14258 #endif
14259 this->name = that->name;
14260 this->value = that->value;
14261 this->solver = that->solver;
14262 this->category = that->category;
14263 this->type = that->type;
14264 this->conType = that->conType;
14265 this->enumType = that->enumType;
14266 this->description = that->description;
14267
14268 int n;
14269
14270 this->numberOfCon = that->numberOfCon;
14271 n = this->numberOfCon;
14272
14273 if (n < 0) return false;
14274 if (n > 0)
14275 {
14276 this->con = new OtherConOption*[n];
14277 for (int i = 0; i < n; i++)
14278 {
14279 this->con[i] = new OtherConOption();
14280 if (!this->con[i]->deepCopyFrom(that->con[i]))
14281 return false;
14282 }
14283 }
14284
14285 this->numberOfEnumerations = that->numberOfEnumerations;
14286 n = this->numberOfEnumerations;
14287
14288 if (n < 0) return false;
14289 if (n > 0)
14290 {
14291 this->enumeration = new OtherOptionEnumeration*[n];
14292 for (int i = 0; i < n; i++)
14293 {
14294 this->enumeration[i] = new OtherOptionEnumeration();
14295 if (!this->enumeration[i]->deepCopyFrom(that->enumeration[i]))
14296 return false;
14297 }
14298 }
14299 return true;
14300 }
14301
14302 bool OtherConOption::deepCopyFrom(OtherConOption *that)
14303 {
14304 #ifndef NDEBUG
14305 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of OtherConOption");
14306 #endif
14307 this->idx = that->idx;
14308 this->name = that->name;
14309 this->value = that->value;
14310 this->lbValue = that->lbValue;
14311 this->ubValue = that->ubValue;
14312 return true;
14313 }
14314
14315
14316 bool SolverOptions::deepCopyFrom(SolverOptions *that)
14317 {
14318 #ifndef NDEBUG
14319 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of SolverOptions");
14320 #endif
14321 this->numberOfSolverOptions = that->numberOfSolverOptions;
14322 int n = this->numberOfSolverOptions;
14323
14324 if (n < 0) return false;
14325 if (n == 0) return true;
14326
14327 this->solverOption = new SolverOption*[n];
14328 for (int i = 0; i < n; i++)
14329 {
14330 this->solverOption[i] = new SolverOption();
14331 if (!this->solverOption[i]->deepCopyFrom(that->solverOption[i]))
14332 return false;
14333 }
14334 return true;
14335 }
14336
14337 bool SolverOption::deepCopyFrom(SolverOption *that)
14338 {
14339 #ifndef NDEBUG
14340 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of SolverOption");
14341 #endif
14342 this->name = that->name;
14343 this->value = that->value;
14344 this->solver = that->solver;
14345 this->category = that->category;
14346 this->type = that->type;
14347 this->description = that->description;
14348
14349 this->numberOfItems = that->numberOfItems;
14350 int n = this->numberOfItems;
14351
14352 if (n < 0) return false;
14353 if (n == 0) return true;
14354
14355 this->item = new std::string[n];
14356 for (int i = 0; i < n; i++)
14357 this->item[i] = that->item[i];
14358
14359 return true;
14360 }
14361