Column
-
class Column : public idol::impl::Column
Column modeling-old object.
This class is used to represent an optimization model’s column. It is made of an objective coefficient and a set of
{ Ctr, Constant }
pairs representing the coefficient (Constant
) of the column in each row (Ctr
). Such pairs are called components.Public Functions
-
Column() = default
Default constructor.
Creates an empty column.
-
inline Column(Constant &&t_obj)
Constructor.
Creates a new column with no components and on objective coefficient equal to
t_obj
- Parameters:
t_obj – The objective coefficient
-
inline Column(const Constant &t_obj)
Constructor.
Creates a new column with no components and on objective coefficient equal to
t_obj
- Parameters:
t_obj – The objective coefficient
-
Column(const Column &t_src) = default
Copy constructor.
- Parameters:
t_src – The object to be copied
-
Column(Column &&t_src) noexcept = default
Move constructor.
- Parameters:
t_src – The object to be moved
-
Column &operator=(const Column &t_src) = default
Copy-assignment operator
- Parameters:
t_src – The object to copy
- Returns:
*this
-
Column &operator=(Column &&t_src) noexcept = default
Move-assignment operator
- Parameters:
t_src – The object to move
- Returns:
*this
-
Column fix(const Solution::Primal &t_primals) const
Creates a new column in which all
Param
in eachConstant
are replaced by their corresponding values int_primals
- Parameters:
t_primals – the primal values for the parameters.
- Returns:
the new column.
-
inline Constant &obj()
Returns the (linear) objective coefficient of the column.
For instance, a model’s variable
x
with column whose objective is2
implies that the model has a term in the objective function which is2 * x
.- Returns:
The (linear) objective coefficient of the column
-
inline const Constant &obj() const
Returns the (linear) objective coefficient of the column. For instance, a model’s variable
x
with column whose objective is2
implies that the model has a term in the objective function which is2 * x
.- Returns:
The (linear) objective coefficient of the column
-
inline ::idol::LinExpr<Var> &obj_quadratic()
Returns the (quadratic) objective coefficient of the column.
For instance, a model’s variable
x
with column whose objective is2 * y
implies that the model has a term in the objective function which is2 * y * x
.- Returns:
The (quadratic) objective coefficient of the column
-
inline const ::idol::LinExpr<Var> &obj_quadratic() const
Returns the (quadratic) objective coefficient of the column.
For instance, a model’s variable
x
with column whose objective is2 * y
implies that the model has a term in the objective function which is2 * y * x
.- Returns:
The (quadratic) objective coefficient of the column
-
inline LinExpr<Ctr> &linear()
Returns the (linear) components of the column.
For instance, a model’s variable
x
with a column having a component{ constraint, 2 }
implies that the model has a constraintconstraint
with a term2 * x
.- Returns:
The (linear) components of the column.
-
inline const LinExpr<Ctr> &linear() const
Returns the (linear) components of the column.
For instance, a model’s variable
x
with a column having a component{ constraint, 2 }
implies that the model has a constraintconstraint
with a term2 * x
.- Returns:
The (linear) components of the column.
-
inline QuadExpr<Ctr, Var> &quadratic()
Returns the (quadratic) components of the column.
For instance, a model’s variable
x
with a column having a component{ constraint, 2 * y }
implies that the model has a constraintconstraint
with a term2 * y * x
.- Returns:
The (quadratic) components of the column.
-
inline const QuadExpr<Ctr, Var> &quadratic() const
Returns the (quadratic) components of the column.
For instance, a model’s variable
x
with a column having a component{ constraint, 2 * y }
implies that the model has a constraintconstraint
with a term2 * y * x
.- Returns:
The (quadratic) components of the column.
-
inline void set_linear(LinExpr<Ctr> &&t_lin_expr)
Sets the (linear) components of the column.
- Parameters:
t_lin_expr – The (linear) components of the column
-
inline void set_linear(const LinExpr<Ctr> &t_lin_expr)
Sets the (linear) components of the column.
- Parameters:
t_lin_expr – The (linear) components of the column
-
inline void set_quadratic(QuadExpr<Ctr, Var> &&t_quad_expr)
Sets the (quadratic) components of the column.
- Parameters:
t_lin_expr – The (quadratic) components of the column
-
inline void set_quadratic(const QuadExpr<Ctr, Var> &t_quad_expr)
Sets the (quadratic) components of the column.
- Parameters:
t_lin_expr – The (quadratic) components of the column
-
inline void set_obj(Constant &&t_obj)
Sets the (linear) objective coefficient.
- Parameters:
t_obj – The (linear) objective coefficient
-
inline void set_obj(const Constant &t_obj)
Sets the (linear) objective coefficient.
- Parameters:
t_obj – The (linear) objective coefficient
-
inline Column &operator+=(const Column &t_rhs)
Adds the objective and components of
t_rhs
to the objective and components of the column.- Parameters:
t_rhs – the right hand-side
- Returns:
*this
-
Column() = default