Skip to content

Commit

Permalink
model remove ok
Browse files Browse the repository at this point in the history
  • Loading branch information
hlefebvr committed Oct 28, 2024
1 parent b19431c commit c1a3616
Show file tree
Hide file tree
Showing 6 changed files with 223 additions and 84 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class idol::CtrVersion : public Version {

void set_type(CtrType t_type) { m_type = t_type; }

LinExpr<Var>& lhs() { return *m_lhs; }
LinExpr<Var>& row() { return *m_lhs; }

const LinExpr<Var>& lhs() const { return *m_lhs; }

Expand Down
11 changes: 7 additions & 4 deletions lib/include/idol/mixed-integer/modeling/models/Model.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ class idol::Model {
bool m_has_been_moved = false;

ObjectiveSense m_sense = Minimize;
Expr<Var, Var> m_objective;
LinExpr<Ctr> m_rhs;

double m_objective_constant = 0.;
std::vector<Var> m_variables;
std::vector<Ctr> m_constraints;

Expand All @@ -69,6 +69,9 @@ class idol::Model {
void build_column(const Var& t_var);
void build_rows();
void build_columns();

bool column_storage_matters() const;
bool row_storage_matters() const;
public:
/**
* Creates a new model for a mathematical optimization problem.
Expand Down Expand Up @@ -586,7 +589,7 @@ class idol::Model {
* ```
* @return the objective function of the model
*/
[[nodiscard]] const Expr<Var, Var>& get_obj_expr() const;
[[nodiscard]] Expr<Var, Var> get_obj_expr() const;

/**
* Returns the right hand-side of the model.
Expand All @@ -600,7 +603,7 @@ class idol::Model {
*
* @return the right hand-side of the model
*/
[[nodiscard]] const LinExpr<Ctr>& get_rhs_expr() const;
[[nodiscard]] LinExpr<Ctr> get_rhs_expr() const;

/**
* Returns a specific coefficient in the model's matrix.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class idol::ADM::Formulation {

std::vector<Model> m_sub_problems;
std::vector<std::optional<Expr<Var, Var>>> m_objective_patterns;
std::vector<std::list<std::pair<Ctr, Expr<Var, Var>>>> m_constraint_patterns; // as ctr: lhs <= 0
std::vector<std::list<std::pair<Ctr, Expr<Var, Var>>>> m_constraint_patterns; // as ctr: row <= 0
std::vector<std::list<Var>> m_l1_vars_in_sub_problem;
Map<Ctr, Var> m_l1_vars;

Expand Down
Loading

0 comments on commit c1a3616

Please sign in to comment.