00001
00015 #ifndef OSGENERAL_H
00016 #define OSGENERAL_H
00017
00018 #include "OSConfig.h"
00019 #include "OSParameters.h"
00020 #include "OSnLNode.h"
00021 #include "OSExpressionTree.h"
00022
00023 #include <string>
00024 #include <vector>
00025
00026
00027
00032 class GeneralFileHeader
00033 {
00034 public:
00035
00039 std::string name;
00040
00045 std::string source;
00046
00050 std::string description;
00051
00055 std::string fileCreator;
00056
00060 std::string licence;
00061
00062
00067 GeneralFileHeader();
00068
00073 ~GeneralFileHeader();
00074
00079 bool IsEqual(GeneralFileHeader *that);
00080
00088 bool setRandom(double density, bool conformant);
00089
00095 bool deepCopyFrom(GeneralFileHeader *that);
00096
00102 std::string getHeaderItem(std::string item);
00103
00113 bool setHeader(std::string name, std::string source, std::string description,
00114 std::string fileCreator, std::string licence);
00115
00116 };
00117
00118
00122 class SparseVector
00123 {
00124 public:
00125
00131 SparseVector(int number);
00132
00137 SparseVector();
00138
00143 ~SparseVector();
00144
00149 bool bDeleteArrays;
00150
00154 int number;
00155
00159 int* indexes;
00160
00164 double* values;
00165
00166 };
00167
00171 class SparseIntVector
00172 {
00173 public:
00174
00180 SparseIntVector(int number);
00181
00186 SparseIntVector();
00187
00192 ~SparseIntVector();
00193
00198 bool bDeleteArrays;
00199
00203 int number;
00204
00210 int* indexes;
00211
00215 int* values;
00216
00217 };
00218
00219
00223 class SparseMatrix
00224 {
00225 public:
00230 bool bDeleteArrays;
00231
00236 bool isColumnMajor;
00237
00241 int startSize;
00242
00246 int valueSize;
00247
00252 int* starts;
00253
00258 int* indexes;
00259
00264 double* values;
00265
00270 SparseMatrix();
00271
00280 SparseMatrix(bool isColumnMajor_, int startSize, int valueSize);
00285 ~SparseMatrix();
00286
00292 bool display(int secondaryDim);
00293
00294 };
00295
00296
00300 class SparseJacobianMatrix
00301 {
00302 public:
00303
00308 bool bDeleteArrays;
00309
00313 int startSize;
00314
00318 int valueSize;
00319
00324 int* starts;
00325
00330 int* conVals;
00331
00335 int* indexes;
00336
00340 double* values;
00341
00346 SparseJacobianMatrix();
00347
00354 SparseJacobianMatrix(int startSize, int valueSize);
00355
00360 ~SparseJacobianMatrix();
00361
00362 };
00363
00364
00365
00376 class SparseHessianMatrix
00377 {
00378 public:
00379
00384 bool bDeleteArrays;
00385
00389 int hessDimension;
00390
00394 int* hessRowIdx;
00395
00399 int* hessColIdx;
00400
00404 double* hessValues;
00405
00410 SparseHessianMatrix();
00411
00418 SparseHessianMatrix(int startSize, int valueSize);
00419
00424 ~SparseHessianMatrix();
00425
00426 };
00427
00431 class QuadraticTerms
00432 {
00433
00434 public:
00435
00440 int* rowIndexes;
00441
00445 int* varOneIndexes;
00446
00450 int* varTwoIndexes;
00451
00455 double* coefficients;
00456
00460 QuadraticTerms();
00461 ~QuadraticTerms();
00462 };
00463
00464
00465
00469 class IntVector
00470 {
00471 public:
00472 IntVector();
00473 ~IntVector();
00474
00476 IntVector(int n);
00477
00482 bool bDeleteArrays;
00483 int numberOfEl;
00484 int *el;
00485
00489 bool IsEqual(IntVector *that);
00490
00499 bool setRandom(double density, bool conformant, int iMin, int iMax);
00500
00506 bool deepCopyFrom(IntVector *that);
00507
00513 bool setIntVector(int *i, int ni);
00514
00519 bool extendIntVector(int i);
00520
00524 int getNumberOfEl();
00525
00530 int getEl(int j);
00531
00532
00540 bool getEl(int *i);
00541 };
00542
00543
00549 class OtherOptionOrResultEnumeration : public IntVector
00550 {
00551 public:
00552 std::string value;
00553 std::string description;
00554
00555 OtherOptionOrResultEnumeration();
00556 ~OtherOptionOrResultEnumeration();
00557
00559 OtherOptionOrResultEnumeration(int n);
00560
00564 bool IsEqual(OtherOptionOrResultEnumeration *that);
00565
00574 bool setRandom(double density, bool conformant, int iMin, int iMax);
00575
00581 bool deepCopyFrom(OtherOptionOrResultEnumeration *that);
00582
00590 bool setOtherOptionOrResultEnumeration(std::string value, std::string description, int *i, int ni);
00591
00592
00596 std::string getValue();
00597
00601 std::string getDescription();
00602
00603 };
00604
00605
00609 class DoubleVector
00610 {
00611 public:
00612 DoubleVector();
00613 ~DoubleVector();
00614
00619 bool bDeleteArrays;
00620 int numberOfEl;
00621 double *el;
00622
00623 bool IsEqual(DoubleVector *that);
00624 };
00625
00626
00630 struct IndexValuePair
00631 {
00635 int idx;
00636
00638 double value;
00639 };
00640
00645 class BasisStatus
00646 {
00647 public:
00648 IntVector* basic;
00649 IntVector* atLower;
00650 IntVector* atUpper;
00651 IntVector* atEquality;
00652 IntVector* isFree;
00653 IntVector* superbasic;
00654 IntVector* unknown;
00655
00656 BasisStatus();
00657 ~BasisStatus();
00658
00662 bool IsEqual(BasisStatus *that);
00663
00672 bool setRandom(double density, bool conformant, int iMin, int iMax);
00673
00679 bool deepCopyFrom(BasisStatus *that);
00680
00688 bool setIntVector(int status, int *i, int ni);
00689
00696 bool addIdx(int status, int idx);
00697
00704 int getNumberOfEl(int status);
00705
00706
00714 int getEl(int status, int j);
00715
00725 bool getIntVector(int status, int *i);
00726
00740 int getBasisDense(int *resultArray, int dim, bool flipIdx);
00741 };
00742
00743
00754 class StorageCapacity
00755 {
00756
00757 public:
00759 std::string unit;
00760
00762 std::string description;
00763
00765 double value;
00766
00771 StorageCapacity();
00776 ~StorageCapacity();
00777
00782 bool IsEqual(StorageCapacity *that);
00783
00791 bool setRandom(double density, bool conformant);
00792
00798 bool deepCopyFrom(StorageCapacity *that);
00799 };
00800
00812 class CPUSpeed
00813 {
00814
00815 public:
00817 std::string unit;
00818
00820 std::string description;
00821
00823 double value;
00824
00829 CPUSpeed();
00834 ~CPUSpeed();
00835
00840 bool IsEqual(CPUSpeed *that);
00841
00850 bool setRandom(double density, bool conformant);
00851
00857 bool deepCopyFrom(CPUSpeed *that);
00858 };
00859
00871 class CPUNumber
00872 {
00873
00874 public:
00876 std::string description;
00877
00879 int value;
00880
00885 CPUNumber();
00890 ~CPUNumber();
00891
00896 bool IsEqual(CPUNumber *that);
00897
00905 bool setRandom(double density, bool conformant);
00906
00912 bool deepCopyFrom(CPUNumber *that);
00913 };
00914
00924 class TimeSpan
00925 {
00926
00927 public:
00929 std::string unit;
00930
00932 double value;
00933
00938 TimeSpan();
00943 ~TimeSpan();
00944
00949 bool IsEqual(TimeSpan *that);
00950
00958 bool setRandom(double density, bool conformant);
00959
00965 bool deepCopyFrom(TimeSpan *that);
00966 };
00967
00968
00969 class OSGeneral
00970 {
00971
00972 };
00973
00974
00975
00976
00977
00978
00979
00980
00981
00982
00983
00984
00985 inline bool OSIsEqual(double x, double y)
00986 {
00987 if (OSIsnan(x) && OSIsnan(y)) return true;
00988 if (x == y) return true;
00989 return false;
00990 }
00991
00992
00993 #endif