Sha256: f671f84adde6ef126c470b8fde1aebf2d9ce7f076b6d4fe082e0395c96187e65

Contents?: true

Size: 1.51 KB

Versions: 2

Compression:

Stored size: 1.51 KB

Contents

module XLearn
  module FFI
    extend ::FFI::Library

    ffi_lib XLearn.ffi_lib

    # https://github.com/aksnzhy/xlearn/blob/master/src/c_api/c_api.h
    # keep same order

    attach_function :XLearnHello, %i[], :int
    attach_function :XLearnCreate, %i[string pointer], :int
    attach_function :XlearnCreateDataFromMat, %i[pointer uint32 uint32 pointer pointer pointer], :int
    attach_function :XlearnDataFree, %i[pointer], :int
    attach_function :XLearnHandleFree, %i[pointer], :int
    attach_function :XLearnShow, %i[pointer], :int
    attach_function :XLearnSetTrain, %i[pointer string], :int
    attach_function :XLearnSetTest, %i[pointer string], :int
    attach_function :XLearnSetPreModel, %i[pointer string], :int
    attach_function :XLearnSetValidate, %i[pointer string], :int
    attach_function :XLearnSetTXTModel, %i[pointer string], :int
    attach_function :XLearnFit, %i[pointer string], :int
    attach_function :XLearnCV, %i[pointer], :int
    attach_function :XLearnPredictForMat, %i[pointer string pointer pointer], :int
    attach_function :XLearnPredictForFile, %i[pointer string string], :int
    attach_function :XLearnSetDMatrix, %i[pointer string pointer], :int
    attach_function :XLearnSetStr, %i[pointer string string], :int
    attach_function :XLearnSetInt, %i[pointer string int], :int
    attach_function :XLearnSetFloat, %i[pointer string float], :int
    attach_function :XLearnSetBool, %i[pointer string bool], :int

    # errors
    attach_function :XLearnGetLastError, %i[], :string
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
xlearn-0.1.5 lib/xlearn/ffi.rb
xlearn-0.1.4 lib/xlearn/ffi.rb