Module: OSQP::Utils

Defined in:
lib/osqp/utils.rb

Class Method Summary collapse

Class Method Details

.float_array(arr) ⇒ Object



4
5
6
7
# File 'lib/osqp/utils.rb', line 4

def float_array(arr)
  # OSQP float = double
  Fiddle::Pointer[arr.to_a.pack("d*")]
end

.int_array(arr) ⇒ Object



9
10
11
12
# File 'lib/osqp/utils.rb', line 9

def int_array(arr)
  # OSQP int = long long
  Fiddle::Pointer[arr.to_a.pack("q*")]
end