lib/ngt/ffi.rb in ngt-0.2.4 vs lib/ngt/ffi.rb in ngt-0.3.0

- old
+ new

@@ -13,12 +13,15 @@ class ObjectDistance < ::FFI::Struct layout :id, :int, :distance, :float end + enum :distance_type, [:l1, :l2, :hamming, :angle, :cosine, :normalized_angle, :normalized_cosine, :jaccard] + attach_function :ngt_open_index, %i[string pointer], :pointer attach_function :ngt_create_graph_and_tree, %i[string pointer pointer], :pointer + attach_function :ngt_create_graph_and_tree_in_memory, %i[pointer pointer], :pointer attach_function :ngt_create_property, %i[pointer], :pointer attach_function :ngt_save_index, %i[pointer string pointer], :bool attach_function :ngt_get_property, %i[pointer pointer pointer], :bool attach_function :ngt_get_property_dimension, %i[pointer pointer], :int32_t attach_function :ngt_set_property_dimension, %i[pointer int32_t pointer], :bool @@ -32,26 +35,29 @@ attach_function :ngt_set_property_distance_type_l2, %i[pointer pointer], :bool attach_function :ngt_set_property_distance_type_angle, %i[pointer pointer], :bool attach_function :ngt_set_property_distance_type_hamming, %i[pointer pointer], :bool attach_function :ngt_set_property_distance_type_jaccard, %i[pointer pointer], :bool attach_function :ngt_set_property_distance_type_cosine, %i[pointer pointer], :bool - attach_function :ngt_batch_insert_index, %i[pointer pointer uint32 pointer pointer], :bool - attach_function :ngt_create_index, %i[pointer uint32 pointer], :bool - attach_function :ngt_remove_index, %i[pointer int pointer], :bool + attach_function :ngt_set_property_distance_type_normalized_angle, %i[pointer pointer], :bool + attach_function :ngt_set_property_distance_type_normalized_cosine, %i[pointer pointer], :bool attach_function :ngt_insert_index, %i[pointer pointer uint32 pointer], :int attach_function :ngt_insert_index_as_float, %i[pointer pointer uint32 pointer], :int attach_function :ngt_create_empty_results, %i[pointer], :pointer attach_function :ngt_search_index, %i[pointer pointer int32 size_t float float pointer pointer], :bool attach_function :ngt_get_result_size, %i[pointer pointer], :uint32 attach_function :ngt_get_result, %i[pointer uint32 pointer], ObjectDistance.by_value + attach_function :ngt_batch_insert_index, %i[pointer pointer uint32 pointer pointer], :bool + attach_function :ngt_create_index, %i[pointer uint32 pointer], :bool + attach_function :ngt_remove_index, %i[pointer int pointer], :bool attach_function :ngt_get_object_space, %i[pointer pointer], :pointer attach_function :ngt_get_object_as_float, %i[pointer int pointer], :pointer attach_function :ngt_get_object_as_integer, %i[pointer int pointer], :pointer + attach_function :ngt_destroy_results, %i[pointer], :void attach_function :ngt_destroy_property, %i[pointer], :void attach_function :ngt_close_index, %i[pointer], :void attach_function :ngt_get_property_edge_size_for_creation, %i[pointer pointer], :int16 attach_function :ngt_get_property_edge_size_for_search, %i[pointer pointer], :int16 - attach_function :ngt_get_property_distance_type, %i[pointer pointer], :int32 + attach_function :ngt_get_property_distance_type, %i[pointer pointer], :distance_type attach_function :ngt_create_error_object, %i[], :pointer attach_function :ngt_get_error_string, %i[pointer], :string attach_function :ngt_destroy_error_object, %i[pointer], :void begin