16#include "OSParameters.h"
48 std::ostringstream outStr;
77 (this->source != that->
source) ||
80 (this->licence != that->
licence))
85 outStr <<
"name: " << this->
name <<
" vs. " << that->
name << endl;
86 outStr <<
"source: " << this->
source <<
" vs. " << that->
source << endl;
89 outStr <<
"licence: " << this->
licence <<
" vs. " << that->
licence << endl;
102 if (
OSRand() <= density) this->
name =
"random string";
103 if (
OSRand() <= density) this->
source =
"random string";
125 if (item ==
"name")
return name;
126 if (item ==
"source")
return source;
129 if (item ==
"licence")
return licence;
130 throw ErrorClass(
"Attempting to access undefined header item in getHeaderItem");
134 std::string description, std::string fileCreator, std::string licence)
216 bDeleteArrays( true),
229 isColumnMajor(isColumnMajor_),
230 startSize(startSize_),
231 valueSize(valueSize_)
265 for ( k = 0; k < secondaryDim; k++)
281 if ( j <
starts[i + 1] - 1)
290 for ( k =
indexes [j] + 1; k < secondaryDim; k++)
305 bDeleteArrays( true),
317 bDeleteArrays( true),
318 startSize(startSize_),
319 valueSize(valueSize_)
351 bDeleteArrays( true),
432 if (
el != NULL)
delete[]
el;
444 this->
el =
new int[ni];
445 for (
int j=0; j<ni; j++)
457 if (this->
el == NULL)
462 int* temp =
new int[ni+1];
463 for (
int j = 0; j < ni; ++j)
464 temp[j] = this->
el[j];
484 throw ErrorClass(
"Attempting to access undefined memory in IntVector::getEl(j)");
497 std::ostringstream outStr;
537 if (this->
el[i] != that->
el[i])
543 outStr <<
"El[" << i <<
"]: " << this->
el[i] <<
" vs. " << that->
el[i] << endl;
564 else n = (int)(4*
OSRand());
567 for (
int i = 0; i < n; i++)
581 if (n < 0)
return false;
582 if (n == 0)
return true;
584 this->
el =
new int[n];
585 for (
int i = 0; i < n; i++)
586 this->
el[i] = that->
el[i];
598 "Inside the OtherOptionOrResultEnumeration Constructor");
609 "Inside the alternate OtherOptionOrResultEnumeration Constructor");
617 "Inside the OtherOptionOrResultEnumeration Destructor");
641 std::ostringstream outStr;
674 outStr <<
"value: " << this->
value <<
" vs. " << that->
value << endl;
691 if (
OSRand() <= density) this->
value =
"random string";
730 if (
el != NULL)
delete[]
el;
738 std::ostringstream outStr;
784 outStr <<
"El[" << i <<
"]: " << this->
el[i] <<
" vs. " << that->
el[i] << endl;
901 throw ErrorClass(
"Unknown basis status encountered in BasisStatus::setIntVector");
945 throw ErrorClass(
"Unknown basis status encountered in BasisStatus::addIdx");
956 if (this->
basic == NULL)
return false;
961 if (this->
atLower == NULL)
return false;
966 if (this->
atUpper == NULL)
return false;
976 if (this->
isFree == NULL)
return false;
986 if (this->
unknown == NULL)
return false;
990 throw ErrorClass(
"Unknown basis status encountered in setIntVector");
1001 if (this->
basic == NULL)
return -1;
1006 if (this->
atLower == NULL)
return -1;
1011 if (this->
atUpper == NULL)
return -1;
1021 if (this->
isFree == NULL)
return -1;
1031 if (this->
unknown == NULL)
return -1;
1035 throw ErrorClass(
"Unknown basis status encountered in getBasisStatusNumberOfEl");
1046 if (this->
basic == NULL)
1047 throw ErrorClass(
"\"basic\" index array never defined in routine BasisStatus::getEl()");
1048 else return this->
basic->
el[j];
1053 throw ErrorClass(
"\"atLower\" index array never defined in routine BasisStatus::getEl()");
1059 throw ErrorClass(
"\"atUpper\" index array never defined in routine BasisStatus::getEl()");
1065 throw ErrorClass(
"\"atEquality\" index array never defined in routine BasisStatus::getEl()");
1070 if (this->
isFree == NULL)
1071 throw ErrorClass(
"\"isFree\" index array never defined in routine BasisStatus::getEl()");
1077 throw ErrorClass(
"\"superbasic\" index array never defined in routine BasisStatus::getEl()");
1083 throw ErrorClass(
"\"unknown\" index array never defined in routine BasisStatus::getEl()");
1087 throw ErrorClass(
"Unknown basis status encountered in getBasisStatusNumberOfEl");
1094 int* statusArray = NULL;
1098 if (this->
basic != NULL)
1101 statusArray =
new int[n];
1103 for (i=0; i < n; i++)
1110 delete [] statusArray;
1118 statusArray =
new int[n];
1120 for (i=0; i < n; i++)
1127 delete [] statusArray;
1134 statusArray =
new int[n];
1136 for (i=0; i < n; i++)
1143 delete [] statusArray;
1150 statusArray =
new int[n];
1152 for (i=0; i < n; i++)
1159 delete [] statusArray;
1163 if (this->
isFree != NULL)
1166 statusArray =
new int[n];
1168 for (i=0; i < n; i++)
1175 delete [] statusArray;
1182 statusArray =
new int[n];
1184 for (i=0; i < n; i++)
1191 delete [] statusArray;
1198 statusArray =
new int[n];
1200 for (i=0; i < n; i++)
1207 delete [] statusArray;
1215 std::ostringstream outStr;
1306 if (that->
basic != NULL)
1330 if (that->
isFree != NULL)
1368 std::ostringstream outStr;
1403 outStr <<
"unit: " << this->
unit <<
" vs. " << that->
unit << endl;
1405 outStr <<
"value: " << this->
value <<
" vs. " << that->
value << endl;
1421 if (conformant) temp = 0.5*temp;
1423 if (temp <= 0.25) this->
unit =
"byte";
1424 else if (temp <= 0.50) this->
unit =
"megabyte";
1425 else if (temp <= 0.75) this->
unit =
"";
1426 else this->
unit =
"overbyte";
1432 else this->
value = 2.71828;
1464 std::ostringstream outStr;
1499 outStr <<
"unit: " << this->
unit <<
" vs. " << that->
unit << endl;
1501 outStr <<
"value: " << this->
value <<
" vs. " << that->
value << endl;
1516 if (conformant) temp = 0.5*temp;
1518 if (temp <= 0.25) this->
unit =
"hertz";
1519 else if (temp <= 0.50) this->
unit =
"gigaflops";
1520 else if (temp <= 0.75) this->
unit =
"";
1521 else this->
unit =
"bellyflops";
1527 else this->
value = 2.71828;
1558 std::ostringstream outStr;
1588 (this->value != that->
value))
1594 outStr <<
"value: " << this->
value <<
" vs. " << that->
value << endl;
1637 std::ostringstream outStr;
1666 this->unit != that->
unit )
1672 outStr <<
"unit: " << this->
unit <<
" vs. " << that->
unit << endl;
1673 outStr <<
"value: " << this->
value <<
" vs. " << that->
value << endl;
1688 if (conformant) temp = 0.5*temp;
1690 if (temp <= 0.25) this->
unit =
"second";
1691 else if (temp <= 0.50) this->
unit =
"tick";
1692 else if (temp <= 0.75) this->
unit =
"";
1694 else this->
unit =
"flea";
1699 else this->
value = 2.71828;
const OSSmartPtr< OSOutput > osoutput
bool OSIsEqual(double x, double y)
double OSiRand(int iMin, int iMax)
OSiRand(int iMin, int iMax)
a data structure to represent an LP basis on both input and output
bool IsEqual(BasisStatus *that)
A function to check for the equality of two objects.
int getBasisDense(int *resultArray, int dim, bool flipIdx)
Get the entire array of basis status in dense form.
bool getIntVector(int status, int *i)
Get the entire array of indices for a particular status.
bool addIdx(int status, int idx)
Add one index to a particular status.
bool setIntVector(int status, int *i, int ni)
Set the indices for a particular status.
int getNumberOfEl(int status)
Get the number of indices for a particular status.
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
bool deepCopyFrom(BasisStatus *that)
A function to make a deep copy of an instance of this class.
int getEl(int status, int j)
Get one entry in the array of indices for a particular status.
bool deepCopyFrom(CPUNumber *that)
A function to make a deep copy of an instance of this class.
~CPUNumber()
Class destructor.
std::string description
additional description about the CPU
bool setRandom(double density, bool conformant)
A function to make a random instance of this class.
int value
the number of CPUs
bool IsEqual(CPUNumber *that)
A function to check for the equality of two objects.
CPUNumber()
Default constructor.
bool deepCopyFrom(CPUSpeed *that)
A function to make a deep copy of an instance of this class.
CPUSpeed()
Default constructor.
bool setRandom(double density, bool conformant)
A function to make a random instance of this class.
std::string description
additional description about the CPU speed
~CPUSpeed()
Class destructor.
std::string unit
the unit in which CPU speed is measured
bool IsEqual(CPUSpeed *that)
A function to check for the equality of two objects.
double value
the CPU speed (expressed in multiples of unit)
a double vector data structure
bool bDeleteArrays
bDeleteArrays is true if we delete the arrays in garbage collection set to true by default
bool IsEqual(DoubleVector *that)
used for throwing exceptions.
an integer Vector data structure
int getNumberOfEl()
get the dimension of an IntVector
int getEl(int j)
get an entry in the data array of an IntVector
bool setIntVector(int *i, int ni)
set values into an IntVector
bool bDeleteArrays
bDeleteArrays is true if we delete the arrays in garbage collection set to true by default
bool IsEqual(IntVector *that)
A method to compare two invectors.
bool extendIntVector(int i)
append a value to an IntVector
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
bool deepCopyFrom(IntVector *that)
A function to make a deep copy of an instance of this class.
std::string getValue()
Get the value for a particular level in an enumeration.
bool IsEqual(OtherOptionOrResultEnumeration *that)
A function to check for the equality of two objects.
bool setOtherOptionOrResultEnumeration(std::string value, std::string description, int *i, int ni)
Set the indices for a particular level in an enumeration.
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
OtherOptionOrResultEnumeration()
bool deepCopyFrom(OtherOptionOrResultEnumeration *that)
A function to make a deep copy of an instance of this class.
~OtherOptionOrResultEnumeration()
std::string getDescription()
Get the description for a particular level in an enumeration.
QuadraticTerms()
Default constructor.
int * varTwoIndexes
varTwoIndexes holds an integer array of the second variable indexes of all the quadratic terms.
int * rowIndexes
rowIndexes holds an integer array of row indexes of all the quadratic terms.
double * coefficients
coefficients holds a double array all the quadratic term coefficients.
int * varOneIndexes
varOneIndexes holds an integer array of the first variable indexes of all the quadratic terms.
int * hessRowIdx
hessRowIdx is an integer array of row indices in the range 0, ..., n - 1.
double * hessValues
hessValues is a double array of the Hessian values.
int * hessColIdx
hessColIdx is an integer array of column indices in the range 0, ..., n - 1.
~SparseHessianMatrix()
Default destructor.
bool bDeleteArrays
bDeleteArrays is true if we delete the arrays in garbage collection set to true by default
SparseHessianMatrix()
Default constructor.
int * indexes
indexes holds an integer array of indexes whose corresponding values are listed in the same order in ...
SparseIntVector()
Default Constructor.
~SparseIntVector()
Default destructor.
bool bDeleteArrays
bDeleteArrays is true if we delete the arrays in garbage collection set to true by default
int number
number is the number of elements in the indexes and values arrays.
int * values
values holds an integer array of nonzero values.
int startSize
startSize is the dimension of the starts array – should equal number of rows + 1
int * indexes
indexes holds an integer array of variable indices.
bool bDeleteArrays
bDeleteArrays is true if we delete the arrays in garbage collection set to true by default
~SparseJacobianMatrix()
Default destructor.
int valueSize
valueSize is the dimension of the values array
int * starts
starts holds an integer array of start elements, each start element points to the start of partials f...
int * conVals
conVals holds an integer array of integers, conVals[i] is the number of constant terms in the gradien...
SparseJacobianMatrix()
Default constructor.
double * values
values holds a double array of nonzero partial derivatives
int * indexes
indexes holds an integer array of rowIdx (or colIdx) elements in coefMatrix (AMatrix).
int valueSize
valueSize is the dimension of the indexes and values arrays
bool bDeleteArrays
bDeleteArrays is true if we delete the arrays in garbage collection set to true by default
int * starts
starts holds an integer array of start elements in coefMatrix (AMatrix), which points to the start of...
double * values
values holds a double array of value elements in coefMatrix (AMatrix), which contains nonzero element...
bool display(int secondaryDim)
This method displays data structure in the matrix format.
~SparseMatrix()
Default destructor.
SparseMatrix()
Default constructor.
int startSize
startSize is the dimension of the starts array
SparseVector()
Default Constructor.
double * values
values holds a double array of nonzero values.
int * indexes
indexes holds an integer array of indexes whose corresponding values are nonzero.
int number
number is the number of elements in the indexes and values arrays.
bool bDeleteArrays
bDeleteArrays is true if we delete the arrays in garbage collection set to true by default
~SparseVector()
Default destructor.
the StorageCapacity class.
bool deepCopyFrom(StorageCapacity *that)
A function to make a deep copy of an instance of this class.
std::string unit
the unit in which storage capacity is measured
StorageCapacity()
Default constructor.
~StorageCapacity()
Class destructor.
double value
the number of units of storage capacity
std::string description
additional description about the storage
bool setRandom(double density, bool conformant)
A function to make a random instance of this class.
bool IsEqual(StorageCapacity *that)
A function to check for the equality of two objects.
bool IsEqual(TimeSpan *that)
A function to check for the equality of two objects.
std::string unit
the unit in which time is measured
~TimeSpan()
Class destructor.
TimeSpan()
Default constructor.
double value
the number of units
bool setRandom(double density, bool conformant)
A function to make a random instance of this class.
bool deepCopyFrom(TimeSpan *that)
A function to make a deep copy of an instance of this class.
@ ENUM_OUTPUT_LEVEL_debug
@ ENUM_OUTPUT_LEVEL_trace
@ ENUM_BASIS_STATUS_isFree
@ ENUM_BASIS_STATUS_unknown
@ ENUM_BASIS_STATUS_basic
@ ENUM_BASIS_STATUS_atLower
@ ENUM_BASIS_STATUS_atEquality
@ ENUM_BASIS_STATUS_superbasic
@ ENUM_BASIS_STATUS_atUpper
@ ENUM_OUTPUT_AREA_OSGeneral