class MIPPeR::Constraint

Attributes

expression[R]
index[RW]
model[RW]
name[R]
rhs[R]
sense[R]

Public Class Methods

new(expr, sense, rhs, name = nil) click to toggle source
# File lib/mipper/constraint.rb, line 6
def initialize(expr, sense, rhs, name = nil)
  @expression = expr
  @sense = sense
  @rhs = rhs
  @name = name

  # Store this constraint for each associated variable
  @expression.terms.each_key do |var|
    var.constraints << self
  end
end

Public Instance Methods

inspect() click to toggle source
# File lib/mipper/constraint.rb, line 18
def inspect
  "#{@expression.inspect} #{sense.to_s} #{rhs}"
end