idol
A C++ Framework for Optimization
Loading...
Searching...
No Matches
idol::TempVar Class Reference

#include <TempVar.h>

Collaboration diagram for idol::TempVar:
Collaboration graph

Public Member Functions

 TempVar ()=default
 
 TempVar (double t_lb, double t_ub, VarType t_type, double t_obj, LinExpr< Ctr > &&t_column)
 
 TempVar (TempVar &&t_src)=default
 
 TempVar (const TempVar &t_src)
 
TempVaroperator= (TempVar &&t_src)=default
 
TempVaroperator= (const TempVar &t_src)=default
 
const LinExpr< Ctr > & column () const
 
LinExpr< Ctr > & column ()
 
double lb () const
 
void set_lb (double t_lb)
 
double ub () const
 
void set_ub (double t_ub)
 
VarType type () const
 
void set_type (VarType t_type)
 
double obj () const
 
void set_obj (double t_obj)
 

Detailed Description

Temporary variable class.

This class represents a variable which has not been built yet by a Model. It contains all the arguments needed to create a real variable as instantiated by the Var class. It is made of a lower and an upper bound, a type (see VarType), and a column (see Column).

Example 1:

model.add_var(0., 1., Binary, 2.);
// is the same as
model.add_var(TempVar(0., 1., Binary, 2.));
TempVar()=default

Definition at line 31 of file TempVar.h.

Constructor & Destructor Documentation

◆ TempVar() [1/4]

idol::TempVar::TempVar ( )
default

Default constructor.

Creates a new temporary variable. The default lower and upper bounds are 0 and Inf and the type is Continuous.

◆ TempVar() [2/4]

idol::TempVar::TempVar ( double  t_lb,
double  t_ub,
VarType  t_type,
double  t_obj,
LinExpr< Ctr > &&  t_column 
)
inline

Constructor.

Creates a new temporary variable.

Parameters
t_lbThe desired lower bound.
t_ubThe desired upper bound.
t_typeThe desired variable type.
t_columnThe desired column.

Definition at line 54 of file TempVar.h.

◆ TempVar() [3/4]

idol::TempVar::TempVar ( TempVar &&  t_src)
default

Copy constructor.

Parameters
t_srcThe object to copy.

◆ TempVar() [4/4]

idol::TempVar::TempVar ( const TempVar t_src)
inline

Move constructor.

Parameters
t_srcThe object to move.

Definition at line 66 of file TempVar.h.

Member Function Documentation

◆ column() [1/2]

LinExpr< Ctr > & idol::TempVar::column ( )
inline

Returns the column of the temporary variable (see Column).

Returns
The column of the temporary variable.

Definition at line 90 of file TempVar.h.

◆ column() [2/2]

const LinExpr< Ctr > & idol::TempVar::column ( ) const
inline

Returns the column of the temporary variable (see Column).

Returns
The column of the temporary variable.

Definition at line 84 of file TempVar.h.

◆ lb()

double idol::TempVar::lb ( ) const
inline

Returns the lower bound of the temporary variable.

Returns
The lower bound of the temporary variable.

Definition at line 96 of file TempVar.h.

◆ obj()

double idol::TempVar::obj ( ) const
inline

Definition at line 133 of file TempVar.h.

◆ operator=() [1/2]

TempVar & idol::TempVar::operator= ( const TempVar t_src)
default

Move-assignment operator.

Parameters
t_srcThe object to move.

◆ operator=() [2/2]

TempVar & idol::TempVar::operator= ( TempVar &&  t_src)
default

Copy-assignment operator.

Parameters
t_srcThe object to copy.

◆ set_lb()

void idol::TempVar::set_lb ( double  t_lb)
inline

Sets the lower bound of the temporary variable.

Parameters
t_lbThe desired lower bound of the temporary variable.

Definition at line 102 of file TempVar.h.

◆ set_obj()

void idol::TempVar::set_obj ( double  t_obj)
inline

Definition at line 135 of file TempVar.h.

◆ set_type()

void idol::TempVar::set_type ( VarType  t_type)
inline

Sets the type of the temporary variable.

Parameters
t_typeThe desired type of the temporary variable.

Definition at line 126 of file TempVar.h.

◆ set_ub()

void idol::TempVar::set_ub ( double  t_ub)
inline

Sets the upper bound of the temporary variable.

Parameters
t_ubThe desired upper bound of the temporary variable.

Definition at line 114 of file TempVar.h.

◆ type()

VarType idol::TempVar::type ( ) const
inline

Returns the type of the temporary variable.

Returns
The type of the temporary variable.

Definition at line 120 of file TempVar.h.

◆ ub()

double idol::TempVar::ub ( ) const
inline

Returns the upper bound of the temporary variable.

Returns
The upper bound of the temporary variable.

Definition at line 108 of file TempVar.h.