Minotaur 0.4.1
Docs for developers
Public Member Functions | Protected Member Functions | Friends | List of all members
Minotaur::Variable Class Reference

#include <Variable.h>

Public Member Functions

 Variable ()
 Default constructor.
 
 Variable (UInt id, UInt index, double lb, double ub, VariableType vtype, std::string name)
 Construct a variable with an id, lb, ub, type and name.
 
virtual ~Variable ()
 Destroy.
 
VariablePtr clone (UInt id) const
 Create a copy.
 
UInt getId () const
 Get the unique id.
 
UInt getIndex () const
 
double getInitVal () const
 Get starting or initial value.
 
double getLb () const
 Get lowerbound.
 
double getUb () const
 Get upperbound.
 
VariableType getType () const
 Get the type (binary, integer, continuous).
 
FunctionType getFunType () const
 Get the function type of constraints that this variable is in.
 
VarSrcType getSrcType () const
 Get the type of origin of this variable.
 
VarState getState () const
 Get the state (fixed, deleted, ...).
 
UInt getNumCons () const
 
UInt getItmp () const
 
ConstrSet::iterator consBegin ()
 First iterator of constraints where this variable appears.
 
ConstrSet::iterator consEnd ()
 Last iterator of constraints where this variable appears.
 
const std::string getName () const
 Get name of the variable.
 
void setItmp (UInt itmp)
 
void write (std::ostream &out) const
 Write the full description of the variable including name, bounds, type etc.
 
void writeConstraintMap (std::ostream &out) const
 Write the list of constraints in which this variable occurs.
 

Protected Member Functions

void setFunType_ (FunctionType ftype)
 Change the function type to a new value.
 
void setId_ (UInt n)
 Change the id to a new value.
 
void setIndex_ (UInt n)
 Change the index to a new value.
 
void setInitVal_ (double val)
 Change starting value.
 
void setLb_ (double newLb)
 Change the lowerbound to a new value.
 
void setName_ (std::string newName)
 Change the name to a new value.
 
void setSrcType (VarSrcType stype)
 Change the type of the origin of this variable.
 
void setState_ (VarState state)
 Change the state to a new value.
 
void setType_ (VariableType vtype)
 Change the type to a new value.
 
void setUb_ (double newUb)
 Change the upperbound to a new value.
 
void outOfConstraint_ (ConstraintPtr cPtr)
 Remove the constraint from the list of constraints this variable belongs to.
 
void inConstraint_ (ConstraintPtr c)
 Add the constraint to the list of constraints this variable belongs to.
 
void clearConstraints_ ()
 Clear the list of constraints this variable belongs to.
 

Friends

class AnalyticalCenter
 
class Linearizations
 
class QGHandlerAdvance
 
class ParQGHandlerAdvance
 
class PerspCon
 
class Problem
 
class TransSep
 
class QGHandler
 
class OAHandler
 
class QuadHandler
 
class MultiSolHeur
 

Detailed Description

Variable class contains methods for defining and changing variables of a Problem. A variable has bounds (lb, ub), a type (binary, integer, continuous), a name, and an id which is unique for the variable and is usually generated by the Problem.

Member Function Documentation

◆ getIndex()

UInt Minotaur::Variable::getIndex ( ) const
inline

Many operations rely on arrays of values. index_ is the index of variable in such arrays. Thus x[index_] will give the value of this variable in an array x, provided x was populated that way (Most engines etc. will populate it on the basis of index_).

Friends And Related Function Documentation

◆ AnalyticalCenter

friend class AnalyticalCenter
friend

Following classes can modify a Variable. All modification methods are private.


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

Minotaur source code documented by Doxygen 1.9.4 on Thu Apr 24 2025