Skip to content

Commit

Permalink
remove old refs to Solution::Primal
Browse files Browse the repository at this point in the history
  • Loading branch information
hlefebvr committed Oct 24, 2024
1 parent bbd8655 commit d3f55da
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 13 deletions.
4 changes: 0 additions & 4 deletions lib/include/idol/mixed-integer/modeling/constraints/TempCtr.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ namespace idol {

class TempCtr;

namespace Solution {
class Primal;
}

template<class Key1, class Key2> class Expr;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@

namespace idol {

namespace Solution {
class Primal;
class Dual;
}

class Algorithm;
class Constant;
class QuadParam;
Expand Down
8 changes: 4 additions & 4 deletions tests/modeling/QuadExpr.rotated-cone.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,23 @@ using namespace idol;

#include "idol/general/linear-algebra/to_rotated_quadratic_cone.h"

double eval(const LinExpr<Var>& t_expr, const Solution::Primal& t_primal) {
double eval(const LinExpr<Var>& t_expr, const PrimalPoint& t_primal) {
double result = 0;
for (const auto& [var, constant] : t_expr) {
result += constant * t_primal.get(var);
}
return result;
}

double eval(const QuadExpr<Var, Var>& t_expr, const Solution::Primal& t_primal) {
double eval(const QuadExpr<Var, Var>& t_expr, const PrimalPoint& t_primal) {
double result = 0;
for (const auto& [var1, var2, constant] : t_expr) {
result += constant * t_primal.get(var1) * t_primal.get(var2);
}
return result;
}

double eval(const Expr<Var, Var>& t_expr, const Solution::Primal& t_primal) {
double eval(const Expr<Var, Var>& t_expr, const PrimalPoint& t_primal) {
return t_expr.constant() + eval(t_expr.linear(), t_primal) + eval(t_expr.quadratic(), t_primal);
}

Expand Down Expand Up @@ -71,7 +71,7 @@ TEST_CASE("QuadExpr: rotated cone expression", "[unit][modeling-old][QuadExpr]")

for (unsigned int i = 0; i < 30; ++i) {

Solution::Primal point;
PrimalPoint point;
point.set_objective_value(0.);
point.set(x[0], dist(engine));
point.set(x[1], dist(engine));
Expand Down

0 comments on commit d3f55da

Please sign in to comment.