6.3 ABA_GLOBAL Class Reference
class stores global data (e.g., a zero tolerance, an output stream, a table with system parameters) und functions operating
with this data.
#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
Private Attributes
Friends
6.3.1 Detailed Description
class stores global data (e.g., a zero tolerance, an output stream, a table with system parameters) und functions operating
with this data.
Definition at line 58 of file global.h.
6.3.2 Constructor & Destructor Documentation
6.3.2.1 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.
-
Parameters:
-
-
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.
6.3.2.2 virtual ABA_GLOBAL::~ABA_GLOBAL () [virtual]
The destructor.
6.3.2.3 ABA_GLOBAL::ABA_GLOBAL (const ABA_GLOBAL & rhs) [private]
6.3.3 Member Function Documentation
6.3.3.1 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.
-
Returns:
-
A reference to the global output stream.
-
Parameters:
-
-
nTab
- The number of tabulators which should be written to the global output stream. The default value is 0.
6.3.3.2 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.
-
Returns:
-
A reference to the global error stream.
-
Parameters:
-
-
nTab
- The number of tabulators which should be written to the global error stream. The default value is 0.
6.3.3.3 double ABA_GLOBAL::eps () const [inline]
-
Returns:
-
The zero tolerance.
Definition at line 434 of file global.h.
6.3.3.4 void ABA_GLOBAL::eps (double e) [inline]
This version of the function eps() sets the zero tolerance.
-
Parameters:
-
-
e
- The new value of the zero tolerance.
Definition at line 439 of file global.h.
6.3.3.5 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.
-
Returns:
-
The machine dependent zero tolerance.
Definition at line 444 of file global.h.
6.3.3.6 void ABA_GLOBAL::machineEps (double e) [inline]
This version of the function machineEps() sets the machine dependent zero tolerance.
-
Parameters:
-
-
e
- The new value of the machine dependent zero tolerance.
Definition at line 449 of file global.h.
6.3.3.7 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.
-
Returns:
-
A very large floating point number. The default value of infinity() is 1.0e32.
Definition at line 454 of file global.h.
6.3.3.8 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.
-
Parameters:
-
-
x
- The new value representing “infinity”.
Definition at line 459 of file global.h.
6.3.3.9 bool ABA_GLOBAL::isInfinity (double x) const [inline]
-
Returns:
-
true If x is regarded as “infinite” large,
false otherwise.
-
Parameters:
-
-
x
- The value compared with “infinity”.
Definition at line 464 of file global.h.
6.3.3.10 bool ABA_GLOBAL::isMinusInfinity (double x) const [inline]
-
Returns:
-
true If x is regarded as infinite small;}
false otherwise.
-
Parameters:
-
-
x
- The value compared with “minus infinity”.
Definition at line 474 of file global.h.
6.3.3.11 bool ABA_GLOBAL::equal (double x, double y) const [inline]
-
Returns:
-
true If the absolute difference of x and y is less than the machine dependent zero tolerance,
false otherwise.
-
Parameters:
-
-
x
- The first value being compared.
-
y
- The second value being compared.
Definition at line 484 of file global.h.
6.3.3.12 bool ABA_GLOBAL::isInteger (double x) const [inline]
-
Returns:
-
true If the value x differs at most by the machine dependent zero tolerance from an integer value,
false otherwise.
Definition at line 490 of file global.h.
6.3.3.13 bool ABA_GLOBAL::isInteger (double x, double eps) const
-
Returns:
-
true If the value x differs at most by eps from an integer value,
false otherwise.
6.3.3.14 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.
-
Returns:
-
The character read from the input stream.
-
Parameters:
-
-
in
- The input stream the character should be read from.
6.3.3.15 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.
-
Parameters:
-
-
fileName
- The name of the parameter file.
6.3.3.16 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.
-
Parameters:
-
-
name
- The name of the parameter.
-
value
- The literal value of the parameter.
6.3.3.17 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.
-
Returns:
-
0 If the parameter is found,
1 otherwise.
-
Parameters:
-
-
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.
6.3.3.18 int ABA_GLOBAL::getParameter (const char * name, unsigned int & param)
6.3.3.19 int ABA_GLOBAL::getParameter (const char * name, double & param)
6.3.3.20 int ABA_GLOBAL::getParameter (const char * name, ABA_STRING & param)
6.3.3.21 int ABA_GLOBAL::getParameter (const char * name, bool & param)
6.3.3.22 int ABA_GLOBAL::getParameter (const char * name, char & param)
6.3.3.23 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.
-
-
This function is overloaded in two ways. First, this function is defined for different types of the argument
parameter, second, for each such type we have both versions, with and without a default value of the parameter.
-
Parameters:
-
-
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.
6.3.3.24 void ABA_GLOBAL::assignParameter (unsigned & param, const char * name, unsigned minVal, unsigned
maxVal)
See ABA_GLOBAL::assignParameter} for description.
6.3.3.25 void ABA_GLOBAL::assignParameter (double & param, const char * name, double minVal, double
maxVal)
See ABA_GLOBAL::assignParameter} for description.
6.3.3.26 void ABA_GLOBAL::assignParameter (bool & param, const char * name)
See ABA_GLOBAL::assignParameter} for description.
6.3.3.27 void ABA_GLOBAL::assignParameter (ABA_STRING & param, const char * name, unsigned nFeasible = 0,
const char * feasible[ ] = 0)
See ABA_GLOBAL::assignParameter} for description.
-
Parameters:
-
-
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.
6.3.3.28 void ABA_GLOBAL::assignParameter (char & param, const char * name, const char * feasible =
0)
See ABA_GLOBAL::assignParameter} for description.
-
Parameters:
-
-
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.
6.3.3.29 void ABA_GLOBAL::assignParameter (int & param, const char * name, int minVal, int maxVal, int
defVal)
See ABA_GLOBAL::assignParameter} for description.
-
Parameters:
-
-
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.
6.3.3.30 void ABA_GLOBAL::assignParameter (unsigned & param, const char * name, unsigned minVal, unsigned
maxVal, unsigned defVal)
See ABA_GLOBAL::assignParameter} for description.
6.3.3.31 void ABA_GLOBAL::assignParameter (double & param, const char * name, double minVal, double maxVal,
double defVal)
See ABA_GLOBAL::assignParameter} for description.
6.3.3.32 void ABA_GLOBAL::assignParameter (bool & param, const char * name, bool defVal)
See ABA_GLOBAL::assignParameter} for description.
6.3.3.33 void ABA_GLOBAL::assignParameter (ABA_STRING & param, const char * name, unsigned nFeasible, const
char * feasible[ ], const char * defVal)
See ABA_GLOBAL::assignParameter} for description.
-
Parameters:
-
-
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.
6.3.3.34 void ABA_GLOBAL::assignParameter (char & param, const char * name, const char * feasible, char
defVal)
See ABA_GLOBAL::assignParameter} for description.
-
Parameters:
-
-
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.
6.3.3.35 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.
-
Returns:
-
The index of the matched feasible setting.
-
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.
6.3.3.36 int ABA_GLOBAL::findParameter (const char * name, unsigned nFeasible, const char * feasible[ ])
See ABA_GLOBAL::findParameter} for description.
6.3.3.37 int ABA_GLOBAL::findParameter (const char * name, const char * feasible)
See ABA_GLOBAL::findParameter} for description.
6.3.3.38 const ABA_GLOBAL& ABA_GLOBAL::operator= (const ABA_GLOBAL & rhs) [private]
6.3.4 Friends And Related Function Documentation
6.3.4.1 ostream& operator<< (ostream & out, const ABA_GLOBAL & rhs) [friend]
The output operator writes some of the data members to an ouput stream.
-
Returns:
-
A reference to the output stream.
-
Parameters:
-
-
out
- The output stream.
-
rhs
- The object being output.
6.3.5 Member Data Documentation
The global output stream.
Definition at line 403 of file global.h.
The global error stream.
Definition at line 407 of file global.h.
A zero tolerance.
Definition at line 411 of file global.h.
The machine dependent zero tolerance, which is used to , e.g., to test if a floating point value is 0.
This value is usually less than eps_, which represents, e.g., a safety tolerance if a constraint is violated.
Definition at line 419 of file global.h.
An “infinite” big number.
Definition at line 423 of file global.h.
A string used as tabulator in the functions out() and err().
Definition at line 427 of file global.h.
Definition at line 428 of file global.h.
The documentation for this class was generated from the following file: