Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
abacus::LpSolution< BaseType, CoType > Class Template Reference

LP solutions. More...

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

+ Inheritance diagram for abacus::LpSolution< BaseType, CoType >:

Public Member Functions

 LpSolution (const LpSolution< BaseType, CoType > &rhs)
 The copy constructor.
 
 LpSolution (Master *master)
 The constructor.
 
 LpSolution (Sub *sub, bool primalVariables, Active< BaseType, CoType > *active)
 The constructor.
 
 ~LpSolution ()
 The destructor.
 
Active< BaseType, CoType > * active ()
 Returns the active variables/constraints.
 
int idLp () const
 Returns the Id of the LP in which the LP solution was generated.
 
int idSub () const
 Returns the Id of the subproblem in which the LP solution was generated.
 
int nVarCon () const
 Returns the number of variables (if BaseType is Variable) or the number of constraints (if BaseType is Constraint).
 
doublezVal ()
 Returns the primal/dual variables of the LP solution.
 
const doublezVal () const
 Returns the primal/dual variables of the LP solution.
 
- Public Member Functions inherited from abacus::AbacusRoot
virtual ~AbacusRoot ()
 The destructor.
 

Protected Attributes

Active< BaseType, CoType > * active_
 The active variables/constraints.
 
int idLp_
 The Id of the LP in which the LP solution was generated.
 
int idSub_
 The Id of the subproblem in which the LP solution was generated.
 
Mastermaster_
 A pointer to the corresponding master of the optimization.
 
int nVarCon_
 The number of variables/constraints.
 
Array< doublezVal_
 The primal/dual variables of the LP solution.
 

Private Member Functions

const LpSolution< BaseType, CoType > & operator= (const LpSolution< BaseType, CoType > &rhs)
 

Friends

std::ostream & operator<< (std::ostream &out, const LpSolution< BaseType, CoType > &rhs)
 The output operator writes the lpsolution to an output stream.
 
class Separator< CoType, BaseType >
 

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

template<class BaseType, class CoType>
class abacus::LpSolution< BaseType, CoType >

LP solutions.

This template class implements an LP solution. This class is necessary when using the class Separator for separation.

If constraints are to be generated in the separation then the BaseType must be Variable and the CoType must be Constraint. In this case an objects of that class stores the primal variables of a linear program. Otherwise, if variables are to be generated, then BaseType must be Constraint and the CoType must be Variable. In this case an objects of that class stores the dual variables of a linear program.

Definition at line 64 of file lpsolution.h.

Constructor & Destructor Documentation

◆ LpSolution() [1/3]

template<class BaseType , class CoType >
abacus::LpSolution< BaseType, CoType >::LpSolution ( Sub sub,
bool  primalVariables,
Active< BaseType, CoType > *  active 
)

The constructor.

Parameters
subA pointer to the subproblem in which the LP solution is generated.
primalVariablesTrue if LpSolution contains the primal variables. In this case BaseType must be Variable. If primaVariables is false, then BaseType must be Constraint.
activeThe active variables/constraints that are associated with the LP solution. The default argument is 0. Then the set of active variables/constraints is not stored, but is assumed to be fixed and known.

◆ LpSolution() [2/3]

template<class BaseType , class CoType >
abacus::LpSolution< BaseType, CoType >::LpSolution ( Master master)

The constructor.

Parameters
masterA pointer to Master.

◆ LpSolution() [3/3]

The copy constructor.

Parameters
rhsThe LP solution that is copied.

◆ ~LpSolution()

The destructor.

Member Function Documentation

◆ active()

Returns the active variables/constraints.

◆ idLp()

template<class BaseType , class CoType >
int abacus::LpSolution< BaseType, CoType >::idLp ( ) const

Returns the Id of the LP in which the LP solution was generated.

◆ idSub()

template<class BaseType , class CoType >
int abacus::LpSolution< BaseType, CoType >::idSub ( ) const

Returns the Id of the subproblem in which the LP solution was generated.

◆ nVarCon()

template<class BaseType , class CoType >
int abacus::LpSolution< BaseType, CoType >::nVarCon ( ) const

Returns the number of variables (if BaseType is Variable) or the number of constraints (if BaseType is Constraint).

◆ operator=()

◆ zVal() [1/2]

Returns the primal/dual variables of the LP solution.

◆ zVal() [2/2]

template<class BaseType , class CoType >
const double * abacus::LpSolution< BaseType, CoType >::zVal ( ) const

Returns the primal/dual variables of the LP solution.

Friends And Related Symbol Documentation

◆ operator<<

template<class BaseType , class CoType >
std::ostream & operator<< ( std::ostream &  out,
const LpSolution< BaseType, CoType > &  rhs 
)
friend

The output operator writes the lpsolution to an output stream.

Parameters
outThe output stream.
rhsThe lpsolution being output.
Returns
A reference to the output stream.

◆ Separator< CoType, BaseType >

Definition at line 46 of file lpsolution.h.

Member Data Documentation

◆ active_

The active variables/constraints.

Definition at line 133 of file lpsolution.h.

◆ idLp_

template<class BaseType , class CoType >
int abacus::LpSolution< BaseType, CoType >::idLp_
protected

The Id of the LP in which the LP solution was generated.

Definition at line 130 of file lpsolution.h.

◆ idSub_

template<class BaseType , class CoType >
int abacus::LpSolution< BaseType, CoType >::idSub_
protected

The Id of the subproblem in which the LP solution was generated.

Definition at line 129 of file lpsolution.h.

◆ master_

template<class BaseType , class CoType >
Master* abacus::LpSolution< BaseType, CoType >::master_
protected

A pointer to the corresponding master of the optimization.

Definition at line 126 of file lpsolution.h.

◆ nVarCon_

template<class BaseType , class CoType >
int abacus::LpSolution< BaseType, CoType >::nVarCon_
protected

The number of variables/constraints.

Definition at line 128 of file lpsolution.h.

◆ zVal_

template<class BaseType , class CoType >
Array<double> abacus::LpSolution< BaseType, CoType >::zVal_
protected

The primal/dual variables of the LP solution.

Definition at line 132 of file lpsolution.h.


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