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
00348 double* hessValues;
00349
00354 SparseHessianMatrix();
00355
00362 SparseHessianMatrix(int startSize, int valueSize);
00363
00368 ~SparseHessianMatrix();
00369
00370 };
00371
00375 class QuadraticTerms
00376 {
00377
00378 public:
00379
00384 int* rowIndexes;
00385
00389 int* varOneIndexes;
00390
00394 int* varTwoIndexes;
00395
00399 double* coefficients;
00400
00405 QuadraticTerms();
00406 ~QuadraticTerms();
00407 };
00408
00409
00410
00414 class IntVector
00415 {
00416 public:
00417 IntVector();
00418 ~IntVector();
00419
00420
00421 IntVector(int n);
00422
00427 bool bDeleteArrays;
00428 int numberOfEl;
00429 int *el;
00430
00434 bool IsEqual(IntVector *that);
00435
00445 bool setRandom(double density, bool conformant, int iMin, int iMax);
00446
00452 bool setIntVector(int *i, int ni);
00453
00458 bool extendIntVector(int i);
00459
00463 int getNumberOfEl();
00464
00469 int getEl(int j);
00470
00471
00479 bool getEl(int *i);
00480 };
00481
00482
00488 class OtherOptionEnumeration : public IntVector
00489 {
00490 public:
00491 std::string value;
00492 std::string description;
00493
00494 OtherOptionEnumeration();
00495 ~OtherOptionEnumeration();
00496
00497
00498 OtherOptionEnumeration(int n);
00499
00504 bool IsEqual(OtherOptionEnumeration *that);
00505
00515 bool setRandom(double density, bool conformant, int iMin, int iMax);
00516
00524 bool setOtherOptionEnumeration(std::string value, std::string description, int *i, int ni);
00525
00526
00530 std::string getValue();
00531
00535 std::string getDescription();
00536
00537 };
00538
00539
00540
00544 class DoubleVector
00545 {
00546 public:
00547 DoubleVector();
00548 ~DoubleVector();
00553 bool bDeleteArrays;
00554 int numberOfEl;
00555 double *el;
00556
00557 bool IsEqual(DoubleVector *that);
00558 };
00559
00560
00564 struct IndexValuePair
00565 {
00569 int idx;
00570
00573 double value;
00574
00575 };
00576
00581 class BasisStatus
00582 {
00583 public:
00584 IntVector* basic;
00585 IntVector* atLower;
00586 IntVector* atUpper;
00587 IntVector* isFree;
00588 IntVector* superbasic;
00589 IntVector* unknown;
00590
00591 BasisStatus();
00592 ~BasisStatus();
00593
00598 bool IsEqual(BasisStatus *that);
00599
00609 bool setRandom(double density, bool conformant, int iMin, int iMax);
00610
00618 bool setIntVector(int status, int *i, int ni);
00619
00626 bool addIdx(int status, int idx);
00627
00634 int getNumberOfEl(int status);
00635
00636
00644 int getEl(int status, int j);
00645
00655 bool getIntVector(int status, int *i);
00656 };
00657
00667 class StorageCapacity
00668 {
00669
00670 public:
00672 std::string unit;
00673
00675 std::string description;
00676
00678 double value;
00679
00684 StorageCapacity();
00689 ~StorageCapacity();
00690
00695 bool IsEqual(StorageCapacity *that);
00696
00704 bool setRandom(double density, bool conformant);
00705 };
00706
00718 class CPUSpeed
00719 {
00720
00721 public:
00723 std::string unit;
00724
00726 std::string description;
00727
00729 double value;
00730
00735 CPUSpeed();
00740 ~CPUSpeed();
00741
00746 bool IsEqual(CPUSpeed *that);
00747
00755 bool setRandom(double density, bool conformant);
00756 };
00757
00769 class CPUNumber
00770 {
00771
00772 public:
00774 std::string description;
00775
00777 int value;
00778
00783 CPUNumber();
00788 ~CPUNumber();
00789
00794 bool IsEqual(CPUNumber *that);
00795
00803 bool setRandom(double density, bool conformant);
00804 };
00805
00815 class TimeSpan
00816 {
00817
00818 public:
00820 std::string unit;
00821
00823 double value;
00824
00829 TimeSpan();
00834 ~TimeSpan();
00835
00840 bool IsEqual(TimeSpan *that);
00841
00849 bool setRandom(double density, bool conformant);
00850 };
00851
00852
00853
00854 class OSGeneral
00855 {
00856
00857 };
00858
00859
00860
00861
00862
00863
00864
00865
00866
00867
00868
00869 enum ENUM_CPUSPEEDUNIT
00870 {
00871 ENUM_CPUSPEEDUNIT_hertz = 1,
00872 ENUM_CPUSPEEDUNIT_kilohertz,
00873 ENUM_CPUSPEEDUNIT_megahertz,
00874 ENUM_CPUSPEEDUNIT_gigahertz,
00875 ENUM_CPUSPEEDUNIT_terahertz,
00876 ENUM_CPUSPEEDUNIT_flops,
00877 ENUM_CPUSPEEDUNIT_kiloflops,
00878 ENUM_CPUSPEEDUNIT_megaflops,
00879 ENUM_CPUSPEEDUNIT_gigaflops,
00880 ENUM_CPUSPEEDUNIT_teraflops,
00881 ENUM_CPUSPEEDUNIT_petaflops
00882 };
00883
00884 inline int returnCPUSpeedUnit(std::string unit)
00885 {
00886 if (unit == "hertz" ) return ENUM_CPUSPEEDUNIT_hertz;
00887 if (unit == "kilohertz") return ENUM_CPUSPEEDUNIT_kilohertz;
00888 if (unit == "megahertz") return ENUM_CPUSPEEDUNIT_megahertz;
00889 if (unit == "gigahertz") return ENUM_CPUSPEEDUNIT_gigahertz;
00890 if (unit == "terahertz") return ENUM_CPUSPEEDUNIT_terahertz;
00891 if (unit == "flops" ) return ENUM_CPUSPEEDUNIT_flops;
00892 if (unit == "kiloflops") return ENUM_CPUSPEEDUNIT_kiloflops;
00893 if (unit == "megaflops") return ENUM_CPUSPEEDUNIT_megaflops;
00894 if (unit == "gigaflops") return ENUM_CPUSPEEDUNIT_gigaflops;
00895 if (unit == "teraflops") return ENUM_CPUSPEEDUNIT_teraflops;
00896 if (unit == "petaflops") return ENUM_CPUSPEEDUNIT_petaflops;
00897 return 0;
00898 }
00899
00900 inline bool verifyCPUSpeedUnit(std::string unit)
00901 {
00902 return (returnCPUSpeedUnit(unit) > 0);
00903 }
00904
00905 enum ENUM_STORAGEUNIT
00906 {
00907 ENUM_STORAGEUNIT_byte = 1,
00908 ENUM_STORAGEUNIT_kilobyte,
00909 ENUM_STORAGEUNIT_megabyte,
00910 ENUM_STORAGEUNIT_gigabyte,
00911 ENUM_STORAGEUNIT_terabyte,
00912 ENUM_STORAGEUNIT_petabyte,
00913 ENUM_STORAGEUNIT_exabyte,
00914 ENUM_STORAGEUNIT_zettabyte,
00915 ENUM_STORAGEUNIT_yottabyte
00916 };
00917
00918 inline int returnStorageUnit(std::string unit)
00919 {
00920 if (unit == "byte" ) return ENUM_STORAGEUNIT_byte;
00921 if (unit == "kilobyte" ) return ENUM_STORAGEUNIT_kilobyte;
00922 if (unit == "megabyte" ) return ENUM_STORAGEUNIT_megabyte;
00923 if (unit == "gigabyte" ) return ENUM_STORAGEUNIT_gigabyte;
00924 if (unit == "terabyte" ) return ENUM_STORAGEUNIT_terabyte;
00925 if (unit == "petabyte" ) return ENUM_STORAGEUNIT_petabyte;
00926 if (unit == "exabyte" ) return ENUM_STORAGEUNIT_exabyte;
00927 if (unit == "zettabyte") return ENUM_STORAGEUNIT_zettabyte;
00928 if (unit == "yottabyte") return ENUM_STORAGEUNIT_yottabyte;
00929 return 0;
00930 }
00931
00932 inline bool verifyStorageUnit(std::string unit)
00933 {
00934 return (returnStorageUnit(unit) > 0);
00935 }
00936
00937 enum ENUM_TIMEUNIT
00938 {
00939 ENUM_TIMEUNIT_tick = 1,
00940 ENUM_TIMEUNIT_millisecond,
00941 ENUM_TIMEUNIT_second,
00942 ENUM_TIMEUNIT_minute,
00943 ENUM_TIMEUNIT_hour,
00944 ENUM_TIMEUNIT_day,
00945 ENUM_TIMEUNIT_week,
00946 ENUM_TIMEUNIT_month,
00947 ENUM_TIMEUNIT_year
00948 };
00949
00950 inline int returnTimeUnit(std::string unit)
00951 {
00952 if (unit == "tick" ) return ENUM_TIMEUNIT_tick;
00953 if (unit == "millisecond") return ENUM_TIMEUNIT_millisecond;
00954 if (unit == "second" ) return ENUM_TIMEUNIT_second;
00955 if (unit == "minute" ) return ENUM_TIMEUNIT_minute;
00956 if (unit == "hour" ) return ENUM_TIMEUNIT_hour;
00957 if (unit == "day" ) return ENUM_TIMEUNIT_day;
00958 if (unit == "week" ) return ENUM_TIMEUNIT_week;
00959 if (unit == "month" ) return ENUM_TIMEUNIT_month;
00960 if (unit == "year" ) return ENUM_TIMEUNIT_year;
00961 return 0;
00962 }
00963
00964 inline bool verifyTimeUnit(std::string unit)
00965 {
00966 return (returnTimeUnit(unit) > 0);
00967 }
00968
00969 enum ENUM_TIMETYPE
00970 {
00971 ENUM_TIMETYPE_cpuTime = 1,
00972 ENUM_TIMETYPE_elapsedTime,
00973 ENUM_TIMETYPE_other
00974 };
00975
00976 inline int returnTimeType(std::string type)
00977 {
00978 if (type == "cpuTime" ) return ENUM_TIMETYPE_cpuTime;
00979 if (type == "elapsedTime") return ENUM_TIMETYPE_elapsedTime;
00980 if (type == "other" ) return ENUM_TIMETYPE_other;
00981 return 0;
00982 }
00983
00984 inline bool verifyTimeType(std::string type)
00985 {
00986 return (returnTimeType(type) > 0);
00987 }
00988
00989 enum ENUM_TIMECATEGORY
00990 {
00991 ENUM_TIMECATEGORY_total = 1,
00992 ENUM_TIMECATEGORY_input,
00993 ENUM_TIMECATEGORY_preprocessing,
00994 ENUM_TIMECATEGORY_optimization,
00995 ENUM_TIMECATEGORY_postprocessing,
00996 ENUM_TIMECATEGORY_output,
00997 ENUM_TIMECATEGORY_other
00998 };
00999
01000 inline int returnTimeCategory(std::string category)
01001 {
01002 if (category == "total" ) return ENUM_TIMECATEGORY_total;
01003 if (category == "input" ) return ENUM_TIMECATEGORY_input;
01004 if (category == "preprocessing" ) return ENUM_TIMECATEGORY_preprocessing;
01005 if (category == "optimization" ) return ENUM_TIMECATEGORY_optimization;
01006 if (category == "postprocessing") return ENUM_TIMECATEGORY_postprocessing;
01007 if (category == "output" ) return ENUM_TIMECATEGORY_output;
01008 if (category == "other" ) return ENUM_TIMECATEGORY_other;
01009 return 0;
01010 }
01011
01012 inline bool verifyTimeCategory(std::string category)
01013 {
01014 return (returnTimeCategory(category) > 0);
01015 }
01016
01017 enum ENUM_LOCATIONTYPE
01018 {
01019 ENUM_LOCATIONTYPE_local = 1,
01020 ENUM_LOCATIONTYPE_http,
01021 ENUM_LOCATIONTYPE_ftp
01022 };
01023
01024 inline int returnLocationType(std::string type)
01025 {
01026 if (type == "local") return ENUM_LOCATIONTYPE_local;
01027 if (type == "http" ) return ENUM_LOCATIONTYPE_http;
01028 if (type == "ftp" ) return ENUM_LOCATIONTYPE_ftp;
01029 return 0;
01030 }
01031
01032 inline bool verifyLocationType(std::string type)
01033 {
01034 return (returnLocationType(type) > 0);
01035 }
01036
01037 enum ENUM_TRANSPORT_TYPE
01038 {
01039 ENUM_TRANSPORT_TYPE_osp = 1,
01040 ENUM_TRANSPORT_TYPE_http,
01041 ENUM_TRANSPORT_TYPE_smtp,
01042 ENUM_TRANSPORT_TYPE_ftp,
01043 ENUM_TRANSPORT_TYPE_other
01044 };
01045
01046 inline int returnTransportType(std::string type)
01047 {
01048 if (type == "osp" ) return ENUM_TRANSPORT_TYPE_osp;
01049 if (type == "http" ) return ENUM_TRANSPORT_TYPE_http;
01050 if (type == "smtp" ) return ENUM_TRANSPORT_TYPE_smtp;
01051 if (type == "ftp" ) return ENUM_TRANSPORT_TYPE_ftp;
01052 if (type == "other") return ENUM_TRANSPORT_TYPE_other;
01053 return 0;
01054 }
01055
01056 inline bool verifyTransportType(std::string type)
01057 {
01058 return (returnTransportType(type) > 0);
01059 }
01060
01061 enum ENUM_SERVICE_TYPE
01062 {
01063 ENUM_SERVICE_TYPE_analyzer = 1,
01064 ENUM_SERVICE_TYPE_solver,
01065 ENUM_SERVICE_TYPE_scheduler,
01066 ENUM_SERVICE_TYPE_modeler,
01067 ENUM_SERVICE_TYPE_registry,
01068 ENUM_SERVICE_TYPE_agent,
01069 ENUM_SERVICE_TYPE_simulations
01070 };
01071
01072 inline int returnServiceType(std::string type)
01073 {
01074 if (type == "analyzer" ) return ENUM_SERVICE_TYPE_analyzer;
01075 if (type == "solver" ) return ENUM_SERVICE_TYPE_solver;
01076 if (type == "scheduler" ) return ENUM_SERVICE_TYPE_scheduler;
01077 if (type == "modeler" ) return ENUM_SERVICE_TYPE_modeler;
01078 if (type == "registry" ) return ENUM_SERVICE_TYPE_registry;
01079 if (type == "agent" ) return ENUM_SERVICE_TYPE_agent;
01080 if (type == "simulations") return ENUM_SERVICE_TYPE_simulations;
01081 return 0;
01082 }
01083
01084 inline bool verifyServiceType(std::string type)
01085 {
01086 return (returnServiceType(type) > 0);
01087 }
01088
01089 enum ENUM_GENERAL_RESULT_STATUS
01090 {
01091 ENUM_GENERAL_RESULT_STATUS_error = 1,
01092 ENUM_GENERAL_RESULT_STATUS_warning,
01093 ENUM_GENERAL_RESULT_STATUS_normal
01094 };
01095
01096 inline int returnGeneralResultStatus(std::string status)
01097 {
01098 if (status == "error" ) return ENUM_GENERAL_RESULT_STATUS_error;
01099 if (status == "warning") return ENUM_GENERAL_RESULT_STATUS_warning;
01100 if (status == "normal" ) return ENUM_GENERAL_RESULT_STATUS_normal;
01101 return 0;
01102 }
01103
01104 inline bool verifyGeneralResultStatus(std::string status)
01105 {
01106 return (returnGeneralResultStatus(status) > 0);
01107 }
01108
01109 enum ENUM_SYSTEM_CURRENT_STATE
01110 {
01111 ENUM_SYSTEM_CURRENT_STATE_busy = 1,
01112 ENUM_SYSTEM_CURRENT_STATE_busyButAccepting,
01113 ENUM_SYSTEM_CURRENT_STATE_idle,
01114 ENUM_SYSTEM_CURRENT_STATE_idleButNotAccepting,
01115 ENUM_SYSTEM_CURRENT_STATE_noResponse
01116 };
01117
01118 inline int returnSystemCurrentState(std::string status)
01119 {
01120 if (status == "busy" ) return ENUM_SYSTEM_CURRENT_STATE_busy;
01121 if (status == "busyButAccepting" ) return ENUM_SYSTEM_CURRENT_STATE_busyButAccepting;
01122 if (status == "idle" ) return ENUM_SYSTEM_CURRENT_STATE_idle;
01123 if (status == "idleButNotAccepting") return ENUM_SYSTEM_CURRENT_STATE_idleButNotAccepting;
01124 if (status == "noResponse" ) return ENUM_SYSTEM_CURRENT_STATE_noResponse;
01125 return 0;
01126 }
01127
01128 inline bool verifySystemCurrentState(std::string status)
01129 {
01130 return (returnSystemCurrentState(status) > 0);
01131 }
01132
01133 enum ENUM_JOB_STATUS
01134 {
01135 ENUM_JOB_STATUS_waiting = 1,
01136 ENUM_JOB_STATUS_running,
01137 ENUM_JOB_STATUS_killed,
01138 ENUM_JOB_STATUS_finished,
01139 ENUM_JOB_STATUS_unknown
01140 };
01141
01142 inline int returnJobStatus(std::string status)
01143 {
01144 if (status == "waiting" ) return ENUM_JOB_STATUS_waiting;
01145 if (status == "running" ) return ENUM_JOB_STATUS_running;
01146 if (status == "killed" ) return ENUM_JOB_STATUS_killed;
01147 if (status == "finished") return ENUM_JOB_STATUS_finished;
01148 if (status == "unknown" ) return ENUM_JOB_STATUS_unknown;
01149 return 0;
01150 }
01151
01152 inline bool verifyJobStatus(std::string status)
01153 {
01154 return (returnJobStatus(status) > 0);
01155 }
01156
01157
01158 enum ENUM_BASIS_STATUS
01159 {
01160 ENUM_BASIS_STATUS_basic = 1,
01161 ENUM_BASIS_STATUS_atLower,
01162 ENUM_BASIS_STATUS_atUpper,
01163 ENUM_BASIS_STATUS_isFree,
01164 ENUM_BASIS_STATUS_superbasic,
01165 ENUM_BASIS_STATUS_unknown
01166 };
01167
01168 inline int returnBasisStatus(std::string status)
01169 {
01170 if (status == "basic" ) return ENUM_BASIS_STATUS_basic;
01171 if (status == "atLower" ) return ENUM_BASIS_STATUS_atLower;
01172 if (status == "atUpper" ) return ENUM_BASIS_STATUS_atUpper;
01173 if (status == "isFree" ) return ENUM_BASIS_STATUS_isFree;
01174 if (status == "superBasic") return ENUM_BASIS_STATUS_superbasic;
01175 if (status == "unknown" ) return ENUM_BASIS_STATUS_unknown;
01176 return 0;
01177 }
01178
01179 inline bool verifyBasisStatus(std::string status)
01180 {
01181 return (returnBasisStatus(status) > 0);
01182 }
01183
01184 enum ENUM_SOLUTION_STATUS
01185 {
01186 ENUM_SOLUTION_STATUS_unbounded = 1,
01187 ENUM_SOLUTION_STATUS_globallyOptimal,
01188 ENUM_SOLUTION_STATUS_locallyOptimal,
01189 ENUM_SOLUTION_STATUS_optimal,
01190 ENUM_SOLUTION_STATUS_bestSoFar,
01191 ENUM_SOLUTION_STATUS_feasible,
01192 ENUM_SOLUTION_STATUS_infeasible,
01193 ENUM_SOLUTION_STATUS_unsure,
01194 ENUM_SOLUTION_STATUS_error,
01195 ENUM_SOLUTION_STATUS_other
01196 };
01197
01198 inline int returnSolutionStatus(std::string status)
01199 {
01200 if (status == "unbounded" ) return ENUM_SOLUTION_STATUS_unbounded;
01201 if (status == "globallyOptimal") return ENUM_SOLUTION_STATUS_globallyOptimal;
01202 if (status == "locallyOptimal" ) return ENUM_SOLUTION_STATUS_locallyOptimal;
01203 if (status == "optimal" ) return ENUM_SOLUTION_STATUS_optimal;
01204 if (status == "bestSoFar" ) return ENUM_SOLUTION_STATUS_bestSoFar;
01205 if (status == "feasible" ) return ENUM_SOLUTION_STATUS_feasible;
01206 if (status == "infeasible" ) return ENUM_SOLUTION_STATUS_infeasible;
01207 if (status == "unsure" ) return ENUM_SOLUTION_STATUS_unsure;
01208 if (status == "error" ) return ENUM_SOLUTION_STATUS_error;
01209 if (status == "other" ) return ENUM_SOLUTION_STATUS_other;
01210 return 0;
01211 }
01212
01213 inline bool verifySolutionStatus(std::string status)
01214 {
01215 return (returnSolutionStatus(status) > 0);
01216 }
01217
01218 enum ENUM_SOLUTION_SUBSTATUSTYPE
01219 {
01220 ENUM_SOLUTION_SUBSTATUSTYPE_stoppedByLimit = 1,
01221 ENUM_SOLUTION_SUBSTATUSTYPE_stoppedByBounds,
01222 ENUM_SOLUTION_SUBSTATUSTYPE_other
01223 };
01224
01225 inline int returnSolutionSubstatusType(std::string type)
01226 {
01227 if (type == "stoppedByLimit" ) return ENUM_SOLUTION_SUBSTATUSTYPE_stoppedByLimit;
01228 if (type == "stoppedByBounds") return ENUM_SOLUTION_SUBSTATUSTYPE_stoppedByBounds;
01229 if (type == "other" ) return ENUM_SOLUTION_SUBSTATUSTYPE_other;
01230 return 0;
01231 }
01232
01233 inline bool verifySolutionSubstatusType(std::string type)
01234 {
01235 return (returnSolutionSubstatusType(type) > 0);
01236 }
01237
01238 enum ENUM_PROBLEM_COMPONENT
01239 {
01240 ENUM_PROBLEM_COMPONENT_variables = 1,
01241 ENUM_PROBLEM_COMPONENT_objectives,
01242 ENUM_PROBLEM_COMPONENT_constraints
01243 };
01244
01245 enum ENUM_VARTYPE
01246 {
01247 ENUM_VARTYPE_CONTINUOUS = 1,
01248 ENUM_VARTYPE_INTEGER,
01249 ENUM_VARTYPE_BINARY,
01250 ENUM_VARTYPE_SEMICONTINUOUS,
01251 ENUM_VARTYPE_SEMIINTEGER,
01252 ENUM_VARTYPE_STRING
01253 };
01254
01255 inline int returnVarType(char vt)
01256 {
01257 if (vt == 'C') return ENUM_VARTYPE_CONTINUOUS;
01258 if (vt == 'B') return ENUM_VARTYPE_BINARY;
01259 if (vt == 'I') return ENUM_VARTYPE_INTEGER;
01260 if (vt == 'S') return ENUM_VARTYPE_STRING;
01261 if (vt == 'D') return ENUM_VARTYPE_SEMICONTINUOUS;
01262 if (vt == 'J') return ENUM_VARTYPE_SEMIINTEGER;
01263 return 0;
01264 }
01265
01266 inline bool verifyVarType(char vt)
01267 {
01268 return (returnVarType(vt) > 0);
01269 }
01270
01271
01272 enum ENUM_PATHPAIR
01273 {
01274
01275 ENUM_PATHPAIR_input_dir = 1,
01276 ENUM_PATHPAIR_input_file,
01277 ENUM_PATHPAIR_output_file,
01278 ENUM_PATHPAIR_output_dir
01279 };
01280
01281
01282
01283
01284
01285
01286
01287
01288 inline bool isEqual(double x, double y)
01289 {
01290 if (OSIsnan(x) && OSIsnan(y)) return true;
01291 if (x == y) return true;
01292 return false;
01293 }
01294
01298 enum ENUM_COMBINE_ARRAYS
01299 {
01300 ENUM_COMBINE_ARRAYS_replace,
01301 ENUM_COMBINE_ARRAYS_merge,
01302 ENUM_COMBINE_ARRAYS_ignore,
01303 ENUM_COMBINE_ARRAYS_throw
01304 };
01305
01306 #endif