Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
abacus::OptSense Class Reference

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 charonOff (bool value)
 Converts a boolean variable to the strings "on" and "off".
 

Detailed Description

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 44 of file optsense.h.

Member Enumeration Documentation

◆ SENSE

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 48 of file optsense.h.

Constructor & Destructor Documentation

◆ OptSense()

abacus::OptSense::OptSense ( SENSE  s = Unknown)
inline

Initializes the optimization sense tos.

Parameters
sThe sense of the optimization. The default value is Unknown.

Definition at line 58 of file optsense.h.

Member Function Documentation

◆ max()

bool abacus::OptSense::max ( ) const
inline

Returns true if it is maximization problem,, false otherwise.

Definition at line 90 of file optsense.h.

◆ min()

bool abacus::OptSense::min ( ) const
inline

Returns true If it is minimization problem,, false otherwise.

Definition at line 84 of file optsense.h.

◆ sense() [1/2]

SENSE abacus::OptSense::sense ( ) const
inline

Returns the sense of the optimization.

Definition at line 80 of file optsense.h.

◆ sense() [2/2]

void abacus::OptSense::sense ( SENSE  s)
inline

Sets the optimization sense to s.

Parameters
sThe new sense of the optimization.

Definition at line 76 of file optsense.h.

◆ unknown()

bool abacus::OptSense::unknown ( ) const
inline

Returns true if the optimization sense is unknown,, false otherwise.

Definition at line 96 of file optsense.h.

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  out,
const OptSense rhs 
)
friend

Output operator for optimization senses.

The output operator writes the optimization sense on an output stream in the form maximize, minimize, or unknown.

Parameters
outThe output stream.
rhsThe sense being output.
Returns
The output stream.

Member Data Documentation

◆ sense_

SENSE abacus::OptSense::sense_
private

The optimization sense.

Definition at line 102 of file optsense.h.


The documentation for this class was generated from the following file: