Open
Graph Drawing
Framework

 v. 2020.02 (Catalpa)
 

abacus::CSense Class Reference

Sense of constraints. More...

#include <ogdf/lib/abacus/csense.h>

+ Inheritance diagram for abacus::CSense:

Public Types

enum  SENSE { Less, Equal, Greater }
 

Public Member Functions

 CSense ()
 Default constructor, sense is undefined. More...
 
 CSense (const SENSE s)
 Initializes the sense to s. More...
 
 CSense (char s)
 Initializes the sense of the constraint specified with a single letter. More...
 
const CSense & operator= (SENSE rhs)
 Assignment operator. More...
 
SENSE sense () const
 Returns the sense of the constraint. More...
 
void sense (SENSE s)
 Changes the sense of the constraint. More...
 
void sense (char s)
 Changes the sense of the constraint given a letter s. More...
 
- Public Member Functions inherited from abacus::AbacusRoot
virtual ~AbacusRoot ()
 The destructor. More...
 

Private Attributes

SENSE sense_
 Stores the sense of a constraint. More...
 

Friends

std::ostream & operator<< (std::ostream &out, const CSense &rhs)
 Output operator for constraint senses. More...
 

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. 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...
 

Detailed Description

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.

Member Enumeration Documentation

◆ SENSE

Enumerator
Less 
Equal 
Greater 

Definition at line 51 of file csense.h.

Constructor & Destructor Documentation

◆ 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
sThe sense.

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
sA character representing the sense: E or e stand for Equal, G and g stand for Greater, and L or l stand for Less.

Member Function Documentation

◆ operator=()

const CSense& abacus::CSense::operator= ( SENSE  rhs)
inline

Assignment operator.

The default assignment operator is overloaded such that also the enumeration SENSE can be used on the right hand side.

Parameters
rhsThe new sense.
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 ( SENSE  s)
inline

Changes the sense of the constraint.

Parameters
sThe new sense.

Definition at line 103 of file csense.h.

◆ sense() [3/3]

void abacus::CSense::sense ( char  s)

Changes the sense of the constraint given a letter s.

Parameters
sThe new sense.

Friends And Related Function Documentation

◆ 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
outThe output stream.
rhsThe sense being output.
Returns
The output stream.

Member Data Documentation

◆ 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: