Skip to content

Commit

Permalink
Revert "Attempted fix"
Browse files Browse the repository at this point in the history
This reverts commit 6d389c3.
  • Loading branch information
ankane committed Oct 6, 2024
1 parent 6d389c3 commit 7999d74
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 15 deletions.
2 changes: 1 addition & 1 deletion lib/or-tools.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
require_relative "or_tools/comparison"
require_relative "or_tools/comparison_operators"
require_relative "or_tools/bool_var"
require_relative "or_tools/constant"
require_relative "or_tools/cp_model"
require_relative "or_tools/cp_solver"
require_relative "or_tools/cp_solver_solution_callback"
require_relative "or_tools/int_var"
require_relative "or_tools/knapsack_solver"
require_relative "or_tools/linear_constraint"
require_relative "or_tools/linear_expr"
require_relative "or_tools/constant"
require_relative "or_tools/mp_variable"
require_relative "or_tools/product_cst"
require_relative "or_tools/routing_index_manager"
Expand Down
4 changes: 1 addition & 3 deletions lib/or_tools/constant.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
module ORTools
class Constant
include LinearExprUtils

class Constant < LinearExpr
def initialize(val)
@val = val
end
Expand Down
6 changes: 1 addition & 5 deletions lib/or_tools/linear_expr.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module ORTools
module LinearExprUtils
class LinearExpr
def solution_value
coeffs.sum { |var, coeff| var.solution_value * coeff }
end
Expand Down Expand Up @@ -82,8 +82,4 @@ def coerce(other)
end
end
end

class LinearExpr
include LinearExprUtils
end
end
4 changes: 1 addition & 3 deletions lib/or_tools/product_cst.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
module ORTools
class ProductCst
include LinearExprUtils

class ProductCst < LinearExpr
attr_reader :expr, :coef

def initialize(expr, coef)
Expand Down
4 changes: 1 addition & 3 deletions lib/or_tools/sum_array.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
module ORTools
class SumArray
include LinearExprUtils

class SumArray < LinearExpr
attr_reader :array

def initialize(array)
Expand Down

0 comments on commit 7999d74

Please sign in to comment.