00001
00016 #ifndef OSGENERAL_H
00017 #define OSGENERAL_H
00018
00019 #include "OSConfig.h"
00020 #include "OSParameters.h"
00021
00022 #include <string>
00023 #include <vector>
00024
00029 class GeneralFileHeader
00030 {
00031 public:
00032
00036 std::string name;
00037
00042 std::string source;
00043
00047 std::string description;
00048
00052 std::string fileCreator;
00053
00057 std::string licence;
00058
00059
00064 GeneralFileHeader();
00065
00070 ~GeneralFileHeader();
00071
00076 bool IsEqual(GeneralFileHeader *that);
00077
00085 bool setRandom(double density, bool conformant);
00086
00092 std::string getHeaderItem(std::string item);
00093
00103 bool setHeader(std::string name, std::string source, std::string description,
00104 std::string fileCreator, std::string licence);
00105
00106 };
00107
00108
00112 class SparseVector
00113 {
00114 public:
00115
00121 SparseVector(int number);
00122
00127 SparseVector();
00128
00133 ~SparseVector();
00134
00139 bool bDeleteArrays;
00140
00144 int number;
00145
00149 int* indexes;
00150
00154 double* values;
00155
00156 };
00157
00158
00162 class SparseMatrix
00163 {
00164 public:
00165
00170 bool bDeleteArrays;
00171
00176 bool isColumnMajor;
00177
00181 int startSize;
00182
00186 int valueSize;
00187
00192 int* starts;
00193
00198 int* indexes;
00199
00204 double* values;
00205
00210 SparseMatrix();
00211
00220 SparseMatrix(bool isColumnMajor_, int startSize, int valueSize);
00225 ~SparseMatrix();
00226
00232 bool display(int secondaryDim);
00233
00234 };
00235
00236
00240 class SparseJacobianMatrix
00241 {
00242 public:
00243
00248 bool bDeleteArrays;
00249
00253 int startSize;
00254
00258 int valueSize;
00259
00264 int* starts;
00265
00270 int* conVals;
00271
00275 int* indexes;
00276
00280 double* values;
00281
00286 SparseJacobianMatrix();
00287
00294 SparseJacobianMatrix(int startSize, int valueSize);
00295
00300 ~SparseJacobianMatrix();
00301
00302 };
00303
00304
00305
00306
00307
00318 class SparseHessianMatrix
00319 {
00320 public:
00321
00326 bool bDeleteArrays;
00327
00331 int hessDimension;
00332
00336 int* hessRowIdx;
00337
00341 int* hessColIdx;
00342
00346 double* hessValues;
00347
00352 SparseHessianMatrix();
00353
00360 SparseHessianMatrix(int startSize, int valueSize);
00361
00366 ~SparseHessianMatrix();
00367
00368 };
00369
00373 class QuadraticTerms
00374 {
00375
00376 public:
00377
00382 int* rowIndexes;
00383
00387 int* varOneIndexes;
00388
00392 int* varTwoIndexes;
00393
00397 double* coefficients;
00398
00403 QuadraticTerms();
00404 ~QuadraticTerms();
00405 };
00406
00407
00408
00412 class IntVector
00413 {
00414 public:
00415 IntVector();
00416 ~IntVector();
00417
00418
00419 IntVector(int n);
00420
00425 bool bDeleteArrays;
00426 int numberOfEl;
00427 int *el;
00428
00432 bool IsEqual(IntVector *that);
00433
00443 bool setRandom(double density, bool conformant, int iMin, int iMax);
00444
00450 bool setIntVector(int *i, int ni);
00451
00456 bool extendIntVector(int i);
00457
00461 int getNumberOfEl();
00462
00467 int getEl(int j);
00468
00469
00477 bool getEl(int *i);
00478 };
00479
00480
00486 class OtherOptionEnumeration : public IntVector
00487 {
00488 public:
00489 std::string value;
00490 std::string description;
00491
00492 OtherOptionEnumeration();
00493 ~OtherOptionEnumeration();
00494
00495
00496 OtherOptionEnumeration(int n);
00497
00502 bool IsEqual(OtherOptionEnumeration *that);
00503
00513 bool setRandom(double density, bool conformant, int iMin, int iMax);
00514
00522 bool setOtherOptionEnumeration(std::string value, std::string description, int *i, int ni);
00523
00524
00528 std::string getValue();
00529
00533 std::string getDescription();
00534
00535 };
00536
00537
00538
00542 class DoubleVector
00543 {
00544 public:
00545 DoubleVector();
00546 ~DoubleVector();
00551 bool bDeleteArrays;
00552 int numberOfEl;
00553 double *el;
00554
00555 bool IsEqual(DoubleVector *that);
00556 };
00557
00558
00562 struct IndexValuePair
00563 {
00567 int idx;
00568
00571 double value;
00572
00573 };
00574
00579 class BasisStatus
00580 {
00581 public:
00582 IntVector* basic;
00583 IntVector* atLower;
00584 IntVector* atUpper;
00585 IntVector* isFree;
00586 IntVector* superbasic;
00587 IntVector* unknown;
00588
00589 BasisStatus();
00590 ~BasisStatus();
00591
00596 bool IsEqual(BasisStatus *that);
00597
00607 bool setRandom(double density, bool conformant, int iMin, int iMax);
00608
00616 bool setIntVector(int status, int *i, int ni);
00617
00624 bool addIdx(int status, int idx);
00625
00632 int getNumberOfEl(int status);
00633
00634
00642 int getEl(int status, int j);
00643
00653 bool getIntVector(int status, int *i);
00654 };
00655
00665 class StorageCapacity
00666 {
00667
00668 public:
00670 std::string unit;
00671
00673 std::string description;
00674
00676 double value;
00677
00682 StorageCapacity();
00687 ~StorageCapacity();
00688
00693 bool IsEqual(StorageCapacity *that);
00694
00702 bool setRandom(double density, bool conformant);
00703 };
00704
00716 class CPUSpeed
00717 {
00718
00719 public:
00721 std::string unit;
00722
00724 std::string description;
00725
00727 double value;
00728
00733 CPUSpeed();
00738 ~CPUSpeed();
00739
00744 bool IsEqual(CPUSpeed *that);
00745
00753 bool setRandom(double density, bool conformant);
00754 };
00755
00767 class CPUNumber
00768 {
00769
00770 public:
00772 std::string description;
00773
00775 int value;
00776
00781 CPUNumber();
00786 ~CPUNumber();
00787
00792 bool IsEqual(CPUNumber *that);
00793
00801 bool setRandom(double density, bool conformant);
00802 };
00803
00813 class TimeSpan
00814 {
00815
00816 public:
00818 std::string unit;
00819
00821 double value;
00822
00827 TimeSpan();
00832 ~TimeSpan();
00833
00838 bool IsEqual(TimeSpan *that);
00839
00847 bool setRandom(double density, bool conformant);
00848 };
00849
00850
00851
00852 class OSGeneral
00853 {
00854
00855 };
00856
00857
00858
00859
00860
00861
00862
00863
00864
00865
00866
00867 enum ENUM_CPUSPEEDUNIT
00868 {
00869 ENUM_CPUSPEEDUNIT_hertz = 1,
00870 ENUM_CPUSPEEDUNIT_kilohertz,
00871 ENUM_CPUSPEEDUNIT_megahertz,
00872 ENUM_CPUSPEEDUNIT_gigahertz,
00873 ENUM_CPUSPEEDUNIT_terahertz,
00874 ENUM_CPUSPEEDUNIT_flops,
00875 ENUM_CPUSPEEDUNIT_kiloflops,
00876 ENUM_CPUSPEEDUNIT_megaflops,
00877 ENUM_CPUSPEEDUNIT_gigaflops,
00878 ENUM_CPUSPEEDUNIT_teraflops,
00879 ENUM_CPUSPEEDUNIT_petaflops
00880 };
00881
00882 inline int returnCPUSpeedUnit(std::string unit)
00883 {
00884 if (unit == "hertz" ) return ENUM_CPUSPEEDUNIT_hertz;
00885 if (unit == "kilohertz") return ENUM_CPUSPEEDUNIT_kilohertz;
00886 if (unit == "megahertz") return ENUM_CPUSPEEDUNIT_megahertz;
00887 if (unit == "gigahertz") return ENUM_CPUSPEEDUNIT_gigahertz;
00888 if (unit == "terahertz") return ENUM_CPUSPEEDUNIT_terahertz;
00889 if (unit == "flops" ) return ENUM_CPUSPEEDUNIT_flops;
00890 if (unit == "kiloflops") return ENUM_CPUSPEEDUNIT_kiloflops;
00891 if (unit == "megaflops") return ENUM_CPUSPEEDUNIT_megaflops;
00892 if (unit == "gigaflops") return ENUM_CPUSPEEDUNIT_gigaflops;
00893 if (unit == "teraflops") return ENUM_CPUSPEEDUNIT_teraflops;
00894 if (unit == "petaflops") return ENUM_CPUSPEEDUNIT_petaflops;
00895 return 0;
00896 }
00897
00898 inline bool verifyCPUSpeedUnit(std::string unit)
00899 {
00900 return (returnCPUSpeedUnit(unit) > 0);
00901 }
00902
00903 enum ENUM_STORAGEUNIT
00904 {
00905 ENUM_STORAGEUNIT_byte = 1,
00906 ENUM_STORAGEUNIT_kilobyte,
00907 ENUM_STORAGEUNIT_megabyte,
00908 ENUM_STORAGEUNIT_gigabyte,
00909 ENUM_STORAGEUNIT_terabyte,
00910 ENUM_STORAGEUNIT_petabyte,
00911 ENUM_STORAGEUNIT_exabyte,
00912 ENUM_STORAGEUNIT_zettabyte,
00913 ENUM_STORAGEUNIT_yottabyte
00914 };
00915
00916 inline int returnStorageUnit(std::string unit)
00917 {
00918 if (unit == "byte" ) return ENUM_STORAGEUNIT_byte;
00919 if (unit == "kilobyte" ) return ENUM_STORAGEUNIT_kilobyte;
00920 if (unit == "megabyte" ) return ENUM_STORAGEUNIT_megabyte;
00921 if (unit == "gigabyte" ) return ENUM_STORAGEUNIT_gigabyte;
00922 if (unit == "terabyte" ) return ENUM_STORAGEUNIT_terabyte;
00923 if (unit == "petabyte" ) return ENUM_STORAGEUNIT_petabyte;
00924 if (unit == "exabyte" ) return ENUM_STORAGEUNIT_exabyte;
00925 if (unit == "zettabyte") return ENUM_STORAGEUNIT_zettabyte;
00926 if (unit == "yottabyte") return ENUM_STORAGEUNIT_yottabyte;
00927 return 0;
00928 }
00929
00930 inline bool verifyStorageUnit(std::string unit)
00931 {
00932 return (returnStorageUnit(unit) > 0);
00933 }
00934
00935 enum ENUM_TIMEUNIT
00936 {
00937 ENUM_TIMEUNIT_tick = 1,
00938 ENUM_TIMEUNIT_millisecond,
00939 ENUM_TIMEUNIT_second,
00940 ENUM_TIMEUNIT_minute,
00941 ENUM_TIMEUNIT_hour,
00942 ENUM_TIMEUNIT_day,
00943 ENUM_TIMEUNIT_week,
00944 ENUM_TIMEUNIT_month,
00945 ENUM_TIMEUNIT_year
00946 };
00947
00948 inline int returnTimeUnit(std::string unit)
00949 {
00950 if (unit == "tick" ) return ENUM_TIMEUNIT_tick;
00951 if (unit == "millisecond") return ENUM_TIMEUNIT_millisecond;
00952 if (unit == "second" ) return ENUM_TIMEUNIT_second;
00953 if (unit == "minute" ) return ENUM_TIMEUNIT_minute;
00954 if (unit == "hour" ) return ENUM_TIMEUNIT_hour;
00955 if (unit == "day" ) return ENUM_TIMEUNIT_day;
00956 if (unit == "week" ) return ENUM_TIMEUNIT_week;
00957 if (unit == "month" ) return ENUM_TIMEUNIT_month;
00958 if (unit == "year" ) return ENUM_TIMEUNIT_year;
00959 return 0;
00960 }
00961
00962 inline bool verifyTimeUnit(std::string unit)
00963 {
00964 return (returnTimeUnit(unit) > 0);
00965 }
00966
00967 enum ENUM_TIMETYPE
00968 {
00969 ENUM_TIMETYPE_cpuTime = 1,
00970 ENUM_TIMETYPE_elapsedTime,
00971 ENUM_TIMETYPE_other
00972 };
00973
00974 inline int returnTimeType(std::string type)
00975 {
00976 if (type == "cpuTime" ) return ENUM_TIMETYPE_cpuTime;
00977 if (type == "elapsedTime") return ENUM_TIMETYPE_elapsedTime;
00978 if (type == "other" ) return ENUM_TIMETYPE_other;
00979 return 0;
00980 }
00981
00982 inline bool verifyTimeType(std::string type)
00983 {
00984 return (returnTimeType(type) > 0);
00985 }
00986
00987 enum ENUM_TIMECATEGORY
00988 {
00989 ENUM_TIMECATEGORY_total = 1,
00990 ENUM_TIMECATEGORY_input,
00991 ENUM_TIMECATEGORY_preprocessing,
00992 ENUM_TIMECATEGORY_optimization,
00993 ENUM_TIMECATEGORY_postprocessing,
00994 ENUM_TIMECATEGORY_output,
00995 ENUM_TIMECATEGORY_other
00996 };
00997
00998 inline int returnTimeCategory(std::string category)
00999 {
01000 if (category == "total" ) return ENUM_TIMECATEGORY_total;
01001 if (category == "input" ) return ENUM_TIMECATEGORY_input;
01002 if (category == "preprocessing" ) return ENUM_TIMECATEGORY_preprocessing;
01003 if (category == "optimization" ) return ENUM_TIMECATEGORY_optimization;
01004 if (category == "postprocessing") return ENUM_TIMECATEGORY_postprocessing;
01005 if (category == "output" ) return ENUM_TIMECATEGORY_output;
01006 if (category == "other" ) return ENUM_TIMECATEGORY_other;
01007 return 0;
01008 }
01009
01010 inline bool verifyTimeCategory(std::string category)
01011 {
01012 return (returnTimeCategory(category) > 0);
01013 }
01014
01015 enum ENUM_LOCATIONTYPE
01016 {
01017 ENUM_LOCATIONTYPE_local = 1,
01018 ENUM_LOCATIONTYPE_http,
01019 ENUM_LOCATIONTYPE_ftp
01020 };
01021
01022 inline int returnLocationType(std::string type)
01023 {
01024 if (type == "local") return ENUM_LOCATIONTYPE_local;
01025 if (type == "http" ) return ENUM_LOCATIONTYPE_http;
01026 if (type == "ftp" ) return ENUM_LOCATIONTYPE_ftp;
01027 return 0;
01028 }
01029
01030 inline bool verifyLocationType(std::string type)
01031 {
01032 return (returnLocationType(type) > 0);
01033 }
01034
01035 enum ENUM_TRANSPORT_TYPE
01036 {
01037 ENUM_TRANSPORT_TYPE_osp = 1,
01038 ENUM_TRANSPORT_TYPE_http,
01039 ENUM_TRANSPORT_TYPE_smtp,
01040 ENUM_TRANSPORT_TYPE_ftp,
01041 ENUM_TRANSPORT_TYPE_other
01042 };
01043
01044 inline int returnTransportType(std::string type)
01045 {
01046 if (type == "osp" ) return ENUM_TRANSPORT_TYPE_osp;
01047 if (type == "http" ) return ENUM_TRANSPORT_TYPE_http;
01048 if (type == "smtp" ) return ENUM_TRANSPORT_TYPE_smtp;
01049 if (type == "ftp" ) return ENUM_TRANSPORT_TYPE_ftp;
01050 if (type == "other") return ENUM_TRANSPORT_TYPE_other;
01051 return 0;
01052 }
01053
01054 inline bool verifyTransportType(std::string type)
01055 {
01056 return (returnTransportType(type) > 0);
01057 }
01058
01059 enum ENUM_SERVICE_TYPE
01060 {
01061 ENUM_SERVICE_TYPE_analyzer = 1,
01062 ENUM_SERVICE_TYPE_solver,
01063 ENUM_SERVICE_TYPE_scheduler,
01064 ENUM_SERVICE_TYPE_modeler,
01065 ENUM_SERVICE_TYPE_registry,
01066 ENUM_SERVICE_TYPE_agent,
01067 ENUM_SERVICE_TYPE_simulations
01068 };
01069
01070 inline int returnServiceType(std::string type)
01071 {
01072 if (type == "analyzer" ) return ENUM_SERVICE_TYPE_analyzer;
01073 if (type == "solver" ) return ENUM_SERVICE_TYPE_solver;
01074 if (type == "scheduler" ) return ENUM_SERVICE_TYPE_scheduler;
01075 if (type == "modeler" ) return ENUM_SERVICE_TYPE_modeler;
01076 if (type == "registry" ) return ENUM_SERVICE_TYPE_registry;
01077 if (type == "agent" ) return ENUM_SERVICE_TYPE_agent;
01078 if (type == "simulations") return ENUM_SERVICE_TYPE_simulations;
01079 return 0;
01080 }
01081
01082 inline bool verifyServiceType(std::string type)
01083 {
01084 return (returnServiceType(type) > 0);
01085 }
01086
01087 enum ENUM_GENERAL_RESULT_STATUS
01088 {
01089 ENUM_GENERAL_RESULT_STATUS_error = 1,
01090 ENUM_GENERAL_RESULT_STATUS_warning,
01091 ENUM_GENERAL_RESULT_STATUS_normal
01092 };
01093
01094 inline int returnGeneralResultStatus(std::string status)
01095 {
01096 if (status == "error" ) return ENUM_GENERAL_RESULT_STATUS_error;
01097 if (status == "warning") return ENUM_GENERAL_RESULT_STATUS_warning;
01098 if (status == "normal" ) return ENUM_GENERAL_RESULT_STATUS_normal;
01099 return 0;
01100 }
01101
01102 inline bool verifyGeneralResultStatus(std::string status)
01103 {
01104 return (returnGeneralResultStatus(status) > 0);
01105 }
01106
01107 enum ENUM_SYSTEM_CURRENT_STATE
01108 {
01109 ENUM_SYSTEM_CURRENT_STATE_busy = 1,
01110 ENUM_SYSTEM_CURRENT_STATE_busyButAccepting,
01111 ENUM_SYSTEM_CURRENT_STATE_idle,
01112 ENUM_SYSTEM_CURRENT_STATE_idleButNotAccepting,
01113 ENUM_SYSTEM_CURRENT_STATE_noResponse
01114 };
01115
01116 inline int returnSystemCurrentState(std::string status)
01117 {
01118 if (status == "busy" ) return ENUM_SYSTEM_CURRENT_STATE_busy;
01119 if (status == "busyButAccepting" ) return ENUM_SYSTEM_CURRENT_STATE_busyButAccepting;
01120 if (status == "idle" ) return ENUM_SYSTEM_CURRENT_STATE_idle;
01121 if (status == "idleButNotAccepting") return ENUM_SYSTEM_CURRENT_STATE_idleButNotAccepting;
01122 if (status == "noResponse" ) return ENUM_SYSTEM_CURRENT_STATE_noResponse;
01123 return 0;
01124 }
01125
01126 inline bool verifySystemCurrentState(std::string status)
01127 {
01128 return (returnSystemCurrentState(status) > 0);
01129 }
01130
01131 enum ENUM_JOB_STATUS
01132 {
01133 ENUM_JOB_STATUS_waiting = 1,
01134 ENUM_JOB_STATUS_running,
01135 ENUM_JOB_STATUS_killed,
01136 ENUM_JOB_STATUS_finished,
01137 ENUM_JOB_STATUS_unknown
01138 };
01139
01140 inline int returnJobStatus(std::string status)
01141 {
01142 if (status == "waiting" ) return ENUM_JOB_STATUS_waiting;
01143 if (status == "running" ) return ENUM_JOB_STATUS_running;
01144 if (status == "killed" ) return ENUM_JOB_STATUS_killed;
01145 if (status == "finished") return ENUM_JOB_STATUS_finished;
01146 if (status == "unknown" ) return ENUM_JOB_STATUS_unknown;
01147 return 0;
01148 }
01149
01150 inline bool verifyJobStatus(std::string status)
01151 {
01152 return (returnJobStatus(status) > 0);
01153 }
01154
01155
01156 enum ENUM_BASIS_STATUS
01157 {
01158 ENUM_BASIS_STATUS_basic = 1,
01159 ENUM_BASIS_STATUS_atLower,
01160 ENUM_BASIS_STATUS_atUpper,
01161 ENUM_BASIS_STATUS_isFree,
01162 ENUM_BASIS_STATUS_superbasic,
01163 ENUM_BASIS_STATUS_unknown
01164 };
01165
01166 inline int returnBasisStatus(std::string status)
01167 {
01168 if (status == "basic" ) return ENUM_BASIS_STATUS_basic;
01169 if (status == "atLower" ) return ENUM_BASIS_STATUS_atLower;
01170 if (status == "atUpper" ) return ENUM_BASIS_STATUS_atUpper;
01171 if (status == "isFree" ) return ENUM_BASIS_STATUS_isFree;
01172 if (status == "superBasic") return ENUM_BASIS_STATUS_superbasic;
01173 if (status == "unknown" ) return ENUM_BASIS_STATUS_unknown;
01174 return 0;
01175 }
01176
01177 inline bool verifyBasisStatus(std::string status)
01178 {
01179 return (returnBasisStatus(status) > 0);
01180 }
01181
01182 enum ENUM_SOLUTION_STATUS
01183 {
01184 ENUM_SOLUTION_STATUS_unbounded = 1,
01185 ENUM_SOLUTION_STATUS_globallyOptimal,
01186 ENUM_SOLUTION_STATUS_locallyOptimal,
01187 ENUM_SOLUTION_STATUS_optimal,
01188 ENUM_SOLUTION_STATUS_bestSoFar,
01189 ENUM_SOLUTION_STATUS_feasible,
01190 ENUM_SOLUTION_STATUS_infeasible,
01191 ENUM_SOLUTION_STATUS_unsure,
01192 ENUM_SOLUTION_STATUS_error,
01193 ENUM_SOLUTION_STATUS_other
01194 };
01195
01196 inline int returnSolutionStatus(std::string status)
01197 {
01198 if (status == "unbounded" ) return ENUM_SOLUTION_STATUS_unbounded;
01199 if (status == "globallyOptimal") return ENUM_SOLUTION_STATUS_globallyOptimal;
01200 if (status == "locallyOptimal" ) return ENUM_SOLUTION_STATUS_locallyOptimal;
01201 if (status == "optimal" ) return ENUM_SOLUTION_STATUS_optimal;
01202 if (status == "bestSoFar" ) return ENUM_SOLUTION_STATUS_bestSoFar;
01203 if (status == "feasible" ) return ENUM_SOLUTION_STATUS_feasible;
01204 if (status == "infeasible" ) return ENUM_SOLUTION_STATUS_infeasible;
01205 if (status == "unsure" ) return ENUM_SOLUTION_STATUS_unsure;
01206 if (status == "error" ) return ENUM_SOLUTION_STATUS_error;
01207 if (status == "other" ) return ENUM_SOLUTION_STATUS_other;
01208 return 0;
01209 }
01210
01211 inline bool verifySolutionStatus(std::string status)
01212 {
01213 return (returnSolutionStatus(status) > 0);
01214 }
01215
01216 enum ENUM_SOLUTION_SUBSTATUSTYPE
01217 {
01218 ENUM_SOLUTION_SUBSTATUSTYPE_stoppedByLimit = 1,
01219 ENUM_SOLUTION_SUBSTATUSTYPE_stoppedByBounds,
01220 ENUM_SOLUTION_SUBSTATUSTYPE_other
01221 };
01222
01223 inline int returnSolutionSubstatusType(std::string type)
01224 {
01225 if (type == "stoppedByLimit" ) return ENUM_SOLUTION_SUBSTATUSTYPE_stoppedByLimit;
01226 if (type == "stoppedByBounds") return ENUM_SOLUTION_SUBSTATUSTYPE_stoppedByBounds;
01227 if (type == "other" ) return ENUM_SOLUTION_SUBSTATUSTYPE_other;
01228 return 0;
01229 }
01230
01231 inline bool verifySolutionSubstatusType(std::string type)
01232 {
01233 return (returnSolutionSubstatusType(type) > 0);
01234 }
01235
01236 enum ENUM_PROBLEM_COMPONENT
01237 {
01238 ENUM_PROBLEM_COMPONENT_variables = 1,
01239 ENUM_PROBLEM_COMPONENT_objectives,
01240 ENUM_PROBLEM_COMPONENT_constraints
01241 };
01242
01243 enum ENUM_VARTYPE
01244 {
01245 ENUM_VARTYPE_CONTINUOUS = 1,
01246 ENUM_VARTYPE_INTEGER,
01247 ENUM_VARTYPE_BINARY,
01248 ENUM_VARTYPE_SEMICONTINUOUS,
01249 ENUM_VARTYPE_SEMIINTEGER,
01250 ENUM_VARTYPE_STRING
01251 };
01252
01253 inline int returnVarType(char vt)
01254 {
01255 if (vt == 'C') return ENUM_VARTYPE_CONTINUOUS;
01256 if (vt == 'B') return ENUM_VARTYPE_BINARY;
01257 if (vt == 'I') return ENUM_VARTYPE_INTEGER;
01258 if (vt == 'S') return ENUM_VARTYPE_STRING;
01259 if (vt == 'D') return ENUM_VARTYPE_SEMICONTINUOUS;
01260 if (vt == 'J') return ENUM_VARTYPE_SEMIINTEGER;
01261 return 0;
01262 }
01263
01264 inline bool verifyVarType(char vt)
01265 {
01266 return (returnVarType(vt) > 0);
01267 }
01268
01269
01270 enum ENUM_PATHPAIR
01271 {
01272
01273 ENUM_PATHPAIR_input_dir = 1,
01274 ENUM_PATHPAIR_input_file,
01275 ENUM_PATHPAIR_output_file,
01276 ENUM_PATHPAIR_output_dir
01277 };
01278
01279
01280
01281
01282
01283
01284
01285
01286 inline bool isEqual(double x, double y)
01287 {
01288 if (OSIsnan(x) && OSIsnan(y)) return true;
01289 if (x == y) return true;
01290 return false;
01291 }
01292
01293
01294 #endif