Sense of optimization. More...
#include <ogdf/lib/abacus/optsense.h>
Inheritance diagram for abacus::OptSense:Public Types | |
| enum | SENSE { Min , Max , Unknown } |
| The enumeration defining the sense of optimization. More... | |
Public Member Functions | |
| OptSense (SENSE s=Unknown) | |
| Initializes the optimization sense tos. | |
| bool | max () const |
| Returns true if it is maximization problem,, false otherwise. | |
| bool | min () const |
| Returns true If it is minimization problem,, false otherwise. | |
| SENSE | sense () const |
| Returns the sense of the optimization. | |
| void | sense (SENSE s) |
| Sets the optimization sense to s. | |
| bool | unknown () const |
| Returns true if the optimization sense is unknown,, false otherwise. | |
Public Member Functions inherited from abacus::AbacusRoot | |
| virtual | ~AbacusRoot () |
| The destructor. | |
Private Attributes | |
| SENSE | sense_ |
| The optimization sense. | |
Friends | |
| std::ostream & | operator<< (std::ostream &out, const OptSense &rhs) |
| Output operator for optimization senses. | |
Additional Inherited Members | |
Static Public Member Functions inherited from abacus::AbacusRoot | |
| static bool | ascii2bool (const string &str) |
| Converts the string str to a boolean value. | |
| static bool | endsWith (const string &str, const string &end) |
| Returns true if str ends with end, false otherwise. | |
| static double | fracPart (double x) |
| Returns the absolute value of the fractional part of x. | |
| static const char * | onOff (bool value) |
| Converts a boolean variable to the strings "on" and "off". | |
Sense of optimization.
We can either minimize or maximize the objective function. We encapsulate this information in a class since it is required in various classes, e.g., in the master of the branch-and-bound algorithm and in the linear program.
Definition at line 45 of file optsense.h.
The enumeration defining the sense of optimization.
| Enumerator | |
|---|---|
| Min | Minimization problem. |
| Max | Maximization problem. |
| Unknown | Unknown optimization sense, required to recognize uninitialized object. |
Definition at line 49 of file optsense.h.
Initializes the optimization sense tos.
| s | The sense of the optimization. The default value is Unknown. |
Definition at line 59 of file optsense.h.
|
inline |
Returns true if it is maximization problem,, false otherwise.
Definition at line 91 of file optsense.h.
|
inline |
Returns true If it is minimization problem,, false otherwise.
Definition at line 85 of file optsense.h.
|
inline |
Returns the sense of the optimization.
Definition at line 81 of file optsense.h.
|
inline |
Sets the optimization sense to s.
| s | The new sense of the optimization. |
Definition at line 77 of file optsense.h.
|
inline |
Returns true if the optimization sense is unknown,, false otherwise.
Definition at line 97 of file optsense.h.
|
friend |
Output operator for optimization senses.
The output operator writes the optimization sense on an output stream in the form maximize, minimize, or unknown.
| out | The output stream. |
| rhs | The sense being output. |
|
private |
The optimization sense.
Definition at line 103 of file optsense.h.