Sha256: 3fd6a89904c8da825b4353f17dabd37fa57eb92d5ddddf6e4ccfea308a072b43
Contents?: true
Size: 1.62 KB
Versions: 4
Compression:
Stored size: 1.62 KB
Contents
module Libmf module FFI extend ::FFI::Library begin ffi_lib Libmf.ffi_lib rescue LoadError => e raise e if ENV["LIBMF_DEBUG"] raise LoadError, "Could not find LIBMF" end class Node < ::FFI::Struct layout :u, :int, :v, :int, :r, :float end class Problem < ::FFI::Struct layout :m, :int, :n, :int, :nnz, :long_long, :r, :pointer end class Parameter < ::FFI::Struct layout :fun, :int, :k, :int, :nr_threads, :int, :nr_bins, :int, :nr_iters, :int, :lambda_p1, :float, :lambda_p2, :float, :lambda_q1, :float, :lambda_q2, :float, :eta, :float, :alpha, :float, :c, :float, :do_nmf, :bool, :quiet, :bool, :copy_data, :bool end class Model < ::FFI::Struct layout :fun, :int, :m, :int, :n, :int, :k, :int, :b, :float, :p, :pointer, :q, :pointer end attach_function :mf_get_default_param, [], Parameter.by_value attach_function :mf_save_model, [Model.by_ref, :string], :int attach_function :mf_load_model, [:string], Model.by_ref attach_function :mf_destroy_model, [Model.by_ref], :void attach_function :mf_train, [Problem.by_ref, Parameter.by_value], Model.by_ref attach_function :mf_train_with_validation, [Problem.by_ref, Problem.by_ref, Parameter.by_value], Model.by_ref attach_function :mf_predict, [Model.by_ref, :int, :int], :float attach_function :mf_cross_validation, [Problem.by_ref, :int, Parameter.by_value], :double end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
libmf-0.1.3 | lib/libmf/ffi.rb |
libmf-0.1.2 | lib/libmf/ffi.rb |
libmf-0.1.1 | lib/libmf/ffi.rb |
libmf-0.1.0 | lib/libmf/ffi.rb |