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++)
277 for ( j = starts[ i ]; j < starts[i + 1]; j++)
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;
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()");
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;
std::string unit
the unit in which CPU speed is measured
~SparseJacobianMatrix()
Default destructor.
std::string description
additional description about the storage
bool deepCopyFrom(BasisStatus *that)
A function to make a deep copy of an instance of this class.
const OSSmartPtr< OSOutput > osoutput
bool setRandom(double density, bool conformant)
A function to make a random instance of this class.
std::string getDescription()
Get the description for a particular level in an enumeration.
double * values
values holds a double array of nonzero partial derivatives
bool IsEqual(OtherOptionOrResultEnumeration *that)
A function to check for the equality of two objects.
bool display(int secondaryDim)
This method displays data structure in the matrix format.
bool setIntVector(int *i, int ni)
set values into an IntVector
bool IsEqual(CPUSpeed *that)
A function to check for the equality of two objects.
bool setRandom(double density, bool conformant)
A function to make a random instance of this class.
bool bDeleteArrays
bDeleteArrays is true if we delete the arrays in garbage collection set to true by default ...
bool bDeleteArrays
bDeleteArrays is true if we delete the arrays in garbage collection set to true by default ...
bool bDeleteArrays
bDeleteArrays is true if we delete the arrays in garbage collection set to true by default ...
bool deepCopyFrom(OtherOptionOrResultEnumeration *that)
A function to make a deep copy of an instance of this class.
bool deepCopyFrom(CPUNumber *that)
A function to make a deep copy of an instance of this class.
bool IsEqual(BasisStatus *that)
A function to check for the equality of two objects.
double value
the number of units
int startSize
startSize is the dimension of the starts array – should equal number of rows + 1
int value
the number of CPUs
~CPUSpeed()
Class destructor.
bool getIntVector(int status, int *i)
Get the entire array of indices for a particular status.
std::string description
additional description about the CPU speed
int * hessColIdx
hessColIdx is an integer array of column indices in the range 0, ..., n - 1.
int getBasisDense(int *resultArray, int dim, bool flipIdx)
Get the entire array of basis status in dense form.
SparseHessianMatrix()
Default constructor.
CPUSpeed()
Default constructor.
int * hessRowIdx
hessRowIdx is an integer array of row indices in the range 0, ..., n - 1.
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
bool IsEqual(DoubleVector *that)
SparseVector()
Default Constructor.
int startSize
startSize is the dimension of the starts array
int * indexes
indexes holds an integer array of indexes whose corresponding values are listed in the same order in ...
int * indexes
indexes holds an integer array of rowIdx (or colIdx) elements in coefMatrix (AMatrix).
bool IsEqual(CPUNumber *that)
A function to check for the equality of two objects.
int getNumberOfEl()
get the dimension of an IntVector
bool setIntVector(int status, int *i, int ni)
Set the indices for a particular status.
double OSiRand(int iMin, int iMax)
OSiRand(int iMin, int iMax)
int getEl(int status, int j)
Get one entry in the array of indices for a particular status.
std::string description
additional description about the CPU
int valueSize
valueSize is the dimension of the values array
a double vector data structure
bool bDeleteArrays
bDeleteArrays is true if we delete the arrays in garbage collection set to true by default ...
int valueSize
valueSize is the dimension of the indexes and values arrays
~SparseMatrix()
Default destructor.
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 ...
~SparseHessianMatrix()
Default destructor.
int * values
values holds an integer array of nonzero values.
int * varOneIndexes
varOneIndexes holds an integer array of the first variable indexes of all the quadratic terms...
bool extendIntVector(int i)
append a value to an IntVector
~SparseIntVector()
Default destructor.
int getNumberOfEl(int status)
Get the number of indices for a particular status.
double * hessValues
hessValues is a double array of the Hessian values.
std::string unit
the unit in which storage capacity is measured
bool deepCopyFrom(CPUSpeed *that)
A function to make a deep copy of an instance of this class.
bool addIdx(int status, int idx)
Add one index to a particular status.
TimeSpan()
Default constructor.
double * values
values holds a double array of value elements in coefMatrix (AMatrix), which contains nonzero element...
bool setRandom(double density, bool conformant)
A function to make a random instance of this class.
~TimeSpan()
Class destructor.
SparseIntVector()
Default Constructor.
bool bDeleteArrays
bDeleteArrays is true if we delete the arrays in garbage collection set to true by default ...
SparseJacobianMatrix()
Default constructor.
an integer Vector data structure
int number
number is the number of elements in the indexes and values arrays.
int * starts
starts holds an integer array of start elements, each start element points to the start of partials f...
double value
the CPU speed (expressed in multiples of unit)
bool deepCopyFrom(TimeSpan *that)
A function to make a deep copy of an instance of this class.
bool IsEqual(IntVector *that)
A method to compare two invectors.
bool setOtherOptionOrResultEnumeration(std::string value, std::string description, int *i, int ni)
Set the indices for a particular level in an enumeration.
bool OSIsEqual(double x, double y)
~OtherOptionOrResultEnumeration()
int * rowIndexes
rowIndexes holds an integer array of row indexes of all the quadratic terms.
int * starts
starts holds an integer array of start elements in coefMatrix (AMatrix), which points to the start of...
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
double * values
values holds a double array of nonzero values.
bool deepCopyFrom(StorageCapacity *that)
A function to make a deep copy of an instance of this class.
int getEl(int j)
get an entry in the data array of an IntVector
OtherOptionOrResultEnumeration()
CPUNumber()
Default constructor.
std::string getValue()
Get the value for a particular level in an enumeration.
int * indexes
indexes holds an integer array of indexes whose corresponding values are nonzero. ...
bool IsEqual(TimeSpan *that)
A function to check for the equality of two objects.
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.
SparseMatrix()
Default constructor.
bool IsEqual(StorageCapacity *that)
A function to check for the equality of two objects.
int * conVals
conVals holds an integer array of integers, conVals[i] is the number of constant terms in the gradien...
double * coefficients
coefficients holds a double array all the quadratic term coefficients.
int * varTwoIndexes
varTwoIndexes holds an integer array of the second variable indexes of all the quadratic terms...
bool setRandom(double density, bool conformant, int iMin, int iMax)
A function to make a random instance of this class.
used for throwing exceptions.
~StorageCapacity()
Class destructor.
a data structure to represent an LP basis on both input and output
the StorageCapacity class.
~CPUNumber()
Class destructor.
std::string unit
the unit in which time is measured
double value
the number of units of storage capacity
StorageCapacity()
Default constructor.
~SparseVector()
Default destructor.
QuadraticTerms()
Default constructor.
bool deepCopyFrom(IntVector *that)
A function to make a deep copy of an instance of this class.
bool setRandom(double density, bool conformant)
A function to make a random instance of this class.