Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

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

Variables identified by a number. More...

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

+ Inheritance diagram for abacus::NumVar:

Public Member Functions

 NumVar (Master *master, const Sub *sub, int number, bool dynamic, bool local, double obj, double lBound, double uBound, VarType::TYPE type)
 The constructor.
 
virtual ~NumVar ()
 The destructor.
 
int number () const
 Returns the number of the variable.
 
- Public Member Functions inherited from abacus::Variable
 Variable (Master *master, const Sub *sub, bool dynamic, bool local, double obj, double lBound, double uBound, VarType::TYPE type)
 Initializes a variable.
 
virtual ~Variable ()
 
bool binary () const
 Returns true If the type of the variable is Binary, false otherwise.
 
virtual double coeff (const Constraint *con) const
 Computes the coefficient of the variable in the constraint con.
 
bool discrete () const
 Returns true if the type of the variable is Integer or Binary, false otherwise.
 
FSVarStatfsVarStat ()
 
const FSVarStatfsVarStat () const
 
virtual int genColumn (Active< Constraint, Variable > *actCon, Column &col) const
 Computes the column col of the variable associated with the active constraints *actCon.
 
bool integer () const
 Returns true If the type of the variable is Integer, false otherwise.
 
double lBound () const
 Returns the lower bound of the variable.
 
void lBound (double newBound)
 Sets the lower bound of the variable to newBound.
 
virtual double obj () const
 Returns the objective function coefficient.
 
void printCol (std::ostream &out, Active< Constraint, Variable > *constraints) const
 Writes the column of the variable corresponding to the constraints to output stream out.
 
virtual double redCost (Active< Constraint, Variable > *actCon, double *y) const
 Computes the reduced cost of the variable corresponding the constraint set actCon and the dual variables y.
 
double uBound () const
 Returns the upper bound of the variable.
 
void uBound (double newBound)
 Sets the upper bound of the variable to newBound.
 
virtual bool useful (Active< Constraint, Variable > *actCon, double *y, double lpVal) const
 Returns whether an (inactive) discrete variable is useful.
 
virtual bool valid (const Sub *sub) const
 Returns true if the variable is valid, false otherwise.
 
VarType::TYPE varType () const
 Returns the type of the variable.
 
virtual bool violated (Active< Constraint, Variable > *constraints, double *y, double *slack=nullptr) const
 Checks, if a variable does not price out correctly.
 
virtual bool violated (double rc) const
 Checks, if a variable does not price out correctly.
 
- Public Member Functions inherited from abacus::ConVar
 ConVar (Master *master, const Sub *sub, bool dynamic, bool local)
 Creates an instance of type ConVar.
 
virtual ~ConVar ()
 
bool active () const
 Checks if the constraint/variable is active in at least one active subproblem.
 
virtual bool dynamic () const
 Return true if the constraint/variable is dynamic.
 
virtual bool equal (const ConVar *cv) const
 Should compare if the constraint/variable is identical (in a mathematical sense) with the constraint/variable cv.
 
bool global () const
 Returns true if the constraint/variable is globally valid, false otherwise.
 
virtual unsigned hashKey () const
 Should provide a key for the constraint/variable that can be used to insert it into a hash table.
 
bool local () const
 Returns true if the constraint/variable is only locally valid, false otherwise.
 
virtual const charname () const
 Should return the name of the constraint/variable.
 
virtual void print (std::ostream &out) const
 Writes the constraint/variable to the output stream out.
 
virtual double rank () const
 The function should return a rank associated with the constraint/variable.
 
const Subsub () const
 Returns a const pointer to the subproblem associated with the constraint/variable.
 
void sub (Sub *sub)
 Associates a new subproblem with the constraint/variable.
 
bool expanded () const
 Returns true if the expanded format of a constraint/variable is available, false otherwise.
 
virtual void expand () const
 Expands a constraint/variable.
 
virtual void compress () const
 Compresses a constraint/variable.
 
virtual bool deletable () const
 Returns true if the constraint/variable can be destructed.
 
- Public Member Functions inherited from abacus::AbacusRoot
virtual ~AbacusRoot ()
 The destructor.
 

Protected Attributes

int number_
 The identification number of the variable.
 
- Protected Attributes inherited from abacus::Variable
FSVarStat fsVarStat_
 The global status of fixing and setting of the variable.
 
double lBound_
 The lower bound of the variable.
 
double obj_
 The objective function coefficient of the variable.
 
VarType type_
 The type of the variable.
 
double uBound_
 The upper bound of the variable.
 
- Protected Attributes inherited from abacus::ConVar
bool dynamic_
 If this member is true then the constraint/variable can be also removed from the active formulation after it is added the first time.
 
bool expanded_
 true, if expanded version of constraint/variables available.
 
bool local_
 true if the constraint/variable is only locally valid
 
Mastermaster_
 A pointer to the corresponding master of the optimization.
 
int nActive_
 The number of active subproblems of which the constraint/variable belongs to the set of active constraints/variables.
 
int nLocks_
 The number of locks which have been set on the constraint/variable.
 
int nReferences_
 The number of references to the pool slot the constraint is stored in.
 
const Subsub_
 A pointer to the subproblem associated with the constraint/variable.
 

Friends

std::ostream & operator<< (std::ostream &out, const NumVar &rhs)
 Writes the number of the variable to an output stream.
 

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

Variables identified by a number.

This class is derived from the class Variable and implements a variable which is uniquely defined by a number.

Definition at line 42 of file numvar.h.

Constructor & Destructor Documentation

◆ NumVar()

abacus::NumVar::NumVar ( Master master,
const Sub sub,
int  number,
bool  dynamic,
bool  local,
double  obj,
double  lBound,
double  uBound,
VarType::TYPE  type 
)
inline

The constructor.

Parameters
masterA pointer to the corresponding master of the optimization.
subA pointer to the subproblem associated with variable. This can also be the 0-pointer.
numberThe number of the column associated with the variable.
dynamicIf this argument is true, then the variable can also be removed again from the set of active variables after it is added once.
localIf this argument is true, then the variable is only locally valid, otherwise it is globally valid. As a locally valid variable is associated with a subproblem, sub must not be 0, if local is true.
objThe objective function coefficient of the variable.
lBoundThe lower bound of the variable.
uBoundThe upper Bound of the variable.
typeThe type of the variable.

Definition at line 63 of file numvar.h.

◆ ~NumVar()

virtual abacus::NumVar::~NumVar ( )
inlinevirtual

The destructor.

Definition at line 76 of file numvar.h.

Member Function Documentation

◆ number()

int abacus::NumVar::number ( ) const
inline

Returns the number of the variable.

Definition at line 90 of file numvar.h.

Friends And Related Symbol Documentation

◆ operator<<

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

Writes the number of the variable to an output stream.

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

Definition at line 85 of file numvar.h.

Member Data Documentation

◆ number_

int abacus::NumVar::number_
protected

The identification number of the variable.

Definition at line 95 of file numvar.h.


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