\( \newcommand{\E}{\mathrm{E}} \) \( \newcommand{\A}{\mathrm{A}} \) \( \newcommand{\R}{\mathrm{R}} \) \( \newcommand{\N}{\mathrm{N}} \) \( \newcommand{\Q}{\mathrm{Q}} \) \( \newcommand{\Z}{\mathrm{Z}} \) \( \def\ccSum #1#2#3{ \sum_{#1}^{#2}{#3} } \def\ccProd #1#2#3{ \sum_{#1}^{#2}{#3} }\)
CGAL 5.0.4 - CGAL and Solvers
MixedIntegerProgramLinearObjective Concept Reference

Definition

MixedIntegerProgramLinearObjective is a concept of the linear objective function in a Mixed Integer Programming (MIP) problem.

Has Models:
CGAL::Linear_objective<FT>

Types

enum  Sense { MINIMIZE, MAXIMIZE, UNDEFINED }
 The objective sense (i.e., optimization direction). More...
 

Creation

 MixedIntegerProgramLinearObjective (MixedIntegerProgramTraits *solver, Sense sense)
 Constructs a linear objective, initialized with the solver it belongs to and the objective sense.
 

Operations

void set_sense (Sense sense)
 Sets the objective sense.
 
Sense sense () const
 Gets the objective sense.
 
void set_coefficients (const std::unordered_map< const MixedIntegerProgramVariable *, FT > &coeffs)
 Sets the coefficients of the constraint.
 
void add_coefficient (const MixedIntegerProgramVariable *var, FT coeff)
 Adds a coefficient to a variable of the constraint.
 
const std::unordered_map< const MixedIntegerProgramVariable *, FT > & coefficients () const
 Returns the coefficients of the constraint.
 
FT get_coefficient (const MixedIntegerProgramVariable *var) const
 Gets the coefficient of the variable in this constraint.
 
void set_offset (FT value)
 Sets the constant term.
 
FT offset () const
 Gets the constant term.
 
void clear ()
 Clears the objective (i.e., removes all variables, resets the objective sense to UNDEFINED). More...
 

Member Enumeration Documentation

◆ Sense

template<typename FT >
enum MixedIntegerProgramLinearObjective::Sense

The objective sense (i.e., optimization direction).

Enumerator
MINIMIZE 
MAXIMIZE 
UNDEFINED 

Member Function Documentation

◆ clear()

template<typename FT >
void MixedIntegerProgramLinearObjective< FT >::clear ( )

Clears the objective (i.e., removes all variables, resets the objective sense to UNDEFINED).

Useful to reuse the object to define a new linear objective.