1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
/* automatically generated by rust-bindgen */

pub const FLANN_VERSION_ : & 'static [ u8 ; 6usize ] = b"1.9.1\0" ; pub const flann_algorithm_t_FLANN_INDEX_LINEAR : flann_algorithm_t = 0 ; pub const flann_algorithm_t_FLANN_INDEX_KDTREE : flann_algorithm_t = 1 ; pub const flann_algorithm_t_FLANN_INDEX_KMEANS : flann_algorithm_t = 2 ; pub const flann_algorithm_t_FLANN_INDEX_COMPOSITE : flann_algorithm_t = 3 ; pub const flann_algorithm_t_FLANN_INDEX_KDTREE_SINGLE : flann_algorithm_t = 4 ; pub const flann_algorithm_t_FLANN_INDEX_HIERARCHICAL : flann_algorithm_t = 5 ; pub const flann_algorithm_t_FLANN_INDEX_LSH : flann_algorithm_t = 6 ; pub const flann_algorithm_t_FLANN_INDEX_SAVED : flann_algorithm_t = 254 ; pub const flann_algorithm_t_FLANN_INDEX_AUTOTUNED : flann_algorithm_t = 255 ; pub type flann_algorithm_t = u32 ; pub const flann_centers_init_t_FLANN_CENTERS_RANDOM : flann_centers_init_t = 0 ; pub const flann_centers_init_t_FLANN_CENTERS_GONZALES : flann_centers_init_t = 1 ; pub const flann_centers_init_t_FLANN_CENTERS_KMEANSPP : flann_centers_init_t = 2 ; pub const flann_centers_init_t_FLANN_CENTERS_GROUPWISE : flann_centers_init_t = 3 ; pub type flann_centers_init_t = u32 ; pub const flann_log_level_t_FLANN_LOG_NONE : flann_log_level_t = 0 ; pub const flann_log_level_t_FLANN_LOG_FATAL : flann_log_level_t = 1 ; pub const flann_log_level_t_FLANN_LOG_ERROR : flann_log_level_t = 2 ; pub const flann_log_level_t_FLANN_LOG_WARN : flann_log_level_t = 3 ; pub const flann_log_level_t_FLANN_LOG_INFO : flann_log_level_t = 4 ; pub const flann_log_level_t_FLANN_LOG_DEBUG : flann_log_level_t = 5 ; pub type flann_log_level_t = u32 ; pub const flann_distance_t_FLANN_DIST_EUCLIDEAN : flann_distance_t = 1 ; pub const flann_distance_t_FLANN_DIST_L2 : flann_distance_t = 1 ; pub const flann_distance_t_FLANN_DIST_MANHATTAN : flann_distance_t = 2 ; pub const flann_distance_t_FLANN_DIST_L1 : flann_distance_t = 2 ; pub const flann_distance_t_FLANN_DIST_MINKOWSKI : flann_distance_t = 3 ; pub const flann_distance_t_FLANN_DIST_MAX : flann_distance_t = 4 ; pub const flann_distance_t_FLANN_DIST_HIST_INTERSECT : flann_distance_t = 5 ; pub const flann_distance_t_FLANN_DIST_HELLINGER : flann_distance_t = 6 ; pub const flann_distance_t_FLANN_DIST_CHI_SQUARE : flann_distance_t = 7 ; pub const flann_distance_t_FLANN_DIST_KULLBACK_LEIBLER : flann_distance_t = 8 ; pub const flann_distance_t_FLANN_DIST_HAMMING : flann_distance_t = 9 ; pub const flann_distance_t_FLANN_DIST_HAMMING_LUT : flann_distance_t = 10 ; pub const flann_distance_t_FLANN_DIST_HAMMING_POPCNT : flann_distance_t = 11 ; pub const flann_distance_t_FLANN_DIST_L2_SIMPLE : flann_distance_t = 12 ; pub type flann_distance_t = u32 ; pub const flann_datatype_t_FLANN_NONE : flann_datatype_t = -1 ; pub const flann_datatype_t_FLANN_INT8 : flann_datatype_t = 0 ; pub const flann_datatype_t_FLANN_INT16 : flann_datatype_t = 1 ; pub const flann_datatype_t_FLANN_INT32 : flann_datatype_t = 2 ; pub const flann_datatype_t_FLANN_INT64 : flann_datatype_t = 3 ; pub const flann_datatype_t_FLANN_UINT8 : flann_datatype_t = 4 ; pub const flann_datatype_t_FLANN_UINT16 : flann_datatype_t = 5 ; pub const flann_datatype_t_FLANN_UINT32 : flann_datatype_t = 6 ; pub const flann_datatype_t_FLANN_UINT64 : flann_datatype_t = 7 ; pub const flann_datatype_t_FLANN_FLOAT32 : flann_datatype_t = 8 ; pub const flann_datatype_t_FLANN_FLOAT64 : flann_datatype_t = 9 ; pub type flann_datatype_t = i32 ; pub const flann_checks_t_FLANN_CHECKS_UNLIMITED : flann_checks_t = -1 ; pub const flann_checks_t_FLANN_CHECKS_AUTOTUNED : flann_checks_t = -2 ; pub type flann_checks_t = i32 ; # [ repr ( C ) ] # [ derive ( Debug , Copy , Clone ) ] pub struct FLANNParameters { pub algorithm : flann_algorithm_t , pub checks : :: std :: os :: raw :: c_int , pub eps : f32 , pub sorted : :: std :: os :: raw :: c_int , pub max_neighbors : :: std :: os :: raw :: c_int , pub cores : :: std :: os :: raw :: c_int , pub trees : :: std :: os :: raw :: c_int , pub leaf_max_size : :: std :: os :: raw :: c_int , pub branching : :: std :: os :: raw :: c_int , pub iterations : :: std :: os :: raw :: c_int , pub centers_init : flann_centers_init_t , pub cb_index : f32 , pub target_precision : f32 , pub build_weight : f32 , pub memory_weight : f32 , pub sample_fraction : f32 , pub table_number_ : :: std :: os :: raw :: c_uint , /// The number of hash tables to use
 pub key_size_ : :: std :: os :: raw :: c_uint , /// The length of the key in the hash tables
 pub multi_probe_level_ : :: std :: os :: raw :: c_uint , /// Number of levels to use in multi-probe LSH, 0 for standard LSH
 pub log_level : flann_log_level_t , pub random_seed : :: std :: os :: raw :: c_long , } # [ test ] fn bindgen_test_layout_FLANNParameters ( ) { assert_eq ! ( :: std :: mem :: size_of :: < FLANNParameters > ( ) , 88usize , concat ! ( "Size of: " , stringify ! ( FLANNParameters ) ) ) ; assert_eq ! ( :: std :: mem :: align_of :: < FLANNParameters > ( ) , 8usize , concat ! ( "Alignment of " , stringify ! ( FLANNParameters ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < FLANNParameters > ( ) ) ) . algorithm as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( FLANNParameters ) , "::" , stringify ! ( algorithm ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < FLANNParameters > ( ) ) ) . checks as * const _ as usize } , 4usize , concat ! ( "Offset of field: " , stringify ! ( FLANNParameters ) , "::" , stringify ! ( checks ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < FLANNParameters > ( ) ) ) . eps as * const _ as usize } , 8usize , concat ! ( "Offset of field: " , stringify ! ( FLANNParameters ) , "::" , stringify ! ( eps ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < FLANNParameters > ( ) ) ) . sorted as * const _ as usize } , 12usize , concat ! ( "Offset of field: " , stringify ! ( FLANNParameters ) , "::" , stringify ! ( sorted ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < FLANNParameters > ( ) ) ) . max_neighbors as * const _ as usize } , 16usize , concat ! ( "Offset of field: " , stringify ! ( FLANNParameters ) , "::" , stringify ! ( max_neighbors ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < FLANNParameters > ( ) ) ) . cores as * const _ as usize } , 20usize , concat ! ( "Offset of field: " , stringify ! ( FLANNParameters ) , "::" , stringify ! ( cores ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < FLANNParameters > ( ) ) ) . trees as * const _ as usize } , 24usize , concat ! ( "Offset of field: " , stringify ! ( FLANNParameters ) , "::" , stringify ! ( trees ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < FLANNParameters > ( ) ) ) . leaf_max_size as * const _ as usize } , 28usize , concat ! ( "Offset of field: " , stringify ! ( FLANNParameters ) , "::" , stringify ! ( leaf_max_size ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < FLANNParameters > ( ) ) ) . branching as * const _ as usize } , 32usize , concat ! ( "Offset of field: " , stringify ! ( FLANNParameters ) , "::" , stringify ! ( branching ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < FLANNParameters > ( ) ) ) . iterations as * const _ as usize } , 36usize , concat ! ( "Offset of field: " , stringify ! ( FLANNParameters ) , "::" , stringify ! ( iterations ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < FLANNParameters > ( ) ) ) . centers_init as * const _ as usize } , 40usize , concat ! ( "Offset of field: " , stringify ! ( FLANNParameters ) , "::" , stringify ! ( centers_init ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < FLANNParameters > ( ) ) ) . cb_index as * const _ as usize } , 44usize , concat ! ( "Offset of field: " , stringify ! ( FLANNParameters ) , "::" , stringify ! ( cb_index ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < FLANNParameters > ( ) ) ) . target_precision as * const _ as usize } , 48usize , concat ! ( "Offset of field: " , stringify ! ( FLANNParameters ) , "::" , stringify ! ( target_precision ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < FLANNParameters > ( ) ) ) . build_weight as * const _ as usize } , 52usize , concat ! ( "Offset of field: " , stringify ! ( FLANNParameters ) , "::" , stringify ! ( build_weight ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < FLANNParameters > ( ) ) ) . memory_weight as * const _ as usize } , 56usize , concat ! ( "Offset of field: " , stringify ! ( FLANNParameters ) , "::" , stringify ! ( memory_weight ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < FLANNParameters > ( ) ) ) . sample_fraction as * const _ as usize } , 60usize , concat ! ( "Offset of field: " , stringify ! ( FLANNParameters ) , "::" , stringify ! ( sample_fraction ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < FLANNParameters > ( ) ) ) . table_number_ as * const _ as usize } , 64usize , concat ! ( "Offset of field: " , stringify ! ( FLANNParameters ) , "::" , stringify ! ( table_number_ ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < FLANNParameters > ( ) ) ) . key_size_ as * const _ as usize } , 68usize , concat ! ( "Offset of field: " , stringify ! ( FLANNParameters ) , "::" , stringify ! ( key_size_ ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < FLANNParameters > ( ) ) ) . multi_probe_level_ as * const _ as usize } , 72usize , concat ! ( "Offset of field: " , stringify ! ( FLANNParameters ) , "::" , stringify ! ( multi_probe_level_ ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < FLANNParameters > ( ) ) ) . log_level as * const _ as usize } , 76usize , concat ! ( "Offset of field: " , stringify ! ( FLANNParameters ) , "::" , stringify ! ( log_level ) ) ) ; assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < FLANNParameters > ( ) ) ) . random_seed as * const _ as usize } , 80usize , concat ! ( "Offset of field: " , stringify ! ( FLANNParameters ) , "::" , stringify ! ( random_seed ) ) ) ; } pub type FLANN_INDEX = * mut :: std :: os :: raw :: c_void ; pub type flann_index_t = * mut :: std :: os :: raw :: c_void ; extern "C" { # [ link_name = "\u{1}DEFAULT_FLANN_PARAMETERS" ] pub static mut DEFAULT_FLANN_PARAMETERS : FLANNParameters ; } extern "C" { /// Sets the log level used for all flann functions (unless
/// specified in FLANNParameters for each call
///
/// Params:
/// level = verbosity level
 pub fn flann_log_verbosity ( level : :: std :: os :: raw :: c_int ) ; } extern "C" { /// Sets the distance type to use throughout FLANN.
/// If distance type specified is MINKOWSKI, the second argument
/// specifies which order the minkowski distance should have.
 pub fn flann_set_distance_type ( distance_type : flann_distance_t , order : :: std :: os :: raw :: c_int ) ; } extern "C" { /// Gets the distance type in use throughout FLANN.
 pub fn flann_get_distance_type ( ) -> flann_distance_t ; } extern "C" { /// Gets the distance order in use throughout FLANN (only applicable if minkowski distance
/// is in use).
 pub fn flann_get_distance_order ( ) -> :: std :: os :: raw :: c_int ; } extern "C" { /// Builds and returns an index. It uses autotuning if the target_precision field of index_params
/// is between 0 and 1, or the parameters specified if it's -1.
///
/// Params:
/// dataset = pointer to a data set stored in row major order
/// rows = number of rows (features) in the dataset
/// cols = number of columns in the dataset (feature dimensionality)
/// speedup = speedup over linear search, estimated if using autotuning, output parameter
/// index_params = index related parameters
/// flann_params = generic flann parameters
///
/// Returns: the newly created index or a number <0 for error
 pub fn flann_build_index ( dataset : * mut f32 , rows : :: std :: os :: raw :: c_int , cols : :: std :: os :: raw :: c_int , speedup : * mut f32 , flann_params : * mut FLANNParameters ) -> flann_index_t ; } extern "C" { pub fn flann_build_index_float ( dataset : * mut f32 , rows : :: std :: os :: raw :: c_int , cols : :: std :: os :: raw :: c_int , speedup : * mut f32 , flann_params : * mut FLANNParameters ) -> flann_index_t ; } extern "C" { pub fn flann_build_index_double ( dataset : * mut f64 , rows : :: std :: os :: raw :: c_int , cols : :: std :: os :: raw :: c_int , speedup : * mut f32 , flann_params : * mut FLANNParameters ) -> flann_index_t ; } extern "C" { pub fn flann_build_index_byte ( dataset : * mut :: std :: os :: raw :: c_uchar , rows : :: std :: os :: raw :: c_int , cols : :: std :: os :: raw :: c_int , speedup : * mut f32 , flann_params : * mut FLANNParameters ) -> flann_index_t ; } extern "C" { pub fn flann_build_index_int ( dataset : * mut :: std :: os :: raw :: c_int , rows : :: std :: os :: raw :: c_int , cols : :: std :: os :: raw :: c_int , speedup : * mut f32 , flann_params : * mut FLANNParameters ) -> flann_index_t ; } extern "C" { /// Adds points to pre-built index.
///
/// Params:
/// index_ptr = pointer to index, must already be built
/// points = pointer to array of points
/// rows = number of points to add
/// columns = feature dimensionality
/// rebuild_threshold = reallocs index when it grows by factor of
/// `rebuild_threshold`. A smaller value results is more space efficient
/// but less computationally efficient. Must be greater than 1.
///
/// Returns: 0 if success otherwise -1
 pub fn flann_add_points ( index_ptr : flann_index_t , points : * mut f32 , rows : :: std :: os :: raw :: c_int , columns : :: std :: os :: raw :: c_int , rebuild_threshold : f32 ) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn flann_add_points_float ( index_ptr : flann_index_t , points : * mut f32 , rows : :: std :: os :: raw :: c_int , columns : :: std :: os :: raw :: c_int , rebuild_threshold : f32 ) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn flann_add_points_double ( index_ptr : flann_index_t , points : * mut f64 , rows : :: std :: os :: raw :: c_int , columns : :: std :: os :: raw :: c_int , rebuild_threshold : f32 ) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn flann_add_points_byte ( index_ptr : flann_index_t , points : * mut :: std :: os :: raw :: c_uchar , rows : :: std :: os :: raw :: c_int , columns : :: std :: os :: raw :: c_int , rebuild_threshold : f32 ) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn flann_add_points_int ( index_ptr : flann_index_t , points : * mut :: std :: os :: raw :: c_int , rows : :: std :: os :: raw :: c_int , columns : :: std :: os :: raw :: c_int , rebuild_threshold : f32 ) -> :: std :: os :: raw :: c_int ; } extern "C" { /// Removes a point from a pre-built index.
///
/// index_ptr = pointer to pre-built index.
/// point_id = index of datapoint to remove.
 pub fn flann_remove_point ( index_ptr : flann_index_t , point_id : :: std :: os :: raw :: c_uint ) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn flann_remove_point_float ( index_ptr : flann_index_t , point_id : :: std :: os :: raw :: c_uint ) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn flann_remove_point_double ( index_ptr : flann_index_t , point_id : :: std :: os :: raw :: c_uint ) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn flann_remove_point_byte ( index_ptr : flann_index_t , point_id : :: std :: os :: raw :: c_uint ) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn flann_remove_point_int ( index_ptr : flann_index_t , point_id : :: std :: os :: raw :: c_uint ) -> :: std :: os :: raw :: c_int ; } extern "C" { /// Gets a point from a given index position.
///
/// index_ptr = pointer to pre-built index.
/// point_id = index of datapoint to get.
///
/// Returns: pointer to datapoint or NULL on miss
 pub fn flann_get_point ( index_ptr : flann_index_t , point_id : :: std :: os :: raw :: c_uint ) -> * mut f32 ; } extern "C" { pub fn flann_get_point_float ( index_ptr : flann_index_t , point_id : :: std :: os :: raw :: c_uint ) -> * mut f32 ; } extern "C" { pub fn flann_get_point_double ( index_ptr : flann_index_t , point_id : :: std :: os :: raw :: c_uint ) -> * mut f64 ; } extern "C" { pub fn flann_get_point_byte ( index_ptr : flann_index_t , point_id : :: std :: os :: raw :: c_uint ) -> * mut :: std :: os :: raw :: c_uchar ; } extern "C" { pub fn flann_get_point_int ( index_ptr : flann_index_t , point_id : :: std :: os :: raw :: c_uint ) -> * mut :: std :: os :: raw :: c_int ; } extern "C" { /// Returns the number of datapoints stored in index.
///
/// index_ptr = pointer to pre-built index.
///
 pub fn flann_veclen ( index_ptr : flann_index_t ) -> :: std :: os :: raw :: c_uint ; } extern "C" { pub fn flann_veclen_float ( index_ptr : flann_index_t ) -> :: std :: os :: raw :: c_uint ; } extern "C" { pub fn flann_veclen_double ( index_ptr : flann_index_t ) -> :: std :: os :: raw :: c_uint ; } extern "C" { pub fn flann_veclen_byte ( index_ptr : flann_index_t ) -> :: std :: os :: raw :: c_uint ; } extern "C" { pub fn flann_veclen_int ( index_ptr : flann_index_t ) -> :: std :: os :: raw :: c_uint ; } extern "C" { /// Returns the dimensionality of datapoints stored in index.
///
/// index_ptr = pointer to pre-built index.
///
 pub fn flann_size ( index_ptr : flann_index_t ) -> :: std :: os :: raw :: c_uint ; } extern "C" { pub fn flann_size_float ( index_ptr : flann_index_t ) -> :: std :: os :: raw :: c_uint ; } extern "C" { pub fn flann_size_double ( index_ptr : flann_index_t ) -> :: std :: os :: raw :: c_uint ; } extern "C" { pub fn flann_size_byte ( index_ptr : flann_index_t ) -> :: std :: os :: raw :: c_uint ; } extern "C" { pub fn flann_size_int ( index_ptr : flann_index_t ) -> :: std :: os :: raw :: c_uint ; } extern "C" { /// Returns the number of bytes consumed by the index.
///
/// index_ptr = pointer to pre-built index.
///
 pub fn flann_used_memory ( index_ptr : flann_index_t ) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn flann_used_memory_float ( index_ptr : flann_index_t ) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn flann_used_memory_double ( index_ptr : flann_index_t ) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn flann_used_memory_byte ( index_ptr : flann_index_t ) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn flann_used_memory_int ( index_ptr : flann_index_t ) -> :: std :: os :: raw :: c_int ; } extern "C" { /// Saves the index to a file. Only the index is saved into the file, the dataset corresponding to the index is not saved.
///
/// @param index_id The index that should be saved
/// @param filename The filename the index should be saved to
/// @return Returns 0 on success, negative value on error.
 pub fn flann_save_index ( index_id : flann_index_t , filename : * mut :: std :: os :: raw :: c_char ) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn flann_save_index_float ( index_id : flann_index_t , filename : * mut :: std :: os :: raw :: c_char ) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn flann_save_index_double ( index_id : flann_index_t , filename : * mut :: std :: os :: raw :: c_char ) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn flann_save_index_byte ( index_id : flann_index_t , filename : * mut :: std :: os :: raw :: c_char ) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn flann_save_index_int ( index_id : flann_index_t , filename : * mut :: std :: os :: raw :: c_char ) -> :: std :: os :: raw :: c_int ; } extern "C" { /// Loads an index from a file.
///
/// @param filename File to load the index from.
/// @param dataset The dataset corresponding to the index.
/// @param rows Dataset tors
/// @param cols Dataset columns
/// @return
 pub fn flann_load_index ( filename : * mut :: std :: os :: raw :: c_char , dataset : * mut f32 , rows : :: std :: os :: raw :: c_int , cols : :: std :: os :: raw :: c_int ) -> flann_index_t ; } extern "C" { pub fn flann_load_index_float ( filename : * mut :: std :: os :: raw :: c_char , dataset : * mut f32 , rows : :: std :: os :: raw :: c_int , cols : :: std :: os :: raw :: c_int ) -> flann_index_t ; } extern "C" { pub fn flann_load_index_double ( filename : * mut :: std :: os :: raw :: c_char , dataset : * mut f64 , rows : :: std :: os :: raw :: c_int , cols : :: std :: os :: raw :: c_int ) -> flann_index_t ; } extern "C" { pub fn flann_load_index_byte ( filename : * mut :: std :: os :: raw :: c_char , dataset : * mut :: std :: os :: raw :: c_uchar , rows : :: std :: os :: raw :: c_int , cols : :: std :: os :: raw :: c_int ) -> flann_index_t ; } extern "C" { pub fn flann_load_index_int ( filename : * mut :: std :: os :: raw :: c_char , dataset : * mut :: std :: os :: raw :: c_int , rows : :: std :: os :: raw :: c_int , cols : :: std :: os :: raw :: c_int ) -> flann_index_t ; } extern "C" { /// Builds an index and uses it to find nearest neighbors.
///
/// Params:
/// dataset = pointer to a data set stored in row major order
/// rows = number of rows (features) in the dataset
/// cols = number of columns in the dataset (feature dimensionality)
/// testset = pointer to a query set stored in row major order
/// trows = number of rows (features) in the query dataset (same dimensionality as features in the dataset)
/// indices = pointer to matrix for the indices of the nearest neighbors of the testset features in the dataset
/// (must have trows number of rows and nn number of columns)
/// nn = how many nearest neighbors to return
/// flann_params = generic flann parameters
///
/// Returns: zero or -1 for error
 pub fn flann_find_nearest_neighbors ( dataset : * mut f32 , rows : :: std :: os :: raw :: c_int , cols : :: std :: os :: raw :: c_int , testset : * mut f32 , trows : :: std :: os :: raw :: c_int , indices : * mut :: std :: os :: raw :: c_int , dists : * mut f32 , nn : :: std :: os :: raw :: c_int , flann_params : * mut FLANNParameters ) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn flann_find_nearest_neighbors_float ( dataset : * mut f32 , rows : :: std :: os :: raw :: c_int , cols : :: std :: os :: raw :: c_int , testset : * mut f32 , trows : :: std :: os :: raw :: c_int , indices : * mut :: std :: os :: raw :: c_int , dists : * mut f32 , nn : :: std :: os :: raw :: c_int , flann_params : * mut FLANNParameters ) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn flann_find_nearest_neighbors_double ( dataset : * mut f64 , rows : :: std :: os :: raw :: c_int , cols : :: std :: os :: raw :: c_int , testset : * mut f64 , trows : :: std :: os :: raw :: c_int , indices : * mut :: std :: os :: raw :: c_int , dists : * mut f64 , nn : :: std :: os :: raw :: c_int , flann_params : * mut FLANNParameters ) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn flann_find_nearest_neighbors_byte ( dataset : * mut :: std :: os :: raw :: c_uchar , rows : :: std :: os :: raw :: c_int , cols : :: std :: os :: raw :: c_int , testset : * mut :: std :: os :: raw :: c_uchar , trows : :: std :: os :: raw :: c_int , indices : * mut :: std :: os :: raw :: c_int , dists : * mut f32 , nn : :: std :: os :: raw :: c_int , flann_params : * mut FLANNParameters ) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn flann_find_nearest_neighbors_int ( dataset : * mut :: std :: os :: raw :: c_int , rows : :: std :: os :: raw :: c_int , cols : :: std :: os :: raw :: c_int , testset : * mut :: std :: os :: raw :: c_int , trows : :: std :: os :: raw :: c_int , indices : * mut :: std :: os :: raw :: c_int , dists : * mut f32 , nn : :: std :: os :: raw :: c_int , flann_params : * mut FLANNParameters ) -> :: std :: os :: raw :: c_int ; } extern "C" { /// Searches for nearest neighbors using the index provided
///
/// Params:
/// index_id = the index (constructed previously using flann_build_index).
/// testset = pointer to a query set stored in row major order
/// trows = number of rows (features) in the query dataset (same dimensionality as features in the dataset)
/// indices = pointer to matrix for the indices of the nearest neighbors of the testset features in the dataset
/// (must have trows number of rows and nn number of columns)
/// dists = pointer to matrix for the distances of the nearest neighbors of the testset features in the dataset
/// (must have trows number of rows and 1 column)
/// nn = how many nearest neighbors to return
/// flann_params = generic flann parameters
///
/// Returns: zero or a number <0 for error
 pub fn flann_find_nearest_neighbors_index ( index_id : flann_index_t , testset : * mut f32 , trows : :: std :: os :: raw :: c_int , indices : * mut :: std :: os :: raw :: c_int , dists : * mut f32 , nn : :: std :: os :: raw :: c_int , flann_params : * mut FLANNParameters ) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn flann_find_nearest_neighbors_index_float ( index_id : flann_index_t , testset : * mut f32 , trows : :: std :: os :: raw :: c_int , indices : * mut :: std :: os :: raw :: c_int , dists : * mut f32 , nn : :: std :: os :: raw :: c_int , flann_params : * mut FLANNParameters ) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn flann_find_nearest_neighbors_index_double ( index_id : flann_index_t , testset : * mut f64 , trows : :: std :: os :: raw :: c_int , indices : * mut :: std :: os :: raw :: c_int , dists : * mut f64 , nn : :: std :: os :: raw :: c_int , flann_params : * mut FLANNParameters ) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn flann_find_nearest_neighbors_index_byte ( index_id : flann_index_t , testset : * mut :: std :: os :: raw :: c_uchar , trows : :: std :: os :: raw :: c_int , indices : * mut :: std :: os :: raw :: c_int , dists : * mut f32 , nn : :: std :: os :: raw :: c_int , flann_params : * mut FLANNParameters ) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn flann_find_nearest_neighbors_index_int ( index_id : flann_index_t , testset : * mut :: std :: os :: raw :: c_int , trows : :: std :: os :: raw :: c_int , indices : * mut :: std :: os :: raw :: c_int , dists : * mut f32 , nn : :: std :: os :: raw :: c_int , flann_params : * mut FLANNParameters ) -> :: std :: os :: raw :: c_int ; } extern "C" { /// Performs an radius search using an already constructed index.
///
/// In case of radius search, instead of always returning a predetermined
/// number of nearest neighbours (for example the 10 nearest neighbours), the
/// search will return all the neighbours found within a search radius
/// of the query point.
///
/// The check parameter in the FLANNParameters below sets the level of approximation
/// for the search by only visiting "checks" number of features in the index
/// (the same way as for the KNN search). A lower value for checks will give
/// a higher search speedup at the cost of potentially not returning all the
/// neighbours in the specified radius.
 pub fn flann_radius_search ( index_ptr : flann_index_t , query : * mut f32 , indices : * mut :: std :: os :: raw :: c_int , dists : * mut f32 , max_nn : :: std :: os :: raw :: c_int , radius : f32 , flann_params : * mut FLANNParameters ) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn flann_radius_search_float ( index_ptr : flann_index_t , query : * mut f32 , indices : * mut :: std :: os :: raw :: c_int , dists : * mut f32 , max_nn : :: std :: os :: raw :: c_int , radius : f32 , flann_params : * mut FLANNParameters ) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn flann_radius_search_double ( index_ptr : flann_index_t , query : * mut f64 , indices : * mut :: std :: os :: raw :: c_int , dists : * mut f64 , max_nn : :: std :: os :: raw :: c_int , radius : f32 , flann_params : * mut FLANNParameters ) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn flann_radius_search_byte ( index_ptr : flann_index_t , query : * mut :: std :: os :: raw :: c_uchar , indices : * mut :: std :: os :: raw :: c_int , dists : * mut f32 , max_nn : :: std :: os :: raw :: c_int , radius : f32 , flann_params : * mut FLANNParameters ) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn flann_radius_search_int ( index_ptr : flann_index_t , query : * mut :: std :: os :: raw :: c_int , indices : * mut :: std :: os :: raw :: c_int , dists : * mut f32 , max_nn : :: std :: os :: raw :: c_int , radius : f32 , flann_params : * mut FLANNParameters ) -> :: std :: os :: raw :: c_int ; } extern "C" { /// Deletes an index and releases the memory used by it.
///
/// Params:
/// index_id = the index (constructed previously using flann_build_index).
/// flann_params = generic flann parameters
///
/// Returns: zero or a number <0 for error
 pub fn flann_free_index ( index_id : flann_index_t , flann_params : * mut FLANNParameters ) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn flann_free_index_float ( index_id : flann_index_t , flann_params : * mut FLANNParameters ) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn flann_free_index_double ( index_id : flann_index_t , flann_params : * mut FLANNParameters ) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn flann_free_index_byte ( index_id : flann_index_t , flann_params : * mut FLANNParameters ) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn flann_free_index_int ( index_id : flann_index_t , flann_params : * mut FLANNParameters ) -> :: std :: os :: raw :: c_int ; } extern "C" { /// Clusters the features in the dataset using a hierarchical kmeans clustering approach.
/// This is significantly faster than using a flat kmeans clustering for a large number
/// of clusters.
///
/// Params:
/// dataset = pointer to a data set stored in row major order
/// rows = number of rows (features) in the dataset
/// cols = number of columns in the dataset (feature dimensionality)
/// clusters = number of cluster to compute
/// result = memory buffer where the output cluster centers are storred
/// index_params = used to specify the kmeans tree parameters (branching factor, max number of iterations to use)
/// flann_params = generic flann parameters
///
/// Returns: number of clusters computed or a number <0 for error. This number can be different than the number of clusters requested, due to the
/// way hierarchical clusters are computed. The number of clusters returned will be the highest number of the form
/// (branch_size-1)*K+1 smaller than the number of clusters requested.
 pub fn flann_compute_cluster_centers ( dataset : * mut f32 , rows : :: std :: os :: raw :: c_int , cols : :: std :: os :: raw :: c_int , clusters : :: std :: os :: raw :: c_int , result : * mut f32 , flann_params : * mut FLANNParameters ) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn flann_compute_cluster_centers_float ( dataset : * mut f32 , rows : :: std :: os :: raw :: c_int , cols : :: std :: os :: raw :: c_int , clusters : :: std :: os :: raw :: c_int , result : * mut f32 , flann_params : * mut FLANNParameters ) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn flann_compute_cluster_centers_double ( dataset : * mut f64 , rows : :: std :: os :: raw :: c_int , cols : :: std :: os :: raw :: c_int , clusters : :: std :: os :: raw :: c_int , result : * mut f64 , flann_params : * mut FLANNParameters ) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn flann_compute_cluster_centers_byte ( dataset : * mut :: std :: os :: raw :: c_uchar , rows : :: std :: os :: raw :: c_int , cols : :: std :: os :: raw :: c_int , clusters : :: std :: os :: raw :: c_int , result : * mut f32 , flann_params : * mut FLANNParameters ) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn flann_compute_cluster_centers_int ( dataset : * mut :: std :: os :: raw :: c_int , rows : :: std :: os :: raw :: c_int , cols : :: std :: os :: raw :: c_int , clusters : :: std :: os :: raw :: c_int , result : * mut f32 , flann_params : * mut FLANNParameters ) -> :: std :: os :: raw :: c_int ; }