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 OtherOptionOrResultEnumeration*[this->other[i]->numberOfEnumerations];
06039 for (j = 0; j < this->other[i]->numberOfEnumerations; j++)
06040 {
06041 this->other[i]->enumeration[j] = new OtherOptionOrResultEnumeration();
06042 this->other[i]->enumeration[j]->setOtherOptionOrResultEnumeration(
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 OtherOptionOrResultEnumeration*[other->numberOfEnumerations];
06111 for (j = 0; j < other->numberOfEnumerations; j++)
06112 {
06113 temp[ nopt]->enumeration[j] = new OtherOptionOrResultEnumeration();
06114 temp[ nopt]->enumeration[j]->setOtherOptionOrResultEnumeration(
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 OtherOptionOrResultEnumeration*[this->other[i]->numberOfEnumerations];
06674 for (j = 0; j < this->other[i]->numberOfEnumerations; j++)
06675 {
06676 this->other[i]->enumeration[j] = new OtherOptionOrResultEnumeration();
06677 this->other[i]->enumeration[j]->setOtherOptionOrResultEnumeration(
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 OtherOptionOrResultEnumeration*[other->numberOfEnumerations];
06749 for (j = 0; j < other->numberOfEnumerations; j++)
06750 {
06751 temp[ nopt]->enumeration[j] = new OtherOptionOrResultEnumeration();
06752 temp[ nopt]->enumeration[j]->setOtherOptionOrResultEnumeration(
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 OtherOptionOrResultEnumeration*[this->other[i]->numberOfEnumerations];
07320 for (j = 0; j < this->other[i]->numberOfEnumerations; j++)
07321 {
07322 this->other[i]->enumeration[j] = new OtherOptionOrResultEnumeration();
07323 this->other[i]->enumeration[j]->setOtherOptionOrResultEnumeration(
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 OtherOptionOrResultEnumeration*[other->numberOfEnumerations];
07395 for (j = 0; j < other->numberOfEnumerations; j++)
07396 {
07397 temp[ nopt]->enumeration[j] = new OtherOptionOrResultEnumeration();
07398 temp[ nopt]->enumeration[j]->setOtherOptionOrResultEnumeration(
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::setHeader(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
07552
07553
07554 this->general = new GeneralOption();
07555 this->general->serviceName = serviceName;
07556 return true;
07557 }
07558
07559 bool OSOption::setInstanceName( std::string instanceName)
07560 {
07561 if (this->general == NULL)
07562 this->general = new GeneralOption();
07563 this->general->instanceName = instanceName;
07564 return true;
07565 }
07566
07567 bool OSOption::setInstanceLocation( std::string instanceLocation)
07568 {
07569 if (this->general == NULL)
07570 this->general = new GeneralOption();
07571 if (this->general->instanceLocation == NULL)
07572 this->general->instanceLocation = new InstanceLocationOption();
07573 this->general->instanceLocation->value = instanceLocation;
07574 return true;
07575 }
07576
07577 bool OSOption::setInstanceLocation( std::string instanceLocation, std::string locationType)
07578 {
07579 if (verifyLocationType(locationType) == 0)
07580 return false;
07581
07582 if (this->general == NULL)
07583 this->general = new GeneralOption();
07584 if (this->general->instanceLocation == NULL)
07585 this->general->instanceLocation = new InstanceLocationOption();
07586 this->general->instanceLocation->value = instanceLocation;
07587 this->general->instanceLocation->locationType = locationType;
07588 return true;
07589 }
07590
07591 bool OSOption::setInstanceLocationType( std::string locationType)
07592 {
07593 try
07594 {
07595 if (this->general == NULL)
07596 this->general = new GeneralOption();
07597 if (this->general->instanceLocation == NULL)
07598 this->general->instanceLocation = new InstanceLocationOption();
07599
07600 if (verifyLocationType(locationType) == 0)
07601 return false;
07602
07603 this->general->instanceLocation->locationType = locationType;
07604 return true;
07605 }
07606 catch(const ErrorClass& eclass)
07607 {
07608 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_error, eclass.errormsg);
07609 return false;
07610 }
07611 }
07612
07613 bool OSOption::setJobID( std::string jobID)
07614 {
07615 if (this->general == NULL)
07616 this->general = new GeneralOption();
07617 this->general->jobID = jobID;
07618 return true;
07619 }
07620
07621 bool OSOption::setSolverToInvoke( std::string solverToInvoke)
07622 {
07623 if (this->general == NULL)
07624 this->general = new GeneralOption();
07625 this->general->solverToInvoke = solverToInvoke;
07626 return true;
07627 }
07628
07629 bool OSOption::setLicense( std::string license)
07630 {
07631 if (this->general == NULL)
07632 this->general = new GeneralOption();
07633 this->general->license = license;
07634 return true;
07635 }
07636
07637 bool OSOption::setUserName( std::string userName)
07638 {
07639 if (this->general == NULL)
07640 this->general = new GeneralOption();
07641 this->general->userName = userName;
07642 return true;
07643 }
07644
07645 bool OSOption::setPassword( std::string password)
07646 {
07647 if (this->general == NULL)
07648 this->general = new GeneralOption();
07649 this->general->password = password;
07650 return true;
07651 }
07652
07653 bool OSOption::setContact( std::string contact)
07654 {
07655 if (this->general == NULL)
07656 this->general = new GeneralOption();
07657 if (this->general->contact == NULL)
07658 this->general->contact = new ContactOption();
07659 this->general->contact->value = contact;
07660 return true;
07661 }
07662
07663 bool OSOption::setContact(std::string contact,std::string transportType)
07664 {
07665 if (verifyTransportType(transportType) == 0)
07666 return false;
07667
07668 if (this->general == NULL)
07669 this->general = new GeneralOption();
07670 if (this->general->contact == NULL)
07671 this->general->contact = new ContactOption();
07672 this->general->contact->value = contact;
07673 this->general->contact->transportType = transportType;
07674 return true;
07675 }
07676
07677 bool OSOption::setContactTransportType( std::string transportType)
07678 {
07679 try
07680 {
07681 if (this->general == NULL)
07682 this->general = new GeneralOption();
07683 if (this->general->contact == NULL)
07684 this->general->contact = new ContactOption();
07685
07686 if (verifyTransportType(transportType) == 0)
07687 throw ErrorClass( "transport type not recognized.");
07688
07689 this->general->contact->transportType = transportType;
07690 return true;
07691 }
07692 catch(const ErrorClass& eclass)
07693 {
07694 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_error, eclass.errormsg);
07695 return false;
07696 }
07697 }
07698
07699 bool OSOption::setOtherGeneralOptions(int numberOfOptions, OtherOption** other)
07700 {
07701 if (this->general == NULL)
07702 this->general = new GeneralOption();
07703 if (this->general->otherOptions == NULL)
07704 this->general->otherOptions = new OtherOptions();
07705 else
07706 {
07707 int i;
07708 for (i = 0; i < this->general->otherOptions->numberOfOtherOptions; i++)
07709 delete this->general->otherOptions->other[i];
07710 delete[] this->general->otherOptions->other;
07711 this->general->otherOptions->other = NULL;
07712 }
07713 return this->general->otherOptions->setOther(numberOfOptions, other);
07714 }
07715
07716 bool OSOption::setAnOtherGeneralOption(std::string name, std::string value, std::string description)
07717 {
07718 if (this->general == NULL)
07719 this->general = new GeneralOption();
07720 if (this->general->otherOptions == NULL)
07721 this->general->otherOptions = new OtherOptions();
07722 return this->general->otherOptions->addOther(name, value, description);
07723 }
07724
07725
07726
07731 bool OSOption::setMinDiskSpace(std::string unit, std::string description, double value)
07732 {
07733 if (verifyStorageUnit(unit) == 0)
07734 return false;
07735
07736 if (this->system == NULL)
07737 this->system = new SystemOption();
07738 if (this->system->minDiskSpace == NULL)
07739 this->system->minDiskSpace = new StorageCapacity();
07740 this->system->minDiskSpace->unit = unit;
07741 this->system->minDiskSpace->value = value;
07742 this->system->minDiskSpace->description = description;
07743 return true;
07744 }
07745
07746 bool OSOption::setMinDiskSpace(double value)
07747 {
07748 if (this->system == NULL)
07749 this->system = new SystemOption();
07750 if (this->system->minDiskSpace == NULL)
07751 this->system->minDiskSpace = new StorageCapacity();
07752 this->system->minDiskSpace->value = value;
07753 return true;
07754 }
07755
07756 bool OSOption::setMinDiskSpaceUnit(std::string unit)
07757 {
07758 try
07759 {
07760 if (this->system == NULL)
07761 this->system = new SystemOption();
07762 if (this->system->minDiskSpace == NULL)
07763 this->system->minDiskSpace = new StorageCapacity();
07764
07765 if (verifyStorageUnit(unit) == 0)
07766 throw ErrorClass( "disk space unit not recognized.");
07767
07768 this->system->minDiskSpace->unit = unit;
07769 return true;
07770 }
07771 catch(const ErrorClass& eclass)
07772 {
07773 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_error, eclass.errormsg);
07774 return false;
07775 }
07776 }
07777
07778 bool OSOption::setMinMemorySize(std::string unit, std::string description, double value)
07779 {
07780 if (verifyStorageUnit(unit) == 0)
07781 return false;
07782
07783 if (this->system == NULL)
07784 this->system = new SystemOption();
07785 if (this->system->minMemorySize == NULL)
07786 this->system->minMemorySize = new StorageCapacity();
07787 this->system->minMemorySize->unit = unit;
07788 this->system->minMemorySize->value = value;
07789 this->system->minMemorySize->description = description;
07790 return true;
07791 }
07792
07793 bool OSOption::setMinMemorySize(double value)
07794 {
07795 if (this->system == NULL)
07796 this->system = new SystemOption();
07797 if (this->system->minMemorySize == NULL)
07798 this->system->minMemorySize = new StorageCapacity();
07799 this->system->minMemorySize->value = value;
07800 return true;
07801 }
07802
07803 bool OSOption::setMinMemoryUnit(std::string unit)
07804 {
07805 try
07806 {
07807 if (this->system == NULL)
07808 this->system = new SystemOption();
07809 if (this->system->minMemorySize == NULL)
07810 this->system->minMemorySize = new StorageCapacity();
07811
07812 if (verifyStorageUnit(unit) == 0)
07813 throw ErrorClass( "memory size unit not recognized.");
07814
07815 this->system->minMemorySize->unit = unit;
07816 return true;
07817 }
07818 catch(const ErrorClass& eclass)
07819 {
07820 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_error, eclass.errormsg);
07821 return false;
07822 }
07823 }
07824
07825 bool OSOption::setMinCPUSpeed(double value)
07826 {
07827 if (this->system == NULL)
07828 this->system = new SystemOption();
07829 if (this->system->minCPUSpeed == NULL)
07830 this->system->minCPUSpeed = new CPUSpeed();
07831 this->system->minCPUSpeed->value = value;
07832 return true;
07833 }
07834
07835 bool OSOption::setMinCPUSpeed(std::string unit, std::string description, double value)
07836 {
07837 if (verifyCPUSpeedUnit(unit) == 0)
07838 return false;
07839
07840 if (this->system == NULL)
07841 this->system = new SystemOption();
07842 if (this->system->minCPUSpeed == NULL)
07843 this->system->minCPUSpeed = new CPUSpeed();
07844 this->system->minCPUSpeed->unit = unit;
07845 this->system->minCPUSpeed->value = value;
07846 this->system->minCPUSpeed->description = description;
07847 return true;
07848 }
07849
07850 bool OSOption::setMinCPUSpeedUnit(std::string unit)
07851 {
07852 try
07853 {
07854 if (this->system == NULL)
07855 this->system = new SystemOption();
07856 if (this->system->minCPUSpeed == NULL)
07857 this->system->minCPUSpeed = new CPUSpeed();
07858
07859 if (verifyCPUSpeedUnit(unit) == 0)
07860 throw ErrorClass( "CPU speed unit not recognized.");
07861
07862 this->system->minCPUSpeed->unit = unit;
07863 return true;
07864 }
07865 catch(const ErrorClass& eclass)
07866 {
07867 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_error, eclass.errormsg);
07868 return false;
07869 }
07870 }
07871
07872 bool OSOption::setMinCPUNumber(int number)
07873 {
07874 if (this->system == NULL)
07875 this->system = new SystemOption();
07876 if (this->system->minCPUNumber == NULL)
07877 this->system->minCPUNumber = new CPUNumber();
07878 this->system->minCPUNumber->value = number;
07879 return true;
07880 }
07881
07882 bool OSOption::setMinCPUNumber(int number, std::string description)
07883 {
07884 if (this->system == NULL)
07885 this->system = new SystemOption();
07886 if (this->system->minCPUNumber == NULL)
07887 this->system->minCPUNumber = new CPUNumber();
07888 this->system->minCPUNumber->value = number;
07889 this->system->minCPUNumber->description = description;
07890 return true;
07891 }
07892
07893 bool OSOption::setOtherSystemOptions(int numberOfOptions, OtherOption** other)
07894 {
07895 if (this->system == NULL)
07896 this->system = new SystemOption();
07897 if (this->system->otherOptions == NULL)
07898 this->system->otherOptions = new OtherOptions();
07899 else
07900 {
07901 int i;
07902 for (i = 0; i < this->system->otherOptions->numberOfOtherOptions; i++)
07903 delete this->system->otherOptions->other[i];
07904 delete[] this->system->otherOptions->other;
07905 this->system->otherOptions->other = NULL;
07906 this->system->otherOptions->numberOfOtherOptions = 0;
07907 }
07908 return this->system->otherOptions->setOther(numberOfOptions, other);
07909 }
07910
07911 bool OSOption::setAnOtherSystemOption(std::string name, std::string value, std::string description)
07912 {
07913 if (this->system == NULL)
07914 this->system = new SystemOption();
07915 if (this->system->otherOptions == NULL)
07916 this->system->otherOptions = new OtherOptions();
07917 return this->system->otherOptions->addOther(name, value, description);
07918 }
07919
07920
07925 bool OSOption::setServiceType( std::string serviceType)
07926 {
07927 try
07928 {
07929 if (this->service == NULL)
07930 this->service = new ServiceOption();
07931
07932 if (verifyServiceType(serviceType) == 0)
07933 throw ErrorClass( "service type not recognized.");
07934
07935 this->service->type = serviceType;
07936 return true;
07937 }
07938 catch(const ErrorClass& eclass)
07939 {
07940 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_error, eclass.errormsg);
07941 return false;
07942 }
07943 }
07944
07945 bool OSOption::setOtherServiceOptions(int numberOfOptions, OtherOption** other)
07946 {
07947 if (this->service == NULL)
07948 this->service = new ServiceOption();
07949 if (this->service->otherOptions == NULL)
07950 this->service->otherOptions = new OtherOptions();
07951 else
07952 {
07953 int i;
07954 for (i = 0; i < this->service->otherOptions->numberOfOtherOptions; i++)
07955 delete this->service->otherOptions->other[i];
07956 delete[] this->service->otherOptions->other;
07957 this->service->otherOptions->other = NULL;
07958 }
07959 return this->service->otherOptions->setOther(numberOfOptions, other);
07960 }
07961
07962 bool OSOption::setAnOtherServiceOption(std::string name, std::string value, std::string description)
07963 {
07964 if (this->service == NULL)
07965 this->service = new ServiceOption();
07966 if (this->service->otherOptions == NULL)
07967 this->service->otherOptions = new OtherOptions();
07968 return this->service->otherOptions->addOther(name, value, description);
07969 }
07970
07975 bool OSOption::setMaxTime(double value)
07976 {
07977 if (this->job == NULL)
07978 this->job = new JobOption();
07979 if (this->job->maxTime == NULL)
07980 this->job->maxTime = new TimeSpan();
07981 this->job->maxTime->value = value;
07982 return true;
07983 }
07984
07985 bool OSOption::setMaxTime(double value, std::string unit)
07986 {
07987 if (verifyTimeUnit(unit) == 0)
07988 return false;
07989
07990 if (this->job == NULL)
07991 this->job = new JobOption();
07992
07993 if (this->job->maxTime == NULL)
07994 this->job->maxTime = new TimeSpan();
07995 this->job->maxTime->value = value;
07996 this->job->maxTime->unit = unit;
07997 return true;
07998 }
07999
08000 bool OSOption::setMaxTimeUnit(std::string unit)
08001 {
08002 try
08003 {
08004 if (this->job == NULL)
08005 this->job = new JobOption();
08006 if (this->job->maxTime == NULL)
08007 this->job->maxTime = new TimeSpan();
08008
08009 if (verifyTimeUnit(unit) == 0)
08010 throw ErrorClass( "time unit not recognized.");
08011
08012 this->job->maxTime->unit = unit;
08013 return true;
08014 }
08015 catch(const ErrorClass& eclass)
08016 {
08017 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_error, eclass.errormsg);
08018 return false;
08019 }
08020 }
08021
08022 bool OSOption::setRequestedStartTime(std::string time)
08023 {
08024 if (this->job == NULL)
08025 this->job = new JobOption();
08026 this->job->requestedStartTime = time;
08027 return true;
08028 }
08029
08030
08031 bool OSOption::setJobDependencies(int numberOfDependencies, std::string* jobDependencies)
08032 {
08033 if (this->job == NULL)
08034 this->job = new JobOption();
08035 if (this->job->dependencies == NULL)
08036 this->job->dependencies = new JobDependencies();
08037 else
08038 delete[] this->job->dependencies->jobID;
08039 this->job->dependencies->jobID = NULL;
08040 return this->job->dependencies->setJobID(numberOfDependencies, jobDependencies);
08041 }
08042
08043 bool OSOption::setAnotherJobDependency(std::string jobID)
08044 {
08045 if (this->job == NULL)
08046 this->job = new JobOption();
08047 if (this->job->dependencies == NULL)
08048 this->job->dependencies = new JobDependencies();
08049 return this->job->dependencies->addJobID(jobID);
08050 }
08051
08052
08053 bool OSOption::setRequiredDirectories(int numberOfPaths, std::string* paths)
08054 {
08055 if (this->job == NULL)
08056 this->job = new JobOption();
08057 if (this->job->requiredDirectories == NULL)
08058 this->job->requiredDirectories = new DirectoriesAndFiles();
08059 else
08060 delete[] this->job->requiredDirectories->path;
08061 this->job->requiredDirectories->path = NULL;
08062 return this->job->requiredDirectories->setPath(numberOfPaths, paths);
08063 }
08064
08065 bool OSOption::setAnotherRequiredDirectory(std::string path)
08066 {
08067 if (this->job == NULL)
08068 this->job = new JobOption();
08069 if (this->job->requiredDirectories == NULL)
08070 this->job->requiredDirectories = new DirectoriesAndFiles();
08071 return this->job->requiredDirectories->addPath(path);
08072 }
08073
08074
08075 bool OSOption::setRequiredFiles(int numberOfPaths, std::string* paths)
08076 {
08077 if (this->job == NULL)
08078 this->job = new JobOption();
08079 if (this->job->requiredFiles == NULL)
08080 this->job->requiredFiles = new DirectoriesAndFiles();
08081 else
08082 delete[] this->job->requiredFiles->path;
08083 this->job->requiredFiles->path = NULL;
08084 return this->job->requiredFiles->setPath(numberOfPaths, paths);
08085 }
08086
08087 bool OSOption::setAnotherRequiredFile(std::string path)
08088 {
08089 if (this->job == NULL)
08090 this->job = new JobOption();
08091 if (this->job->requiredFiles == NULL)
08092 this->job->requiredFiles = new DirectoriesAndFiles();
08093 return this->job->requiredFiles->addPath(path);
08094 }
08095
08096
08097 bool OSOption::setDirectoriesToMake(int numberOfPaths, std::string* paths)
08098 {
08099 if (this->job == NULL)
08100 this->job = new JobOption();
08101 if (this->job->directoriesToMake == NULL)
08102 this->job->directoriesToMake = new DirectoriesAndFiles();
08103 else
08104 delete[] this->job->directoriesToMake->path;
08105 this->job->directoriesToMake->path = NULL;
08106 return this->job->directoriesToMake->setPath(numberOfPaths, paths);
08107 }
08108
08109 bool OSOption::setAnotherDirectoryToMake(std::string path)
08110 {
08111 if (this->job == NULL)
08112 this->job = new JobOption();
08113 if (this->job->directoriesToMake == NULL)
08114 this->job->directoriesToMake = new DirectoriesAndFiles();
08115 return this->job->directoriesToMake->addPath(path);
08116 }
08117
08118
08119 bool OSOption::setFilesToMake(int numberOfPaths, std::string* paths)
08120 {
08121 if (this->job == NULL)
08122 this->job = new JobOption();
08123 if (this->job->filesToMake == NULL)
08124 this->job->filesToMake = new DirectoriesAndFiles();
08125 else
08126 delete[] this->job->filesToMake->path;
08127 this->job->filesToMake->path = NULL;
08128 return this->job->filesToMake->setPath(numberOfPaths, paths);
08129 }
08130
08131 bool OSOption::setAnotherFileToMake(std::string path)
08132 {
08133 if (this->job == NULL)
08134 this->job = new JobOption();
08135 if (this->job->filesToMake == NULL)
08136 this->job->filesToMake = new DirectoriesAndFiles();
08137 return this->job->filesToMake->addPath(path);
08138 }
08139
08140 bool OSOption::setPathPairs(int object, std::string *from, std::string *to, bool *makeCopy, int numberOfPathPairs)
08141 {
08142 if (numberOfPathPairs < 0) return false;
08143 if (this->job == NULL)
08144 this->job = new JobOption();
08145 switch (object)
08146 {
08147 case ENUM_PATHPAIR_input_dir:
08148 {
08149 if (this->job->inputDirectoriesToMove == NULL)
08150 this->job->inputDirectoriesToMove = new PathPairs();
08151 return this->job->inputDirectoriesToMove->setPathPair(from, to, makeCopy, numberOfPathPairs);
08152 }
08153 case ENUM_PATHPAIR_input_file:
08154 {
08155 if (this->job->inputFilesToMove == NULL)
08156 this->job->inputFilesToMove = new PathPairs();
08157 return this->job->inputFilesToMove->setPathPair(from, to, makeCopy, numberOfPathPairs);
08158 }
08159 case ENUM_PATHPAIR_output_file:
08160 {
08161 if (this->job->outputFilesToMove == NULL)
08162 this->job->outputFilesToMove = new PathPairs();
08163 return this->job->outputFilesToMove->setPathPair(from, to, makeCopy, numberOfPathPairs);
08164 }
08165 case ENUM_PATHPAIR_output_dir:
08166 {
08167 if (this->job->outputDirectoriesToMove == NULL)
08168 this->job->outputDirectoriesToMove = new PathPairs();
08169 return this->job->outputDirectoriesToMove->setPathPair(from, to, makeCopy, numberOfPathPairs);
08170 }
08171 default:
08172 throw ErrorClass("target object not implemented in setPathPairs");
08173 }
08174
08175 }
08176
08177
08178 bool OSOption::setInputDirectoriesToMove(int numberOfPathPairs, PathPair** pathPair)
08179 {
08180 if (this->job == NULL)
08181 this->job = new JobOption();
08182 if (this->job->inputDirectoriesToMove == NULL)
08183 this->job->inputDirectoriesToMove = new PathPairs();
08184 else
08185 delete[] this->job->inputDirectoriesToMove->pathPair;
08186 this->job->inputDirectoriesToMove->pathPair = NULL;
08187 return this->job->inputDirectoriesToMove->setPathPair(numberOfPathPairs, pathPair);
08188 }
08189
08190 bool OSOption::setAnotherInputDirectoryToMove(std::string fromPath, std::string toPath, bool makeCopy)
08191 {
08192 if (this->job == NULL)
08193 this->job = new JobOption();
08194 if (this->job->inputDirectoriesToMove == NULL)
08195 this->job->inputDirectoriesToMove = new PathPairs();
08196 return this->job->inputDirectoriesToMove->addPathPair(fromPath, toPath, makeCopy);
08197 }
08198
08199
08200 bool OSOption::setInputFilesToMove(int numberOfPathPairs, PathPair** pathPair)
08201 {
08202 if (this->job == NULL)
08203 this->job = new JobOption();
08204 if (this->job->inputFilesToMove == NULL)
08205 this->job->inputFilesToMove = new PathPairs();
08206 else
08207 delete[] this->job->inputFilesToMove->pathPair;
08208 this->job->inputFilesToMove->pathPair = NULL;
08209 return this->job->inputFilesToMove->setPathPair(numberOfPathPairs, pathPair);
08210 }
08211
08212 bool OSOption::setAnotherInputFileToMove(std::string fromPath, std::string toPath, bool makeCopy)
08213 {
08214 if (this->job == NULL)
08215 this->job = new JobOption();
08216 if (this->job->inputFilesToMove == NULL)
08217 this->job->inputFilesToMove = new PathPairs();
08218 return this->job->inputFilesToMove->addPathPair(fromPath, toPath, makeCopy);
08219 }
08220
08221
08222 bool OSOption::setOutputFilesToMove(int numberOfPathPairs, PathPair** pathPair)
08223 {
08224 if (this->job == NULL)
08225 this->job = new JobOption();
08226 if (this->job->outputFilesToMove == NULL)
08227 this->job->outputFilesToMove = new PathPairs();
08228 else
08229 delete[] this->job->outputFilesToMove->pathPair;
08230 this->job->outputFilesToMove->pathPair = NULL;
08231 return this->job->outputFilesToMove->setPathPair(numberOfPathPairs, pathPair);
08232 }
08233
08234 bool OSOption::setAnotherOutputFileToMove(std::string fromPath, std::string toPath, bool makeCopy)
08235 {
08236 if (this->job == NULL)
08237 this->job = new JobOption();
08238 if (this->job->outputFilesToMove == NULL)
08239 this->job->outputFilesToMove = new PathPairs();
08240 return this->job->outputFilesToMove->addPathPair(fromPath, toPath, makeCopy);
08241 }
08242
08243
08244 bool OSOption::setOutputDirectoriesToMove(int numberOfPathPairs, PathPair** pathPair)
08245 {
08246 if (this->job == NULL)
08247 this->job = new JobOption();
08248 if (this->job->outputDirectoriesToMove == NULL)
08249 this->job->outputDirectoriesToMove = new PathPairs();
08250 else
08251 delete[] this->job->outputDirectoriesToMove->pathPair;
08252 this->job->outputDirectoriesToMove->pathPair = NULL;
08253 return this->job->outputDirectoriesToMove->setPathPair(numberOfPathPairs, pathPair);
08254 }
08255
08256 bool OSOption::setAnotherOutputDirectoryToMove(std::string fromPath, std::string toPath, bool makeCopy)
08257 {
08258 if (this->job == NULL)
08259 this->job = new JobOption();
08260 if (this->job->outputDirectoriesToMove == NULL)
08261 this->job->outputDirectoriesToMove = new PathPairs();
08262 return this->job->outputDirectoriesToMove->addPathPair(fromPath, toPath, makeCopy);
08263 }
08264
08265
08266 bool OSOption::setFilesToDelete(int numberOfPaths, std::string* paths)
08267 {
08268 if (this->job == NULL)
08269 this->job = new JobOption();
08270 if (this->job->filesToDelete == NULL)
08271 this->job->filesToDelete = new DirectoriesAndFiles();
08272 else
08273 delete[] this->job->filesToDelete->path;
08274 this->job->filesToDelete->path = NULL;
08275 return this->job->filesToDelete->setPath(numberOfPaths, paths);
08276 }
08277
08278 bool OSOption::setAnotherFileToDelete(std::string path)
08279 {
08280 if (this->job == NULL)
08281 this->job = new JobOption();
08282 if (this->job->filesToDelete == NULL)
08283 this->job->filesToDelete = new DirectoriesAndFiles();
08284 return this->job->filesToDelete->addPath(path);
08285 }
08286
08287
08288 bool OSOption::setDirectoriesToDelete(int numberOfPaths, std::string* paths)
08289 {
08290 if (this->job == NULL)
08291 this->job = new JobOption();
08292 if (this->job->directoriesToDelete == NULL)
08293 this->job->directoriesToDelete = new DirectoriesAndFiles();
08294 else
08295 delete[] this->job->directoriesToDelete->path;
08296 this->job->directoriesToDelete->path = NULL;
08297 return this->job->directoriesToDelete->setPath(numberOfPaths, paths);
08298 }
08299
08300 bool OSOption::setAnotherDirectoryToDelete(std::string path)
08301 {
08302 if (this->job == NULL)
08303 this->job = new JobOption();
08304 if (this->job->directoriesToDelete == NULL)
08305 this->job->directoriesToDelete = new DirectoriesAndFiles();
08306 return this->job->directoriesToDelete->addPath(path);
08307 }
08308
08309
08310 bool OSOption::setProcessesToKill(int numberOfProcesses, std::string* processes)
08311 {
08312 if (this->job == NULL)
08313 this->job = new JobOption();
08314 if (this->job->processesToKill == NULL)
08315 this->job->processesToKill = new Processes();
08316 else
08317 delete[] this->job->processesToKill->process;
08318 this->job->processesToKill->process = NULL;
08319 return this->job->processesToKill->setProcess(numberOfProcesses, processes);
08320 }
08321
08322 bool OSOption::setAnotherProcessToKill(std::string process)
08323 {
08324 if (this->job == NULL)
08325 this->job = new JobOption();
08326 if (this->job->processesToKill == NULL)
08327 this->job->processesToKill = new Processes();
08328 return this->job->processesToKill->addProcess(process);
08329 }
08330
08331
08332 bool OSOption::setOtherJobOptions(int numberOfOptions, OtherOption** other)
08333 {
08334 if (this->job == NULL)
08335 this->job = new JobOption();
08336 if (this->job->otherOptions == NULL)
08337 this->job->otherOptions = new OtherOptions();
08338 else
08339 {
08340 int i;
08341 for (i = 0; i < this->job->otherOptions->numberOfOtherOptions; i++)
08342 delete this->job->otherOptions->other[i];
08343 delete[] this->job->otherOptions->other;
08344 this->job->otherOptions->other = NULL;
08345 }
08346 return this->job->otherOptions->setOther(numberOfOptions, other);
08347 }
08348
08349 bool OSOption::setAnOtherJobOption(std::string name, std::string value, std::string description)
08350 {
08351 if (this->job == NULL)
08352 this->job = new JobOption();
08353 if (this->job->otherOptions == NULL)
08354 this->job->otherOptions = new OtherOptions();
08355 return this->job->otherOptions->addOther(name, value, description);
08356 }
08357
08358
08359
08360 bool OSOption::setNumberOfVariables(int numberOfVariables)
08361 {
08362 if (this->optimization == NULL)
08363 this->optimization = new OptimizationOption();
08364 this->optimization->numberOfVariables = numberOfVariables;
08365 return true;
08366 }
08367
08368 bool OSOption::setNumberOfObjectives(int numberOfObjectives)
08369 {
08370 if (this->optimization == NULL)
08371 this->optimization = new OptimizationOption();
08372 this->optimization->numberOfObjectives = numberOfObjectives;
08373 return true;
08374 }
08375
08376 bool OSOption::setNumberOfConstraints(int numberOfConstraints)
08377 {
08378 if (this->optimization == NULL)
08379 this->optimization = new OptimizationOption();
08380 this->optimization->numberOfConstraints = numberOfConstraints;
08381 return true;
08382 }
08383
08384
08385 bool OSOption::setInitVarValues(int numberOfVar, int* idx, double* value, std::string* name)
08386 {
08387 if (this->optimization == NULL)
08388 this->optimization = new OptimizationOption();
08389 if (this->optimization->variables == NULL)
08390 this->optimization->variables = new VariableOption();
08391 if (this->optimization->variables->initialVariableValues != NULL)
08392 return false;
08393
08394 this->optimization->variables->initialVariableValues = new InitVariableValues();
08395
08396 return this->optimization->variables->initialVariableValues->setVar(numberOfVar, idx, value, name);
08397 }
08398
08399 bool OSOption::setInitVarValuesSparse(int numberOfVar, InitVarValue** var)
08400 {
08401 if (this->optimization == NULL)
08402 this->optimization = new OptimizationOption();
08403 if (this->optimization->variables == NULL)
08404 this->optimization->variables = new VariableOption();
08405 if (this->optimization->variables->initialVariableValues == NULL)
08406 this->optimization->variables->initialVariableValues = new InitVariableValues();
08407 else
08408 {
08409 int i;
08410 for (i = 0; i < this->optimization->variables->initialVariableValues->numberOfVar; i++)
08411 delete this->optimization->variables->initialVariableValues->var[i];
08412 delete[] this->optimization->variables->initialVariableValues->var;
08413 this->optimization->variables->initialVariableValues->var = NULL;
08414 }
08415 return this->optimization->variables->initialVariableValues->setVar(numberOfVar, var);
08416 }
08417
08418 bool OSOption::setInitVarValuesSparse(int numberOfVar, InitVarValue** var, ENUM_COMBINE_ARRAYS disp)
08419 {
08420 if (this->optimization == NULL)
08421 this->optimization = new OptimizationOption();
08422 if (this->optimization->variables == NULL)
08423 this->optimization->variables = new VariableOption();
08424 if (this->optimization->variables->initialVariableValues == NULL)
08425 this->optimization->variables->initialVariableValues = new InitVariableValues();
08426 return this->optimization->variables->initialVariableValues->setVar(numberOfVar, var, disp);
08427 }
08428
08429 bool OSOption::setInitVarValuesDense(int numberOfVar, double *value)
08430 {
08431 if (this->optimization == NULL)
08432 this->optimization = new OptimizationOption();
08433 if (this->optimization->variables == NULL)
08434 this->optimization->variables = new VariableOption();
08435 if (this->optimization->variables->initialVariableValues == NULL)
08436 this->optimization->variables->initialVariableValues = new InitVariableValues();
08437 else
08438 {
08439 delete[] this->optimization->variables->initialVariableValues->var;
08440 this->optimization->variables->initialVariableValues->var = NULL;
08441 }
08442
08443 int i;
08444 for (i = 0; i < numberOfVar; i++)
08445 {
08446
08447 if (!this->optimization->variables->initialVariableValues->addVar(i, value[i]))
08448 return false;
08449 }
08450 return true;
08451 }
08452
08453 bool OSOption::setAnotherInitVarValue(int idx, double value)
08454 {
08455 if (this->optimization == NULL)
08456 this->optimization = new OptimizationOption();
08457 if (this->optimization->variables == NULL)
08458 this->optimization->variables = new VariableOption();
08459 if (this->optimization->variables->initialVariableValues == NULL)
08460 this->optimization->variables->initialVariableValues = new InitVariableValues();
08461 return this->optimization->variables->initialVariableValues->addVar(idx, value);
08462 }
08463
08464 bool OSOption::setInitVarValuesString(int numberOfVar, int* idx, std::string* value, std::string* name)
08465 {
08466 if (this->optimization == NULL)
08467 this->optimization = new OptimizationOption();
08468 if (this->optimization->variables == NULL)
08469 this->optimization->variables = new VariableOption();
08470 if (this->optimization->variables->initialVariableValuesString != NULL)
08471 return false;
08472
08473 this->optimization->variables->initialVariableValuesString = new InitVariableValuesString();
08474
08475 return this->optimization->variables->initialVariableValuesString->setVar(numberOfVar, idx, value, name);
08476 }
08477
08478 bool OSOption::setInitVarValuesStringSparse(int numberOfVar, InitVarValueString** var)
08479 {
08480 if (this->optimization == NULL)
08481 this->optimization = new OptimizationOption();
08482 if (this->optimization->variables == NULL)
08483 this->optimization->variables = new VariableOption();
08484 if (this->optimization->variables->initialVariableValuesString == NULL)
08485 this->optimization->variables->initialVariableValuesString = new InitVariableValuesString();
08486 else
08487
08488
08489 {
08490 int i;
08491 for (i = 0; i < this->optimization->variables->initialVariableValuesString->numberOfVar; i++)
08492 delete this->optimization->variables->initialVariableValuesString->var[i];
08493 delete[] this->optimization->variables->initialVariableValuesString->var;
08494 this->optimization->variables->initialVariableValuesString->var = NULL;
08495 }
08496 return this->optimization->variables->initialVariableValuesString->setVar(numberOfVar, var);
08497 }
08498
08499 bool OSOption::setInitVarValuesStringSparse(int numberOfVar, InitVarValueString** var, ENUM_COMBINE_ARRAYS disp)
08500 {
08501 if (this->optimization == NULL)
08502 this->optimization = new OptimizationOption();
08503 if (this->optimization->variables == NULL)
08504 this->optimization->variables = new VariableOption();
08505 if (this->optimization->variables->initialVariableValuesString == NULL)
08506 this->optimization->variables->initialVariableValuesString = new InitVariableValuesString();
08507 return this->optimization->variables->initialVariableValuesString->setVar(numberOfVar, var, disp);
08508 }
08509
08510 bool OSOption::setInitVarValuesStringDense(int numberOfVar, std::string *value)
08511 {
08512 if (this->optimization == NULL)
08513 this->optimization = new OptimizationOption();
08514 if (this->optimization->variables == NULL)
08515 this->optimization->variables = new VariableOption();
08516 if (this->optimization->variables->initialVariableValuesString == NULL)
08517 this->optimization->variables->initialVariableValuesString = new InitVariableValuesString();
08518 else
08519 {
08520 delete[] this->optimization->variables->initialVariableValuesString->var;
08521 this->optimization->variables->initialVariableValuesString->var = NULL;
08522 }
08523 int i;
08524 for (i = 0; i < numberOfVar; i++)
08525 {
08526 if (value[i] != "")
08527 if (!this->optimization->variables->initialVariableValuesString->addVar(i, value[i]))
08528 return false;
08529 }
08530 return true;
08531 }
08532
08533 bool OSOption::setAnotherInitVarValueString(int idx, std::string value)
08534 {
08535 if (this->optimization == NULL)
08536 this->optimization = new OptimizationOption();
08537 if (this->optimization->variables == NULL)
08538 this->optimization->variables = new VariableOption();
08539 if (this->optimization->variables->initialVariableValuesString == NULL)
08540 this->optimization->variables->initialVariableValuesString = new InitVariableValuesString();
08541 return this->optimization->variables->initialVariableValuesString->addVar(idx, value);
08542 }
08543
08544 bool OSOption::setInitBasisStatus(int object, int status, int *i, int ni)
08545 {
08546 if (optimization == NULL) return false;
08547
08548 switch (object)
08549 {
08550 case ENUM_PROBLEM_COMPONENT_variables:
08551 {
08552 if (optimization->variables == NULL)
08553 optimization->variables = new VariableOption();
08554 if (optimization->variables->initialBasisStatus == NULL)
08555 optimization->variables->initialBasisStatus = new BasisStatus();
08556
08557 for (int j=0; j<ni; j++)
08558 {
08559 if (i[j] < 0)
08560 return false;
08561 }
08562 return optimization->variables->initialBasisStatus->setIntVector(status, i, ni);
08563 }
08564 case ENUM_PROBLEM_COMPONENT_objectives:
08565 {
08566 if (optimization->objectives == NULL)
08567 optimization->objectives = new ObjectiveOption();
08568 if (optimization->objectives->initialBasisStatus == NULL)
08569 optimization->objectives->initialBasisStatus = new BasisStatus();
08570 for (int j=0; j<ni; j++)
08571 {
08572 if (i[j] >= 0)
08573 return false;
08574 }
08575 return optimization->objectives->initialBasisStatus->setIntVector(status, i, ni);
08576 }
08577 case ENUM_PROBLEM_COMPONENT_constraints:
08578 {
08579 if (optimization->constraints == NULL)
08580 optimization->constraints = new ConstraintOption();
08581 if (optimization->constraints->initialBasisStatus == NULL)
08582 optimization->constraints->initialBasisStatus = new BasisStatus();
08583 for (int j=0; j<ni; j++)
08584 {
08585 if (i[j] < 0)
08586 return false;
08587 }
08588 return optimization->constraints->initialBasisStatus->setIntVector(status, i, ni);
08589 }
08590 default:
08591 throw ErrorClass("target object not implemented in setInitBasisStatus");
08592 }
08593 }
08594
08595 bool OSOption::setAnotherInitBasisStatus(int object, int idx, int status)
08596 {
08597 if (optimization == NULL) return false;
08598
08599 switch (object)
08600 {
08601 case ENUM_PROBLEM_COMPONENT_variables:
08602 {
08603 if (optimization->variables == NULL)
08604 optimization->variables = new VariableOption();
08605 if (optimization->variables->initialBasisStatus == NULL)
08606 optimization->variables->initialBasisStatus = new BasisStatus();
08607 if (idx < 0) return false;
08608 return optimization->variables->initialBasisStatus->addIdx(status, idx);
08609 }
08610 case ENUM_PROBLEM_COMPONENT_objectives:
08611 {
08612 if (optimization->objectives == NULL)
08613 optimization->objectives = new ObjectiveOption();
08614 if (optimization->objectives->initialBasisStatus == NULL)
08615 optimization->objectives->initialBasisStatus = new BasisStatus();
08616 if (idx >= 0) return false;
08617 return optimization->objectives->initialBasisStatus->addIdx(status, idx);
08618 }
08619 case ENUM_PROBLEM_COMPONENT_constraints:
08620 {
08621 if (optimization->constraints == NULL)
08622 optimization->constraints = new ConstraintOption();
08623 if (optimization->constraints->initialBasisStatus == NULL)
08624 optimization->constraints->initialBasisStatus = new BasisStatus();
08625 if (idx < 0) return false;
08626 return optimization->constraints->initialBasisStatus->addIdx(status, idx);
08627 }
08628 default:
08629 throw ErrorClass("target object not implemented in setAnotherInitBasisStatus");
08630 }
08631 }
08632
08633 bool OSOption::setIntegerVariableBranchingWeights(int numberOfVar, int* idx, double* value, std::string* name)
08634 {
08635 if (this->optimization == NULL)
08636 this->optimization = new OptimizationOption();
08637 if (this->optimization->variables == NULL)
08638 this->optimization->variables = new VariableOption();
08639 if (this->optimization->variables->integerVariableBranchingWeights != NULL)
08640 return false;
08641
08642 this->optimization->variables->integerVariableBranchingWeights = new IntegerVariableBranchingWeights();
08643
08644 return this->optimization->variables->integerVariableBranchingWeights->setVar(numberOfVar, idx, value, name);
08645 }
08646
08647 bool OSOption::setIntegerVariableBranchingWeightsSparse(int numberOfVar, BranchingWeight** var)
08648 {
08649 if (this->optimization == NULL)
08650 this->optimization = new OptimizationOption();
08651 if (this->optimization->variables == NULL)
08652 this->optimization->variables = new VariableOption();
08653 if (this->optimization->variables->integerVariableBranchingWeights == NULL)
08654 this->optimization->variables->integerVariableBranchingWeights = new IntegerVariableBranchingWeights();
08655 else
08656 {
08657 int i;
08658 for (i = 0; i < this->optimization->variables->integerVariableBranchingWeights->numberOfVar; i++)
08659 delete this->optimization->variables->integerVariableBranchingWeights->var[i];
08660 delete[] this->optimization->variables->integerVariableBranchingWeights->var;
08661 this->optimization->variables->integerVariableBranchingWeights->var = NULL;
08662 }
08663 return this->optimization->variables->integerVariableBranchingWeights->setVar(numberOfVar, var);
08664 }
08665
08666 bool OSOption::setIntegerVariableBranchingWeightsSparse(int numberOfVar, BranchingWeight** var, ENUM_COMBINE_ARRAYS disp)
08667 {
08668 if (this->optimization == NULL)
08669 this->optimization = new OptimizationOption();
08670 if (this->optimization->variables == NULL)
08671 this->optimization->variables = new VariableOption();
08672 if (this->optimization->variables->integerVariableBranchingWeights == NULL)
08673 this->optimization->variables->integerVariableBranchingWeights = new IntegerVariableBranchingWeights();
08674 return this->optimization->variables->integerVariableBranchingWeights->setVar(numberOfVar, var, disp);
08675 }
08676
08677 bool OSOption::setIntegerVariableBranchingWeightsDense(int numberOfVar, double *value)
08678 {
08679 if (this->optimization == NULL)
08680 this->optimization = new OptimizationOption();
08681 if (this->optimization->variables == NULL)
08682 this->optimization->variables = new VariableOption();
08683 if (this->optimization->variables->integerVariableBranchingWeights == NULL)
08684 this->optimization->variables->integerVariableBranchingWeights = new IntegerVariableBranchingWeights();
08685 else
08686 {
08687 delete[] this->optimization->variables->integerVariableBranchingWeights->var;
08688 this->optimization->variables->integerVariableBranchingWeights->var = NULL;
08689 }
08690 int i;
08691 for (i = 0; i < numberOfVar; i++)
08692 {
08693
08694 if (!this->optimization->variables->integerVariableBranchingWeights->addVar(i, value[i]))
08695 return false;
08696 }
08697 return true;
08698 }
08699
08700 bool OSOption::setAnotherIntegerVariableBranchingWeight(int idx, double value)
08701 {
08702 if (this->optimization == NULL)
08703 this->optimization = new OptimizationOption();
08704 if (this->optimization->variables == NULL)
08705 this->optimization->variables = new VariableOption();
08706 if (this->optimization->variables->integerVariableBranchingWeights == NULL)
08707 this->optimization->variables->integerVariableBranchingWeights = new IntegerVariableBranchingWeights();
08708 return this->optimization->variables->integerVariableBranchingWeights->addVar(idx, value);
08709 }
08710
08711
08712 bool OSOption::setSOSVariableBranchingWeights(int numberOfSOS, SOSWeights** sos)
08713 {
08714 if (this->optimization == NULL)
08715 this->optimization = new OptimizationOption();
08716 if (this->optimization->variables == NULL)
08717 this->optimization->variables = new VariableOption();
08718 if (this->optimization->variables->sosVariableBranchingWeights == NULL)
08719 this->optimization->variables->sosVariableBranchingWeights = new SOSVariableBranchingWeights();
08720 else
08721 {
08722 int i;
08723 for (i = 0; i < this->optimization->variables->sosVariableBranchingWeights->numberOfSOS; i++)
08724 delete this->optimization->variables->sosVariableBranchingWeights->sos[i];
08725 delete[] this->optimization->variables->sosVariableBranchingWeights->sos;
08726 this->optimization->variables->sosVariableBranchingWeights->sos = NULL;
08727 }
08728 return this->optimization->variables->sosVariableBranchingWeights->setSOS(numberOfSOS, sos);
08729 }
08730
08731 bool OSOption::setAnotherSOSVariableBranchingWeight(int sosIdx, int nvar, double weight, int* idx, double* value, std::string* name)
08732 {
08733 if (this->optimization == NULL)
08734 this->optimization = new OptimizationOption();
08735 if (this->optimization->variables == NULL)
08736 this->optimization->variables = new VariableOption();
08737 if (this->optimization->variables->sosVariableBranchingWeights == NULL)
08738 this->optimization->variables->sosVariableBranchingWeights = new SOSVariableBranchingWeights();
08739 return this->optimization->variables->sosVariableBranchingWeights->addSOS(sosIdx, nvar, weight, idx, value, name);
08740 }
08741
08742 bool OSOption::setNumberOfOtherVariableOptions(int numberOfOther)
08743 {
08744 if (optimization == NULL)
08745 optimization = new OptimizationOption();
08746 if (optimization->variables == NULL)
08747 optimization->variables = new VariableOption();
08748 if(optimization->variables->numberOfOtherVariableOptions < 0) return false;
08749
08750 optimization->variables->numberOfOtherVariableOptions = numberOfOther;
08751
08752 if (numberOfOther > 0)
08753 {
08754 optimization->variables->other = new OtherVariableOption*[numberOfOther];
08755
08756 for (int j=0; j < numberOfOther; j++)
08757 optimization->variables->other[j] = new OtherVariableOption();
08758 }
08759
08760 return true;
08761 }
08762
08763 bool OSOption::setOtherVariableOptionAttributes(int iOther, int numberOfVar,
08764 int numberOfEnumerations, std::string name,
08765 std::string value, std::string solver,
08766 std::string category, std::string type,
08767 std::string varType, std::string enumType,
08768 std::string description)
08769 {
08770 if (optimization == NULL) return false;
08771 if (optimization->variables == NULL) return false;
08772 if (optimization->variables->other == NULL) return false;
08773
08774 if (iOther < 0 || iOther >= optimization->variables->numberOfOtherVariableOptions) return false;
08775
08776
08777 optimization->variables->other[iOther]->numberOfVar = numberOfVar;
08778 optimization->variables->other[iOther]->numberOfEnumerations = numberOfEnumerations;
08779 optimization->variables->other[iOther]->name = name;
08780 optimization->variables->other[iOther]->value = value;
08781 optimization->variables->other[iOther]->solver = solver;
08782 optimization->variables->other[iOther]->category = category;
08783 optimization->variables->other[iOther]->type = type;
08784 optimization->variables->other[iOther]->varType = varType;
08785 optimization->variables->other[iOther]->enumType = enumType;
08786 optimization->variables->other[iOther]->description = description;
08787
08788 if (numberOfVar > 0)
08789 {
08790 optimization->variables->other[iOther]->var = new OtherVarOption*[numberOfVar];
08791 for (int j=0; j<numberOfVar; j++)
08792 optimization->variables->other[iOther]->var[j] = new OtherVarOption();
08793 }
08794
08795 if (numberOfEnumerations > 0)
08796 {
08797 optimization->variables->other[iOther]->enumeration = new OtherOptionOrResultEnumeration*[numberOfEnumerations];
08798 for (int j=0; j<numberOfEnumerations; j++)
08799 optimization->variables->other[iOther]->enumeration[j] = new OtherOptionOrResultEnumeration();
08800 }
08801 return true;
08802 }
08803
08804 bool OSOption::setOtherOptionOrResultEnumeration(int object, int otherOptionNumber, int enumerationNumber,
08805 int numberOfEl, std::string value, std::string description, int* idxArray)
08806 {
08807 if (optimization == NULL) return false;
08808 if (numberOfEl < 0) return false;
08809
08810 switch (object)
08811 {
08812 case ENUM_PROBLEM_COMPONENT_variables:
08813 {
08814 if (optimization->variables == NULL) return false;
08815 if (optimization->variables->other == NULL) return false;
08816 if (otherOptionNumber < 0 || otherOptionNumber >= optimization->variables->numberOfOtherVariableOptions) return false;
08817 if (optimization->variables->other[otherOptionNumber] == NULL) return false;
08818 for (int j=0; j<numberOfEl; j++) if (idxArray[j] < 0) return false;
08819
08820 if (optimization->variables->other[otherOptionNumber]->enumeration == NULL) return false;
08821 if (enumerationNumber < 0 || enumerationNumber >= optimization->variables->other[otherOptionNumber]->numberOfEnumerations) return false;
08822 if (optimization->variables->other[otherOptionNumber]->enumeration[enumerationNumber] == NULL) return false;
08823
08824 return optimization->variables->other[otherOptionNumber]->enumeration[enumerationNumber]->setOtherOptionOrResultEnumeration(value, description, idxArray, numberOfEl);
08825 }
08826
08827 case ENUM_PROBLEM_COMPONENT_objectives:
08828 {
08829 if (optimization->objectives == NULL) return false;
08830 if (optimization->objectives->other == NULL) return false;
08831 if (otherOptionNumber < 0 || otherOptionNumber >= optimization->objectives->numberOfOtherObjectiveOptions) return false;
08832 if (optimization->objectives->other[otherOptionNumber] == NULL) return false;
08833 for (int j=0; j<numberOfEl; j++) if (idxArray[j] >= 0) return false;
08834
08835 if (optimization->objectives->other[otherOptionNumber]->enumeration == NULL) return false;
08836 if (enumerationNumber < 0 || enumerationNumber >= optimization->objectives->other[otherOptionNumber]->numberOfEnumerations) return false;
08837 if (optimization->objectives->other[otherOptionNumber]->enumeration[enumerationNumber] == NULL) return false;
08838
08839 return optimization->objectives->other[otherOptionNumber]->enumeration[enumerationNumber]->setOtherOptionOrResultEnumeration(value, description, idxArray, numberOfEl);
08840 }
08841
08842 case ENUM_PROBLEM_COMPONENT_constraints:
08843 {
08844 if (optimization->constraints == NULL) return false;
08845 if (optimization->constraints->other == NULL) return false;
08846 if (otherOptionNumber < 0 || otherOptionNumber >= optimization->constraints->numberOfOtherConstraintOptions) return false;
08847 if (optimization->constraints->other[otherOptionNumber] == NULL) return false;
08848 for (int j=0; j<numberOfEl; j++) if (idxArray[j] < 0) return false;
08849
08850
08851 if (optimization->constraints->other[otherOptionNumber]->enumeration == NULL) return false;
08852 if (enumerationNumber < 0 || enumerationNumber >= optimization->constraints->other[otherOptionNumber]->numberOfEnumerations) return false;
08853 if (optimization->constraints->other[otherOptionNumber]->enumeration[enumerationNumber] == NULL) return false;
08854
08855 return optimization->constraints->other[otherOptionNumber]->enumeration[enumerationNumber]->setOtherOptionOrResultEnumeration(value, description, idxArray, numberOfEl);
08856 }
08857 default:
08858 throw ErrorClass("target object not implemented in setOtherOptionOrResultEnumeration");
08859 }
08860
08861 }
08862
08863 bool OSOption::setOtherVariableOptionVar(int otherOptionNumber, int varNumber,
08864 int idx, std::string name, std::string value, std::string lbValue, std::string ubValue)
08865 {
08866 if (optimization == NULL) return false;
08867
08868 if (optimization->variables == NULL) return false;
08869 if (optimization->variables->other == NULL) return false;
08870 if (otherOptionNumber < 0 || otherOptionNumber >= optimization->variables->numberOfOtherVariableOptions) return false;
08871 if (optimization->variables->other[otherOptionNumber] == NULL) return false;
08872 if (idx < 0) return false;
08873
08874 if (optimization->variables->other[otherOptionNumber]->var == NULL) return false;
08875 if (varNumber < 0 || varNumber >= optimization->variables->other[otherOptionNumber]->numberOfVar) return false;
08876 if (optimization->variables->other[otherOptionNumber]->var[varNumber] == NULL) return false;
08877
08878 optimization->variables->other[otherOptionNumber]->var[varNumber]->idx = idx;
08879 optimization->variables->other[otherOptionNumber]->var[varNumber]->name = name;
08880 optimization->variables->other[otherOptionNumber]->var[varNumber]->value = value;
08881 optimization->variables->other[otherOptionNumber]->var[varNumber]->lbValue = lbValue;
08882 optimization->variables->other[otherOptionNumber]->var[varNumber]->ubValue = ubValue;
08883 return true;
08884 }
08885
08886
08887 bool OSOption::setOtherVariableOptions(int numberOfOptions, OtherVariableOption** other)
08888 {
08889 if (this->optimization == NULL)
08890 this->optimization = new OptimizationOption();
08891 if (this->optimization->variables == NULL)
08892 this->optimization->variables = new VariableOption();
08893 else
08894 {
08895 int i;
08896 for (i = 0; i < this->optimization->variables->numberOfOtherVariableOptions; i++)
08897 delete this->optimization->variables->other[i];
08898 delete[] this->optimization->variables->other;
08899 this->optimization->variables->other = NULL;
08900 }
08901 return this->optimization->variables->setOther(numberOfOptions, other);
08902 }
08903
08904 bool OSOption::setAnOtherVariableOption(OtherVariableOption* optionValue)
08905 {
08906 if (this->optimization == NULL)
08907 this->optimization = new OptimizationOption();
08908 if (this->optimization->variables == NULL)
08909 this->optimization->variables = new VariableOption();
08910 return this->optimization->variables->addOther(optionValue);
08911 }
08912
08913 bool OSOption::setInitObjValues(int numberOfObj, int* idx, double* value, std::string* name)
08914 {
08915 if (this->optimization == NULL)
08916 this->optimization = new OptimizationOption();
08917 if (this->optimization->objectives == NULL)
08918 this->optimization->objectives = new ObjectiveOption();
08919 if (this->optimization->objectives->initialObjectiveValues != NULL)
08920 return false;
08921
08922 this->optimization->objectives->initialObjectiveValues = new InitObjectiveValues();
08923
08924 return this->optimization->objectives->initialObjectiveValues->setObj(numberOfObj, idx, value, name);
08925 }
08926
08927 bool OSOption::setInitObjValuesSparse(int numberOfObj, InitObjValue** obj)
08928 {
08929 if (this->optimization == NULL)
08930 this->optimization = new OptimizationOption();
08931 if (this->optimization->objectives == NULL)
08932 this->optimization->objectives = new ObjectiveOption();
08933 if (this->optimization->objectives->initialObjectiveValues == NULL)
08934 this->optimization->objectives->initialObjectiveValues = new InitObjectiveValues();
08935 else
08936 {
08937 int i;
08938 for (i = 0; i < this->optimization->objectives->initialObjectiveValues->numberOfObj; i++)
08939 delete this->optimization->objectives->initialObjectiveValues->obj[i];
08940 delete[] this->optimization->objectives->initialObjectiveValues->obj;
08941 this->optimization->objectives->initialObjectiveValues->obj = NULL;
08942 }
08943 return this->optimization->objectives->initialObjectiveValues->setObj(numberOfObj, obj);
08944 }
08945
08946 bool OSOption::setInitObjValuesSparse(int numberOfObj, InitObjValue** obj, ENUM_COMBINE_ARRAYS disp)
08947 {
08948 if (this->optimization == NULL)
08949 this->optimization = new OptimizationOption();
08950 if (this->optimization->objectives == NULL)
08951 this->optimization->objectives = new ObjectiveOption();
08952 if (this->optimization->objectives->initialObjectiveValues == NULL)
08953 this->optimization->objectives->initialObjectiveValues = new InitObjectiveValues();
08954 return this->optimization->objectives->initialObjectiveValues->setObj(numberOfObj, obj, disp);
08955 }
08956
08957 bool OSOption::setInitObjValuesDense(int numberOfObj, double *value)
08958 {
08959 if (this->optimization == NULL)
08960 this->optimization = new OptimizationOption();
08961 if (this->optimization->objectives == NULL)
08962 this->optimization->objectives = new ObjectiveOption();
08963 if (this->optimization->objectives->initialObjectiveValues == NULL)
08964 this->optimization->objectives->initialObjectiveValues = new InitObjectiveValues();
08965 else
08966 {
08967 delete[] this->optimization->objectives->initialObjectiveValues->obj;
08968 this->optimization->objectives->initialObjectiveValues->obj = NULL;
08969 }
08970 int i;
08971 for (i = 0; i < numberOfObj; i++)
08972 {
08973
08974 if (!this->optimization->objectives->initialObjectiveValues->addObj(-1-i, value[i]))
08975 return false;
08976 }
08977 return true;
08978 }
08979
08980 bool OSOption::setAnotherInitObjValue(int idx, double value)
08981 {
08982 if (this->optimization == NULL)
08983 this->optimization = new OptimizationOption();
08984 if (this->optimization->objectives == NULL)
08985 this->optimization->objectives = new ObjectiveOption();
08986 if (this->optimization->objectives->initialObjectiveValues == NULL)
08987 this->optimization->objectives->initialObjectiveValues = new InitObjectiveValues();
08988 return this->optimization->objectives->initialObjectiveValues->addObj(idx, value);
08989 }
08990
08991 bool OSOption::setInitObjBounds(int numberOfObj, int* idx, double* lbValue, double* ubValue, std::string* name)
08992 {
08993 if (this->optimization == NULL)
08994 this->optimization = new OptimizationOption();
08995 if (this->optimization->objectives == NULL)
08996 this->optimization->objectives = new ObjectiveOption();
08997
08998 if (this->optimization->objectives->initialObjectiveBounds != NULL)
08999 return false;
09000
09001 this->optimization->objectives->initialObjectiveBounds = new InitObjectiveBounds();
09002
09003 return this->optimization->objectives->initialObjectiveBounds->setObj(numberOfObj, idx, lbValue, ubValue, name);
09004 }
09005
09006 bool OSOption::setInitObjBoundsSparse(int numberOfObj, InitObjBound** obj)
09007 {
09008 if (this->optimization == NULL)
09009 this->optimization = new OptimizationOption();
09010 if (this->optimization->objectives == NULL)
09011 this->optimization->objectives = new ObjectiveOption();
09012 if (this->optimization->objectives->initialObjectiveBounds == NULL)
09013 this->optimization->objectives->initialObjectiveBounds = new InitObjectiveBounds();
09014 else
09015 {
09016 int i;
09017 for (i = 0; i < this->optimization->objectives->initialObjectiveBounds->numberOfObj; i++)
09018 delete this->optimization->objectives->initialObjectiveBounds->obj[i];
09019 delete[] this->optimization->objectives->initialObjectiveBounds->obj;
09020 this->optimization->objectives->initialObjectiveBounds->obj = NULL;
09021 }
09022 return this->optimization->objectives->initialObjectiveBounds->setObj(numberOfObj, obj);
09023 }
09024
09025 bool OSOption::setInitObjBoundsSparse(int numberOfObj, InitObjBound** obj, ENUM_COMBINE_ARRAYS disp)
09026 {
09027 if (this->optimization == NULL)
09028 this->optimization = new OptimizationOption();
09029 if (this->optimization->objectives == NULL)
09030 this->optimization->objectives = new ObjectiveOption();
09031 if (this->optimization->objectives->initialObjectiveBounds == NULL)
09032 this->optimization->objectives->initialObjectiveBounds = new InitObjectiveBounds();
09033 return this->optimization->objectives->initialObjectiveBounds->setObj(numberOfObj, obj, disp);
09034 }
09035
09036 bool OSOption::setInitObjBoundsDense(int numberOfObj, double* lb, double* ub)
09037 {
09038 if (this->optimization == NULL)
09039 this->optimization = new OptimizationOption();
09040 if (this->optimization->objectives == NULL)
09041 this->optimization->objectives = new ObjectiveOption();
09042 if (this->optimization->objectives->initialObjectiveBounds == NULL)
09043 this->optimization->objectives->initialObjectiveBounds = new InitObjectiveBounds();
09044 else
09045 {
09046 delete[] this->optimization->objectives->initialObjectiveBounds->obj;
09047 this->optimization->objectives->initialObjectiveBounds->obj = NULL;
09048 }
09049 int i;
09050 for (i = 0; i < numberOfObj; i++)
09051 {
09052 if (!this->optimization->objectives->initialObjectiveBounds->addObj(-1-i, lb[i], ub[i]))
09053 return false;
09054 }
09055 return true;
09056 }
09057
09058 bool OSOption::setAnotherInitObjBound(int idx, double lb, double ub)
09059 {
09060 if (this->optimization == NULL)
09061 this->optimization = new OptimizationOption();
09062 if (this->optimization->objectives == NULL)
09063 this->optimization->objectives = new ObjectiveOption();
09064 if (this->optimization->objectives->initialObjectiveBounds == NULL)
09065 this->optimization->objectives->initialObjectiveBounds = new InitObjectiveBounds();
09066 return this->optimization->objectives->initialObjectiveBounds->addObj(idx, lb, ub);
09067 }
09068
09069 bool OSOption::setOtherObjectiveOptionObj(int otherOptionNumber, int objNumber,
09070 int idx, std::string name, std::string value, std::string lbValue, std::string ubValue)
09071 {
09072 if (optimization == NULL) return false;
09073
09074 if (optimization->objectives == NULL) return false;
09075 if (optimization->objectives->other == NULL) return false;
09076 if (otherOptionNumber < 0 || otherOptionNumber >= optimization->objectives->numberOfOtherObjectiveOptions) return false;
09077 if (optimization->objectives->other[otherOptionNumber] == NULL) return false;
09078 if (idx >= 0) return false;
09079
09080 if (optimization->objectives->other[otherOptionNumber]->obj == NULL) return false;
09081 if (objNumber < 0 || objNumber >= optimization->objectives->other[otherOptionNumber]->numberOfObj) return false;
09082 if (optimization->objectives->other[otherOptionNumber]->obj[objNumber] == NULL) return false;
09083
09084 optimization->objectives->other[otherOptionNumber]->obj[objNumber]->idx = idx;
09085 optimization->objectives->other[otherOptionNumber]->obj[objNumber]->name = name;
09086 optimization->objectives->other[otherOptionNumber]->obj[objNumber]->value = value;
09087 optimization->objectives->other[otherOptionNumber]->obj[objNumber]->lbValue = lbValue;
09088 optimization->objectives->other[otherOptionNumber]->obj[objNumber]->ubValue = ubValue;
09089 return true;
09090 }
09091
09092 bool OSOption::setNumberOfOtherObjectiveOptions(int numberOfOther)
09093 {
09094 if (optimization == NULL) return false;
09095 if (optimization->objectives == NULL)
09096 optimization->objectives = new ObjectiveOption();
09097 if (optimization->objectives->numberOfOtherObjectiveOptions < 0) return false;
09098
09099 optimization->objectives->numberOfOtherObjectiveOptions = numberOfOther;
09100
09101 if (numberOfOther > 0)
09102 {
09103 optimization->objectives->other = new OtherObjectiveOption*[numberOfOther];
09104
09105 for (int j=0; j < numberOfOther; j++)
09106 optimization->objectives->other[j] = new OtherObjectiveOption();
09107 }
09108 return true;
09109
09110 }
09111
09112 bool OSOption::setOtherObjectiveOptionAttributes(int iOther, int numberOfObj,
09113 int numberOfEnumerations, std::string name,
09114 std::string value, std::string solver,
09115 std::string category, std::string type,
09116 std::string objType, std::string enumType,
09117 std::string description)
09118 {
09119 if (optimization == NULL) return false;
09120 if (optimization->objectives == NULL) return false;
09121 if (optimization->objectives->other == NULL) return false;
09122
09123 if (iOther < 0 || iOther >= optimization->objectives->numberOfOtherObjectiveOptions) return false;
09124
09125 optimization->objectives->other[iOther]->numberOfObj = numberOfObj;
09126 optimization->objectives->other[iOther]->numberOfEnumerations = numberOfEnumerations;
09127 optimization->objectives->other[iOther]->name = name;
09128 optimization->objectives->other[iOther]->value = value;
09129 optimization->objectives->other[iOther]->solver = solver;
09130 optimization->objectives->other[iOther]->category = category;
09131 optimization->objectives->other[iOther]->type = type;
09132 optimization->objectives->other[iOther]->objType = objType;
09133 optimization->objectives->other[iOther]->enumType = enumType;
09134 optimization->objectives->other[iOther]->description = description;
09135
09136 if (numberOfObj > 0)
09137 {
09138 optimization->objectives->other[iOther]->obj = new OtherObjOption*[numberOfObj];
09139 for (int j=0; j<numberOfObj; j++)
09140 optimization->objectives->other[iOther]->obj[j] = new OtherObjOption();
09141 }
09142
09143 if (numberOfEnumerations > 0)
09144 {
09145 optimization->objectives->other[iOther]->enumeration = new OtherOptionOrResultEnumeration*[numberOfEnumerations];
09146 for (int j=0; j<numberOfEnumerations; j++)
09147 optimization->objectives->other[iOther]->enumeration[j] = new OtherOptionOrResultEnumeration();
09148 }
09149 return true;
09150 }
09151
09152 bool OSOption::setOtherObjectiveOptions(int numberOfOptions, OtherObjectiveOption** other)
09153 {
09154 if (this->optimization == NULL)
09155 this->optimization = new OptimizationOption();
09156 if (this->optimization->objectives == NULL)
09157 this->optimization->objectives = new ObjectiveOption();
09158 else
09159 {
09160 int i;
09161 for (i = 0; i < this->optimization->objectives->numberOfOtherObjectiveOptions; i++)
09162 delete this->optimization->objectives->other[i];
09163 delete[] this->optimization->objectives->other;
09164 this->optimization->objectives->other = NULL;
09165 }
09166 return this->optimization->objectives->setOther(numberOfOptions, other);
09167 }
09168
09169 bool OSOption::setAnOtherObjectiveOption(OtherObjectiveOption* optionValue)
09170 {
09171 if (this->optimization == NULL)
09172 this->optimization = new OptimizationOption();
09173 if (this->optimization->objectives == NULL)
09174 this->optimization->objectives = new ObjectiveOption();
09175 return this->optimization->objectives->addOther(optionValue);
09176 }
09177
09178
09179 bool OSOption::setInitConValues(int numberOfCon, int* idx, double* value, std::string* name)
09180 {
09181 if (this->optimization == NULL)
09182 this->optimization = new OptimizationOption();
09183 if (this->optimization->constraints == NULL)
09184 this->optimization->constraints = new ConstraintOption();
09185 if (this->optimization->constraints->initialConstraintValues != NULL)
09186 return false;
09187
09188 this->optimization->constraints->initialConstraintValues = new InitConstraintValues();
09189
09190 return this->optimization->constraints->initialConstraintValues->setCon(numberOfCon, idx, value, name);
09191 }
09192
09193
09194 bool OSOption::setInitConValuesSparse(int numberOfCon, InitConValue** con)
09195 {
09196 if (this->optimization == NULL)
09197 this->optimization = new OptimizationOption();
09198 if (this->optimization->constraints == NULL)
09199 this->optimization->constraints = new ConstraintOption();
09200 if (this->optimization->constraints->initialConstraintValues == NULL)
09201 this->optimization->constraints->initialConstraintValues = new InitConstraintValues();
09202 else
09203 {
09204 int i;
09205 for (i = 0; i < this->optimization->constraints->initialConstraintValues->numberOfCon; i++)
09206 delete this->optimization->constraints->initialConstraintValues->con[i];
09207 delete[] this->optimization->constraints->initialConstraintValues->con;
09208 this->optimization->constraints->initialConstraintValues->con = NULL;
09209 }
09210 return this->optimization->constraints->initialConstraintValues->setCon(numberOfCon, con);
09211 }
09212
09213 bool OSOption::setInitConValuesSparse(int numberOfCon, InitConValue** con, ENUM_COMBINE_ARRAYS disp)
09214 {
09215 if (this->optimization == NULL)
09216 this->optimization = new OptimizationOption();
09217 if (this->optimization->constraints == NULL)
09218 this->optimization->constraints = new ConstraintOption();
09219 if (this->optimization->constraints->initialConstraintValues == NULL)
09220 this->optimization->constraints->initialConstraintValues = new InitConstraintValues();
09221 return this->optimization->constraints->initialConstraintValues->setCon(numberOfCon, con, disp);
09222 }
09223
09224 bool OSOption::setInitConValuesDense(int numberOfCon, double *value)
09225 {
09226 if (this->optimization == NULL)
09227 this->optimization = new OptimizationOption();
09228 if (this->optimization->constraints == NULL)
09229 this->optimization->constraints = new ConstraintOption();
09230 if (this->optimization->constraints->initialConstraintValues == NULL)
09231 this->optimization->constraints->initialConstraintValues = new InitConstraintValues();
09232 else
09233 {
09234 delete[] this->optimization->constraints->initialConstraintValues->con;
09235 this->optimization->constraints->initialConstraintValues->con = NULL;
09236 }
09237 int i;
09238 for (i = 0; i < numberOfCon; i++)
09239 {
09240
09241 if (!this->optimization->constraints->initialConstraintValues->addCon(i, value[i]))
09242 return false;
09243 }
09244 return true;
09245 }
09246
09247 bool OSOption::setAnotherInitConValue(int idx, double value)
09248 {
09249 if (this->optimization == NULL)
09250 this->optimization = new OptimizationOption();
09251 if (this->optimization->constraints == NULL)
09252 this->optimization->constraints = new ConstraintOption();
09253 if (this->optimization->constraints->initialConstraintValues == NULL)
09254 this->optimization->constraints->initialConstraintValues = new InitConstraintValues();
09255 return this->optimization->constraints->initialConstraintValues->addCon(idx, value);
09256 }
09257
09258 bool OSOption::setInitDualValues(int numberOfCon, int* idx, double* lbValue, double* ubValue, std::string* name)
09259 {
09260 if (this->optimization == NULL)
09261 this->optimization = new OptimizationOption();
09262 if (this->optimization->constraints == NULL)
09263 this->optimization->constraints = new ConstraintOption();
09264 if (this->optimization->constraints->initialDualValues != NULL)
09265 return false;
09266
09267 this->optimization->constraints->initialDualValues = new InitDualVariableValues();
09268
09269 return this->optimization->constraints->initialDualValues->setCon(numberOfCon, idx, lbValue, ubValue, name);
09270 }
09271
09272 bool OSOption::setInitDualVarValuesSparse(int numberOfCon, InitDualVarValue** con)
09273 {
09274 if (this->optimization == NULL)
09275 this->optimization = new OptimizationOption();
09276 if (this->optimization->constraints == NULL)
09277 this->optimization->constraints = new ConstraintOption();
09278 if (this->optimization->constraints->initialDualValues == NULL)
09279 this->optimization->constraints->initialDualValues = new InitDualVariableValues();
09280 else
09281 {
09282 int i;
09283 for (i = 0; i < this->optimization->constraints->initialDualValues->numberOfCon; i++)
09284 delete this->optimization->constraints->initialDualValues->con[i];
09285 delete[] this->optimization->constraints->initialDualValues->con;
09286 this->optimization->constraints->initialDualValues->con = NULL;
09287 }
09288 return this->optimization->constraints->initialDualValues->setCon(numberOfCon, con);
09289 }
09290
09291 bool OSOption::setInitDualVarValuesSparse(int numberOfCon, InitDualVarValue** con, ENUM_COMBINE_ARRAYS disp)
09292 {
09293 if (this->optimization == NULL)
09294 this->optimization = new OptimizationOption();
09295 if (this->optimization->constraints == NULL)
09296 this->optimization->constraints = new ConstraintOption();
09297 if (this->optimization->constraints->initialDualValues == NULL)
09298 this->optimization->constraints->initialDualValues = new InitDualVariableValues();
09299 return this->optimization->constraints->initialDualValues->setCon(numberOfCon, con, disp);
09300 }
09301
09302 bool OSOption::setInitDualVarValuesDense(int numberOfCon, double* lb, double* ub)
09303 {
09304 if (this->optimization == NULL)
09305 this->optimization = new OptimizationOption();
09306 if (this->optimization->constraints == NULL)
09307 this->optimization->constraints = new ConstraintOption();
09308 if (this->optimization->constraints->initialDualValues == NULL)
09309 this->optimization->constraints->initialDualValues = new InitDualVariableValues();
09310 else
09311 {
09312 delete[] this->optimization->constraints->initialDualValues->con;
09313 this->optimization->constraints->initialDualValues->con = NULL;
09314 }
09315 int i;
09316 for (i = 0; i < numberOfCon; i++)
09317 {
09318 if ((lb[i] != 0.0) || (ub[i] != 0.0))
09319 if (!this->optimization->constraints->initialDualValues->addCon(i, lb[i], ub[i]))
09320 return false;
09321 }
09322 return true;
09323 }
09324
09325 bool OSOption::setAnotherInitDualVarValue(int idx, double lbValue, double ubValue)
09326 {
09327 if (this->optimization == NULL)
09328 this->optimization = new OptimizationOption();
09329 if (this->optimization->constraints == NULL)
09330 this->optimization->constraints = new ConstraintOption();
09331 if (this->optimization->constraints->initialDualValues == NULL)
09332 this->optimization->constraints->initialDualValues = new InitDualVariableValues();
09333 return this->optimization->constraints->initialDualValues->addCon(idx, lbValue, ubValue);
09334 }
09335
09336 bool OSOption::setNumberOfOtherConstraintOptions(int numberOfOther)
09337 {
09338 if (optimization == NULL) return false;
09339 if (optimization->constraints == NULL)
09340 optimization->constraints = new ConstraintOption();
09341 if (optimization->constraints->numberOfOtherConstraintOptions < 0) return false;
09342
09343 optimization->constraints->numberOfOtherConstraintOptions = numberOfOther;
09344
09345 if (numberOfOther > 0)
09346 {
09347 optimization->constraints->other = new OtherConstraintOption*[numberOfOther];
09348
09349 for (int j=0; j < numberOfOther; j++)
09350 optimization->constraints->other[j] = new OtherConstraintOption();
09351 }
09352
09353 return true;
09354 }
09355
09356 bool OSOption::setOtherConstraintOptionAttributes(int iOther, int numberOfCon,
09357 int numberOfEnumerations, std::string name,
09358 std::string value, std::string solver,
09359 std::string category, std::string type,
09360 std::string conType, std::string enumType,
09361 std::string description)
09362 {
09363 if (optimization == NULL) return false;
09364 if (optimization->constraints == NULL) return false;
09365 if (optimization->constraints->other == NULL) return false;
09366 if (iOther < 0 || iOther >= optimization->constraints->numberOfOtherConstraintOptions) return false;
09367
09368 optimization->constraints->other[iOther]->numberOfCon = numberOfCon;
09369 optimization->constraints->other[iOther]->numberOfEnumerations = numberOfEnumerations;
09370 optimization->constraints->other[iOther]->name = name;
09371 optimization->constraints->other[iOther]->value = value;
09372 optimization->constraints->other[iOther]->solver = solver;
09373 optimization->constraints->other[iOther]->category = category;
09374 optimization->constraints->other[iOther]->type = type;
09375 optimization->constraints->other[iOther]->conType = conType;
09376 optimization->constraints->other[iOther]->enumType = enumType;
09377 optimization->constraints->other[iOther]->description = description;
09378
09379 if (numberOfCon > 0)
09380 {
09381 optimization->constraints->other[iOther]->con = new OtherConOption*[numberOfCon];
09382 for (int j=0; j<numberOfCon; j++)
09383 optimization->constraints->other[iOther]->con[j] = new OtherConOption();
09384 }
09385
09386 if (numberOfEnumerations > 0)
09387 {
09388 optimization->constraints->other[iOther]->enumeration = new OtherOptionOrResultEnumeration*[numberOfEnumerations];
09389 for (int j=0; j<numberOfEnumerations; j++)
09390 optimization->constraints->other[iOther]->enumeration[j] = new OtherOptionOrResultEnumeration();
09391 }
09392 return true;
09393 }
09394
09395
09396 bool OSOption::setOtherConstraintOptionCon(int otherOptionNumber, int conNumber,
09397 int idx, std::string name, std::string value, std::string lbValue, std::string ubValue)
09398 {
09399 if (optimization == NULL) return false;
09400
09401 if (optimization->constraints == NULL) return false;
09402 if (optimization->constraints->other == NULL) return false;
09403 if (otherOptionNumber < 0 || otherOptionNumber >= optimization->constraints->numberOfOtherConstraintOptions) return false;
09404 if (optimization->constraints->other[otherOptionNumber] == NULL) return false;
09405 if (idx < 0) return false;
09406
09407 if (optimization->constraints->other[otherOptionNumber]->con == NULL) return false;
09408 if (conNumber < 0 || conNumber >= optimization->constraints->other[otherOptionNumber]->numberOfCon) return false;
09409 if (optimization->constraints->other[otherOptionNumber]->con[conNumber] == NULL) return false;
09410
09411 optimization->constraints->other[otherOptionNumber]->con[conNumber]->idx = idx;
09412 optimization->constraints->other[otherOptionNumber]->con[conNumber]->name = name;
09413 optimization->constraints->other[otherOptionNumber]->con[conNumber]->value = value;
09414 optimization->constraints->other[otherOptionNumber]->con[conNumber]->lbValue = lbValue;
09415 optimization->constraints->other[otherOptionNumber]->con[conNumber]->ubValue = ubValue;
09416 return true;
09417 }
09418
09419
09420
09421 bool OSOption::setOtherConstraintOptions(int numberOfOptions, OtherConstraintOption** other)
09422 {
09423 if (this->optimization == NULL)
09424 this->optimization = new OptimizationOption();
09425 if (this->optimization->constraints == NULL)
09426 this->optimization->constraints = new ConstraintOption();
09427 else
09428 {
09429 int i;
09430 for (i = 0; i < this->optimization->constraints->numberOfOtherConstraintOptions; i++)
09431 delete this->optimization->constraints->other[i];
09432 delete[] this->optimization->constraints->other;
09433 this->optimization->constraints->other = NULL;
09434 }
09435 return this->optimization->constraints->setOther(numberOfOptions, other);
09436 }
09437
09438 bool OSOption::setAnOtherConstraintOption(OtherConstraintOption* optionValue)
09439 {
09440 if (this->optimization == NULL)
09441 this->optimization = new OptimizationOption();
09442 if (this->optimization->constraints == NULL)
09443 this->optimization->constraints = new ConstraintOption();
09444 return this->optimization->constraints->addOther(optionValue);
09445 }
09446
09447
09448 bool OSOption::setNumberOfSolverOptions(int numberOfOptions)
09449 {
09450 if (optimization == NULL) return false;
09451 if (optimization->solverOptions != NULL) return false;
09452
09453 optimization->solverOptions = new SolverOptions();
09454 optimization->solverOptions->numberOfSolverOptions = numberOfOptions;
09455 optimization->solverOptions->solverOption = new SolverOption*[numberOfOptions];
09456
09457 for (int j=0; j < numberOfOptions; j++)
09458 optimization->solverOptions->solverOption[j] = new SolverOption();
09459 return true;
09460 }
09461
09462 bool OSOption::setSolverOptionContent(int iOption, int numberOfItems,
09463 std::string name,
09464 std::string value, std::string solver,
09465 std::string category, std::string type,
09466 std::string description, std::string *itemList)
09467 {
09468 if (optimization == NULL) return false;
09469 if (optimization->solverOptions == NULL) return false;
09470 if (optimization->solverOptions->solverOption == NULL) return false;
09471
09472 if (iOption < 0 || iOption >= optimization->solverOptions->numberOfSolverOptions) return false;
09473
09474 optimization->solverOptions->solverOption[iOption]->numberOfItems = numberOfItems;
09475 optimization->solverOptions->solverOption[iOption]->name = name;
09476 optimization->solverOptions->solverOption[iOption]->value = value;
09477 optimization->solverOptions->solverOption[iOption]->solver = solver;
09478 optimization->solverOptions->solverOption[iOption]->category = category;
09479 optimization->solverOptions->solverOption[iOption]->type = type;
09480 optimization->solverOptions->solverOption[iOption]->description = description;
09481
09482 if (numberOfItems > 0)
09483 {
09484 optimization->solverOptions->solverOption[iOption]->item = new std::string[numberOfItems];
09485 for (int j=0; j<numberOfItems; j++)
09486 optimization->solverOptions->solverOption[iOption]->item[j] = itemList[j];
09487 }
09488
09489 return true;
09490 }
09491
09492 bool OSOption::setSolverOptions(int numberOfSolverOptions, SolverOption** solverOption)
09493 {
09494 if (this->optimization == NULL)
09495 this->optimization = new OptimizationOption();
09496 if (this->optimization->solverOptions == NULL)
09497 this->optimization->solverOptions = new SolverOptions();
09498 else
09499 {
09500 int i;
09501 for (i = 0; i < this->optimization->solverOptions->numberOfSolverOptions; i++)
09502 delete this->optimization->solverOptions->solverOption[i];
09503 delete[] this->optimization->solverOptions->solverOption;
09504 this->optimization->solverOptions->solverOption = NULL;
09505 }
09506 return this->optimization->solverOptions->setSolverOptions(numberOfSolverOptions, solverOption);
09507 }
09508
09509 bool OSOption::setAnotherSolverOption(std::string name, std::string value, std::string solver,
09510 std::string category, std::string type, std::string description)
09511 {
09512 if (this->optimization == NULL)
09513 this->optimization = new OptimizationOption();
09514 if (this->optimization->solverOptions == NULL)
09515 this->optimization->solverOptions = new SolverOptions();
09516 return this->optimization->solverOptions->addSolverOption(name, value, solver, category, type, description);
09517 }
09518
09519
09520 bool OSOption::setOptionStr(std::string optionName, std::string optionValue)
09521 {
09522 if (optionName == "serviceURI")
09523 return this->setServiceURI(optionValue);
09524
09525 if (optionName == "serviceName")
09526 return this->setServiceName(optionValue);
09527
09528 if (optionName == "instanceName")
09529 return this->setInstanceName(optionValue);
09530
09531 if (optionName == "instanceLocation")
09532 return this->setInstanceLocation(optionValue);
09533
09534 if (optionName == "locationType")
09535 return this->setInstanceLocationType(optionValue);
09536
09537 if (optionName == "jobID")
09538 return this->setJobID(optionValue);
09539
09540 if (optionName == "solverName")
09541 return this->setSolverToInvoke(optionValue);
09542
09543 if (optionName == "solverToInvoke")
09544 return this->setSolverToInvoke(optionValue);
09545
09546 if (optionName == "license")
09547 return this->setLicense(optionValue);
09548
09549 if (optionName == "userName")
09550 return this->setUserName(optionValue);
09551
09552 if (optionName == "password")
09553 return this->setPassword(optionValue);
09554
09555 if (optionName == "contact")
09556 return this->setContact(optionValue);
09557
09558 if (optionName == "transportType")
09559 return this->setContactTransportType(optionValue);
09560
09561 if (optionName == "minDiskSpaceUnit")
09562 return this->setMinDiskSpaceUnit(optionValue);
09563
09564 if (optionName == "minMemoryUnit")
09565 return this->setMinMemoryUnit(optionValue);
09566
09567 if (optionName == "minCPUSpeedUnit")
09568 return this->setMinCPUSpeedUnit(optionValue);
09569
09570 if (optionName == "serviceType")
09571 return this->setServiceType(optionValue);
09572
09573 if (optionName == "maxTimeUnit")
09574 return this->setMaxTimeUnit(optionValue);
09575
09576 if (optionName == "requestedStartTime")
09577 return this->setRequestedStartTime(optionValue);
09578
09579 return false;
09580 }
09581
09582
09583 bool OSOption::setOptionInt(std::string optionName, int optionValue)
09584 {
09585 if (optionName == "minCPUNumber")
09586 return this->setMinCPUNumber(optionValue);
09587
09588 return false;
09589 }
09590
09591
09592 bool OSOption::setOptionDbl(std::string optionName, double value)
09593 {
09594 if (optionName == "minDiskSpaceValue")
09595 return this->setMinDiskSpace(value);
09596
09597 if (optionName == "minMemoryValue")
09598 return this->setMinMemorySize(value);
09599
09600 if (optionName == "minCPUSpeedValue")
09601
09602 return this->setMinCPUSpeed(value);
09603
09604 if (optionName == "maxTime")
09605 return this->setMaxTime(value);
09606
09607 return false;
09608 }
09609
09610
09611
09612
09613
09614 bool OSOption::IsEqual(OSOption *that)
09615 {
09616 #ifndef NDEBUG
09617 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in OSOption");
09618 #endif
09619 if (this == NULL)
09620 {
09621 if (that == NULL)
09622 return true;
09623 else
09624 {
09625 #ifndef NDEBUG
09626 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
09627 #endif
09628 return false;
09629 }
09630 }
09631 else
09632 {
09633 if (that == NULL)
09634 {
09635 #ifndef NDEBUG
09636 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
09637 #endif
09638 return false;
09639 }
09640 else
09641 {
09642 if (!this->optionHeader->IsEqual(that->optionHeader))
09643 return false;
09644 if (!this->general->IsEqual(that->general))
09645 return false;
09646 if (!this->system->IsEqual(that->system))
09647
09648 return false;
09649 if (!this->service->IsEqual(that->service))
09650 return false;
09651 if (!this->job->IsEqual(that->job))
09652 return false;
09653 if (!this->optimization->IsEqual(that->optimization))
09654 return false;
09655 return true;
09656 }
09657 }
09658 }
09659
09660
09661 bool GeneralOption::IsEqual(GeneralOption *that)
09662 {
09663 std::ostringstream outStr;
09664
09665 #ifndef NDEBUG
09666 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in GeneralOption");
09667 #endif
09668 if (this == NULL)
09669 {
09670 if (that == NULL)
09671 return true;
09672 else
09673 {
09674 #ifndef NDEBUG
09675 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
09676 #endif
09677 return false;
09678 }
09679 }
09680 else
09681 {
09682 if (that == NULL)
09683 {
09684 #ifndef NDEBUG
09685 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
09686 #endif
09687 return false;
09688 }
09689 else
09690 {
09691 bool same;
09692 same = (this->serviceURI == that->serviceURI);
09693 same = ((this->serviceName == that->serviceName ) && same);
09694 same = ((this->instanceName == that->instanceName ) && same);
09695 same = ((this->jobID == that->jobID ) && same);
09696 same = ((this->solverToInvoke == that->solverToInvoke) && same);
09697 same = ((this->license == that->license ) && same);
09698 same = ((this->userName == that->userName ) && same);
09699 same = ((this->password == that->password ) && same);
09700 if (!same)
09701 {
09702 #ifndef NDEBUG
09703 outStr.str("");
09704 outStr.clear();
09705 outStr << "serviceURI: " << this->serviceURI << " vs. " << that->serviceURI << endl;
09706 outStr << "serviceName: " << this->serviceName << " vs. " << that->serviceName << endl;
09707 outStr << "instanceName: " << this->instanceName << " vs. " << that->instanceName << endl;
09708 outStr << "jobID: " << this->jobID << " vs. " << that->jobID << endl;
09709 outStr << "solverToInvoke:" << this->solverToInvoke << " vs. " << that->solverToInvoke << endl;
09710 outStr << "license: " << this->license << " vs. " << that->license << endl;
09711 outStr << "userName: " << this->userName << " vs. " << that->userName << endl;
09712 outStr << "password: " << this->password << " vs. " << that->password << endl;
09713 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
09714 #endif
09715 return false;
09716 }
09717 if (!this->instanceLocation->IsEqual(that->instanceLocation))
09718 return false;
09719 if (!this->contact->IsEqual(that->contact))
09720 return false;
09721 if (!this->otherOptions->IsEqual(that->otherOptions))
09722 return false;
09723 return true;
09724 }
09725 }
09726 }
09727
09728
09729 bool SystemOption::IsEqual(SystemOption *that)
09730 {
09731 #ifndef NDEBUG
09732 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in SystemOption");
09733 #endif
09734 if (this == NULL)
09735 {
09736 if (that == NULL)
09737 return true;
09738 else
09739 {
09740 #ifndef NDEBUG
09741 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
09742 #endif
09743 return false;
09744 }
09745 }
09746 else
09747 {
09748 if (that == NULL)
09749 {
09750 #ifndef NDEBUG
09751 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
09752 #endif
09753 return false;
09754 }
09755 else
09756 {
09757 if (!this->minDiskSpace->IsEqual(that->minDiskSpace))
09758 return false;
09759 if (!this->minMemorySize->IsEqual(that->minMemorySize))
09760 return false;
09761 if (!this->minCPUSpeed->IsEqual(that->minCPUSpeed))
09762 return false;
09763 if (!this->minCPUNumber->IsEqual(that->minCPUNumber))
09764 return false;
09765 if (!this->otherOptions->IsEqual(that->otherOptions))
09766 return false;
09767 return true;
09768 }
09769 }
09770 }
09771
09772
09773 bool ServiceOption::IsEqual(ServiceOption *that)
09774 {
09775 std::ostringstream outStr;
09776
09777 #ifndef NDEBUG
09778 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in ServiceOption");
09779 #endif
09780 if (this == NULL)
09781 {
09782 if (that == NULL)
09783 return true;
09784 else
09785 {
09786 #ifndef NDEBUG
09787 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
09788 #endif
09789 return false;
09790 }
09791 }
09792 else
09793 {
09794 if (that == NULL)
09795 {
09796 #ifndef NDEBUG
09797 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
09798 #endif
09799 return false;
09800 }
09801 else
09802 {
09803 if (this->type != that->type)
09804 {
09805 #ifndef NDEBUG
09806 outStr.str("");
09807 outStr.clear();
09808 outStr << "service type: " << this->type << " vs. " << that->type << endl;
09809 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
09810 #endif
09811 return false;
09812 }
09813
09814 if (!this->otherOptions->IsEqual(that->otherOptions))
09815 return false;
09816 return true;
09817 }
09818 }
09819 }
09820
09821
09822 bool JobOption::IsEqual(JobOption *that)
09823 {
09824 std::ostringstream outStr;
09825
09826 #ifndef NDEBUG
09827 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in JobOption");
09828 #endif
09829 if (this == NULL)
09830 {
09831 if (that == NULL)
09832 return true;
09833 else
09834 {
09835 #ifndef NDEBUG
09836 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
09837 #endif
09838 return false;
09839 }
09840 }
09841 else
09842 {
09843 if (that == NULL)
09844 {
09845 #ifndef NDEBUG
09846 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
09847 #endif
09848
09849 return false;
09850 }
09851 else
09852 {
09853 if (this->requestedStartTime != that->requestedStartTime)
09854 {
09855 #ifndef NDEBUG
09856 outStr.str("");
09857 outStr.clear();
09858 outStr << "requestedStartTime: " << this->requestedStartTime << " vs. " << that->requestedStartTime << endl;
09859 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
09860 #endif
09861 return false;
09862 }
09863
09864
09865 if (!this->maxTime->IsEqual(that->maxTime))
09866 return false;
09867 if (!this->dependencies->IsEqual(that->dependencies))
09868 return false;
09869 if (!this->requiredDirectories->IsEqual(that->requiredDirectories))
09870 return false;
09871 if (!this->requiredFiles->IsEqual(that->requiredFiles))
09872 return false;
09873 if (!this->directoriesToMake->IsEqual(that->directoriesToMake))
09874 return false;
09875 if (!this->filesToMake->IsEqual(that->filesToMake))
09876 return false;
09877 if (!this->inputDirectoriesToMove->IsEqual(that->inputDirectoriesToMove))
09878 return false;
09879 if (!this->inputFilesToMove->IsEqual(that->inputFilesToMove))
09880 return false;
09881 if (!this->outputFilesToMove->IsEqual(that->outputFilesToMove))
09882 return false;
09883 if (!this->outputDirectoriesToMove->IsEqual(that->outputDirectoriesToMove))
09884 return false;
09885 if (!this->filesToDelete->IsEqual(that->filesToDelete))
09886 return false;
09887 if (!this->directoriesToDelete->IsEqual(that->directoriesToDelete))
09888 return false;
09889 if (!this->processesToKill->IsEqual(that->processesToKill))
09890 return false;
09891 if (!this->otherOptions->IsEqual(that->otherOptions))
09892 return false;
09893 return true;
09894 }
09895 }
09896 }
09897
09898 bool OptimizationOption::IsEqual(OptimizationOption *that)
09899 {
09900 std::ostringstream outStr;
09901
09902 #ifndef NDEBUG
09903 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in OptimizationOption");
09904 #endif
09905 if (this == NULL)
09906 {
09907 if (that == NULL)
09908 return true;
09909 else
09910 {
09911 #ifndef NDEBUG
09912 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
09913 #endif
09914 return false;
09915 }
09916 }
09917 else
09918 {
09919 if (that == NULL)
09920 {
09921 #ifndef NDEBUG
09922 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
09923 #endif
09924 return false;
09925 }
09926 else
09927 {
09928 if ((this->numberOfVariables != that->numberOfVariables) &&
09929 (this->numberOfVariables * that->numberOfVariables) != 0)
09930 {
09931 #ifndef NDEBUG
09932 outStr.str("");
09933 outStr.clear();
09934 outStr << "numberOfVariables: "
09935 << this->numberOfVariables << " vs. " << that->numberOfVariables << endl;
09936 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
09937 #endif
09938 return false;
09939 }
09940 if ((this->numberOfObjectives != that->numberOfObjectives) &&
09941 (this->numberOfObjectives * that->numberOfObjectives) != 0)
09942 {
09943 #ifndef NDEBUG
09944 outStr.str("");
09945 outStr.clear();
09946 outStr << "numberOfObjectives: "
09947 << this->numberOfObjectives << " vs. " << that->numberOfObjectives << endl;
09948 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
09949 #endif
09950 return false;
09951 }
09952 if ((this->numberOfConstraints != that->numberOfConstraints) &&
09953 (this->numberOfConstraints * that->numberOfConstraints) != 0)
09954 {
09955 #ifndef NDEBUG
09956 outStr.str("");
09957 outStr.clear();
09958 outStr << "numberOfConstraints: "
09959 << this->numberOfConstraints << " vs. " << that->numberOfConstraints << endl;
09960 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
09961 #endif
09962 return false;
09963 }
09964
09965 if (!this->variables->IsEqual(that->variables))
09966 return false;
09967 if (!this->objectives->IsEqual(that->objectives))
09968 return false;
09969 if (!this->constraints->IsEqual(that->constraints))
09970 return false;
09971 if (!this->solverOptions->IsEqual(that->solverOptions))
09972 return false;
09973 return true;
09974 }
09975 }
09976 }
09977
09978 bool InstanceLocationOption::IsEqual(InstanceLocationOption *that)
09979 {
09980 std::ostringstream outStr;
09981
09982 #ifndef NDEBUG
09983 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in InstanceLocation");
09984 #endif
09985 if (this == NULL)
09986 {
09987 if (that == NULL)
09988 return true;
09989 else
09990 {
09991 #ifndef NDEBUG
09992 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
09993 #endif
09994 return false;
09995 }
09996 }
09997 else
09998 {
09999 if (that == NULL)
10000 {
10001 #ifndef NDEBUG
10002 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
10003 #endif
10004 return false;
10005 }
10006 else
10007 {
10008 if ((this->locationType != that->locationType) || (this->value != that->value))
10009 {
10010 #ifndef NDEBUG
10011 outStr.str("");
10012 outStr.clear();
10013 outStr << "location type: " << this->locationType << " vs. " << that->locationType << endl;
10014 outStr << "value: " << this->value << " vs. " << that->value << endl;
10015 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
10016 #endif
10017 return false;
10018 }
10019 return true;
10020 }
10021 }
10022 }
10023
10024 bool ContactOption::IsEqual(ContactOption *that)
10025 {
10026 std::ostringstream outStr;
10027
10028 #ifndef NDEBUG
10029 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in ContactOption");
10030 #endif
10031 if (this == NULL)
10032 {
10033 if (that == NULL)
10034 return true;
10035 else
10036 {
10037 #ifndef NDEBUG
10038 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
10039 #endif
10040 return false;
10041 }
10042 }
10043 else
10044 {
10045 if (that == NULL)
10046 {
10047 #ifndef NDEBUG
10048 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
10049 #endif
10050 return false;
10051 }
10052 else
10053 {
10054 if ((this->transportType != that->transportType) || (this->value != that->value))
10055 {
10056 #ifndef NDEBUG
10057 outStr.str("");
10058 outStr.clear();
10059 outStr << "transport type: " << this->transportType << " vs. " << that->transportType << endl;
10060 outStr << "value: " << this->value << " vs. " << that->value << endl;
10061 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
10062 #endif
10063 return false;
10064 }
10065 return true;
10066 }
10067 }
10068 }
10069
10070 bool OtherOptions::IsEqual(OtherOptions *that)
10071 {
10072 std::ostringstream outStr;
10073
10074 #ifndef NDEBUG
10075 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in OtherOptions");
10076 #endif
10077 if (this == NULL)
10078 {
10079 if (that == NULL)
10080 return true;
10081 else
10082 {
10083 #ifndef NDEBUG
10084 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
10085 #endif
10086 return false;
10087 }
10088 }
10089 else
10090 {
10091 if (that == NULL)
10092 {
10093 #ifndef NDEBUG
10094 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
10095 #endif
10096 return false;
10097 }
10098 else
10099 {
10100 if (this->numberOfOtherOptions != that->numberOfOtherOptions)
10101 {
10102 #ifndef NDEBUG
10103 outStr.str("");
10104 outStr.clear();
10105 outStr << "numberOfOtherOptions: " << this->numberOfOtherOptions << " vs. " << that->numberOfOtherOptions << endl;
10106 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
10107 #endif
10108 return false;
10109 }
10110 int i;
10111 for (i = 0; i < this->numberOfOtherOptions; i++)
10112 if (!this->other[i]->IsEqual(that->other[i]))
10113 return false;
10114 return true;
10115 }
10116 }
10117 }
10118
10119
10120 bool OtherOption::IsEqual(OtherOption *that)
10121 {
10122 std::ostringstream outStr;
10123
10124 #ifndef NDEBUG
10125 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in OtherOption");
10126 #endif
10127 if (this == NULL)
10128 {
10129 if (that == NULL)
10130 return true;
10131 else
10132 {
10133 #ifndef NDEBUG
10134 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
10135 #endif
10136 return false;
10137 }
10138 }
10139 else
10140 {
10141 if (that == NULL)
10142 {
10143 #ifndef NDEBUG
10144 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
10145 #endif
10146 return false;
10147 }
10148 else
10149 {
10150 if ((this->name != that->name) ||
10151 (this->value != that->value) ||
10152 (this->description != that->description) )
10153 {
10154 #ifndef NDEBUG
10155 outStr.str("");
10156 outStr.clear();
10157 outStr << "name: " << this->name << " vs. " << that->name << endl;
10158 outStr << "value: " << this->value << " vs. " << that->value << endl;
10159 outStr << "description: " << this->description << " vs. " << that->description << endl;
10160 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
10161 #endif
10162 return false;
10163 }
10164 return true;
10165 }
10166 }
10167 }
10168
10169 bool MinDiskSpace::IsEqual(MinDiskSpace *that)
10170 {
10171 std::ostringstream outStr;
10172
10173 #ifndef NDEBUG
10174 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in MinDiskSpace");
10175 #endif
10176 if (this == NULL)
10177 {
10178 if (that == NULL)
10179 return true;
10180 else
10181 {
10182 #ifndef NDEBUG
10183 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
10184 #endif
10185 return false;
10186 }
10187 }
10188 else
10189 {
10190 if (that == NULL)
10191 {
10192 #ifndef NDEBUG
10193 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
10194 #endif
10195 return false;
10196 }
10197 else
10198 {
10199 if ((this->unit != that->unit) ||
10200 !OSIsEqual(this->value, that->value) ||
10201 (this->description != that->description) )
10202 {
10203 #ifndef NDEBUG
10204 outStr.str("");
10205 outStr.clear();
10206 outStr << "unit: " << this->unit << " vs. " << that->unit << endl;
10207 outStr << "value: " << this->value << " vs. " << that->value << endl;
10208 outStr << "description: " << this->description << " vs. " << that->description << endl;
10209 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
10210 #endif
10211 return false;
10212 }
10213 return true;
10214 }
10215 }
10216 }
10217
10218 bool MinMemorySize::IsEqual(MinMemorySize *that)
10219 {
10220 std::ostringstream outStr;
10221
10222 #ifndef NDEBUG
10223 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in MinMemorySize");
10224 #endif
10225 if (this == NULL)
10226 {
10227 if (that == NULL)
10228 return true;
10229 else
10230 {
10231 #ifndef NDEBUG
10232 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
10233 #endif
10234 return false;
10235 }
10236 }
10237 else
10238 {
10239 if (that == NULL)
10240 {
10241 #ifndef NDEBUG
10242 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
10243 #endif
10244 return false;
10245 }
10246 else
10247 {
10248 if ((this->unit != that->unit) ||
10249 !OSIsEqual(this->value, that->value) ||
10250 (this->description != that->description) )
10251 {
10252 #ifndef NDEBUG
10253 outStr.str("");
10254 outStr.clear();
10255 outStr << "unit: " << this->unit << " vs. " << that->unit << endl;
10256 outStr << "value: " << this->value << " vs. " << that->value << endl;
10257 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
10258 #endif
10259 return false;
10260 }
10261 return true;
10262 }
10263 }
10264 }
10265
10266 bool MinCPUSpeed::IsEqual(MinCPUSpeed *that)
10267 {
10268 std::ostringstream outStr;
10269
10270 #ifndef NDEBUG
10271 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in MinCPUSpeed");
10272 #endif
10273 if (this == NULL)
10274 {
10275 if (that == NULL)
10276 return true;
10277 else
10278 {
10279 #ifndef NDEBUG
10280 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
10281 #endif
10282 return false;
10283 }
10284 }
10285 else
10286 {
10287 if (that == NULL)
10288 {
10289 #ifndef NDEBUG
10290 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
10291 #endif
10292 return false;
10293 }
10294 else
10295 {
10296 if ((this->unit != that->unit) ||
10297 !OSIsEqual(this->value, that->value) ||
10298 (this->description != that->description) )
10299 {
10300 #ifndef NDEBUG
10301 outStr.str("");
10302 outStr.clear();
10303 outStr << "unit: " << this->unit << " vs. " << that->unit << endl;
10304 outStr << "value: " << this->value << " vs. " << that->value << endl;
10305 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
10306 #endif
10307 return false;
10308 }
10309 return true;
10310 }
10311 }
10312 }
10313
10314 bool MinCPUNumber::IsEqual(MinCPUNumber *that)
10315 {
10316 std::ostringstream outStr;
10317
10318 #ifndef NDEBUG
10319 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in MinCPUNumber");
10320 #endif
10321 if (this == NULL)
10322 {
10323 if (that == NULL)
10324 return true;
10325 else
10326 {
10327 #ifndef NDEBUG
10328 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
10329 #endif
10330 return false;
10331 }
10332 }
10333 else
10334 {
10335 if (that == NULL)
10336 {
10337 #ifndef NDEBUG
10338 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
10339 #endif
10340 return false;
10341 }
10342 else
10343 {
10344 if ((this->description != that->description) ||
10345 (this->value != that->value) )
10346 {
10347 #ifndef NDEBUG
10348 outStr.str("");
10349 outStr.clear();
10350 outStr << "description: " << this->description << " vs. " << that->description << endl;
10351 outStr << "value: " << this->value << " vs. " << that->value << endl;
10352 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
10353 #endif
10354 return false;
10355 }
10356 return true;
10357 }
10358 }
10359 }
10360
10361 bool JobDependencies::IsEqual(JobDependencies *that)
10362 {
10363 std::ostringstream outStr;
10364
10365 #ifndef NDEBUG
10366 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in JobDependencies");
10367 #endif
10368 if (this == NULL)
10369 {
10370 if (that == NULL)
10371 return true;
10372 else
10373 {
10374 #ifndef NDEBUG
10375 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
10376 #endif
10377 return false;
10378 }
10379 }
10380 else
10381 {
10382 if (that == NULL)
10383 {
10384 #ifndef NDEBUG
10385 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
10386 #endif
10387 return false;
10388 }
10389 else
10390 {
10391 if (this->numberOfJobIDs != that->numberOfJobIDs)
10392 {
10393 #ifndef NDEBUG
10394 outStr.str("");
10395 outStr.clear();
10396 outStr << "numberOfJobIDs: " << this->numberOfJobIDs << " vs. " << that->numberOfJobIDs << endl;
10397 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
10398 #endif
10399 return false;
10400 }
10401 int i;
10402 for (i = 0; i < numberOfJobIDs; i++)
10403 if (this->jobID[i] != that->jobID[i])
10404 {
10405 #ifndef NDEBUG
10406 outStr.str("");
10407 outStr.clear();
10408 outStr << "jobID[" << i << "]: " << this->jobID[i] << " vs. " << that->jobID[i] << endl;
10409 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
10410 #endif
10411 return false;
10412 }
10413 return true;
10414 }
10415 }
10416 }
10417
10418 bool DirectoriesAndFiles::IsEqual(DirectoriesAndFiles *that)
10419 {
10420 std::ostringstream outStr;
10421
10422 #ifndef NDEBUG
10423 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in DirectoriesAndFiles");
10424 #endif
10425 if (this == NULL)
10426 {
10427 if (that == NULL)
10428 return true;
10429 else
10430 {
10431 #ifndef NDEBUG
10432 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
10433 #endif
10434 return false;
10435 }
10436 }
10437 else
10438 {
10439 if (that == NULL)
10440 {
10441 #ifndef NDEBUG
10442 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
10443 #endif
10444 return false;
10445 }
10446 else
10447 {
10448 if (this->numberOfPaths != that->numberOfPaths)
10449 {
10450 #ifndef NDEBUG
10451 outStr.str("");
10452 outStr.clear();
10453 outStr << "numberOfPaths: " << this->numberOfPaths << " vs. " << that->numberOfPaths << endl;
10454 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
10455 #endif
10456 return false;
10457 }
10458 int i;
10459 for (i = 0; i < numberOfPaths; i++)
10460 if (this->path[i] != that->path[i])
10461 {
10462 #ifndef NDEBUG
10463 outStr.str("");
10464 outStr.clear();
10465 outStr << "path[" << i << "]: \'" << this->path[i] << "\' vs. \'" << that->path[i] << "\'" << endl;
10466 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
10467 #endif
10468 return false;
10469 }
10470 return true;
10471 }
10472 }
10473 }
10474
10475 bool PathPairs::IsEqual(PathPairs *that)
10476 {
10477 std::ostringstream outStr;
10478
10479 #ifndef NDEBUG
10480 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in PathPairs");
10481 #endif
10482 if (this == NULL)
10483 {
10484 if (that == NULL)
10485 return true;
10486 else
10487 {
10488 #ifndef NDEBUG
10489 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
10490 #endif
10491 return false;
10492 }
10493 }
10494 else
10495 {
10496 if (that == NULL)
10497 {
10498 #ifndef NDEBUG
10499 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
10500 #endif
10501 return false;
10502 }
10503 else
10504 {
10505 if (this->numberOfPathPairs != that->numberOfPathPairs)
10506 {
10507 #ifndef NDEBUG
10508 outStr.str("");
10509 outStr.clear();
10510 outStr << "numberOfPathPairs: " << this->numberOfPathPairs << " vs. " << that->numberOfPathPairs << endl;
10511 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
10512 #endif
10513 return false;
10514 }
10515 int i;
10516 for (i = 0; i < numberOfPathPairs; i++)
10517 if (!this->pathPair[i]->IsEqual(that->pathPair[i]))
10518 return false;
10519 return true;
10520 }
10521 }
10522 }
10523
10524
10525 bool PathPair::IsEqual(PathPair *that)
10526 {
10527 std::ostringstream outStr;
10528
10529 #ifndef NDEBUG
10530 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in PathPair");
10531 #endif
10532 if (this == NULL)
10533 {
10534 if (that == NULL)
10535 return true;
10536
10537 else
10538 {
10539 #ifndef NDEBUG
10540 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
10541 #endif
10542 return false;
10543 }
10544 }
10545 else
10546 {
10547 if (that == NULL)
10548 {
10549 #ifndef NDEBUG
10550 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
10551 #endif
10552 return false;
10553 }
10554 else
10555 {
10556 if ((this->from != that->from) || (this->to != that->to) ||
10557 (this->makeCopy != that->makeCopy))
10558 {
10559 #ifndef NDEBUG
10560 outStr.str("");
10561 outStr.clear();
10562 outStr << "from: " << this->from << " vs. " << that->from << endl;
10563 outStr << "to: " << this->to << " vs. " << that->to << endl;
10564 outStr << "makeCopy: " << this->makeCopy << " vs. " << that->makeCopy << endl;
10565 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
10566 #endif
10567 return false;
10568 }
10569 return true;
10570 }
10571 }
10572 }
10573
10574 bool Processes::IsEqual(Processes *that)
10575 {
10576 std::ostringstream outStr;
10577
10578 #ifndef NDEBUG
10579 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in Processes");
10580 #endif
10581 if (this == NULL)
10582 {
10583 if (that == NULL)
10584 return true;
10585 else
10586 {
10587 #ifndef NDEBUG
10588 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
10589 #endif
10590 return false;
10591 }
10592 }
10593 else
10594 {
10595 if (that == NULL)
10596 {
10597 #ifndef NDEBUG
10598 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
10599 #endif
10600 return false;
10601 }
10602 else
10603 {
10604 if (this->numberOfProcesses != that->numberOfProcesses)
10605 {
10606 #ifndef NDEBUG
10607 outStr.str("");
10608 outStr.clear();
10609 outStr << "numberOfProcesses: " << this->numberOfProcesses << " vs. " << that->numberOfProcesses << endl;
10610 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
10611 #endif
10612 return false;
10613 }
10614 int i;
10615 for (i = 0; i < numberOfProcesses; i++)
10616 if (this->process[i] != that->process[i])
10617 {
10618 #ifndef NDEBUG
10619 outStr.str("");
10620 outStr.clear();
10621 outStr << "process[" << i << "]: " << this->process[i] << " vs. " << that->process[i] << endl;
10622 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
10623 #endif
10624 return false;
10625 }
10626 return true;
10627 }
10628 }
10629 }
10630
10631
10632 bool VariableOption::IsEqual(VariableOption *that)
10633 {
10634 std::ostringstream outStr;
10635
10636 #ifndef NDEBUG
10637 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in VariableOption");
10638 #endif
10639 if (this == NULL)
10640 {
10641 if (that == NULL)
10642 return true;
10643 else
10644 {
10645 #ifndef NDEBUG
10646 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
10647 #endif
10648 return false;
10649 }
10650 }
10651 else
10652 {
10653 if (that == NULL)
10654 {
10655 #ifndef NDEBUG
10656 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
10657 #endif
10658 return false;
10659 }
10660 else
10661 {
10662 if (!this->initialVariableValues->IsEqual(that->initialVariableValues))
10663 return false;
10664 if (!this->initialVariableValuesString->IsEqual(that->initialVariableValuesString))
10665 return false;
10666 if (!this->initialBasisStatus->IsEqual(that->initialBasisStatus))
10667 return false;
10668 if (!this->integerVariableBranchingWeights->IsEqual(that->integerVariableBranchingWeights))
10669 return false;
10670 if (!this->sosVariableBranchingWeights->IsEqual(that->sosVariableBranchingWeights))
10671 return false;
10672
10673 if (this->numberOfOtherVariableOptions != that->numberOfOtherVariableOptions)
10674 {
10675 #ifndef NDEBUG
10676 outStr.str("");
10677 outStr.clear();
10678 outStr << "numberOfOtherVariableOptions: " << this->numberOfOtherVariableOptions << " vs. " << that->numberOfOtherVariableOptions << endl;
10679 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
10680 #endif
10681 return false;
10682 }
10683
10684 int i;
10685 for (i = 0; i < numberOfOtherVariableOptions; i++)
10686 if (!this->other[i]->IsEqual(that->other[i]))
10687 {
10688 #ifndef NDEBUG
10689 outStr.str("");
10690 outStr.clear();
10691 outStr << "other[" << i << "]: " << this->other[i] << " vs. " << that->other[i] << endl;
10692 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
10693 #endif
10694 return false;
10695 }
10696
10697 return true;
10698 }
10699 }
10700 }
10701
10702 bool InitVariableValues::IsEqual(InitVariableValues *that)
10703 {
10704 std::ostringstream outStr;
10705
10706 #ifndef NDEBUG
10707 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in InitVariableValues");
10708 #endif
10709 if (this == NULL)
10710 {
10711 if (that == NULL)
10712 return true;
10713 else
10714 {
10715 #ifndef NDEBUG
10716 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
10717 #endif
10718 return false;
10719 }
10720 }
10721 else
10722 {
10723 if (that == NULL)
10724 {
10725 #ifndef NDEBUG
10726 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
10727 #endif
10728 return false;
10729 }
10730 else
10731 {
10732 if (this->numberOfVar != that->numberOfVar)
10733 {
10734 #ifndef NDEBUG
10735 outStr.str("");
10736 outStr.clear();
10737 outStr << "numberOfVar: " << this->numberOfVar << " vs. " << that->numberOfVar << endl;
10738 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
10739 #endif
10740 return false;
10741 }
10742 int i;
10743 for (i = 0; i < numberOfVar; i++)
10744 if (!this->var[i]->IsEqual(that->var[i]))
10745 return false;
10746 return true;
10747 }
10748 }
10749 }
10750
10751 bool InitVarValue::IsEqual(InitVarValue *that)
10752 {
10753 std::ostringstream outStr;
10754
10755 #ifndef NDEBUG
10756 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in InitVarValue");
10757 #endif
10758 if (this == NULL)
10759 {
10760 if (that == NULL)
10761 return true;
10762 else
10763 {
10764 #ifndef NDEBUG
10765 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
10766 #endif
10767 return false;
10768 }
10769 }
10770 else
10771 {
10772 if (that == NULL)
10773 {
10774 #ifndef NDEBUG
10775 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
10776 #endif
10777 return false;
10778 }
10779 else
10780 {
10781 if ((this->idx != that->idx) || this->name != that->name
10782 || !OSIsEqual(this->value, that->value))
10783 {
10784 #ifndef NDEBUG
10785 outStr.str("");
10786 outStr.clear();
10787 outStr << "idx: " << this->idx << " vs. " << that->idx << endl;
10788 outStr << "value: " << this->value << " vs. " << that->value << endl;
10789 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
10790 #endif
10791 return false;
10792 }
10793 return true;
10794 }
10795 }
10796 }
10797
10798
10799 bool InitVariableValuesString::IsEqual(InitVariableValuesString *that)
10800 {
10801 std::ostringstream outStr;
10802
10803 #ifndef NDEBUG
10804 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in InitVariableValuesString");
10805 #endif
10806 if (this == NULL)
10807 {
10808 if (that == NULL)
10809 return true;
10810 else
10811 {
10812 #ifndef NDEBUG
10813 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
10814 #endif
10815 return false;
10816 }
10817 }
10818 else
10819 {
10820 if (that == NULL)
10821 {
10822 #ifndef NDEBUG
10823 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
10824 #endif
10825 return false;
10826 }
10827 else
10828 {
10829 if (this->numberOfVar != that->numberOfVar)
10830 {
10831 #ifndef NDEBUG
10832 outStr.str("");
10833 outStr.clear();
10834 outStr << "numberOfVar: " << this->numberOfVar << " vs. " << that->numberOfVar << endl;
10835 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
10836 #endif
10837 return false;
10838 }
10839 int i;
10840 for (i = 0; i < numberOfVar; i++)
10841 if (!this->var[i]->IsEqual(that->var[i]))
10842 return false;
10843 return true;
10844 }
10845 }
10846 }
10847
10848 bool InitVarValueString::IsEqual(InitVarValueString *that)
10849 {
10850 std::ostringstream outStr;
10851
10852 #ifndef NDEBUG
10853 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in InitVarValueString");
10854 #endif
10855 if (this == NULL)
10856 {
10857 if (that == NULL)
10858 return true;
10859 else
10860 {
10861 #ifndef NDEBUG
10862 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
10863 #endif
10864 return false;
10865 }
10866 }
10867 else
10868 {
10869 if (that == NULL)
10870 {
10871 #ifndef NDEBUG
10872 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
10873 #endif
10874 return false;
10875 }
10876 else
10877 {
10878 if ((this->idx != that->idx) || this->name != that->name || (this->value != that->value))
10879 {
10880 #ifndef NDEBUG
10881 outStr.str("");
10882 outStr.clear();
10883 outStr << "idx: " << this->idx << " vs. " << that->idx << endl;
10884 outStr << "value: " << this->value << " vs. " << that->value << endl;
10885 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
10886 #endif
10887 return false;
10888 }
10889 return true;
10890 }
10891 }
10892 }
10893
10894 bool InitialBasisStatus::IsEqual(InitialBasisStatus *that)
10895 {
10896 std::ostringstream outStr;
10897
10898 #ifndef NDEBUG
10899 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in InitialBasisStatus");
10900 #endif
10901 if (this == NULL)
10902 {
10903 if (that == NULL)
10904 return true;
10905 else
10906 {
10907 #ifndef NDEBUG
10908 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
10909 #endif
10910 return false;
10911 }
10912 }
10913 else
10914 {
10915 if (that == NULL)
10916 {
10917 #ifndef NDEBUG
10918 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
10919 #endif
10920 return false;
10921 }
10922 else
10923 {
10924 if (this->numberOfVar != that->numberOfVar)
10925 {
10926 #ifndef NDEBUG
10927 outStr.str("");
10928 outStr.clear();
10929 outStr << "numberOfVar: " << this->numberOfVar << " vs. " << that->numberOfVar << endl;
10930 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
10931 #endif
10932 return false;
10933 }
10934 int i;
10935 for (i = 0; i < numberOfVar; i++)
10936 if (!this->var[i]->IsEqual(that->var[i]))
10937 return false;
10938 return true;
10939 }
10940 }
10941 }
10942
10943 bool InitBasStatus::IsEqual(InitBasStatus *that)
10944 {
10945 std::ostringstream outStr;
10946
10947 #ifndef NDEBUG
10948 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in InitBasStatus");
10949 #endif
10950 if (this == NULL)
10951 {
10952 if (that == NULL)
10953 return true;
10954 else
10955 {
10956 #ifndef NDEBUG
10957 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
10958 #endif
10959 return false;
10960 }
10961 }
10962 else
10963 {
10964 if (that == NULL)
10965 {
10966 #ifndef NDEBUG
10967 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
10968 #endif
10969 return false;
10970 }
10971 else
10972 {
10973 if ((this->idx != that->idx) || (this->value != that->value))
10974 if ((this->value != "unknown" && that->value != "") ||
10975 (that->value != "unknown" && this->value != "") )
10976 {
10977 #ifndef NDEBUG
10978 outStr.str("");
10979 outStr.clear();
10980 outStr << "idx: " << this->idx << " vs. " << that->idx << endl;
10981 outStr << "value: " << this->value << " vs. " << that->value << endl;
10982 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
10983 #endif
10984 return false;
10985 }
10986 return true;
10987 }
10988 }
10989 }
10990
10991
10992 bool IntegerVariableBranchingWeights::IsEqual(IntegerVariableBranchingWeights *that)
10993 {
10994 std::ostringstream outStr;
10995
10996 #ifndef NDEBUG
10997 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in IntegerVariableBranchingWeights");
10998 #endif
10999 if (this == NULL)
11000 {
11001 if (that == NULL)
11002 return true;
11003 else
11004 {
11005 #ifndef NDEBUG
11006 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
11007 #endif
11008 return false;
11009 }
11010 }
11011 else
11012 {
11013 if (that == NULL)
11014 {
11015 #ifndef NDEBUG
11016 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
11017 #endif
11018 return false;
11019 }
11020 else
11021 {
11022 if (this->numberOfVar != that->numberOfVar)
11023 {
11024 #ifndef NDEBUG
11025 outStr.str("");
11026 outStr.clear();
11027 outStr << "numberOfVar: " << this->numberOfVar << " vs. " << that->numberOfVar << endl;
11028 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
11029 #endif
11030 return false;
11031 }
11032 int i;
11033 for (i = 0; i < numberOfVar; i++)
11034 if (!this->var[i]->IsEqual(that->var[i]))
11035 return false;
11036 return true;
11037 }
11038 }
11039 }
11040
11041 bool SOSVariableBranchingWeights::IsEqual(SOSVariableBranchingWeights *that)
11042 {
11043 std::ostringstream outStr;
11044
11045 #ifndef NDEBUG
11046 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in SOSVariableBranchingWeights");
11047 #endif
11048 if (this == NULL)
11049 {
11050 if (that == NULL)
11051 return true;
11052 else
11053 {
11054 #ifndef NDEBUG
11055 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
11056 #endif
11057 return false;
11058 }
11059 }
11060 else
11061 {
11062 if (that == NULL)
11063 {
11064 #ifndef NDEBUG
11065 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
11066 #endif
11067 return false;
11068 }
11069 else
11070 {
11071 if (this->numberOfSOS != that->numberOfSOS)
11072 {
11073 #ifndef NDEBUG
11074 outStr.str("");
11075 outStr.clear();
11076 outStr << "numberOfSOS: " << this->numberOfSOS << " vs. " << that->numberOfSOS << endl;
11077 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
11078 #endif
11079 return false;
11080 }
11081 int i;
11082 for (i = 0; i < numberOfSOS; i++)
11083 {
11084 if (!this->sos[i]->IsEqual(that->sos[i]))
11085 return false;
11086 }
11087 return true;
11088 }
11089 }
11090 }
11091
11092
11093 bool SOSWeights::IsEqual(SOSWeights *that)
11094 {
11095 std::ostringstream outStr;
11096
11097 #ifndef NDEBUG
11098 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in SOSWeights");
11099 #endif
11100 if (this == NULL)
11101 {
11102 if (that == NULL)
11103 return true;
11104 else
11105 {
11106 #ifndef NDEBUG
11107 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
11108 #endif
11109 return false;
11110 }
11111 }
11112 else
11113 {
11114 if (that == NULL)
11115 {
11116 #ifndef NDEBUG
11117 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
11118 #endif
11119 return false;
11120 }
11121 else
11122 {
11123 if ((this->sosIdx != that->sosIdx) ||
11124 !OSIsEqual(this->groupWeight, that->groupWeight))
11125 {
11126 #ifndef NDEBUG
11127 outStr.str("");
11128 outStr.clear();
11129 outStr << "sosIdx: " << this->sosIdx << " vs. " << that->sosIdx << endl;
11130 outStr << "groupWeight: " << this->groupWeight << " vs. " << that->groupWeight << endl;
11131 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
11132 #endif
11133 return false;
11134 }
11135
11136 if (this->numberOfVar != that->numberOfVar)
11137 {
11138 #ifndef NDEBUG
11139 outStr.str("");
11140 outStr.clear();
11141 outStr << "numberOfVar: " << this->numberOfVar << " vs. " << that->numberOfVar << endl;
11142 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
11143 #endif
11144 return false;
11145 }
11146 int i;
11147 for (i = 0; i < numberOfVar; i++)
11148 {
11149
11150 if (!this->var[i]->IsEqual(that->var[i]))
11151 return false;
11152 }
11153 return true;
11154 }
11155 }
11156 }
11157
11158
11159 bool BranchingWeight::IsEqual(BranchingWeight *that)
11160 {
11161 std::ostringstream outStr;
11162
11163 #ifndef NDEBUG
11164 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in BranchingWeight");
11165 #endif
11166 if (this == NULL)
11167 {
11168 if (that == NULL)
11169 return true;
11170 else
11171 {
11172 #ifndef NDEBUG
11173 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
11174 #endif
11175 return false;
11176 }
11177 }
11178 else
11179 {
11180 if (that == NULL)
11181 {
11182 #ifndef NDEBUG
11183 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
11184 #endif
11185 return false;
11186 }
11187 else
11188 {
11189 if ((this->idx != that->idx) || this->name != that->name || !OSIsEqual(this->value, that->value))
11190 {
11191 #ifndef NDEBUG
11192 outStr.str("");
11193 outStr.clear();
11194 outStr << "idx: " << this->idx << " vs. " << that->idx << endl;
11195 outStr << "value: " << this->value << " vs. " << that->value << endl;
11196 outStr << "name: -" << this->name << "- vs. -" << that->name << "-" << endl;
11197 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
11198 #endif
11199 return false;
11200 }
11201 return true;
11202 }
11203 }
11204 }
11205
11206 bool OtherVariableOption::IsEqual(OtherVariableOption *that)
11207 {
11208 std::ostringstream outStr;
11209
11210 #ifndef NDEBUG
11211 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in OtherVariableOption");
11212 #endif
11213 if (this == NULL)
11214 {
11215 if (that == NULL)
11216 return true;
11217 else
11218 {
11219 #ifndef NDEBUG
11220 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
11221 #endif
11222 return false;
11223 }
11224 }
11225 else
11226 {
11227 if (that == NULL)
11228 {
11229 #ifndef NDEBUG
11230 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
11231 #endif
11232 return false;
11233 }
11234 else
11235 {
11236 if ((this->name != that->name) ||
11237 (this->value != that->value) ||
11238 (this->solver != that->solver) ||
11239 (this->category != that->category) ||
11240 (this->type != that->type) ||
11241 (this->description != that->description))
11242 {
11243 #ifndef NDEBUG
11244 outStr.str("");
11245 outStr.clear();
11246 outStr << "name: " << this->name << " vs. " << that->name << endl;
11247 outStr << "value: " << this->value << " vs. " << that->value << endl;
11248 outStr << "solver: " << this->solver << " vs. " << that->solver << endl;
11249 outStr << "category: " << this->category << " vs. " << that->category << endl;
11250 outStr << "type: " << this->type << " vs. " << that->type << endl;
11251 outStr << "description: " << this->description << " vs. " << that->description << endl;
11252 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
11253 #endif
11254 return false;
11255 }
11256
11257 if (this->numberOfVar != that->numberOfVar)
11258 {
11259 #ifndef NDEBUG
11260 outStr.str("");
11261 outStr.clear();
11262 outStr << "numberOfVar: " << this->numberOfVar << " vs. " << that->numberOfVar << endl;
11263 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
11264 #endif
11265 return false;
11266 }
11267 int i;
11268 for (i = 0; i < numberOfVar; i++)
11269 if (!this->var[i]->IsEqual(that->var[i]))
11270 return false;
11271
11272 if (this->numberOfEnumerations != that->numberOfEnumerations)
11273 {
11274 #ifndef NDEBUG
11275 outStr.str("");
11276 outStr.clear();
11277 outStr << "numberOfEnumerations: " << this->numberOfEnumerations << " vs. " << that->numberOfEnumerations << endl;
11278 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
11279 #endif
11280 return false;
11281 }
11282 for (i = 0; i < numberOfEnumerations; i++)
11283 if (!this->enumeration[i]->IsEqual(that->enumeration[i]))
11284 return false;
11285 return true;
11286 }
11287 }
11288 }
11289
11290 bool OtherVarOption::IsEqual(OtherVarOption *that)
11291 {
11292 std::ostringstream outStr;
11293
11294 #ifndef NDEBUG
11295 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in OtherVarOption");
11296 #endif
11297 if (this == NULL)
11298 {
11299 if (that == NULL)
11300 return true;
11301 else
11302 {
11303 #ifndef NDEBUG
11304 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
11305 #endif
11306 return false;
11307 }
11308 }
11309 else
11310 {
11311 if (that == NULL)
11312 {
11313 #ifndef NDEBUG
11314 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
11315 #endif
11316 return false;
11317 }
11318 else
11319 {
11320 if ((this->idx != that->idx) || this->name != that->name || (this->value != that->value) ||
11321 (this->lbValue != that->lbValue) || (this->ubValue != that->ubValue))
11322 {
11323 #ifndef NDEBUG
11324 outStr.str("");
11325 outStr.clear();
11326 outStr << "idx: " << this->idx << " vs. " << that->idx << endl;
11327 outStr << "value: " << this->value << " vs. " << that->value << endl;
11328 outStr << "lbValue: " << this->lbValue << " vs. " << that->lbValue << endl;
11329 outStr << "ubValue: " << this->ubValue << " vs. " << that->ubValue << endl;
11330 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
11331 #endif
11332 return false;
11333 }
11334 return true;
11335 }
11336 }
11337 }
11338
11339 bool ObjectiveOption::IsEqual(ObjectiveOption *that)
11340 {
11341 std::ostringstream outStr;
11342
11343 #ifndef NDEBUG
11344 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in ObjectiveOption");
11345 #endif
11346 if (this == NULL)
11347 {
11348 if (that == NULL)
11349 return true;
11350 else
11351 {
11352 #ifndef NDEBUG
11353 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
11354 #endif
11355 return false;
11356 }
11357 }
11358 else
11359 {
11360 if (that == NULL)
11361 {
11362 #ifndef NDEBUG
11363 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
11364 #endif
11365 return false;
11366 }
11367 else
11368 {
11369 if (!this->initialObjectiveValues->IsEqual(that->initialObjectiveValues))
11370 return false;
11371 if (!this->initialObjectiveBounds->IsEqual(that->initialObjectiveBounds))
11372 return false;
11373 if (!this->initialBasisStatus->IsEqual(that->initialBasisStatus))
11374 return false;
11375
11376 if (this->numberOfOtherObjectiveOptions != that->numberOfOtherObjectiveOptions)
11377 {
11378 #ifndef NDEBUG
11379 outStr.str("");
11380 outStr.clear();
11381 outStr << "numberOfOtherObjectiveOptions: " << this->numberOfOtherObjectiveOptions << " vs. " << that->numberOfOtherObjectiveOptions << endl;
11382 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
11383 #endif
11384 return false;
11385 }
11386 int i;
11387 for (i = 0; i < numberOfOtherObjectiveOptions; i++)
11388 if (!this->other[i]->IsEqual(that->other[i]))
11389 return false;
11390
11391 return true;
11392 }
11393 }
11394 }
11395
11396 bool InitObjectiveValues::IsEqual(InitObjectiveValues *that)
11397 {
11398 std::ostringstream outStr;
11399
11400 #ifndef NDEBUG
11401 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in InitObjectiveValues");
11402 #endif
11403 if (this == NULL)
11404 {
11405 if (that == NULL)
11406 return true;
11407 else
11408 {
11409 #ifndef NDEBUG
11410 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
11411 #endif
11412 return false;
11413 }
11414 }
11415 else
11416 {
11417 if (that == NULL)
11418 {
11419 #ifndef NDEBUG
11420 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
11421 #endif
11422 return false;
11423 }
11424 else
11425 {
11426 if (this->numberOfObj != that->numberOfObj)
11427 {
11428 #ifndef NDEBUG
11429 outStr.str("");
11430 outStr.clear();
11431 outStr << "numberOfObj: " << this->numberOfObj << " vs. " << that->numberOfObj << endl;
11432 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
11433 #endif
11434 return false;
11435 }
11436 int i;
11437 for (i = 0; i < numberOfObj; i++)
11438 if (!this->obj[i]->IsEqual(that->obj[i]))
11439 return false;
11440 return true;
11441 }
11442 }
11443 }
11444
11445 bool InitObjValue::IsEqual(InitObjValue *that)
11446 {
11447 std::ostringstream outStr;
11448
11449 #ifndef NDEBUG
11450 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in InitObjValue");
11451 #endif
11452 if (this == NULL)
11453 {
11454 if (that == NULL)
11455 return true;
11456 else
11457 {
11458 #ifndef NDEBUG
11459 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
11460 #endif
11461 return false;
11462 }
11463 }
11464 else
11465 {
11466 if (that == NULL)
11467 {
11468 #ifndef NDEBUG
11469 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
11470 #endif
11471 return false;
11472 }
11473 else
11474 {
11475 if ((this->idx != that->idx) || this->name != that->name || !OSIsEqual(this->value, that->value))
11476 {
11477 #ifndef NDEBUG
11478 outStr.str("");
11479 outStr.clear();
11480 outStr << "idx: " << this->idx << " vs. " << that->idx << endl;
11481 outStr << "value: " << this->value << " vs. " << that->value << endl;
11482 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
11483 #endif
11484 return false;
11485 }
11486 return true;
11487 }
11488 }
11489 }
11490
11491 bool InitObjectiveBounds::IsEqual(InitObjectiveBounds *that)
11492 {
11493 std::ostringstream outStr;
11494
11495 #ifndef NDEBUG
11496 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in InitObjectiveBounds");
11497 #endif
11498 if (this == NULL)
11499 {
11500 if (that == NULL)
11501 return true;
11502 else
11503 {
11504 #ifndef NDEBUG
11505 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
11506 #endif
11507 return false;
11508 }
11509 }
11510 else
11511 {
11512 if (that == NULL)
11513 {
11514 #ifndef NDEBUG
11515 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
11516 #endif
11517 return false;
11518 }
11519 else
11520 {
11521 if (this->numberOfObj != that->numberOfObj)
11522 {
11523 #ifndef NDEBUG
11524 outStr.str("");
11525 outStr.clear();
11526 outStr << "numberOfObj: " << this->numberOfObj << " vs. " << that->numberOfObj << endl;
11527 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
11528 #endif
11529 return false;
11530 }
11531 int i;
11532 for (i = 0; i < numberOfObj; i++)
11533 if (!this->obj[i]->IsEqual(that->obj[i]))
11534 return false;
11535 return true;
11536 }
11537 }
11538 }
11539
11540 bool InitObjBound::IsEqual(InitObjBound *that)
11541 {
11542 std::ostringstream outStr;
11543
11544 #ifndef NDEBUG
11545 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in InitObjBound");
11546 #endif
11547 if (this == NULL)
11548 {
11549 if (that == NULL)
11550 return true;
11551 else
11552 {
11553 #ifndef NDEBUG
11554 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
11555 #endif
11556 return false;
11557 }
11558 }
11559 else
11560 {
11561 if (that == NULL)
11562 {
11563 #ifndef NDEBUG
11564 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
11565 #endif
11566 return false;
11567 }
11568 else
11569 {
11570 if ((this->idx != that->idx) ||
11571 this->name != that->name ||
11572 !OSIsEqual(this->lbValue, that->lbValue) ||
11573 !OSIsEqual(this->ubValue, that->ubValue) )
11574 {
11575 #ifndef NDEBUG
11576 outStr.str("");
11577 outStr.clear();
11578 outStr << "idx: " << this->idx << " vs. " << that->idx << endl;
11579 outStr << "lbValue: " << this->lbValue << " vs. " << that->lbValue << endl;
11580 outStr << "ubValue: " << this->ubValue << " vs. " << that->ubValue << endl;
11581 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
11582 #endif
11583 return false;
11584 }
11585 return true;
11586 }
11587 }
11588 }
11589
11590 bool OtherObjectiveOption::IsEqual(OtherObjectiveOption *that)
11591 {
11592 std::ostringstream outStr;
11593
11594 #ifndef NDEBUG
11595 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in OtherObjectiveOption");
11596 #endif
11597 if (this == NULL)
11598 {
11599 if (that == NULL)
11600 return true;
11601 else
11602 {
11603 #ifndef NDEBUG
11604 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
11605 #endif
11606 return false;
11607 }
11608 }
11609 else
11610 {
11611 if (that == NULL)
11612 {
11613 #ifndef NDEBUG
11614 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
11615 #endif
11616 return false;
11617 }
11618 else
11619 {
11620 if ((this->name != that->name) ||
11621 (this->value != that->value) ||
11622 (this->solver != that->solver) ||
11623 (this->category != that->category) ||
11624 (this->type != that->type) ||
11625 (this->description != that->description))
11626 {
11627 #ifndef NDEBUG
11628 outStr.str("");
11629 outStr.clear();
11630 outStr << "name: " << this->name << " vs. " << that->name << endl;
11631 outStr << "value: " << this->value << " vs. " << that->value << endl;
11632 outStr << "solver: " << this->solver << " vs. " << that->solver << endl;
11633 outStr << "category: " << this->category << " vs. " << that->category << endl;
11634 outStr << "type: " << this->type << " vs. " << that->type << endl;
11635 outStr << "description: " << this->description << " vs. " << that->description << endl;
11636 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
11637 #endif
11638 return false;
11639 }
11640
11641 if (this->numberOfObj != that->numberOfObj)
11642 {
11643 #ifndef NDEBUG
11644 outStr.str("");
11645 outStr.clear();
11646 outStr << "numberOfObj: " << this->numberOfObj << " vs. " << that->numberOfObj << endl;
11647 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
11648 #endif
11649 return false;
11650 }
11651 int i;
11652 for (i = 0; i < numberOfObj; i++)
11653 if (!this->obj[i]->IsEqual(that->obj[i]))
11654 return false;
11655 return true;
11656 }
11657 }
11658 }
11659
11660 bool OtherObjOption::IsEqual(OtherObjOption *that)
11661 {
11662 std::ostringstream outStr;
11663
11664 #ifndef NDEBUG
11665 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in OtherObjOption");
11666 #endif
11667 if (this == NULL)
11668 {
11669 if (that == NULL)
11670 return true;
11671 else
11672 {
11673 #ifndef NDEBUG
11674 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
11675 #endif
11676 return false;
11677 }
11678 }
11679 else
11680 {
11681 if (that == NULL)
11682 {
11683 #ifndef NDEBUG
11684 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
11685 #endif
11686 return false;
11687 }
11688 else
11689 {
11690 if ((this->idx != that->idx) || this->name != that->name || (this->value != that->value) ||
11691 (this->lbValue != that->lbValue) || (this->ubValue != that->ubValue))
11692 {
11693 #ifndef NDEBUG
11694 outStr.str("");
11695 outStr.clear();
11696 outStr << "idx: " << this->idx << " vs. " << that->idx << endl;
11697 outStr << "value: " << this->value << " vs. " << that->value << endl;
11698 outStr << "lbValue: " << this->lbValue << " vs. " << that->lbValue << endl;
11699 outStr << "ubValue: " << this->ubValue << " vs. " << that->ubValue << endl;
11700 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
11701 #endif
11702 return false;
11703 }
11704 return true;
11705 }
11706 }
11707 }
11708
11709 bool ConstraintOption::IsEqual(ConstraintOption *that)
11710 {
11711 std::ostringstream outStr;
11712
11713 #ifndef NDEBUG
11714 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in ConstraintOption");
11715 #endif
11716 if (this == NULL)
11717 {
11718 if (that == NULL)
11719 return true;
11720 else
11721 {
11722 #ifndef NDEBUG
11723 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
11724 #endif
11725 return false;
11726 }
11727 }
11728 else
11729 {
11730 if (that == NULL)
11731 {
11732 #ifndef NDEBUG
11733 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
11734 #endif
11735 return false;
11736 }
11737 else
11738 {
11739 if (!this->initialConstraintValues->IsEqual(that->initialConstraintValues))
11740 return false;
11741 if (!this->initialDualValues->IsEqual(that->initialDualValues))
11742 return false;
11743 if (!this->initialBasisStatus->IsEqual(that->initialBasisStatus))
11744 return false;
11745
11746 if (this->numberOfOtherConstraintOptions != that->numberOfOtherConstraintOptions)
11747 {
11748 #ifndef NDEBUG
11749 outStr.str("");
11750 outStr.clear();
11751 outStr << "numberOfOtherConstraintOptions: " << this->numberOfOtherConstraintOptions << " vs. " << that->numberOfOtherConstraintOptions << endl;
11752 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
11753 #endif
11754 return false;
11755 }
11756 int i;
11757 for (i = 0; i < numberOfOtherConstraintOptions; i++)
11758 if (!this->other[i]->IsEqual(that->other[i]))
11759 return false;
11760
11761 return true;
11762 }
11763 }
11764 }
11765
11766 bool InitConstraintValues::IsEqual(InitConstraintValues *that)
11767 {
11768 std::ostringstream outStr;
11769
11770 #ifndef NDEBUG
11771 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in InitConstraintValues");
11772 #endif
11773 if (this == NULL)
11774 {
11775 if (that == NULL)
11776 return true;
11777 else
11778 {
11779 #ifndef NDEBUG
11780 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
11781 #endif
11782 return false;
11783 }
11784 }
11785 else
11786 {
11787 if (that == NULL)
11788 {
11789 #ifndef NDEBUG
11790 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
11791 #endif
11792 return false;
11793 }
11794 else
11795 {
11796 if (this->numberOfCon != that->numberOfCon)
11797 {
11798 #ifndef NDEBUG
11799 outStr.str("");
11800 outStr.clear();
11801 outStr << "numberOfCon: " << this->numberOfCon << " vs. " << that->numberOfCon << endl;
11802 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
11803 #endif
11804 return false;
11805 }
11806 int i;
11807 for (i = 0; i < numberOfCon; i++)
11808 if (!this->con[i]->IsEqual(that->con[i]))
11809 return false;
11810 return true;
11811 }
11812 }
11813 }
11814
11815 bool InitConValue::IsEqual(InitConValue *that)
11816 {
11817 std::ostringstream outStr;
11818
11819 #ifndef NDEBUG
11820 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in InitConValue");
11821 #endif
11822 if (this == NULL)
11823 {
11824 if (that == NULL)
11825 return true;
11826 else
11827 {
11828 #ifndef NDEBUG
11829 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
11830 #endif
11831 return false;
11832 }
11833 }
11834 else
11835 {
11836 if (that == NULL)
11837 {
11838 #ifndef NDEBUG
11839 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
11840 #endif
11841 return false;
11842 }
11843 else
11844 {
11845 if ((this->idx != that->idx) || this->name != that->name || !OSIsEqual(this->value, that->value))
11846 {
11847 #ifndef NDEBUG
11848 outStr.str("");
11849 outStr.clear();
11850 outStr << "idx: " << this->idx << " vs. " << that->idx << endl;
11851 outStr << "value: " << this->value << " vs. " << that->value << endl;
11852 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
11853 #endif
11854 return false;
11855 }
11856 return true;
11857 }
11858 }
11859 }
11860
11861 bool InitDualVariableValues::IsEqual(InitDualVariableValues *that)
11862 {
11863 std::ostringstream outStr;
11864
11865 #ifndef NDEBUG
11866 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in InitDualVariableValues");
11867 #endif
11868 if (this == NULL)
11869 {
11870 if (that == NULL)
11871 return true;
11872 else
11873 {
11874 #ifndef NDEBUG
11875 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
11876 #endif
11877 return false;
11878 }
11879 }
11880 else
11881 {
11882 if (that == NULL)
11883 {
11884 #ifndef NDEBUG
11885 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
11886 #endif
11887 return false;
11888 }
11889 else
11890 {
11891 if (this->numberOfCon != that->numberOfCon)
11892 {
11893 #ifndef NDEBUG
11894 outStr.str("");
11895 outStr.clear();
11896 outStr << "numberOfCon: " << this->numberOfCon << " vs. " << that->numberOfCon << endl;
11897 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
11898 #endif
11899 return false;
11900 }
11901 int i;
11902 for (i = 0; i < numberOfCon; i++)
11903 if (!this->con[i]->IsEqual(that->con[i]))
11904 return false;
11905 return true;
11906 }
11907 }
11908 }
11909
11910 bool InitDualVarValue::IsEqual(InitDualVarValue *that)
11911 {
11912 std::ostringstream outStr;
11913
11914 #ifndef NDEBUG
11915 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in InitDualVarValue");
11916 #endif
11917 if (this == NULL)
11918 {
11919 if (that == NULL)
11920 return true;
11921 else
11922 {
11923 #ifndef NDEBUG
11924 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
11925 #endif
11926 return false;
11927 }
11928 }
11929 else
11930 {
11931 if (that == NULL)
11932 {
11933 #ifndef NDEBUG
11934 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
11935 #endif
11936 return false;
11937 }
11938 else
11939 {
11940 if ((this->idx != that->idx) || this->name != that->name ||
11941 !OSIsEqual(this->lbDualValue, that->lbDualValue) ||
11942 !OSIsEqual(this->ubDualValue, that->ubDualValue))
11943 {
11944 #ifndef NDEBUG
11945 outStr.str("");
11946 outStr.clear();
11947 outStr << "idx: " << this->idx << " vs. " << that->idx << endl;
11948 outStr << "lbDualValue: " << this->lbDualValue << " vs. " << that->lbDualValue << endl;
11949 outStr << "ubDualValue: " << this->ubDualValue << " vs. " << that->ubDualValue << endl;
11950 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
11951 #endif
11952 return false;
11953 }
11954 return true;
11955 }
11956 }
11957 }
11958
11959 bool OtherConstraintOption::IsEqual(OtherConstraintOption *that)
11960 {
11961 std::ostringstream outStr;
11962
11963 #ifndef NDEBUG
11964 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in OtherConstraintOption");
11965 #endif
11966 if (this == NULL)
11967 {
11968 if (that == NULL)
11969 return true;
11970 else
11971 {
11972 #ifndef NDEBUG
11973 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
11974 #endif
11975 return false;
11976 }
11977 }
11978 else
11979 {
11980 if (that == NULL)
11981 {
11982 #ifndef NDEBUG
11983 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
11984 #endif
11985 return false;
11986 }
11987 else
11988 {
11989 if ((this->name != that->name) ||
11990 (this->value != that->value) ||
11991 (this->solver != that->solver) ||
11992 (this->category != that->category) ||
11993 (this->type != that->type) ||
11994 (this->description != that->description))
11995 {
11996 #ifndef NDEBUG
11997 outStr.str("");
11998 outStr.clear();
11999 outStr << "name: " << this->name << " vs. " << that->name << endl;
12000 outStr << "value: " << this->value << " vs. " << that->value << endl;
12001 outStr << "solver: " << this->solver << " vs. " << that->solver << endl;
12002 outStr << "category: " << this->category << " vs. " << that->category << endl;
12003 outStr << "type: " << this->type << " vs. " << that->type << endl;
12004 outStr << "description: " << this->description << " vs. " << that->description << endl;
12005 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
12006 #endif
12007 return false;
12008 }
12009
12010 if (this->numberOfCon != that->numberOfCon)
12011 {
12012 #ifndef NDEBUG
12013 outStr.str("");
12014 outStr.clear();
12015 outStr << "numberOfCon: " << this->numberOfCon << " vs. " << that->numberOfCon << endl;
12016 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
12017 #endif
12018 return false;
12019 }
12020 int i;
12021 for (i = 0; i < numberOfCon; i++)
12022 if (!this->con[i]->IsEqual(that->con[i]))
12023 return false;
12024 return true;
12025 }
12026 }
12027 }
12028
12029 bool OtherConOption::IsEqual(OtherConOption *that)
12030 {
12031 std::ostringstream outStr;
12032
12033 #ifndef NDEBUG
12034 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in OtherConOption");
12035 #endif
12036 if (this == NULL)
12037 {
12038 if (that == NULL)
12039 return true;
12040 else
12041 {
12042 #ifndef NDEBUG
12043 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
12044 #endif
12045 return false;
12046 }
12047 }
12048 else
12049 {
12050 if (that == NULL)
12051 {
12052 #ifndef NDEBUG
12053 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
12054 #endif
12055 return false;
12056 }
12057
12058 else
12059 {
12060 if ((this->idx != that->idx) || this->name != that->name || (this->value != that->value) ||
12061 (this->lbValue != that->lbValue) || (this->ubValue != that->ubValue))
12062 {
12063 #ifndef NDEBUG
12064 outStr.str("");
12065 outStr.clear();
12066 outStr << "idx: " << this->idx << " vs. " << that->idx << endl;
12067 outStr << "value: " << this->value << " vs. " << that->value << endl;
12068 outStr << "lbValue: " << this->lbValue << " vs. " << that->lbValue << endl;
12069 outStr << "ubValue: " << this->ubValue << " vs. " << that->ubValue << endl;
12070 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
12071 #endif
12072 return false;
12073 }
12074 return true;
12075 }
12076 }
12077 }
12078
12079
12080 bool SolverOptions::IsEqual(SolverOptions *that)
12081 {
12082 std::ostringstream outStr;
12083
12084 #ifndef NDEBUG
12085 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in SolverOptions");
12086 #endif
12087 if (this == NULL)
12088 {
12089 if (that == NULL)
12090 return true;
12091 else
12092 {
12093 #ifndef NDEBUG
12094 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
12095 #endif
12096 return false;
12097 }
12098 }
12099 else
12100 {
12101 if (that == NULL)
12102 {
12103 #ifndef NDEBUG
12104 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
12105 #endif
12106 return false;
12107 }
12108 else
12109 {
12110 if (this->numberOfSolverOptions != that->numberOfSolverOptions)
12111 {
12112 #ifndef NDEBUG
12113 outStr.str("");
12114 outStr.clear();
12115 outStr << "numberOfSolverOptions: " << this->numberOfSolverOptions << " vs. " << that->numberOfSolverOptions << endl;
12116 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
12117 #endif
12118 return false;
12119 }
12120
12121 int i;
12122 for (i = 0; i < numberOfSolverOptions; i++)
12123 if (!this->solverOption[i]->IsEqual(that->solverOption[i]))
12124 return false;
12125
12126 return true;
12127 }
12128 }
12129 }
12130
12131 bool SolverOption::IsEqual(SolverOption *that )
12132 {
12133 std::ostringstream outStr;
12134
12135 #ifndef NDEBUG
12136 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Start comparing in SolverOption");
12137 #endif
12138 if (this == NULL)
12139 {
12140 if (that == NULL)
12141 return true;
12142 else
12143 {
12144 #ifndef NDEBUG
12145 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "First object is NULL, second is not");
12146 #endif
12147 return false;
12148 }
12149 }
12150 else
12151 {
12152 if (that == NULL)
12153 {
12154 #ifndef NDEBUG
12155 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, "Second object is NULL, first is not");
12156 #endif
12157 return false;
12158 }
12159 else
12160 {
12161 if ((this->name != that->name) ||
12162 (this->value != that->value) ||
12163 (this->solver != that->solver) ||
12164 (this->category != that->category) ||
12165 (this->type != that->type) ||
12166 (this->description != that->description))
12167 {
12168 #ifndef NDEBUG
12169 outStr.str("");
12170 outStr.clear();
12171 outStr << "name: " << this->name << " vs. " << that->name << endl;
12172 outStr << "value: " << this->value << " vs. " << that->value << endl;
12173 outStr << "solver: " << this->solver << " vs. " << that->solver << endl;
12174 outStr << "category: " << this->category << " vs. " << that->category << endl;
12175 outStr << "type: " << this->type << " vs. " << that->type << endl;
12176 outStr << "description: " << this->description << " vs. " << that->description << endl;
12177 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_debug, outStr.str());
12178 #endif
12179 return false;
12180 }
12181 return true;
12182 }
12183 }
12184 }
12185
12186
12187
12188
12189
12190
12191
12192
12193
12194
12195
12196
12197
12198
12199 bool OSOption::setRandom( double density, bool conformant )
12200 {
12201 #ifndef NDEBUG
12202 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random OSOption");
12203 #endif
12204 if (OSRand() <= density)
12205 {
12206 optionHeader = new GeneralFileHeader();
12207 optionHeader->setRandom(density, conformant);
12208 }
12209 if (OSRand() <= density)
12210 {
12211 general = new GeneralOption();
12212 general->setRandom(density, conformant);
12213 }
12214 if (OSRand() <= density)
12215 {
12216 system = new SystemOption();
12217 system->setRandom(density, conformant);
12218 }
12219 if (OSRand() <= density)
12220 {
12221 service = new ServiceOption();
12222 service->setRandom(density, conformant);
12223 }
12224 if (OSRand() <= density)
12225 {
12226 job = new JobOption();
12227 job->setRandom(density, conformant);
12228 }
12229 if (OSRand() <= density)
12230 {
12231 optimization = new OptimizationOption();
12232 optimization->setRandom(density, conformant);
12233 }
12234 return true;
12235 }
12236
12237
12238 bool GeneralOption::setRandom( double density, bool conformant )
12239 {
12240 #ifndef NDEBUG
12241 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random GeneralOption");
12242 #endif
12243 if (OSRand() <= density) this->serviceURI = "random string";
12244 if (OSRand() <= density) this->serviceName = "random string";
12245 if (OSRand() <= density) this->instanceName = "random string";
12246 if (OSRand() <= density) this->jobID = "random string";
12247 if (OSRand() <= density) this->solverToInvoke = "random string";
12248 if (OSRand() <= density) this->license = "random string";
12249 if (OSRand() <= density) this->userName = "random string";
12250 if (OSRand() <= density) this->password = "random string";
12251
12252 if (OSRand() <= density)
12253 {
12254 instanceLocation = new InstanceLocationOption();
12255 instanceLocation->setRandom(density, conformant);
12256 }
12257 if (OSRand() <= density)
12258 {
12259 contact = new ContactOption();
12260 contact->setRandom(density, conformant);
12261 }
12262 if (OSRand() <= density)
12263 {
12264 otherOptions = new OtherOptions();
12265 otherOptions->setRandom(density, conformant);
12266 }
12267 return true;
12268 }
12269
12270
12271 bool SystemOption::setRandom( double density, bool conformant )
12272 {
12273 #ifndef NDEBUG
12274 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random SystemOption");
12275 #endif
12276 if (OSRand() <= density)
12277 {
12278 minDiskSpace = new StorageCapacity();
12279 minDiskSpace->setRandom(density, conformant);
12280 }
12281 if (OSRand() <= density)
12282 {
12283 minMemorySize = new StorageCapacity();
12284 minMemorySize->setRandom(density, conformant);
12285 }
12286 if (OSRand() <= density)
12287 {
12288 minCPUSpeed = new CPUSpeed();
12289 minCPUSpeed->setRandom(density, conformant);
12290 }
12291 if (OSRand() <= density)
12292 {
12293 minCPUNumber = new CPUNumber();
12294 minCPUNumber->setRandom(density, conformant);
12295 }
12296 if (OSRand() <= density)
12297 {
12298 otherOptions = new OtherOptions();
12299 otherOptions->setRandom(density, conformant);
12300 }
12301 return true;
12302 }
12303
12304
12305 bool ServiceOption::setRandom( double density, bool conformant )
12306 {
12307 #ifndef NDEBUG
12308 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random ServiceOption");
12309 #endif
12310 if (OSRand() <= density)
12311 {
12312 double temp = OSRand();
12313 if (conformant) temp = 0.5*temp;
12314
12315 if (temp <= 0.25) this->type = "solver";
12316 else if (temp <= 0.50) this->type = "agent";
12317 else if (temp <= 0.75) this->type = "";
12318 else this->type = "spy";
12319 }
12320
12321 if (OSRand() <= density)
12322 {
12323 otherOptions = new OtherOptions();
12324 otherOptions->setRandom(density, conformant);
12325 }
12326
12327 return true;
12328 }
12329
12330
12331 bool JobOption::setRandom( double density, bool conformant )
12332 {
12333 #ifndef NDEBUG
12334 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random JobOption");
12335 #endif
12336 if (OSRand() <= density) this->requestedStartTime = "1997-08-11T01:23:45-09:13";
12337
12338 if (OSRand() <= density)
12339 {
12340 maxTime = new TimeSpan();
12341 maxTime->setRandom(density, conformant);
12342 }
12343 if (OSRand() <= density)
12344 {
12345 dependencies = new JobDependencies();
12346 dependencies->setRandom(density, conformant);
12347 }
12348 if (OSRand() <= density)
12349 {
12350 requiredDirectories = new DirectoriesAndFiles();
12351 requiredDirectories->setRandom(density, conformant);
12352 }
12353 if (OSRand() <= density)
12354 {
12355 requiredFiles = new DirectoriesAndFiles();
12356 requiredFiles->setRandom(density, conformant);
12357 }
12358 if (OSRand() <= density)
12359 {
12360 directoriesToMake = new DirectoriesAndFiles();
12361 directoriesToMake->setRandom(density, conformant);
12362 }
12363 if (OSRand() <= density)
12364 {
12365 filesToMake = new DirectoriesAndFiles();
12366 filesToMake->setRandom(density, conformant);
12367 }
12368 if (OSRand() <= density)
12369 {
12370 inputDirectoriesToMove = new PathPairs();
12371 inputDirectoriesToMove->setRandom(density, conformant);
12372 }
12373 if (OSRand() <= density)
12374 {
12375 inputFilesToMove = new PathPairs();
12376 inputFilesToMove->setRandom(density, conformant);
12377 }
12378 if (OSRand() <= density)
12379 {
12380 outputFilesToMove = new PathPairs();
12381 outputFilesToMove->setRandom(density, conformant);
12382 }
12383 if (OSRand() <= density)
12384 {
12385 outputDirectoriesToMove = new PathPairs();
12386 outputDirectoriesToMove->setRandom(density, conformant);
12387 }
12388 if (OSRand() <= density)
12389 {
12390 filesToDelete = new DirectoriesAndFiles();
12391 filesToDelete->setRandom(density, conformant);
12392 }
12393 if (OSRand() <= density)
12394 {
12395 directoriesToDelete = new DirectoriesAndFiles();
12396 directoriesToDelete->setRandom(density, conformant);
12397 }
12398 if (OSRand() <= density)
12399 {
12400 processesToKill = new Processes();
12401 processesToKill->setRandom(density, conformant);
12402 }
12403 if (OSRand() <= density)
12404 {
12405 otherOptions = new OtherOptions();
12406 otherOptions->setRandom(density, conformant);
12407 }
12408 return true;
12409 }
12410
12411 bool OptimizationOption::setRandom( double density, bool conformant )
12412 {
12413 #ifndef NDEBUG
12414 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random OptimizationOption");
12415 #endif
12416 if (OSRand() <= density && !conformant) this->numberOfVariables = (int)(1+9*OSRand());
12417 if (OSRand() <= density && !conformant) this->numberOfObjectives = (int)(1+9*OSRand());
12418 if (OSRand() <= density && !conformant) this->numberOfConstraints = (int)(1+9*OSRand());
12419
12420 if (OSRand() <= density)
12421 {
12422 variables = new VariableOption();
12423 variables->setRandom(density, conformant);
12424 }
12425 if (OSRand() <= density)
12426 {
12427 objectives = new ObjectiveOption();
12428 objectives->setRandom(density, conformant);
12429 }
12430 if (OSRand() <= density)
12431 {
12432 constraints = new ConstraintOption();
12433 constraints->setRandom(density, conformant);
12434 }
12435 if (OSRand() <= density)
12436 {
12437 solverOptions = new SolverOptions();
12438 solverOptions->setRandom(density, conformant);
12439 }
12440
12441 return true;
12442 }
12443
12444 bool InstanceLocationOption::setRandom( double density, bool conformant )
12445 {
12446 #ifndef NDEBUG
12447 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random InstanceLocationOption");
12448 #endif
12449 if (OSRand() <= density) this->value = "http://www.google.com";
12450 if (OSRand() <= density)
12451 {
12452 double temp = OSRand();
12453 if (conformant) temp = 0.5*temp;
12454
12455 if (temp <= 0.25) this->locationType = "local";
12456 else if (temp <= 0.50) this->locationType = "ftp";
12457 else if (temp <= 0.75) this->locationType = "";
12458 else this->locationType = "global";
12459 }
12460 return true;
12461 }
12462
12463 bool ContactOption::setRandom( double density, bool conformant )
12464 {
12465 #ifndef NDEBUG
12466 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random ContactOption");
12467 #endif
12468 if (OSRand() <= density) this->value = "http://www.google.com";
12469 if (OSRand() <= density)
12470 {
12471 double temp = OSRand();
12472 if (conformant) temp = 0.5*temp;
12473
12474 if (temp <= 0.25) this->transportType = "osp";
12475 else if (temp <= 0.50) this->transportType = "ftp";
12476 else if (temp <= 0.75) this->transportType = "";
12477 else this->transportType = "nlp";
12478 }
12479 return true;
12480 }
12481
12482 bool OtherOptions::setRandom( double density, bool conformant )
12483 {
12484 #ifndef NDEBUG
12485 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random OtherOptions");
12486 #endif
12487 int n;
12488
12489 this->numberOfOtherOptions = (int)(1+4*OSRand());
12490
12491 if (conformant) n = this->numberOfOtherOptions;
12492 else n = (int)(1+4*OSRand());
12493
12494 other = new OtherOption*[n];
12495
12496 for (int i = 0; i < n; i++)
12497 {
12498 other[i] = new OtherOption();
12499 other[i]->setRandom(density, conformant);
12500 }
12501
12502 return true;
12503 }
12504
12505 bool OtherOption::setRandom( double density, bool conformant )
12506 {
12507 #ifndef NDEBUG
12508 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random OtherOption");
12509 #endif
12510 if (OSRand() <= density || conformant) this->name = "random string";
12511 if (OSRand() <= density) this->value = "random string";
12512 if (OSRand() <= density) this->description = "random string";
12513 return true;
12514 }
12515
12516
12517
12518 bool JobDependencies::setRandom( double density, bool conformant )
12519 {
12520 #ifndef NDEBUG
12521 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random JobDependencies");
12522 #endif
12523 int n;
12524
12525 this->numberOfJobIDs = (int)(1+4*OSRand());
12526
12527 if (conformant) n = this->numberOfJobIDs;
12528 else n = (int)(1+4*OSRand());
12529
12530 jobID = new std::string[n];
12531 for (int i = 0; i < n; i++)
12532 jobID[i] = "random string";
12533
12534 return true;
12535 }
12536
12537 bool DirectoriesAndFiles::setRandom( double density, bool conformant )
12538 {
12539 #ifndef NDEBUG
12540 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random DirectoriesAndFiles");
12541 #endif
12542 int n;
12543
12544 this->numberOfPaths = (int)(1+4*OSRand());
12545
12546 if (conformant) n = this->numberOfPaths;
12547 else n = (int)(1+4*OSRand());
12548
12549
12550 path = new std::string[n];
12551 for (int i = 0; i < n; i++)
12552 path[i] = "random string";
12553
12554 return true;
12555 }
12556
12557 bool PathPairs::setRandom( double density, bool conformant )
12558 {
12559 #ifndef NDEBUG
12560 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random PathPairs");
12561 #endif
12562 int n;
12563
12564 this->numberOfPathPairs = (int)(1+4*OSRand());
12565
12566 if (conformant) n = this->numberOfPathPairs;
12567 else n =(int)(1+4*OSRand());
12568
12569 pathPair = new PathPair*[n];
12570 for (int i = 0; i < n; i++)
12571 {
12572 this->pathPair[i] = new PathPair();
12573 this->pathPair[i]->setRandom(density, conformant);
12574 }
12575
12576 return true;
12577 }
12578
12579 bool PathPair::setRandom( double density, bool conformant )
12580 {
12581 #ifndef NDEBUG
12582 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random PathPair");
12583 #endif
12584 this->from = "random string";
12585 this->to = "random string";
12586 if (OSRand() <= density) this->makeCopy = (OSRand() <= 0.5);
12587 return true;
12588 }
12589
12590 bool Processes::setRandom( double density, bool conformant )
12591 {
12592 #ifndef NDEBUG
12593 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random Processes");
12594 #endif
12595 int n;
12596
12597 this->numberOfProcesses = (int)(1+4*OSRand());
12598
12599 if (conformant) n = this->numberOfProcesses;
12600 else n = (int)(1+4*OSRand());
12601
12602 process = new std::string[n];
12603 for (int i = 0; i < n; i++)
12604 process[i] = "random string";
12605
12606 return true;
12607 }
12608
12609 bool VariableOption::setRandom( double density, bool conformant )
12610 {
12611 #ifndef NDEBUG
12612 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random VariableOption");
12613 #endif
12614 if (OSRand() <= density)
12615 {
12616 this->initialVariableValues = new InitVariableValues();
12617 this->initialVariableValues->setRandom(density, conformant);
12618 }
12619 return false;
12620 if (OSRand() <= density)
12621 {
12622 this->initialVariableValuesString = new InitVariableValuesString();
12623 this->initialVariableValuesString->setRandom(density, conformant);
12624 }
12625 if (OSRand() <= density)
12626 {
12627 this->initialBasisStatus = new BasisStatus();
12628 this->initialBasisStatus->setRandom(density, conformant, 0, 9);
12629 }
12630 if (OSRand() <= density)
12631 {
12632 this->integerVariableBranchingWeights = new IntegerVariableBranchingWeights();
12633 this->integerVariableBranchingWeights->setRandom(density, conformant);
12634 }
12635 if (OSRand() <= density)
12636 {
12637 this->sosVariableBranchingWeights = new SOSVariableBranchingWeights();
12638 this->sosVariableBranchingWeights->setRandom(density, conformant);
12639 }
12640
12641
12642 this->numberOfOtherVariableOptions = (int)(4*OSRand());
12643
12644 int n;
12645
12646 if (conformant) n = this->numberOfOtherVariableOptions;
12647 else n = (int)(4*OSRand());
12648
12649 other = new OtherVariableOption*[n];
12650 for (int i = 0; i < n; i++)
12651 {
12652 other[i] = new OtherVariableOption();
12653 other[i]->setRandom(density, conformant);
12654 }
12655 return true;
12656 }
12657
12658 bool InitVariableValues::setRandom( double density, bool conformant )
12659 {
12660 #ifndef NDEBUG
12661 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random InitVariableValues");
12662 #endif
12663 this->numberOfVar = (int)(1+4*OSRand());
12664
12665 int n;
12666
12667 if (conformant) n = this->numberOfVar;
12668 else n = (int)(1+4*OSRand());
12669
12670 var = new InitVarValue*[n];
12671 for (int i = 0; i < n; i++)
12672 {
12673 var[i] = new InitVarValue();
12674 var[i]->setRandom(density, conformant);
12675 }
12676 return true;
12677 }
12678
12679 bool InitVarValue::setRandom( double density, bool conformant )
12680 {
12681 #ifndef NDEBUG
12682 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random InitVarValue");
12683 #endif
12684 this->idx = (int)(4*OSRand());
12685
12686 if (OSRand() <= density)
12687 this->name = "random string";
12688
12689 if (OSRand() <= density)
12690 {
12691 if (OSRand() <= 0.5) this->value = 3.14156;
12692 else this->value = 2.71828;
12693 }
12694 return true;
12695 }
12696
12697
12698 bool InitVariableValuesString::setRandom( double density, bool conformant )
12699 {
12700 #ifndef NDEBUG
12701 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random InitVariableValuesString");
12702 #endif
12703 this->numberOfVar = (int)(1+4*OSRand());
12704
12705 int n;
12706
12707 if (conformant) n = this->numberOfVar;
12708 else n = (int)(1+4*OSRand());
12709
12710 var = new InitVarValueString*[n];
12711 for (int i = 0; i < n; i++)
12712 {
12713 var[i] = new InitVarValueString();
12714 var[i]->setRandom(density, conformant);
12715 }
12716 return true;
12717 }
12718
12719 bool InitVarValueString::setRandom( double density, bool conformant )
12720 {
12721 #ifndef NDEBUG
12722 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random InitVarValueString");
12723 #endif
12724 this->idx = (int)(4*OSRand());
12725
12726 if (OSRand() <= density) this->name = "random string";
12727 if (OSRand() <= density) this->value = "random string";
12728
12729 return true;
12730 }
12731
12732
12733 bool IntegerVariableBranchingWeights::setRandom( double density, bool conformant )
12734 {
12735 #ifndef NDEBUG
12736 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random IntegerVariableBranchingWeights");
12737 #endif
12738 this->numberOfVar = (int)(1+4*OSRand());
12739
12740 int n;
12741
12742 if (conformant) n = this->numberOfVar;
12743 else n = (int)(1+4*OSRand());
12744
12745 var = new BranchingWeight*[n];
12746 for (int i = 0; i < n; i++)
12747 {
12748 var[i] = new BranchingWeight();
12749 var[i]->setRandom(density, conformant);
12750 }
12751 return true;
12752 }
12753
12754 bool SOSVariableBranchingWeights::setRandom( double density, bool conformant )
12755 {
12756 #ifndef NDEBUG
12757 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random SOSVariableBranchingWeights");
12758 #endif
12759 this->numberOfSOS = (int)(1+4*OSRand());
12760
12761 int n;
12762
12763 if (conformant) n = this->numberOfSOS;
12764 else n = (int)(1+4*OSRand());
12765
12766 sos = new SOSWeights*[n];
12767 for (int i = 0; i < n; i++)
12768 {
12769 sos[i] = new SOSWeights();
12770 sos[i]->setRandom(density, conformant);
12771 }
12772 return true;
12773 }
12774
12775
12776 bool SOSWeights::setRandom( double density, bool conformant )
12777 {
12778 #ifndef NDEBUG
12779 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random SOSWeights");
12780 #endif
12781 this->sosIdx = (int)(4*OSRand());
12782 this->numberOfVar = (int)(4*OSRand());
12783
12784 if (OSRand() <= density) this->groupWeight = OSRand();
12785
12786
12787 int n;
12788
12789 if (conformant) n = this->numberOfVar;
12790 else n = (int)(4*OSRand());
12791
12792 var = new BranchingWeight*[n];
12793 for (int i = 0; i < n; i++)
12794 {
12795 var[i] = new BranchingWeight();
12796 var[i]->setRandom(density, conformant);
12797 }
12798 return true;
12799 }
12800
12801
12802 bool BranchingWeight::setRandom( double density, bool conformant )
12803 {
12804 #ifndef NDEBUG
12805 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random BranchingWeight");
12806 #endif
12807 this->idx = (int)(4*OSRand());
12808
12809 if (OSRand() <= density) this->name = "random string";
12810
12811 if (OSRand() <= density)
12812 this->value = OSRand();
12813 return true;
12814 }
12815
12816 bool OtherVariableOption::setRandom( double density, bool conformant )
12817 {
12818 #ifndef NDEBUG
12819 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random OtherVariableOption");
12820 #endif
12821 this->name = "random string";
12822 if (OSRand() <= density) this->value = "random string";
12823 if (OSRand() <= density) this->solver = "random string";
12824 if (OSRand() <= density) this->category = "random string";
12825 if (OSRand() <= density) this->type = "random string";
12826 if (OSRand() <= density) this->description = "random string";
12827
12828 if (OSRand() <= density)
12829 {
12830 if (OSRand() <= 0.5)
12831 {
12832 this->numberOfVar = (int)(4*OSRand());
12833
12834 int n;
12835
12836 if (conformant) n = this->numberOfVar;
12837 else n = (int)(4*OSRand());
12838
12839 var = new OtherVarOption*[n];
12840 for (int i = 0; i < n; i++)
12841 {
12842 var[i] = new OtherVarOption();
12843 var[i]->setRandom(density, conformant);
12844 }
12845 }
12846 else
12847 {
12848 this->numberOfEnumerations = (int)(4*OSRand());
12849
12850 int n;
12851
12852 if (conformant) n = this->numberOfEnumerations;
12853 else n = (int)(4*OSRand());
12854
12855 enumeration = new OtherOptionOrResultEnumeration*[n];
12856 for (int i = 0; i < n; i++)
12857 {
12858 enumeration[i] = new OtherOptionOrResultEnumeration();
12859 enumeration[i]->setRandom(density, conformant, 0, 9);
12860 }
12861 }
12862 }
12863 return true;
12864 }
12865
12866 bool OtherVarOption::setRandom( double density, bool conformant )
12867 {
12868 #ifndef NDEBUG
12869 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random OtherVarOption");
12870 #endif
12871 this->idx = (int)(4*OSRand());
12872 if (OSRand() <= density) this->name = "random string";
12873 if (OSRand() <= density) this->value = "random string";
12874 if (OSRand() <= density) this->lbValue = "random string";
12875 if (OSRand() <= density) this->ubValue = "random string";
12876 return true;
12877 }
12878
12879 bool ObjectiveOption::setRandom( double density, bool conformant )
12880 {
12881 #ifndef NDEBUG
12882 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random ObjectiveOption");
12883 #endif
12884 if (OSRand() <= density)
12885 {
12886 this->initialObjectiveValues = new InitObjectiveValues();
12887 this->initialObjectiveValues->setRandom(density, conformant);
12888 }
12889 return false;
12890 if (OSRand() <= density)
12891 {
12892 this->initialObjectiveBounds = new InitObjectiveBounds();
12893 this->initialObjectiveBounds->setRandom(density, conformant);
12894 }
12895 if (OSRand() <= density)
12896 {
12897 this->initialBasisStatus = new BasisStatus();
12898 this->initialBasisStatus->setRandom(density, conformant, -2, -1);
12899 }
12900
12901 if (OSRand() <= density)
12902 {
12903 this->numberOfOtherObjectiveOptions = (int)(4*OSRand());
12904
12905 int n;
12906
12907 if (conformant) n = this->numberOfOtherObjectiveOptions;
12908 else n = (int)(4*OSRand());
12909
12910 other = new OtherObjectiveOption*[n];
12911 for (int i = 0; i < n; i++)
12912 {
12913 other[i] = new OtherObjectiveOption();
12914 other[i]->setRandom(density, conformant);
12915 }
12916 }
12917 return true;
12918 }
12919
12920 bool InitObjectiveValues::setRandom( double density, bool conformant )
12921 {
12922 #ifndef NDEBUG
12923 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random InitObjectiveValues");
12924 #endif
12925 this->numberOfObj = (int)(1+4*OSRand());
12926
12927 int n;
12928
12929 if (conformant) n = this->numberOfObj;
12930 else n = (int)(1+4*OSRand());
12931
12932 obj = new InitObjValue*[n];
12933 for (int i = 0; i < n; i++)
12934 {
12935 obj[i] = new InitObjValue();
12936 obj[i]->setRandom(density, conformant);
12937 }
12938 return true;
12939 }
12940
12941 bool InitObjValue::setRandom( double density, bool conformant )
12942 {
12943 #ifndef NDEBUG
12944 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random InitObjValue");
12945 #endif
12946 if (OSRand() <= 0.5) idx = -1;
12947 else idx = -2;
12948
12949 if (OSRand() <= density) this->name = "random string";
12950
12951 if (OSRand() <= density)
12952 {
12953 if (OSRand() <= 0.5) this->value = 3.14156;
12954 else this->value = 2.71828;
12955 }
12956 return true;
12957 }
12958
12959 bool InitObjectiveBounds::setRandom( double density, bool conformant )
12960 {
12961
12962 #ifndef NDEBUG
12963 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random InitObjectiveBounds");
12964 #endif
12965 this->numberOfObj = (int)(1+4*OSRand());
12966
12967 int n;
12968
12969 if (conformant) n = this->numberOfObj;
12970 else n = (int)(1+4*OSRand());
12971
12972 obj = new InitObjBound*[n];
12973 for (int i = 0; i < n; i++)
12974 {
12975 obj[i] = new InitObjBound();
12976 obj[i]->setRandom(density, conformant);
12977 }
12978 return true;
12979 }
12980
12981 bool InitObjBound::setRandom( double density, bool conformant )
12982 {
12983 #ifndef NDEBUG
12984 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random InitObjBound");
12985 #endif
12986 if (OSRand() <= 0.5) idx = -1;
12987 else idx = -2;
12988
12989 if (OSRand() <= density) this->name = "random string";
12990
12991 if (OSRand() <= density)
12992 {
12993 if (OSRand() <= 0.5) this->lbValue = 3.14156;
12994 else this->lbValue = 2.71828;
12995 if (OSRand() <= 0.5) this->ubValue = 3.14156;
12996 else this->ubValue = 2.71828;
12997 }
12998 return true;
12999 }
13000
13001 bool OtherObjectiveOption::setRandom( double density, bool conformant )
13002 {
13003 #ifndef NDEBUG
13004 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random OtherObjectiveOption");
13005 #endif
13006 this->name = "random string";
13007 if (OSRand() <= density) this->value = "random string";
13008 if (OSRand() <= density) this->solver = "random string";
13009 if (OSRand() <= density) this->category = "random string";
13010 if (OSRand() <= density) this->type = "random string";
13011 if (OSRand() <= density) this->description = "random string";
13012
13013 if (OSRand() <= density)
13014 {
13015 if (OSRand() <= 0.5)
13016 {
13017 this->numberOfObj = (int)(4*OSRand());
13018
13019 int n;
13020
13021 if (conformant) n = this->numberOfObj;
13022 else n = (int)(4*OSRand());
13023
13024 obj = new OtherObjOption*[n];
13025 for (int i = 0; i < n; i++)
13026 {
13027 obj[i] = new OtherObjOption();
13028 obj[i]->setRandom(density, conformant);
13029 }
13030 }
13031 else
13032 {
13033 this->numberOfEnumerations = (int)(4*OSRand());
13034
13035 int n;
13036
13037 if (conformant) n = this->numberOfEnumerations;
13038 else n = (int)(4*OSRand());
13039
13040 enumeration = new OtherOptionOrResultEnumeration*[n];
13041 for (int i = 0; i < n; i++)
13042 {
13043 enumeration[i] = new OtherOptionOrResultEnumeration();
13044 enumeration[i]->setRandom(density, conformant, -2, -1);
13045 }
13046 }
13047 }
13048 return true;
13049 }
13050
13051 bool OtherObjOption::setRandom( double density, bool conformant )
13052 {
13053 #ifndef NDEBUG
13054 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random OtherObjOption");
13055 #endif
13056 if (OSRand() <= 0.5) this->idx = -1;
13057 else this->idx = -2;
13058 if (OSRand() <= density) this->name = "random string";
13059 if (OSRand() <= density) this->value = "random string";
13060 if (OSRand() <= density) this->lbValue = "random string";
13061 if (OSRand() <= density) this->ubValue = "random string";
13062 return true;
13063 }
13064
13065 bool ConstraintOption::setRandom( double density, bool conformant )
13066 {
13067 #ifndef NDEBUG
13068 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random ConstraintOption");
13069 #endif
13070 if (OSRand() <= density)
13071 {
13072 this->initialConstraintValues = new InitConstraintValues();
13073 this->initialConstraintValues->setRandom(density, conformant);
13074 }
13075 return false;
13076 if (OSRand() <= density)
13077 {
13078 this->initialDualValues = new InitDualVariableValues();
13079 this->initialDualValues->setRandom(density, conformant);
13080 }
13081 if (OSRand() <= density)
13082 {
13083 this->initialBasisStatus = new BasisStatus();
13084 this->initialBasisStatus->setRandom(density, conformant, 0, 4);
13085 }
13086
13087 if (OSRand() <= density)
13088 {
13089 this->numberOfOtherConstraintOptions = (int)(4*OSRand());
13090
13091 int n;
13092
13093 if (conformant) n = this->numberOfOtherConstraintOptions;
13094 else n = (int)(4*OSRand());
13095
13096 other = new OtherConstraintOption*[n];
13097 for (int i = 0; i < n; i++)
13098 {
13099 other[i] = new OtherConstraintOption();
13100 other[i]->setRandom(density, conformant);
13101 }
13102 }
13103 return true;
13104 }
13105
13106 bool InitConstraintValues::setRandom( double density, bool conformant )
13107 {
13108 #ifndef NDEBUG
13109 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random InitConstraintValues");
13110 #endif
13111 this->numberOfCon = (int)(1+4*OSRand());
13112
13113 int n;
13114
13115 if (conformant) n = this->numberOfCon;
13116 else n = (int)(1+4*OSRand());
13117
13118 con = new InitConValue*[n];
13119 for (int i = 0; i < n; i++)
13120 {
13121 con[i] = new InitConValue();
13122 con[i]->setRandom(density, conformant);
13123 }
13124 return true;
13125 }
13126
13127 bool InitConValue::setRandom( double density, bool conformant )
13128 {
13129 #ifndef NDEBUG
13130 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random InitConValue");
13131 #endif
13132 this->idx = (int)(4*OSRand());
13133
13134 if (OSRand() <= density) this->name = "random string";
13135
13136 if (OSRand() <= density)
13137
13138 {
13139 if (OSRand() <= 0.5) this->value = 3.14156;
13140 else this->value = 2.71828;
13141 }
13142 return true;
13143 }
13144
13145 bool InitDualVariableValues::setRandom( double density, bool conformant )
13146 {
13147 #ifndef NDEBUG
13148 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random InitDualVariableValues");
13149 #endif
13150 this->numberOfCon = (int)(1+4*OSRand());
13151
13152 int n;
13153
13154 if (conformant) n = this->numberOfCon;
13155 else n = (int)(1+4*OSRand());
13156
13157 con = new InitDualVarValue*[n];
13158 for (int i = 0; i < n; i++)
13159 {
13160 con[i] = new InitDualVarValue();
13161 con[i]->setRandom(density, conformant);
13162 }
13163 return true;
13164 }
13165
13166 bool InitDualVarValue::setRandom( double density, bool conformant )
13167 {
13168 #ifndef NDEBUG
13169 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random InitDualVarValue");
13170 #endif
13171 this->idx = (int)(4*OSRand());
13172
13173 if (OSRand() <= density) this->name = "random string";
13174
13175 if (OSRand() <= density)
13176 {
13177 if (OSRand() <= 0.5) this->lbDualValue = 3.14156;
13178 else this->lbDualValue = 2.71828;
13179 if (OSRand() <= 0.5) this->ubDualValue = 3.14156;
13180 else this->ubDualValue = 2.71828;
13181 }
13182 return true;
13183 }
13184
13185 bool OtherConstraintOption::setRandom( double density, bool conformant )
13186 {
13187 #ifndef NDEBUG
13188 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random OtherConstraintOption");
13189 #endif
13190 this->name = "random string";
13191 if (OSRand() <= density) this->value = "random string";
13192 if (OSRand() <= density) this->solver = "random string";
13193 if (OSRand() <= density) this->category = "random string";
13194 if (OSRand() <= density) this->type = "random string";
13195 if (OSRand() <= density) this->description = "random string";
13196
13197 if (OSRand() <= density)
13198 {
13199 if (OSRand() <= 0.5)
13200 {
13201 this->numberOfCon = (int)(4*OSRand());
13202
13203 int n;
13204
13205 if (conformant) n = this->numberOfCon;
13206 else n = (int)(4*OSRand());
13207
13208 con = new OtherConOption*[n];
13209 for (int i = 0; i < n; i++)
13210 {
13211 con[i] = new OtherConOption();
13212 con[i]->setRandom(density, conformant);
13213 }
13214 }
13215 else
13216 {
13217 this->numberOfEnumerations = (int)(4*OSRand());
13218
13219 int n;
13220
13221 if (conformant) n = this->numberOfEnumerations;
13222 else n = (int)(4*OSRand());
13223
13224 enumeration = new OtherOptionOrResultEnumeration*[n];
13225 for (int i = 0; i < n; i++)
13226 {
13227 enumeration[i] = new OtherOptionOrResultEnumeration();
13228 enumeration[i]->setRandom(density, conformant, 0, 4);
13229 }
13230 }
13231 }
13232 return true;
13233 }
13234
13235 bool OtherConOption::setRandom( double density, bool conformant )
13236 {
13237 #ifndef NDEBUG
13238 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random OtherConOption");
13239 #endif
13240 this->idx = (int)(4*OSRand());
13241 if (OSRand() <= density) this->name = "random string";
13242 if (OSRand() <= density) this->value = "random string";
13243 if (OSRand() <= density) this->lbValue = "random string";
13244 if (OSRand() <= density) this->ubValue = "random string";
13245 return true;
13246 }
13247
13248
13249 bool SolverOptions::setRandom( double density, bool conformant )
13250 {
13251 #ifndef NDEBUG
13252 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random SolverOptions");
13253 #endif
13254 this->numberOfSolverOptions = (int)(1+4*OSRand());
13255
13256 int n;
13257
13258 if (conformant) n = this->numberOfSolverOptions;
13259 else n = (int)(1+4*OSRand());
13260
13261 solverOption = new SolverOption*[n];
13262 for (int i = 0; i < n; i++)
13263 {
13264 solverOption[i] = new SolverOption();
13265 solverOption[i]->setRandom(density, conformant);
13266 }
13267 return true;
13268 }
13269
13270 bool SolverOption::setRandom( double density, bool conformant )
13271 {
13272 #ifndef NDEBUG
13273 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Set random SolverOption");
13274 #endif
13275 if (OSRand() <= density || conformant) this->name = "random string";
13276
13277 if (OSRand() <= density) this->value = "random string";
13278 if (OSRand() <= density) this->solver = "random string";
13279 if (OSRand() <= density) this->category = "random string";
13280 if (OSRand() <= density) this->type = "random string";
13281 if (OSRand() <= density) this->description = "random string";
13282
13283 if (OSRand() <= density)
13284 {
13285 this->numberOfItems = (int)(4*OSRand());
13286
13287 int n;
13288
13289 if (conformant) n = this->numberOfItems;
13290 else n = (int)(4*OSRand());
13291
13292 item = new std::string[n];
13293 for (int i = 0; i < n; i++)
13294 item[i] = "random string";
13295 }
13296 return true;
13297 }
13298
13299
13300
13301
13302
13303
13304
13305
13306
13307
13308 bool OSOption::deepCopyFrom(OSOption *that)
13309 {
13310 #ifndef NDEBUG
13311 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of OSOption");
13312 #endif
13313 if (that->optionHeader != NULL)
13314 {
13315 this->optionHeader = new GeneralFileHeader();
13316 if (!this->optionHeader->deepCopyFrom(that->optionHeader))
13317 return false;
13318 }
13319 if (that->general != NULL)
13320 {
13321 this->general = new GeneralOption();
13322 if (!this->general->deepCopyFrom(that->general))
13323 return false;
13324 }
13325 if (that->system != NULL)
13326 {
13327 this->system = new SystemOption();
13328 if (!this->system->deepCopyFrom(that->system))
13329 return false;
13330 }
13331 if (that->service != NULL)
13332 {
13333 this->service = new ServiceOption();
13334 if (!this->service->deepCopyFrom(that->service))
13335 return false;
13336 }
13337 if (that->job != NULL)
13338 {
13339 this->job = new JobOption();
13340 if (!this->job->deepCopyFrom(that->job))
13341 return false;
13342 }
13343 if (that->optimization != NULL)
13344 {
13345 this->optimization = new OptimizationOption();
13346 if (!this->optimization->deepCopyFrom(that->optimization))
13347 return false;
13348 }
13349 return true;
13350 }
13351
13352
13353 bool GeneralOption::deepCopyFrom(GeneralOption *that)
13354 {
13355 #ifndef NDEBUG
13356 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of GeneralOption");
13357 #endif
13358 this->serviceURI = that->serviceURI;
13359 this->serviceName = that->serviceName;
13360 this->instanceName = that->instanceName;
13361 this->jobID = that->jobID;
13362 this->solverToInvoke = that->solverToInvoke;
13363 this->license = that->license;
13364 this->userName = that->userName;
13365 this->password = that->password;
13366
13367 if (that->instanceLocation != NULL)
13368 {
13369 this->instanceLocation = new InstanceLocationOption();
13370 if (!this->instanceLocation->deepCopyFrom(that->instanceLocation))
13371 return false;
13372 }
13373 if (that->contact != NULL)
13374 {
13375 this->contact = new ContactOption();
13376 if (!this->contact->deepCopyFrom(that->contact))
13377 return false;
13378 }
13379 if (that->otherOptions != NULL)
13380 {
13381 this->otherOptions = new OtherOptions();
13382 if (!this->otherOptions->deepCopyFrom(that->otherOptions))
13383 return false;
13384 }
13385 return true;
13386 }
13387
13388
13389 bool SystemOption::deepCopyFrom(SystemOption *that)
13390 {
13391 #ifndef NDEBUG
13392 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of SystemOption");
13393 #endif
13394 if (that->minDiskSpace != NULL)
13395 {
13396 this->minDiskSpace = new StorageCapacity();
13397 if (!this->minDiskSpace->deepCopyFrom(that->minDiskSpace))
13398 return false;
13399 }
13400 if (that->minMemorySize != NULL)
13401 {
13402 this->minMemorySize = new StorageCapacity();
13403 if (!this->minMemorySize->deepCopyFrom(that->minMemorySize))
13404 return false;
13405 }
13406 if (that->minCPUSpeed != NULL)
13407 {
13408 this->minCPUSpeed = new CPUSpeed();
13409 if (!this->minCPUSpeed->deepCopyFrom(that->minCPUSpeed))
13410 return false;
13411 }
13412 if (that->minCPUNumber != NULL)
13413 {
13414 this->minCPUNumber = new CPUNumber();
13415 if (!this->minCPUNumber->deepCopyFrom(that->minCPUNumber))
13416 return false;
13417 }
13418 if (that->otherOptions != NULL)
13419 {
13420 this->otherOptions = new OtherOptions();
13421 if (!this->otherOptions->deepCopyFrom(that->otherOptions))
13422 return false;
13423 }
13424 return true;
13425 }
13426
13427
13428 bool ServiceOption::deepCopyFrom(ServiceOption *that)
13429 {
13430 #ifndef NDEBUG
13431 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of ServiceOption");
13432 #endif
13433 this->type = that->type;
13434
13435 if (that->otherOptions != NULL)
13436 {
13437 otherOptions = new OtherOptions();
13438 if (!otherOptions->deepCopyFrom(that->otherOptions))
13439 return false;
13440 }
13441
13442 return true;
13443 }
13444
13445
13446 bool JobOption::deepCopyFrom(JobOption *that)
13447 {
13448 #ifndef NDEBUG
13449 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of JobOption");
13450 #endif
13451 this->requestedStartTime = that->requestedStartTime;
13452
13453 if (that->maxTime != NULL)
13454 {
13455 maxTime = new TimeSpan();
13456 if (!maxTime->deepCopyFrom(that->maxTime))
13457 return false;
13458 }
13459 if (that->dependencies != NULL)
13460 {
13461 dependencies = new JobDependencies();
13462 if (!dependencies->deepCopyFrom(that->dependencies))
13463 return false;
13464 }
13465 if (that->requiredDirectories != NULL)
13466 {
13467 requiredDirectories = new DirectoriesAndFiles();
13468 if (!requiredDirectories->deepCopyFrom(that->requiredDirectories))
13469 return false;
13470 }
13471 if (that->requiredFiles != NULL)
13472 {
13473 requiredFiles = new DirectoriesAndFiles();
13474 if (!requiredFiles->deepCopyFrom(that->requiredFiles))
13475 return false;
13476 }
13477 if (that->directoriesToMake != NULL)
13478 {
13479 directoriesToMake = new DirectoriesAndFiles();
13480 if (!directoriesToMake->deepCopyFrom(that->directoriesToMake))
13481 return false;
13482 }
13483 if (that->filesToMake != NULL)
13484 {
13485 filesToMake = new DirectoriesAndFiles();
13486 if (!filesToMake->deepCopyFrom(that->filesToMake))
13487 return false;
13488 }
13489 if (that->inputDirectoriesToMove != NULL)
13490 {
13491 inputDirectoriesToMove = new PathPairs();
13492 if (!inputDirectoriesToMove->deepCopyFrom(that->inputDirectoriesToMove))
13493 return false;
13494 }
13495 if (that->inputFilesToMove != NULL)
13496 {
13497 inputFilesToMove = new PathPairs();
13498 if (!inputFilesToMove->deepCopyFrom(that->inputFilesToMove))
13499 return false;
13500 }
13501 if (that->outputFilesToMove != NULL)
13502 {
13503 outputFilesToMove = new PathPairs();
13504 if (!outputFilesToMove->deepCopyFrom(that->outputFilesToMove))
13505 return false;
13506 }
13507 if (that->outputDirectoriesToMove != NULL)
13508 {
13509 outputDirectoriesToMove = new PathPairs();
13510 if (!outputDirectoriesToMove->deepCopyFrom(that->outputDirectoriesToMove))
13511 return false;
13512 }
13513 if (that->filesToDelete != NULL)
13514 {
13515 filesToDelete = new DirectoriesAndFiles();
13516 if (!filesToDelete->deepCopyFrom(that->filesToDelete))
13517 return false;
13518 }
13519 if (that->directoriesToDelete != NULL)
13520 {
13521 directoriesToDelete = new DirectoriesAndFiles();
13522 if (!directoriesToDelete->deepCopyFrom(that->directoriesToDelete))
13523 return false;
13524 }
13525 if (that->processesToKill != NULL)
13526 {
13527 processesToKill = new Processes();
13528 if (!processesToKill->deepCopyFrom(that->processesToKill))
13529 return false;
13530 }
13531 if (that->otherOptions != NULL)
13532 {
13533 otherOptions = new OtherOptions();
13534 if (!otherOptions->deepCopyFrom(that->otherOptions))
13535 return false;
13536 }
13537 return true;
13538 }
13539
13540 bool OptimizationOption::deepCopyFrom(OptimizationOption *that)
13541 {
13542 #ifndef NDEBUG
13543 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of OptimizationOption");
13544 #endif
13545 this->numberOfVariables = that->numberOfVariables;
13546 this->numberOfObjectives = that->numberOfObjectives;
13547 this->numberOfConstraints = that->numberOfConstraints;
13548
13549 if (that->variables != NULL)
13550 {
13551 variables = new VariableOption();
13552 if (!variables->deepCopyFrom(that->variables))
13553 return false;
13554 }
13555 if (that->objectives != NULL)
13556 {
13557 objectives = new ObjectiveOption();
13558 if (!objectives->deepCopyFrom(that->objectives))
13559 return false;
13560 }
13561 if (that->constraints != NULL)
13562 {
13563 constraints = new ConstraintOption();
13564 if (!constraints->deepCopyFrom(that->constraints))
13565 return false;
13566 }
13567 if (that->solverOptions != NULL)
13568 {
13569 solverOptions = new SolverOptions();
13570 if (!solverOptions->deepCopyFrom(that->solverOptions))
13571 return false;
13572 }
13573
13574 return true;
13575 }
13576
13577 bool InstanceLocationOption::deepCopyFrom(InstanceLocationOption *that)
13578 {
13579 #ifndef NDEBUG
13580 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of InstanceLocationOption");
13581 #endif
13582 this->value = that->value;
13583 this->locationType = that->locationType;
13584 return true;
13585 }
13586
13587 bool ContactOption::deepCopyFrom(ContactOption *that)
13588 {
13589 #ifndef NDEBUG
13590 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of ContactOption");
13591 #endif
13592 this->value = that->value;
13593 this->transportType = that->transportType;
13594 return true;
13595 }
13596
13597 bool OtherOptions::deepCopyFrom(OtherOptions *that)
13598 {
13599 #ifndef NDEBUG
13600 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of OtherOptions");
13601 #endif
13602 int n;
13603
13604 n = that->numberOfOtherOptions;
13605 this->numberOfOtherOptions = n;
13606
13607 if (n < 0) return false;
13608 if (n == 0) return true;
13609
13610 this->other = new OtherOption*[n];
13611
13612 for (int i = 0; i < n; i++)
13613 {
13614 this->other[i] = new OtherOption();
13615 if (!this->other[i]->deepCopyFrom(that->other[i]))
13616 return false;
13617 }
13618
13619 return true;
13620 }
13621
13622 bool OtherOption::deepCopyFrom(OtherOption *that)
13623 {
13624 #ifndef NDEBUG
13625 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of OtherOption");
13626 #endif
13627 this->name = that->name;
13628 this->value = that->value;
13629 this->description = that->description;
13630 return true;
13631 }
13632
13633
13634 bool JobDependencies::deepCopyFrom(JobDependencies *that)
13635 {
13636 #ifndef NDEBUG
13637 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of JobDependencies");
13638 #endif
13639 int n;
13640
13641 this->numberOfJobIDs = that->numberOfJobIDs;
13642 n = this->numberOfJobIDs;
13643
13644 if (n < 0) return false;
13645 if (n == 0) return true;
13646
13647 this->jobID = new std::string[n];
13648 for (int i = 0; i < n; i++)
13649 this->jobID[i] = that->jobID[i];
13650
13651 return true;
13652 }
13653
13654 bool DirectoriesAndFiles::deepCopyFrom(DirectoriesAndFiles *that)
13655 {
13656 #ifndef NDEBUG
13657 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of DirectoriesAndFiles");
13658 #endif
13659 int n;
13660
13661 this->numberOfPaths = that->numberOfPaths;
13662 n = this->numberOfPaths;
13663
13664 if (n < 0) return false;
13665 if (n == 0) return true;
13666
13667 this->path = new std::string[n];
13668 for (int i = 0; i < n; i++)
13669 this->path[i] = that->path[i];
13670
13671 return true;
13672 }
13673
13674 bool PathPairs::deepCopyFrom(PathPairs *that)
13675 {
13676 #ifndef NDEBUG
13677 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of PathPairs");
13678 #endif
13679 int n;
13680
13681 this->numberOfPathPairs = that->numberOfPathPairs;
13682 n = this->numberOfPathPairs;
13683
13684 if (n < 0) return false;
13685 if (n == 0) return true;
13686
13687 pathPair = new PathPair*[n];
13688 for (int i = 0; i < n; i++)
13689 {
13690 this->pathPair[i] = new PathPair();
13691 if (!this->pathPair[i]->deepCopyFrom(that->pathPair[i]))
13692 return false;
13693 }
13694
13695 return true;
13696 }
13697
13698 bool PathPair::deepCopyFrom(PathPair *that)
13699 {
13700 #ifndef NDEBUG
13701 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of PathPair");
13702 #endif
13703 this->from = that->from;
13704 this->to = that->to;
13705 this->makeCopy = that->makeCopy;
13706 return true;
13707 }
13708
13709 bool Processes::deepCopyFrom(Processes *that)
13710 {
13711 #ifndef NDEBUG
13712 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of Processes");
13713 #endif
13714 int n;
13715
13716 this->numberOfProcesses = that->numberOfProcesses;
13717 n = this->numberOfProcesses;
13718
13719 if (n < 0) return false;
13720 if (n == 0) return true;
13721
13722 process = new std::string[n];
13723 for (int i = 0; i < n; i++)
13724 this->process[i] = that->process[i];
13725
13726 return true;
13727 }
13728
13729
13730 bool VariableOption::deepCopyFrom(VariableOption *that)
13731 {
13732 #ifndef NDEBUG
13733 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of VariableOption");
13734 #endif
13735 if (that->initialVariableValues != NULL)
13736 {
13737 this->initialVariableValues = new InitVariableValues();
13738 if (!this->initialVariableValues->deepCopyFrom(that->initialVariableValues))
13739 return false;
13740 }
13741 if (that->initialVariableValuesString != NULL)
13742 {
13743 this->initialVariableValuesString = new InitVariableValuesString();
13744 if (!this->initialVariableValuesString->deepCopyFrom(that->initialVariableValuesString))
13745 return false;
13746 }
13747 if (that->initialBasisStatus != NULL)
13748 {
13749 this->initialBasisStatus = new BasisStatus();
13750 if (!this->initialBasisStatus->deepCopyFrom(that->initialBasisStatus))
13751 return false;
13752 }
13753 if (that->integerVariableBranchingWeights != NULL)
13754 {
13755 this->integerVariableBranchingWeights = new IntegerVariableBranchingWeights();
13756 if (!this->integerVariableBranchingWeights->deepCopyFrom(that->integerVariableBranchingWeights))
13757 return false;
13758 }
13759 if (that->sosVariableBranchingWeights != NULL)
13760 {
13761 this->sosVariableBranchingWeights = new SOSVariableBranchingWeights();
13762 if (!this->sosVariableBranchingWeights->deepCopyFrom(that->sosVariableBranchingWeights))
13763 return false;
13764 }
13765
13766 this->numberOfOtherVariableOptions = that->numberOfOtherVariableOptions;
13767 int n = this->numberOfOtherVariableOptions;
13768
13769 if (n < 0) return false;
13770 if (n == 0) return true;
13771
13772 this->other = new OtherVariableOption*[n];
13773 for (int i = 0; i < n; i++)
13774 {
13775 this->other[i] = new OtherVariableOption();
13776 if (!this->other[i]->deepCopyFrom(that->other[i]))
13777 return false;
13778 }
13779 return true;
13780 }
13781
13782 bool InitVariableValues::deepCopyFrom(InitVariableValues *that)
13783 {
13784 #ifndef NDEBUG
13785 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of InitVariableValues");
13786 #endif
13787 this->numberOfVar = that->numberOfVar;
13788
13789 int n = this->numberOfVar;
13790
13791 if (n < 0) return false;
13792 if (n == 0) return true;
13793
13794 this->var = new InitVarValue*[n];
13795 for (int i = 0; i < n; i++)
13796 {
13797 this->var[i] = new InitVarValue();
13798 if (!this->var[i]->deepCopyFrom(that->var[i]))
13799 return false;
13800 }
13801 return true;
13802 }
13803
13804 bool InitVarValue::deepCopyFrom(InitVarValue *that)
13805 {
13806 #ifndef NDEBUG
13807 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of InitVarValue");
13808 #endif
13809 this->idx = that->idx;
13810 this->name = that->name;
13811 this->value = that->value;
13812 return true;
13813 }
13814
13815
13816 bool InitVariableValuesString::deepCopyFrom(InitVariableValuesString *that)
13817 {
13818 #ifndef NDEBUG
13819 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of InitVariableValuesString");
13820 #endif
13821 this->numberOfVar = that->numberOfVar;
13822 int n = this->numberOfVar;
13823
13824 if (n < 0) return false;
13825 if (n == 0) return true;
13826
13827 this->var = new InitVarValueString*[n];
13828 for (int i = 0; i < n; i++)
13829 {
13830 this->var[i] = new InitVarValueString();
13831 if (!this->var[i]->deepCopyFrom(that->var[i]))
13832 return false;
13833 }
13834 return true;
13835 }
13836
13837 bool InitVarValueString::deepCopyFrom(InitVarValueString *that)
13838 {
13839 #ifndef NDEBUG
13840 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of InitVarValueString");
13841 #endif
13842 this->idx = that->idx;
13843 this->name = that->name;
13844 this->value = that->value;
13845 return true;
13846 }
13847
13848
13849 bool IntegerVariableBranchingWeights::deepCopyFrom(IntegerVariableBranchingWeights *that)
13850 {
13851 #ifndef NDEBUG
13852 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of IntegerVariableBranchingWeights");
13853 #endif
13854 this->numberOfVar = that->numberOfVar;
13855 int n = this->numberOfVar;
13856
13857 if (n < 0) return false;
13858 if (n == 0) return true;
13859
13860 this->var = new BranchingWeight*[n];
13861 for (int i = 0; i < n; i++)
13862 {
13863 this->var[i] = new BranchingWeight();
13864 if (!this->var[i]->deepCopyFrom(that->var[i]))
13865 return false;
13866 }
13867 return true;
13868 }
13869
13870 bool SOSVariableBranchingWeights::deepCopyFrom(SOSVariableBranchingWeights *that)
13871 {
13872 #ifndef NDEBUG
13873 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of SOSVariableBranchingWeights");
13874 #endif
13875 this->numberOfSOS = that->numberOfSOS;
13876 int n = this->numberOfSOS;
13877
13878 if (n < 0) return false;
13879 if (n == 0) return true;
13880
13881 this->sos = new SOSWeights*[n];
13882 for (int i = 0; i < n; i++)
13883 {
13884 this->sos[i] = new SOSWeights();
13885 if (!this->sos[i]->deepCopyFrom(that->sos[i]))
13886 return false;
13887 }
13888 return true;
13889 }
13890
13891
13892 bool SOSWeights::deepCopyFrom(SOSWeights *that)
13893 {
13894 #ifndef NDEBUG
13895 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of SOSWeights");
13896 #endif
13897 this->sosIdx = that->sosIdx;
13898 this->groupWeight = that->groupWeight;
13899
13900 this->numberOfVar = that->numberOfVar;
13901 int n = this->numberOfVar;
13902
13903 if (n < 0) return false;
13904 if (n == 0) return true;
13905
13906 this->var = new BranchingWeight*[n];
13907 for (int i = 0; i < n; i++)
13908 {
13909 this->var[i] = new BranchingWeight();
13910 if (!this->var[i]->deepCopyFrom(that->var[i]))
13911 return false;
13912 }
13913 return true;
13914 }
13915
13916
13917 bool BranchingWeight::deepCopyFrom(BranchingWeight *that)
13918 {
13919 #ifndef NDEBUG
13920 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of BranchingWeight");
13921 #endif
13922 this->idx = that->idx;
13923 this->name = that->name;
13924 this->value = that->value;
13925 return true;
13926 }
13927
13928 bool OtherVariableOption::deepCopyFrom(OtherVariableOption *that)
13929 {
13930 #ifndef NDEBUG
13931 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of OtherVariableOption");
13932 #endif
13933 this->name = that->name;
13934 this->value = that->value;
13935 this->solver = that->solver;
13936 this->category = that->category;
13937 this->type = that->type;
13938 this->varType = that->varType;
13939 this->enumType = that->enumType;
13940 this->description = that->description;
13941
13942 int n;
13943 this->numberOfVar = that->numberOfVar;
13944 n = this->numberOfVar;
13945
13946 if (n < 0) return false;
13947 if (n > 0)
13948 {
13949 this->var = new OtherVarOption*[n];
13950 for (int i = 0; i < n; i++)
13951 {
13952 this->var[i] = new OtherVarOption();
13953 if (!this->var[i]->deepCopyFrom(that->var[i]))
13954 return false;
13955 }
13956 }
13957
13958 this->numberOfEnumerations = that->numberOfEnumerations;
13959 n = this->numberOfEnumerations;
13960
13961 if (n < 0) return false;
13962 if (n == 0) return true;
13963
13964 this->enumeration = new OtherOptionOrResultEnumeration*[n];
13965 for (int i = 0; i < n; i++)
13966 {
13967 this->enumeration[i] = new OtherOptionOrResultEnumeration();
13968 if (!this->enumeration[i]->deepCopyFrom(that->enumeration[i]))
13969 return false;
13970 }
13971 return true;
13972 }
13973
13974 bool OtherVarOption::deepCopyFrom(OtherVarOption *that)
13975 {
13976 #ifndef NDEBUG
13977 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of OtherVarOption");
13978 #endif
13979 this->idx = that->idx;
13980 this->name = that->name;
13981 this->value = that->value;
13982 this->lbValue = that->lbValue;
13983 this->ubValue = that->ubValue;
13984 return true;
13985 }
13986
13987 bool ObjectiveOption::deepCopyFrom(ObjectiveOption *that)
13988 {
13989 #ifndef NDEBUG
13990 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of ObjectiveOption");
13991 #endif
13992 if (that->initialObjectiveValues != NULL)
13993 {
13994 this->initialObjectiveValues = new InitObjectiveValues();
13995 if (!this->initialObjectiveValues->deepCopyFrom(that->initialObjectiveValues))
13996 return false;
13997 }
13998 if (that->initialObjectiveBounds != NULL)
13999 {
14000 this->initialObjectiveBounds = new InitObjectiveBounds();
14001 if (!this->initialObjectiveBounds->deepCopyFrom(that->initialObjectiveBounds))
14002 return false;
14003 }
14004 if (that->initialBasisStatus != NULL)
14005 {
14006 this->initialBasisStatus = new BasisStatus();
14007 if (!this->initialBasisStatus->deepCopyFrom(that->initialBasisStatus))
14008 return false;
14009 }
14010
14011 this->numberOfOtherObjectiveOptions = that->numberOfOtherObjectiveOptions;
14012 int n = this->numberOfOtherObjectiveOptions;
14013
14014 if (n < 0) return false;
14015 if (n == 0) return true;
14016
14017 this->other = new OtherObjectiveOption*[n];
14018 for (int i = 0; i < n; i++)
14019 {
14020 this->other[i] = new OtherObjectiveOption();
14021 if (!this->other[i]->deepCopyFrom(that->other[i]))
14022 return false;
14023 }
14024 return true;
14025 }
14026
14027 bool InitObjectiveValues::deepCopyFrom(InitObjectiveValues *that)
14028 {
14029 #ifndef NDEBUG
14030 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of InitObjectiveValues");
14031 #endif
14032 this->numberOfObj = that->numberOfObj;
14033 int n = this->numberOfObj;
14034
14035 if (n < 0) return false;
14036 if (n == 0) return true;
14037
14038 this->obj = new InitObjValue*[n];
14039 for (int i = 0; i < n; i++)
14040 {
14041 this->obj[i] = new InitObjValue();
14042 if (!this->obj[i]->deepCopyFrom(that->obj[i]))
14043 return false;
14044 }
14045 return true;
14046 }
14047
14048 bool InitObjValue::deepCopyFrom(InitObjValue *that)
14049 {
14050 #ifndef NDEBUG
14051 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of InitObjValue");
14052 #endif
14053 this->idx = that->idx;
14054 this->name = that->name;
14055 this->value = that->value;
14056 return true;
14057 }
14058
14059 bool InitObjectiveBounds::deepCopyFrom(InitObjectiveBounds *that)
14060 {
14061 #ifndef NDEBUG
14062 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of InitObjectiveBounds");
14063 #endif
14064 this->numberOfObj = that->numberOfObj;
14065 int n = this->numberOfObj;
14066
14067 if (n < 0) return false;
14068 if (n == 0) return true;
14069
14070 this->obj = new InitObjBound*[n];
14071 for (int i = 0; i < n; i++)
14072 {
14073 this->obj[i] = new InitObjBound();
14074 if (!this->obj[i]->deepCopyFrom(that->obj[i]))
14075 return false;
14076 }
14077 return true;
14078 }
14079
14080 bool InitObjBound::deepCopyFrom(InitObjBound *that)
14081 {
14082 #ifndef NDEBUG
14083 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of InitObjBound");
14084 #endif
14085 this->idx = that->idx;
14086 this->name = that->name;
14087 this->lbValue = that->lbValue;
14088 this->ubValue = that->ubValue;
14089 return true;
14090 }
14091
14092 bool OtherObjectiveOption::deepCopyFrom(OtherObjectiveOption *that)
14093 {
14094 #ifndef NDEBUG
14095 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of OtherObjectiveOption");
14096 #endif
14097 this->name = that->name;
14098 this->value = that->value;
14099 this->solver = that->solver;
14100 this->category = that->category;
14101 this->type = that->type;
14102 this->objType = that->objType;
14103 this->enumType = that->enumType;
14104 this->description = that->description;
14105
14106 int n;
14107
14108 this->numberOfObj = that->numberOfObj;
14109
14110 n = this->numberOfObj;
14111
14112 if (n < 0) return false;
14113 if (n > 0)
14114 {
14115 this->obj = new OtherObjOption*[n];
14116 for (int i = 0; i < n; i++)
14117 {
14118 this->obj[i] = new OtherObjOption();
14119 if (!this->obj[i]->deepCopyFrom(that->obj[i]))
14120 return false;
14121 }
14122 }
14123
14124 this->numberOfEnumerations = that->numberOfEnumerations;
14125 n = this->numberOfEnumerations;
14126
14127 if (n < 0) return false;
14128 if (n > 0)
14129 {
14130 this->enumeration = new OtherOptionOrResultEnumeration*[n];
14131 for (int i = 0; i < n; i++)
14132 {
14133 this->enumeration[i] = new OtherOptionOrResultEnumeration();
14134 if (!this->enumeration[i]->deepCopyFrom(that->enumeration[i]))
14135 return false;
14136 }
14137 }
14138 return true;
14139 }
14140
14141 bool OtherObjOption::deepCopyFrom(OtherObjOption *that)
14142 {
14143 #ifndef NDEBUG
14144 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of OtherObjOption");
14145 #endif
14146 this->idx = that->idx;
14147 this->name = that->name;
14148 this->value = that->value;
14149 this->lbValue = that->lbValue;
14150 this->ubValue = that->ubValue;
14151 return true;
14152 }
14153
14154 bool ConstraintOption::deepCopyFrom(ConstraintOption *that)
14155 {
14156 #ifndef NDEBUG
14157 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of ConstraintOption");
14158 #endif
14159 if (that->initialConstraintValues != NULL)
14160 {
14161 this->initialConstraintValues = new InitConstraintValues();
14162 if (!this->initialConstraintValues->deepCopyFrom(that->initialConstraintValues))
14163 return false;
14164 }
14165 if (that->initialDualValues != NULL)
14166 {
14167 this->initialDualValues = new InitDualVariableValues();
14168 if (!this->initialDualValues->deepCopyFrom(that->initialDualValues))
14169 return false;
14170 }
14171 if (that->initialBasisStatus != NULL)
14172 {
14173 this->initialBasisStatus = new BasisStatus();
14174 if (!this->initialBasisStatus->deepCopyFrom(that->initialBasisStatus))
14175 return false;
14176 }
14177
14178 this->numberOfOtherConstraintOptions = that->numberOfOtherConstraintOptions;
14179 int n = this->numberOfOtherConstraintOptions;
14180
14181 if (n < 0) return false;
14182 if (n == 0) return true;
14183
14184 this->other = new OtherConstraintOption*[n];
14185 for (int i = 0; i < n; i++)
14186 {
14187 this->other[i] = new OtherConstraintOption();
14188 if (!this->other[i]->deepCopyFrom(that->other[i]))
14189 return false;
14190 }
14191 return true;
14192 }
14193
14194 bool InitConstraintValues::deepCopyFrom(InitConstraintValues *that)
14195 {
14196 #ifndef NDEBUG
14197 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of InitConstraintValues");
14198 #endif
14199 this->numberOfCon = that->numberOfCon;
14200 int n = this->numberOfCon;
14201
14202 if (n < 0) return false;
14203 if (n == 0) return true;
14204
14205 this->con = new InitConValue*[n];
14206 for (int i = 0; i < n; i++)
14207 {
14208 this->con[i] = new InitConValue();
14209 if (!this->con[i]->deepCopyFrom(that->con[i]))
14210 return false;
14211 }
14212 return true;
14213 }
14214
14215 bool InitConValue::deepCopyFrom(InitConValue *that)
14216 {
14217 #ifndef NDEBUG
14218 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of InitConValue");
14219 #endif
14220 this->idx = that->idx;
14221 this->name = that->name;
14222 this->value = that->value;
14223 return true;
14224 }
14225
14226 bool InitDualVariableValues::deepCopyFrom(InitDualVariableValues *that)
14227 {
14228 #ifndef NDEBUG
14229 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of InitDualVariableValues");
14230 #endif
14231 this->numberOfCon = that->numberOfCon;
14232 int n = this->numberOfCon;
14233
14234 if (n < 0) return false;
14235 if (n == 0) return true;
14236
14237 this->con = new InitDualVarValue*[n];
14238 for (int i = 0; i < n; i++)
14239 {
14240 this->con[i] = new InitDualVarValue();
14241 if (!this->con[i]->deepCopyFrom(that->con[i]))
14242 return false;
14243 }
14244 return true;
14245 }
14246
14247 bool InitDualVarValue::deepCopyFrom(InitDualVarValue *that)
14248 {
14249 #ifndef NDEBUG
14250 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of InitDualVarValue");
14251 #endif
14252 this->idx = that->idx;
14253 this->name = that->name;
14254 this->lbDualValue = that->lbDualValue;
14255 this->ubDualValue = that->ubDualValue;
14256 return true;
14257 }
14258
14259 bool OtherConstraintOption::deepCopyFrom(OtherConstraintOption *that)
14260 {
14261 #ifndef NDEBUG
14262 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of OtherConstraintOption");
14263 #endif
14264 this->name = that->name;
14265 this->value = that->value;
14266 this->solver = that->solver;
14267 this->category = that->category;
14268 this->type = that->type;
14269 this->conType = that->conType;
14270 this->enumType = that->enumType;
14271 this->description = that->description;
14272
14273 int n;
14274
14275 this->numberOfCon = that->numberOfCon;
14276 n = this->numberOfCon;
14277
14278 if (n < 0) return false;
14279 if (n > 0)
14280 {
14281 this->con = new OtherConOption*[n];
14282 for (int i = 0; i < n; i++)
14283 {
14284 this->con[i] = new OtherConOption();
14285 if (!this->con[i]->deepCopyFrom(that->con[i]))
14286 return false;
14287 }
14288 }
14289
14290 this->numberOfEnumerations = that->numberOfEnumerations;
14291 n = this->numberOfEnumerations;
14292
14293 if (n < 0) return false;
14294 if (n > 0)
14295 {
14296 this->enumeration = new OtherOptionOrResultEnumeration*[n];
14297 for (int i = 0; i < n; i++)
14298 {
14299 this->enumeration[i] = new OtherOptionOrResultEnumeration();
14300 if (!this->enumeration[i]->deepCopyFrom(that->enumeration[i]))
14301 return false;
14302 }
14303 }
14304 return true;
14305 }
14306
14307 bool OtherConOption::deepCopyFrom(OtherConOption *that)
14308 {
14309 #ifndef NDEBUG
14310 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of OtherConOption");
14311 #endif
14312 this->idx = that->idx;
14313 this->name = that->name;
14314 this->value = that->value;
14315 this->lbValue = that->lbValue;
14316 this->ubValue = that->ubValue;
14317 return true;
14318 }
14319
14320
14321 bool SolverOptions::deepCopyFrom(SolverOptions *that)
14322 {
14323 #ifndef NDEBUG
14324 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of SolverOptions");
14325 #endif
14326 this->numberOfSolverOptions = that->numberOfSolverOptions;
14327 int n = this->numberOfSolverOptions;
14328
14329 if (n < 0) return false;
14330 if (n == 0) return true;
14331
14332 this->solverOption = new SolverOption*[n];
14333 for (int i = 0; i < n; i++)
14334 {
14335 this->solverOption[i] = new SolverOption();
14336 if (!this->solverOption[i]->deepCopyFrom(that->solverOption[i]))
14337 return false;
14338 }
14339 return true;
14340 }
14341
14342 bool SolverOption::deepCopyFrom(SolverOption *that)
14343 {
14344 #ifndef NDEBUG
14345 osoutput->OSPrint(ENUM_OUTPUT_AREA_OSOption, ENUM_OUTPUT_LEVEL_trace, "Make deep copy of SolverOption");
14346 #endif
14347 this->name = that->name;
14348 this->value = that->value;
14349 this->solver = that->solver;
14350 this->category = that->category;
14351 this->type = that->type;
14352 this->description = that->description;
14353
14354 this->numberOfItems = that->numberOfItems;
14355 int n = this->numberOfItems;
14356
14357 if (n < 0) return false;
14358 if (n == 0) return true;
14359
14360 this->item = new std::string[n];
14361 for (int i = 0; i < n; i++)
14362 this->item[i] = that->item[i];
14363
14364 return true;
14365 }
14366