Sha256: 7fecb2d6f2746b8a2a419fb8f1f3178d8e9712ce0b6c4b83ad228f3910f535c4

Contents?: true

Size: 287 Bytes

Versions: 3

Compression:

Stored size: 287 Bytes

Contents

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

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
osqp-0.3.0 lib/osqp/utils.rb
osqp-0.2.2 lib/osqp/utils.rb
osqp-0.2.1 lib/osqp/utils.rb