#include <global.h>
Inheritance diagram for ABA_GLOBAL:
Public Member Functions | |
ABA_GLOBAL (double eps=1.0e-4, double machineEps=1.0e-7, double infinity=1.0e32) | |
The constructor initializes our filtered output and error stream with the standard output stream cout and the standard error stream cerr. | |
virtual | ~ABA_GLOBAL () |
The destructor. | |
virtual ABA_OSTREAM & | out (int nTab=0) |
Returns a reference to the output stream associated with this global object after writing nTab (default value 0) tabulators on this stream. This tabulator is not the normal tabulator but consists of four blanks. | |
virtual ABA_OSTREAM & | err (int nTab=0) |
Behaves like the function out() except that the global error stream is used instead of the global output stream. | |
double | eps () const |
void | eps (double e) |
This version of the function eps() sets the zero tolerance. | |
double | machineEps () const |
void | machineEps (double e) |
This version of the function machineEps() sets the machine dependent zero tolerance. | |
double | infinity () const |
Provides a floating point value of ``infinite'' size. Especially, we assume that -infinity() is the lower and infinity() is the upper bound of an unbounded variable in the linear program. | |
void | infinity (double x) |
This version of the function infinity() sets the ``infinite value''. Please note that this value might be different from the value the LP-solver uses internally. You should make sure that the value used here is always greater than or equal to the value used by the solver. | |
bool | isInfinity (double x) const |
bool | isMinusInfinity (double x) const |
bool | equal (double x, double y) const |
bool | isInteger (double x) const |
bool | isInteger (double x, double eps) const |
virtual char | enter (istream &in) |
Displays the string { ENTER>} on the global output stream and waits for a character on the input stream in, e.g., a keystroke if in == cin. | |
void | readParameters (const char *fileName) |
Opens the parameter file fileName, reads all parameters, and inserts them in the parameter table. | |
void | insertParameter (const char *name, const char *value) |
int | getParameter (const char *name, int ¶m) |
int | getParameter (const char *name, unsigned int ¶m) |
int | getParameter (const char *name, double ¶m) |
int | getParameter (const char *name, ABA_STRING ¶m) |
int | getParameter (const char *name, bool ¶m) |
int | getParameter (const char *name, char ¶m) |
void | assignParameter (int ¶m, const char *name, int minVal, int maxVal) |
void | assignParameter (unsigned ¶m, const char *name, unsigned minVal, unsigned maxVal) |
See ABA_GLOBAL::assignParameter} for description. | |
void | assignParameter (double ¶m, const char *name, double minVal, double maxVal) |
See ABA_GLOBAL::assignParameter} for description. | |
void | assignParameter (bool ¶m, const char *name) |
See ABA_GLOBAL::assignParameter} for description. | |
void | assignParameter (ABA_STRING ¶m, const char *name, unsigned nFeasible=0, const char *feasible[]=0) |
void | assignParameter (char ¶m, const char *name, const char *feasible=0) |
void | assignParameter (int ¶m, const char *name, int minVal, int maxVal, int defVal) |
void | assignParameter (unsigned ¶m, const char *name, unsigned minVal, unsigned maxVal, unsigned defVal) |
See ABA_GLOBAL::assignParameter} for description. | |
void | assignParameter (double ¶m, const char *name, double minVal, double maxVal, double defVal) |
See ABA_GLOBAL::assignParameter} for description. | |
void | assignParameter (bool ¶m, const char *name, bool defVal) |
See ABA_GLOBAL::assignParameter} for description. | |
void | assignParameter (ABA_STRING ¶m, const char *name, unsigned nFeasible, const char *feasible[], const char *defVal) |
void | assignParameter (char ¶m, const char *name, const char *feasible, char defVal) |
int | findParameter (const char *name, unsigned nFeasible, const int *feasible) |
int | findParameter (const char *name, unsigned nFeasible, const char *feasible[]) |
See ABA_GLOBAL::findParameter} for description. | |
int | findParameter (const char *name, const char *feasible) |
See ABA_GLOBAL::findParameter} for description. | |
Private Member Functions | |
ABA_GLOBAL (const ABA_GLOBAL &rhs) | |
const ABA_GLOBAL & | operator= (const ABA_GLOBAL &rhs) |
Private Attributes | |
ABA_OSTREAM | out_ |
ABA_OSTREAM | err_ |
double | eps_ |
double | machineEps_ |
The machine dependent zero tolerance, which is used to , e.g., to test if a floating point value is 0. | |
double | infinity_ |
char * | tab_ |
ABA_HASH< ABA_STRING, ABA_STRING > | paramTable_ |
Friends | |
ostream & | operator<< (ostream &out, const ABA_GLOBAL &rhs) |
Definition at line 58 of file global.h.
ABA_GLOBAL::ABA_GLOBAL | ( | double | eps = 1.0e-4 , |
|
double | machineEps = 1.0e-7 , |
|||
double | infinity = 1.0e32 | |||
) |
The constructor initializes our filtered output and error stream with the standard output stream cout and the standard error stream cerr.
eps | The zero-tolerance used within all member functions of objects which have a pointer to this global object (default value 1.0e-4). | |
machineEps | The machine dependent zero tolerance (default value 1.0e-7). | |
infinity | All values greater than infinity are regarded as ``infinite big'', all values less than -infinity are regarded as ``infinite small'' (default value 1.0e32). Please note that this value might be different from the value the LP-solver uses internally. You should make sure that the value used here is always greater than or equal to the value used by the solver. |
virtual ABA_GLOBAL::~ABA_GLOBAL | ( | ) | [virtual] |
The destructor.
ABA_GLOBAL::ABA_GLOBAL | ( | const ABA_GLOBAL & | rhs | ) | [private] |
virtual ABA_OSTREAM& ABA_GLOBAL::out | ( | int | nTab = 0 |
) | [virtual] |
Returns a reference to the output stream associated with this global object after writing nTab (default value 0) tabulators on this stream. This tabulator is not the normal tabulator but consists of four blanks.
nTab | The number of tabulators which should be written to the global output stream. The default value is 0. |
virtual ABA_OSTREAM& ABA_GLOBAL::err | ( | int | nTab = 0 |
) | [virtual] |
Behaves like the function out() except that the global error stream is used instead of the global output stream.
nTab | The number of tabulators which should be written to the global error stream. The default value is 0. |
double ABA_GLOBAL::eps | ( | ) | const [inline] |
void ABA_GLOBAL::eps | ( | double | e | ) | [inline] |
double ABA_GLOBAL::machineEps | ( | ) | const [inline] |
Provides a machine dependent zero tolerance.
The machine dependent zero tolerance is used, e.g., to test if a floating point value is 0. This value is usually less than eps(), which provides, e.g., a safety tolerance if a constraint is violated.
void ABA_GLOBAL::machineEps | ( | double | e | ) | [inline] |
This version of the function machineEps() sets the machine dependent zero tolerance.
e | The new value of the machine dependent zero tolerance. |
double ABA_GLOBAL::infinity | ( | ) | const [inline] |
Provides a floating point value of ``infinite'' size. Especially, we assume that -infinity() is the lower and infinity() is the upper bound of an unbounded variable in the linear program.
void ABA_GLOBAL::infinity | ( | double | x | ) | [inline] |
This version of the function infinity() sets the ``infinite value''. Please note that this value might be different from the value the LP-solver uses internally. You should make sure that the value used here is always greater than or equal to the value used by the solver.
x | The new value representing ``infinity''. |
bool ABA_GLOBAL::isInfinity | ( | double | x | ) | const [inline] |
bool ABA_GLOBAL::isMinusInfinity | ( | double | x | ) | const [inline] |
bool ABA_GLOBAL::equal | ( | double | x, | |
double | y | |||
) | const [inline] |
bool ABA_GLOBAL::isInteger | ( | double | x | ) | const [inline] |
bool ABA_GLOBAL::isInteger | ( | double | x, | |
double | eps | |||
) | const |
false otherwise.
virtual char ABA_GLOBAL::enter | ( | istream & | in | ) | [virtual] |
Displays the string { ENTER>} on the global output stream and waits for a character on the input stream in, e.g., a keystroke if in == cin.
in | The input stream the character should be read from. |
void ABA_GLOBAL::readParameters | ( | const char * | fileName | ) |
Opens the parameter file fileName, reads all parameters, and inserts them in the parameter table.
A parameter file may have at most 1024 characters per line.
fileName | The name of the parameter file. |
void ABA_GLOBAL::insertParameter | ( | const char * | name, | |
const char * | value | |||
) |
Inserts a parameter in the parameter table.
If the parameter already is in the table, the value is overwritten.
name | The name of the parameter. | |
value | The literal value of the parameter. |
int ABA_GLOBAL::getParameter | ( | const char * | name, | |
int & | param | |||
) |
Searches for the parameter name in the parameter table.
This function is overloaded for different types of the argument parameter. See also the functions assignParameter and findParameter with enhanced functionality.
1 otherwise.
name | The name of the parameter. | |
parameter | The variable parameter receives the value of the parameter, if the function returns 1, otherwise it is undefined. |
int ABA_GLOBAL::getParameter | ( | const char * | name, | |
unsigned int & | param | |||
) |
int ABA_GLOBAL::getParameter | ( | const char * | name, | |
double & | param | |||
) |
int ABA_GLOBAL::getParameter | ( | const char * | name, | |
ABA_STRING & | param | |||
) |
int ABA_GLOBAL::getParameter | ( | const char * | name, | |
bool & | param | |||
) |
int ABA_GLOBAL::getParameter | ( | const char * | name, | |
char & | param | |||
) |
void ABA_GLOBAL::assignParameter | ( | int & | param, | |
const char * | name, | |||
int | minVal, | |||
int | maxVal | |||
) |
Searches for the parameter name in the parameter table.
If no parameter name is found and no default value of the parameter is given, the program terminates with an error messages. The program terminates also with an error message if the value of a parameter is not within a specified feasible region. Depending on the type of the parameter, a feasible region can be an interval (specified by minVal and maxVal) or can be given by a set of feasible settings (given by a number nFeasible and a pointer feasible to the feasible values.
param | The variable parameter receives the value of the parameter. | |
name | The name of the parameter. | |
minVal | The value of the parameter is considered as infeasible if it is less than minVal. | |
maxVal | The value of the parameter is considered as infeasible if it is larger than maxVal. |
void ABA_GLOBAL::assignParameter | ( | unsigned & | param, | |
const char * | name, | |||
unsigned | minVal, | |||
unsigned | maxVal | |||
) |
See ABA_GLOBAL::assignParameter} for description.
void ABA_GLOBAL::assignParameter | ( | double & | param, | |
const char * | name, | |||
double | minVal, | |||
double | maxVal | |||
) |
See ABA_GLOBAL::assignParameter} for description.
void ABA_GLOBAL::assignParameter | ( | bool & | param, | |
const char * | name | |||
) |
See ABA_GLOBAL::assignParameter} for description.
void ABA_GLOBAL::assignParameter | ( | ABA_STRING & | param, | |
const char * | name, | |||
unsigned | nFeasible = 0 , |
|||
const char * | feasible[] = 0 | |||
) |
See ABA_GLOBAL::assignParameter} for description.
param | The variable parameter receives the value of the parameter. | |
name | The name of the parameter. | |
nFeasible | The number of feasible settings. If nFeasible is equal to zero, then all values are allowed. 0 is the default value. | |
feasible | If nFeasible is greater zero, the this are the settings for the parameter to be considered as feasible. Must be an array of nFeasible strings. |
void ABA_GLOBAL::assignParameter | ( | char & | param, | |
const char * | name, | |||
const char * | feasible = 0 | |||
) |
See ABA_GLOBAL::assignParameter} for description.
param | The variable param receives the value of the parameter. | |
name | The name of the parameter. | |
feasible | A string consisting of all feasible characters. If feasible is zero, then all characters are allowed. |
void ABA_GLOBAL::assignParameter | ( | int & | param, | |
const char * | name, | |||
int | minVal, | |||
int | maxVal, | |||
int | defVal | |||
) |
See ABA_GLOBAL::assignParameter} for description.
parameter | The variable parameter receives the value of the parameter. | |
name | The name of the parameter. | |
minVal | The value of the parameter is considered as infeasible if it is less than minVal. | |
maxVal | The value of the parameter is considered as infeasible if it is larger than maxVal. | |
defVal | The default value that is used when the paramter is not found in the parameter table. |
void ABA_GLOBAL::assignParameter | ( | unsigned & | param, | |
const char * | name, | |||
unsigned | minVal, | |||
unsigned | maxVal, | |||
unsigned | defVal | |||
) |
See ABA_GLOBAL::assignParameter} for description.
void ABA_GLOBAL::assignParameter | ( | double & | param, | |
const char * | name, | |||
double | minVal, | |||
double | maxVal, | |||
double | defVal | |||
) |
See ABA_GLOBAL::assignParameter} for description.
void ABA_GLOBAL::assignParameter | ( | bool & | param, | |
const char * | name, | |||
bool | defVal | |||
) |
See ABA_GLOBAL::assignParameter} for description.
void ABA_GLOBAL::assignParameter | ( | ABA_STRING & | param, | |
const char * | name, | |||
unsigned | nFeasible, | |||
const char * | feasible[], | |||
const char * | defVal | |||
) |
See ABA_GLOBAL::assignParameter} for description.
parameter | The variable parameter receives the value of the parameter. | |
name | The name of the parameter. | |
nFeasible | The number of feasible settings. If nFeasible is equal to zero, then all settings are allowed. | |
feasible | The settings for the parameter to be considered as feasible. Must be an array of nFeasible strings. | |
defVal | The default value that is used when the paramter is not found in the parameter table. |
void ABA_GLOBAL::assignParameter | ( | char & | param, | |
const char * | name, | |||
const char * | feasible, | |||
char | defVal | |||
) |
See ABA_GLOBAL::assignParameter} for description.
param | The variable param receives the value of the parameter. | |
name | The name of the parameter. | |
feasible | A string containing all feasible settings. If feasible is zero, then all settings are allowed. | |
defVal | The default value that is used when the paramter is not found in the parameter table. |
int ABA_GLOBAL::findParameter | ( | const char * | name, | |
unsigned | nFeasible, | |||
const int * | feasible | |||
) |
Searches for the parameter name in the parameter table.
If no parameter name is found the program terminates with an error messages. The program terminates also with an error message if the value of a parameter is not within a given list of feasible settings. This function is overloaded and can be used for different types of parameters such as integer valued, char valued and string parameters.
name | The name of the parameter. | |
nFeasible | The number of feasible settings. | |
feasible | The settings for the parameter to be considered as feasible. Must be an array of nFeasible strings. |
int ABA_GLOBAL::findParameter | ( | const char * | name, | |
unsigned | nFeasible, | |||
const char * | feasible[] | |||
) |
See ABA_GLOBAL::findParameter} for description.
int ABA_GLOBAL::findParameter | ( | const char * | name, | |
const char * | feasible | |||
) |
See ABA_GLOBAL::findParameter} for description.
const ABA_GLOBAL& ABA_GLOBAL::operator= | ( | const ABA_GLOBAL & | rhs | ) | [private] |
ostream& operator<< | ( | ostream & | out, | |
const ABA_GLOBAL & | rhs | |||
) | [friend] |
The output operator writes some of the data members to an ouput stream.
out | The output stream. | |
rhs | The object being output. |
ABA_OSTREAM ABA_GLOBAL::out_ [private] |
ABA_OSTREAM ABA_GLOBAL::err_ [private] |
double ABA_GLOBAL::eps_ [private] |
double ABA_GLOBAL::machineEps_ [private] |
double ABA_GLOBAL::infinity_ [private] |
char* ABA_GLOBAL::tab_ [private] |
ABA_HASH<ABA_STRING, ABA_STRING> ABA_GLOBAL::paramTable_ [private] |