class Guruby::Environment
Attributes
ptr[R]
Public Class Methods
finalize(ptr)
click to toggle source
Free the environment
# File lib/guruby/env.rb, line 21 def self.finalize(ptr) proc { Gurobi.GRBfreeenv ptr } end
new()
click to toggle source
# File lib/guruby/env.rb, line 7 def initialize # Create a new environment object @ptr = FFI::MemoryPointer.new :pointer Gurobi.GRBloadenv @ptr, nil @ptr = @ptr.read_pointer # Disable output Gurobi.GRBsetintparam @ptr, GRB_INT_PAR_OUTPUTFLAG, 0 # Ensure the environment is freed ObjectSpace.define_finalizer self, self.class.finalize(@ptr) end