Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
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.
 
 CSense (char s)
 Initializes the sense of the constraint specified with a single letter.
 
 CSense (const SENSE s)
 Initializes the sense to s.
 
const CSenseoperator= (SENSE rhs)
 Assignment operator.
 
SENSE sense () const
 Returns the sense of the constraint.
 
void sense (char s)
 Changes the sense of the constraint given a letter s.
 
void sense (SENSE s)
 Changes the sense of the constraint.
 
- Public Member Functions inherited from abacus::AbacusRoot
virtual ~AbacusRoot ()
 The destructor.
 

Private Attributes

SENSE sense_
 Stores the sense of a constraint.
 

Friends

std::ostream & operator<< (std::ostream &out, const CSense &rhs)
 Output operator for constraint 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 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 ( char  s)

Changes the sense of the constraint given a letter s.

Parameters
sThe new sense.

◆ sense() [3/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.

Friends And Related Symbol 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: