idol
A C++ Framework for Optimization
Loading...
Searching...
No Matches
idol::Optimizers::GLPK Class Reference
Inheritance diagram for idol::Optimizers::GLPK:
Inheritance graph
Collaboration diagram for idol::Optimizers::GLPK:
Collaboration graph

Public Member Functions

 GLPK (const Model &t_model, bool t_continuous_relaxation)
 
std::string name () const override
 
void set_param_time_limit (double t_time_limit) override
 
void set_param_best_obj_stop (double t_best_obj_stop) override
 
void set_param_best_bound_stop (double t_best_bound_stop) override
 
void set_param_presolve (bool t_value) override
 
void set_param_logs (bool t_value) override
 
int & operator[] (const Var &t_var)
 
const int & operator[] (const Var &t_var) const
 
int & operator[] (const Ctr &t_ctr)
 
const int & operator[] (const Ctr &t_ctr) const
 

Static Public Member Functions

static Model read_from_file (Env &t_env, const std::string &t_filename)
 

Protected Member Functions

void hook_build () override
 
void hook_optimize () override
 
void hook_write (const std::string &t_name) override
 
int hook_add (const Var &t_var, bool t_add_column) override
 
int hook_add (const Ctr &t_ctr) override
 
int hook_add (const QCtr &t_ctr) override
 
int hook_add (const SOSCtr &t_ctr) override
 
void hook_update_objective_sense () override
 
void hook_update_matrix (const Ctr &t_ctr, const Var &t_var, double t_constant) override
 
void hook_update () override
 
void hook_update (const Var &t_var) override
 
void hook_update (const Ctr &t_ctr) override
 
void hook_update_objective () override
 
void hook_update_rhs () override
 
void hook_remove (const Var &t_var) override
 
void hook_remove (const Ctr &t_ctr) override
 
void hook_remove (const QCtr &t_ctr) override
 
void hook_remove (const SOSCtr &t_ctr) override
 
void set_var_attr (int t_index, int t_type, double t_lb, double t_ub, double t_obj)
 
void set_ctr_attr (int t_index, int t_type, double t_rhs)
 
void save_simplex_solution_status ()
 
void compute_farkas_certificate ()
 
void compute_unbounded_ray ()
 
void save_milp_solution_status ()
 
SolutionStatus get_status () const override
 
SolutionReason get_reason () const override
 
double get_best_obj () const override
 
double get_best_bound () const override
 
double get_var_primal (const Var &t_var) const override
 
double get_var_reduced_cost (const Var &t_var) const override
 
double get_var_ray (const Var &t_var) const override
 
double get_ctr_dual (const Ctr &t_ctr) const override
 
double get_ctr_farkas (const Ctr &t_ctr) const override
 
double get_relative_gap () const override
 
double get_absolute_gap () const override
 
unsigned int get_n_solutions () const override
 
unsigned int get_solution_index () const override
 
void set_solution_index (unsigned int t_index) override
 
void build () final
 
void write (const std::string &t_name) final
 
void add (const Var &t_var) final
 
void add (const Ctr &t_ctr) final
 
void add (const QCtr &t_ctr) final
 
void add (const SOSCtr &t_ctr) final
 
void update () final
 
void remove (const Var &t_var) final
 
void remove (const Ctr &t_ctr) final
 
void remove (const QCtr &t_ctr) final
 
void remove (const SOSCtr &t_ctr) final
 
bool has_lazy (const Var &t_var) const
 
bool has_lazy (const Ctr &t_ctr) const
 
bool has_lazy (const QCtr &t_qctr) const
 
auto & lazy (const Var &t_var)
 
const auto & lazy (const Var &t_var) const
 
auto & lazy (const Ctr &t_ctr)
 
const auto & lazy (const Ctr &t_ctr) const
 
auto & lazy (const QCtr &t_ctr)
 
const auto & lazy (const QCtr &t_ctr) const
 
auto & lazy (const SOSCtr &t_ctr)
 
const auto & lazy (const SOSCtr &t_ctr) const
 
auto & lazy_vars ()
 
const auto & lazy_vars () const
 
auto & lazy_ctrs ()
 
const auto & lazy_ctrs () const
 
auto & lazy_qctrs ()
 
const auto & lazy_qctrs () const
 
auto & lazy_sosctrs ()
 
const auto & lazy_sosctrs () const
 
void set_objective_to_be_updated ()
 
bool is_objective_to_be_updated () const
 
void set_objective_as_updated ()
 
void set_rhs_to_be_updated ()
 
bool is_rhs_to_be_updated () const
 
void set_rhs_as_updated ()
 
void update_obj_sense () override
 
void update_obj () override
 
void update_rhs () override
 
void update_obj_constant () override
 
void update_mat_coeff (const Ctr &t_ctr, const Var &t_var) override
 
void update_ctr_type (const Ctr &t_ctr) override
 
void update_ctr_rhs (const Ctr &t_ctr) override
 
void update_var_type (const Var &t_var) override
 
void update_var_lb (const Var &t_var) override
 
void update_var_ub (const Var &t_var) override
 
void update_var_obj (const Var &t_var) override
 

Static Protected Member Functions

static Model read_from_glpk (idol::Env &t_env, glp_prob *t_model)
 
static Model read_from_lp_file (Env &t_env, const std::string &t_filename)
 
static Model read_from_mps_file (Env &t_env, const std::string &t_filename)
 

Detailed Description

Definition at line 19 of file Optimizers_GLPK.h.

Member Function Documentation

◆ add() [1/4]

void idol::OptimizerWithLazyUpdates< int , int , int , int >::add ( const Ctr t_ctr)
finalprotectedinherited

Definition at line 93 of file OptimizerWithLazyUpdates.h.

◆ add() [2/4]

void idol::OptimizerWithLazyUpdates< int , int , int , int >::add ( const QCtr t_ctr)
finalprotectedinherited

Definition at line 96 of file OptimizerWithLazyUpdates.h.

◆ add() [3/4]

void idol::OptimizerWithLazyUpdates< int , int , int , int >::add ( const SOSCtr t_ctr)
finalprotectedinherited

Definition at line 99 of file OptimizerWithLazyUpdates.h.

◆ add() [4/4]

void idol::OptimizerWithLazyUpdates< int , int , int , int >::add ( const Var t_var)
finalprotectedinherited

Definition at line 90 of file OptimizerWithLazyUpdates.h.

◆ build()

void idol::OptimizerWithLazyUpdates< int , int , int , int >::build ( )
finalprotectedinherited

Definition at line 84 of file OptimizerWithLazyUpdates.h.

◆ has_lazy() [1/3]

bool idol::OptimizerWithLazyUpdates< int , int , int , int >::has_lazy ( const Ctr t_ctr) const
inlineprotectedinherited

Definition at line 131 of file OptimizerWithLazyUpdates.h.

◆ has_lazy() [2/3]

bool idol::OptimizerWithLazyUpdates< int , int , int , int >::has_lazy ( const QCtr t_qctr) const
inlineprotectedinherited

Definition at line 136 of file OptimizerWithLazyUpdates.h.

◆ has_lazy() [3/3]

bool idol::OptimizerWithLazyUpdates< int , int , int , int >::has_lazy ( const Var t_var) const
inlineprotectedinherited

Definition at line 126 of file OptimizerWithLazyUpdates.h.

◆ hook_add() [1/4]

int idol::Optimizers::GLPK::hook_add ( const Ctr t_ctr)
overrideprotectedvirtual

◆ hook_add() [2/4]

int idol::Optimizers::GLPK::hook_add ( const QCtr t_ctr)
overrideprotectedvirtual

◆ hook_add() [3/4]

int idol::Optimizers::GLPK::hook_add ( const SOSCtr t_ctr)
overrideprotectedvirtual

◆ hook_add() [4/4]

int idol::Optimizers::GLPK::hook_add ( const Var t_var,
bool  t_add_column 
)
overrideprotectedvirtual

◆ hook_build()

void idol::Optimizers::GLPK::hook_build ( )
overrideprotectedvirtual

◆ hook_remove() [1/4]

void idol::Optimizers::GLPK::hook_remove ( const Ctr t_ctr)
overrideprotectedvirtual

◆ hook_remove() [2/4]

void idol::Optimizers::GLPK::hook_remove ( const QCtr t_ctr)
overrideprotectedvirtual

◆ hook_remove() [3/4]

void idol::Optimizers::GLPK::hook_remove ( const SOSCtr t_ctr)
overrideprotectedvirtual

◆ hook_remove() [4/4]

void idol::Optimizers::GLPK::hook_remove ( const Var t_var)
overrideprotectedvirtual

◆ hook_update() [1/3]

void idol::Optimizers::GLPK::hook_update ( )
overrideprotectedvirtual

◆ hook_update() [2/3]

void idol::Optimizers::GLPK::hook_update ( const Ctr t_ctr)
overrideprotectedvirtual

◆ hook_update() [3/3]

void idol::Optimizers::GLPK::hook_update ( const Var t_var)
overrideprotectedvirtual

◆ hook_update_matrix()

void idol::Optimizers::GLPK::hook_update_matrix ( const Ctr t_ctr,
const Var t_var,
double  t_constant 
)
overrideprotectedvirtual

◆ hook_update_objective()

void idol::Optimizers::GLPK::hook_update_objective ( )
overrideprotectedvirtual

◆ hook_update_objective_sense()

void idol::Optimizers::GLPK::hook_update_objective_sense ( )
overrideprotectedvirtual

◆ hook_update_rhs()

void idol::Optimizers::GLPK::hook_update_rhs ( )
overrideprotectedvirtual

◆ hook_write()

void idol::Optimizers::GLPK::hook_write ( const std::string &  t_name)
overrideprotectedvirtual

◆ is_objective_to_be_updated()

bool idol::OptimizerWithLazyUpdates< int , int , int , int >::is_objective_to_be_updated ( ) const
inlineprotectedinherited

Definition at line 166 of file OptimizerWithLazyUpdates.h.

◆ is_rhs_to_be_updated()

bool idol::OptimizerWithLazyUpdates< int , int , int , int >::is_rhs_to_be_updated ( ) const
inlineprotectedinherited

Definition at line 170 of file OptimizerWithLazyUpdates.h.

◆ lazy() [1/8]

auto & idol::OptimizerWithLazyUpdates< int , int , int , int >::lazy ( const Ctr t_ctr)
inlineprotectedinherited

Definition at line 144 of file OptimizerWithLazyUpdates.h.

◆ lazy() [2/8]

const auto & idol::OptimizerWithLazyUpdates< int , int , int , int >::lazy ( const Ctr t_ctr) const
inlineprotectedinherited

Definition at line 145 of file OptimizerWithLazyUpdates.h.

◆ lazy() [3/8]

auto & idol::OptimizerWithLazyUpdates< int , int , int , int >::lazy ( const QCtr t_ctr)
inlineprotectedinherited

Definition at line 147 of file OptimizerWithLazyUpdates.h.

◆ lazy() [4/8]

const auto & idol::OptimizerWithLazyUpdates< int , int , int , int >::lazy ( const QCtr t_ctr) const
inlineprotectedinherited

Definition at line 148 of file OptimizerWithLazyUpdates.h.

◆ lazy() [5/8]

auto & idol::OptimizerWithLazyUpdates< int , int , int , int >::lazy ( const SOSCtr t_ctr)
inlineprotectedinherited

Definition at line 150 of file OptimizerWithLazyUpdates.h.

◆ lazy() [6/8]

const auto & idol::OptimizerWithLazyUpdates< int , int , int , int >::lazy ( const SOSCtr t_ctr) const
inlineprotectedinherited

Definition at line 151 of file OptimizerWithLazyUpdates.h.

◆ lazy() [7/8]

auto & idol::OptimizerWithLazyUpdates< int , int , int , int >::lazy ( const Var t_var)
inlineprotectedinherited

Definition at line 141 of file OptimizerWithLazyUpdates.h.

◆ lazy() [8/8]

const auto & idol::OptimizerWithLazyUpdates< int , int , int , int >::lazy ( const Var t_var) const
inlineprotectedinherited

Definition at line 142 of file OptimizerWithLazyUpdates.h.

◆ lazy_ctrs() [1/2]

auto & idol::OptimizerWithLazyUpdates< int , int , int , int >::lazy_ctrs ( )
inlineprotectedinherited

Definition at line 156 of file OptimizerWithLazyUpdates.h.

◆ lazy_ctrs() [2/2]

const auto & idol::OptimizerWithLazyUpdates< int , int , int , int >::lazy_ctrs ( ) const
inlineprotectedinherited

Definition at line 157 of file OptimizerWithLazyUpdates.h.

◆ lazy_qctrs() [1/2]

auto & idol::OptimizerWithLazyUpdates< int , int , int , int >::lazy_qctrs ( )
inlineprotectedinherited

Definition at line 159 of file OptimizerWithLazyUpdates.h.

◆ lazy_qctrs() [2/2]

const auto & idol::OptimizerWithLazyUpdates< int , int , int , int >::lazy_qctrs ( ) const
inlineprotectedinherited

Definition at line 160 of file OptimizerWithLazyUpdates.h.

◆ lazy_sosctrs() [1/2]

auto & idol::OptimizerWithLazyUpdates< int , int , int , int >::lazy_sosctrs ( )
inlineprotectedinherited

Definition at line 162 of file OptimizerWithLazyUpdates.h.

◆ lazy_sosctrs() [2/2]

const auto & idol::OptimizerWithLazyUpdates< int , int , int , int >::lazy_sosctrs ( ) const
inlineprotectedinherited

Definition at line 163 of file OptimizerWithLazyUpdates.h.

◆ lazy_vars() [1/2]

auto & idol::OptimizerWithLazyUpdates< int , int , int , int >::lazy_vars ( )
inlineprotectedinherited

Definition at line 153 of file OptimizerWithLazyUpdates.h.

◆ lazy_vars() [2/2]

const auto & idol::OptimizerWithLazyUpdates< int , int , int , int >::lazy_vars ( ) const
inlineprotectedinherited

Definition at line 154 of file OptimizerWithLazyUpdates.h.

◆ name()

std::string idol::Optimizers::GLPK::name ( ) const
inlineoverride

Definition at line 103 of file Optimizers_GLPK.h.

◆ operator[]() [1/4]

int & idol::OptimizerWithLazyUpdates< int , int , int , int >::operator[] ( const Ctr t_ctr)
inlineinherited

Definition at line 188 of file OptimizerWithLazyUpdates.h.

◆ operator[]() [2/4]

const int & idol::OptimizerWithLazyUpdates< int , int , int , int >::operator[] ( const Ctr t_ctr) const
inlineinherited

Definition at line 189 of file OptimizerWithLazyUpdates.h.

◆ operator[]() [3/4]

int & idol::OptimizerWithLazyUpdates< int , int , int , int >::operator[] ( const Var t_var)
inlineinherited

Definition at line 185 of file OptimizerWithLazyUpdates.h.

◆ operator[]() [4/4]

const int & idol::OptimizerWithLazyUpdates< int , int , int , int >::operator[] ( const Var t_var) const
inlineinherited

Definition at line 186 of file OptimizerWithLazyUpdates.h.

◆ remove() [1/4]

void idol::OptimizerWithLazyUpdates< int , int , int , int >::remove ( const Ctr t_ctr)
finalprotectedinherited

Definition at line 117 of file OptimizerWithLazyUpdates.h.

◆ remove() [2/4]

void idol::OptimizerWithLazyUpdates< int , int , int , int >::remove ( const QCtr t_ctr)
finalprotectedinherited

Definition at line 120 of file OptimizerWithLazyUpdates.h.

◆ remove() [3/4]

void idol::OptimizerWithLazyUpdates< int , int , int , int >::remove ( const SOSCtr t_ctr)
finalprotectedinherited

Definition at line 123 of file OptimizerWithLazyUpdates.h.

◆ remove() [4/4]

void idol::OptimizerWithLazyUpdates< int , int , int , int >::remove ( const Var t_var)
finalprotectedinherited

Definition at line 114 of file OptimizerWithLazyUpdates.h.

◆ set_objective_as_updated()

void idol::OptimizerWithLazyUpdates< int , int , int , int >::set_objective_as_updated ( )
inlineprotectedinherited

Definition at line 167 of file OptimizerWithLazyUpdates.h.

◆ set_objective_to_be_updated()

void idol::OptimizerWithLazyUpdates< int , int , int , int >::set_objective_to_be_updated ( )
inlineprotectedinherited

Definition at line 165 of file OptimizerWithLazyUpdates.h.

◆ set_rhs_as_updated()

void idol::OptimizerWithLazyUpdates< int , int , int , int >::set_rhs_as_updated ( )
inlineprotectedinherited

Definition at line 171 of file OptimizerWithLazyUpdates.h.

◆ set_rhs_to_be_updated()

void idol::OptimizerWithLazyUpdates< int , int , int , int >::set_rhs_to_be_updated ( )
inlineprotectedinherited

Definition at line 169 of file OptimizerWithLazyUpdates.h.

◆ update()

void idol::OptimizerWithLazyUpdates< int , int , int , int >::update ( )
finalprotectedinherited

Definition at line 105 of file OptimizerWithLazyUpdates.h.

◆ update_ctr_rhs()

void idol::OptimizerWithLazyUpdates< int , int , int , int >::update_ctr_rhs ( const Ctr t_ctr)
overrideprotectedinherited

Definition at line 179 of file OptimizerWithLazyUpdates.h.

◆ update_ctr_type()

void idol::OptimizerWithLazyUpdates< int , int , int , int >::update_ctr_type ( const Ctr t_ctr)
overrideprotectedinherited

Definition at line 178 of file OptimizerWithLazyUpdates.h.

◆ update_mat_coeff()

void idol::OptimizerWithLazyUpdates< int , int , int , int >::update_mat_coeff ( const Ctr t_ctr,
const Var t_var 
)
overrideprotectedinherited

Definition at line 177 of file OptimizerWithLazyUpdates.h.

◆ update_obj()

void idol::OptimizerWithLazyUpdates< int , int , int , int >::update_obj ( )
overrideprotectedinherited

Definition at line 174 of file OptimizerWithLazyUpdates.h.

◆ update_obj_constant()

void idol::OptimizerWithLazyUpdates< int , int , int , int >::update_obj_constant ( )
overrideprotectedinherited

Definition at line 176 of file OptimizerWithLazyUpdates.h.

◆ update_obj_sense()

void idol::OptimizerWithLazyUpdates< int , int , int , int >::update_obj_sense ( )
overrideprotectedinherited

Definition at line 173 of file OptimizerWithLazyUpdates.h.

◆ update_rhs()

void idol::OptimizerWithLazyUpdates< int , int , int , int >::update_rhs ( )
overrideprotectedinherited

Definition at line 175 of file OptimizerWithLazyUpdates.h.

◆ update_var_lb()

void idol::OptimizerWithLazyUpdates< int , int , int , int >::update_var_lb ( const Var t_var)
overrideprotectedinherited

Definition at line 181 of file OptimizerWithLazyUpdates.h.

◆ update_var_obj()

void idol::OptimizerWithLazyUpdates< int , int , int , int >::update_var_obj ( const Var t_var)
overrideprotectedinherited

Definition at line 183 of file OptimizerWithLazyUpdates.h.

◆ update_var_type()

void idol::OptimizerWithLazyUpdates< int , int , int , int >::update_var_type ( const Var t_var)
overrideprotectedinherited

Definition at line 180 of file OptimizerWithLazyUpdates.h.

◆ update_var_ub()

void idol::OptimizerWithLazyUpdates< int , int , int , int >::update_var_ub ( const Var t_var)
overrideprotectedinherited

Definition at line 182 of file OptimizerWithLazyUpdates.h.

◆ write()

void idol::OptimizerWithLazyUpdates< int , int , int , int >::write ( const std::string &  t_name)
finalprotectedinherited

Definition at line 87 of file OptimizerWithLazyUpdates.h.