Open
Graph Drawing
Framework

 v. 2022.02 (Dogwood)
 

abacus::LpSolution< BaseType, CoType > Class Template Reference

LP solutions. More...

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

Public Member Functions

 LpSolution (const LpSolution< BaseType, CoType > &rhs)
 The copy constructor. More...
 
 LpSolution (Master *master)
 The constructor. More...
 
 LpSolution (Sub *sub, bool primalVariables, Active< BaseType, CoType > *active)
 The constructor. More...
 
 ~LpSolution ()
 The destructor. More...
 
Active< BaseType, CoType > * active ()
 Returns the active variables/constraints. More...
 
int idLp () const
 Returns the Id of the LP in which the LP solution was generated. More...
 
int idSub () const
 Returns the Id of the subproblem in which the LP solution was generated. More...
 
int nVarCon () const
 Returns the number of variables (if BaseType is Variable) or the number of constraints (if BaseType is Constraint). More...
 
double * zVal ()
 Returns the primal/dual variables of the LP solution. More...
 
const double * zVal () const
 Returns the primal/dual variables of the LP solution. More...
 

Protected Attributes

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

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. More...
 
class Separator< CoType, BaseType >
 

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 43 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]

template<class BaseType , class CoType >
abacus::LpSolution< BaseType, CoType >::LpSolution ( const LpSolution< BaseType, CoType > &  rhs)

The copy constructor.

Parameters
rhsThe LP solution that is copied.

◆ ~LpSolution()

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

The destructor.

Member Function Documentation

◆ active()

template<class BaseType , class CoType >
Active<BaseType, CoType>* abacus::LpSolution< BaseType, CoType >::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=()

template<class BaseType , class CoType >
const LpSolution<BaseType, CoType>& abacus::LpSolution< BaseType, CoType >::operator= ( const LpSolution< BaseType, CoType > &  rhs)
private

◆ zVal() [1/2]

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

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

template<class BaseType , class CoType >
friend class Separator< CoType, BaseType >
friend

Definition at line 66 of file lpsolution.h.

Member Data Documentation

◆ active_

template<class BaseType , class CoType >
Active<BaseType, CoType>* abacus::LpSolution< BaseType, CoType >::active_
protected

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: