Class: ORTools::Constant
- Inherits:
-
LinearExpr
- Object
- LinearExpr
- ORTools::Constant
- Defined in:
- lib/or_tools/constant.rb
Instance Method Summary collapse
- #add_self_to_coeff_map_or_stack(coeffs, multiplier, stack) ⇒ Object
-
#initialize(val) ⇒ Constant
constructor
A new instance of Constant.
- #to_s ⇒ Object
Methods inherited from LinearExpr
#*, #+, #-, #-@, #/, #<=, #==, #>=, #coeffs, #coerce, #inspect, #solution_value
Constructor Details
#initialize(val) ⇒ Constant
Returns a new instance of Constant.
3 4 5 |
# File 'lib/or_tools/constant.rb', line 3 def initialize(val) @val = val end |
Instance Method Details
#add_self_to_coeff_map_or_stack(coeffs, multiplier, stack) ⇒ Object
11 12 13 |
# File 'lib/or_tools/constant.rb', line 11 def add_self_to_coeff_map_or_stack(coeffs, multiplier, stack) coeffs[OFFSET_KEY] += @val * multiplier end |
#to_s ⇒ Object
7 8 9 |
# File 'lib/or_tools/constant.rb', line 7 def to_s @val.to_s end |