From 6b87e38ffa21aaf981fa9bdef85bb7c0574ee714 Mon Sep 17 00:00:00 2001 From: Henri Lefebvre Date: Thu, 24 Oct 2024 10:29:48 +0200 Subject: [PATCH] remove Constant in QuadExpr --- lib/include/idol/modeling/expressions/Expr.h | 16 ---------------- lib/include/idol/modeling/expressions/QuadExpr.h | 12 +++--------- 2 files changed, 3 insertions(+), 25 deletions(-) diff --git a/lib/include/idol/modeling/expressions/Expr.h b/lib/include/idol/modeling/expressions/Expr.h index eec549b6..2689c1ca 100644 --- a/lib/include/idol/modeling/expressions/Expr.h +++ b/lib/include/idol/modeling/expressions/Expr.h @@ -43,8 +43,6 @@ class idol::impl::Expr { Expr(); Expr(double t_num); // NOLINT(google-explicit-constructor) Expr(const Param& t_param); // NOLINT(google-explicit-constructor) - Expr(Constant&& t_expr); // NOLINT(google-explicit-constructor) - Expr(const Constant& t_expr); // NOLINT(google-explicit-constructor) Expr(const Key1& t_var); // NOLINT(google-explicit-constructor) Expr(LinExpr&& t_expr); // NOLINT(google-explicit-constructor) Expr(const LinExpr& t_expr); // NOLINT(google-explicit-constructor) @@ -119,18 +117,6 @@ idol::impl::Expr::Expr(const Param &t_param) } -template -idol::impl::Expr::Expr(Constant &&t_expr) - : m_constant(std::make_unique(std::move(t_expr))) { - -} - -template -idol::impl::Expr::Expr(const Constant &t_expr) - : m_constant(std::make_unique(t_expr)) { - -} - template idol::impl::Expr::Expr(const Key1 &t_var) : m_linear(t_var), @@ -230,8 +216,6 @@ class idol::Expr : public impl::Expr { Expr() = default; Expr(double t_num) : impl::Expr(t_num) {} // NOLINT(google-explicit-constructor) Expr(const Param& t_param) : impl::Expr(t_param) {} // NOLINT(google-explicit-constructor) - Expr(Constant&& t_expr) : impl::Expr(std::move(t_expr)) {} // NOLINT(google-explicit-constructor) - Expr(const Constant& t_expr) : impl::Expr(t_expr) {} // NOLINT(google-explicit-constructor) Expr(const Key1& t_var) : impl::Expr(t_var) {} // NOLINT(google-explicit-constructor) Expr(LinExpr&& t_expr) : impl::Expr(std::move(t_expr)) {} // NOLINT(google-explicit-constructor) Expr(const LinExpr& t_expr) : impl::Expr(t_expr) {} // NOLINT(google-explicit-constructor) diff --git a/lib/include/idol/modeling/expressions/QuadExpr.h b/lib/include/idol/modeling/expressions/QuadExpr.h index 191f3d90..d57dbc68 100644 --- a/lib/include/idol/modeling/expressions/QuadExpr.h +++ b/lib/include/idol/modeling/expressions/QuadExpr.h @@ -51,8 +51,7 @@ class idol::QuadExpr : public AbstractExpr, QuadTerm::QuadExpr(const Key1 &t_a, const Key2 } template -idol::QuadExpr::QuadExpr(Constant &&t_factor, const Key1 &t_a, const Key2 &t_b) { - set(t_a, t_b, std::move(t_factor)); -} - -template -idol::QuadExpr::QuadExpr(const Constant &t_factor, const Key1 &t_a, const Key2 &t_b) { - set(t_a, t_b, Constant(t_factor)); +idol::QuadExpr::QuadExpr(double t_factor, const Key1 &t_a, const Key2 &t_b) { + set(t_a, t_b, t_factor); } template