Sense of constraints.
More...
#include <ogdf/lib/abacus/csense.h>
|
static bool | ascii2bool (const string &str) |
| Converts the string str to a boolean value. More...
|
|
static bool | endsWith (const string &str, const string &end) |
| Returns true if str ends with end, false otherwise. More...
|
|
static double | fracPart (double x) |
| Returns the absolute value of the fractional part of x. More...
|
|
static const char * | onOff (bool value) |
| Converts a boolean variable to the strings "on" and "off". More...
|
|
Sense of constraints.
The most important objects in a cutting plane algorithm are constraints, which can be equations (Equal) or inequalities with the sense Less or Greater. We implement the sense of optimization as a class since we require it both in the classes Constraint and Row.
Definition at line 48 of file csense.h.
◆ SENSE
Enumerator |
---|
Less | |
Equal | |
Greater | |
Definition at line 51 of file csense.h.
◆ CSense() [1/3]
abacus::CSense::CSense |
( |
| ) |
|
|
inline |
Default constructor, sense is undefined.
Definition at line 54 of file csense.h.
◆ CSense() [2/3]
abacus::CSense::CSense |
( |
const SENSE |
s | ) |
|
|
inline |
Initializes the sense to s.
- Parameters
-
Definition at line 60 of file csense.h.
◆ CSense() [3/3]
abacus::CSense::CSense |
( |
char |
s | ) |
|
Initializes the sense of the constraint specified with a single letter.
- Parameters
-
s | A character representing the sense: E or e stand for Equal, G and g stand for Greater, and L or l stand for Less. |
◆ operator=()
Assignment operator.
The default assignment operator is overloaded such that also the enumeration SENSE can be used on the right hand side.
- Parameters
-
- Returns
- A reference to the sense.
Definition at line 91 of file csense.h.
◆ sense() [1/3]
SENSE abacus::CSense::sense |
( |
| ) |
const |
|
inline |
Returns the sense of the constraint.
Definition at line 97 of file csense.h.
◆ sense() [2/3]
void abacus::CSense::sense |
( |
char |
s | ) |
|
Changes the sense of the constraint given a letter s.
- Parameters
-
◆ sense() [3/3]
void abacus::CSense::sense |
( |
SENSE |
s | ) |
|
|
inline |
Changes the sense of the constraint.
- Parameters
-
Definition at line 103 of file csense.h.
◆ operator<<
std::ostream& operator<< |
( |
std::ostream & |
out, |
|
|
const CSense & |
rhs |
|
) |
| |
|
friend |
Output operator for constraint senses.
The output operator writes the sense on an output stream in the form <=, =, or >=.
- Parameters
-
out | The output stream. |
rhs | The sense being output. |
- Returns
- The output stream.
◆ sense_
SENSE abacus::CSense::sense_ |
|
private |
Stores the sense of a constraint.
Definition at line 113 of file csense.h.
The documentation for this class was generated from the following file: