MetricKnn API
Fast Similarity Search using the Metric Space Approach
mknn_params.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012-2015, Juan Manuel Barrios <juanmanuel@barrios.cl>
3  * All rights reserved.
4  *
5  * This file is part of MetricKnn.
6  * MetricKnn is made available under the terms of the BSD 2-Clause License.
7  */
8 
9 #ifndef MKNN_PARAMS_H_
10 #define MKNN_PARAMS_H_
11 
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
15 
16 #include "../metricknn_c.h"
17 
37 
44  const char *parameters_string);
45 
62  const char *parameters_string);
63 
70  MknnDistanceParams *params_from);
71 
78 
85 
102 void mknn_distanceParams_addString(MknnDistanceParams *params, const char *name,
103  const char *value);
104 
113 void mknn_distanceParams_addDouble(MknnDistanceParams *params, const char *name,
114  double value);
115 
124 void mknn_distanceParams_addInt(MknnDistanceParams *params, const char *name,
125  int64_t value);
126 
135 void mknn_distanceParams_addBool(MknnDistanceParams *params, const char *name,
136 bool value);
137 
147 void mknn_distanceParams_addObject(MknnDistanceParams *params, const char *name,
148  void *value);
166  const char *name);
175  const char *name);
176 
184 int64_t mknn_distanceParams_getInt(MknnDistanceParams *params, const char *name);
185 
193 bool mknn_distanceParams_getBool(MknnDistanceParams *params, const char *name);
194 
203  const char *name);
204 
220  const char *id_dist);
221 
241 
247 MknnIndexParams *mknn_indexParams_newParseString(const char *parameters_string);
248 
261  const char *parameters_string);
262 
269  MknnIndexParams *params_from);
270 
277 
283 const char *mknn_indexParams_toString(MknnIndexParams *params);
300 void mknn_indexParams_addString(MknnIndexParams *params, const char *name,
301  const char *value);
302 
311 void mknn_indexParams_addDouble(MknnIndexParams *params, const char *name,
312  double value);
313 
322 void mknn_indexParams_addInt(MknnIndexParams *params, const char *name,
323  int64_t value);
324 
333 void mknn_indexParams_addBool(MknnIndexParams *params, const char *name,
334 bool value);
335 
345 void mknn_indexParams_addObject(MknnIndexParams *params, const char *name,
346  void *value);
363 const char *mknn_indexParams_getString(MknnIndexParams *params,
364  const char *name);
372 double mknn_indexParams_getDouble(MknnIndexParams *params, const char *name);
373 
381 int64_t mknn_indexParams_getInt(MknnIndexParams *params, const char *name);
382 
390 bool mknn_indexParams_getBool(MknnIndexParams *params, const char *name);
391 
399 void *mknn_indexParams_getObject(MknnIndexParams *params, const char *name);
400 
414 void mknn_indexParams_setIndexId(MknnIndexParams *p, const char *id_index);
415 
422 
437 
449  double range, int64_t max_threads, const char *parameters_string);
450 
462  const char *parameters_string);
463 
470  MknnResolverParams *params_from);
471 
500 void mknn_resolverParams_addString(MknnResolverParams *params, const char *name,
501  const char *value);
502 
511 void mknn_resolverParams_addDouble(MknnResolverParams *params, const char *name,
512  double value);
513 
522 void mknn_resolverParams_addInt(MknnResolverParams *params, const char *name,
523  int64_t value);
524 
533 void mknn_resolverParams_addBool(MknnResolverParams *params, const char *name,
534 bool value);
535 
545 void mknn_resolverParams_addObject(MknnResolverParams *params, const char *name,
546  void *value);
564  const char *name);
573  const char *name);
574 
582 int64_t mknn_resolverParams_getInt(MknnResolverParams *params, const char *name);
583 
591 bool mknn_resolverParams_getBool(MknnResolverParams *params, const char *name);
592 
601  const char *name);
615 void mknn_resolverParams_setKnn(MknnResolverParams *params, int64_t knn);
621 void mknn_resolverParams_setRange(MknnResolverParams *params, double range);
629  int64_t max_threads);
648 
653 #ifdef __cplusplus
654 }
655 #endif
656 
657 #endif
double mknn_resolverParams_getRange(MknnResolverParams *params)
Definition: parameters.c:345
MknnIndexParams * mknn_indexParams_newEmpty()
Creates an empty object.
MknnDistanceParams * mknn_distanceParams_newEmpty()
Creates an empty object.
void mknn_distanceParams_addInt(MknnDistanceParams *params, const char *name, int64_t value)
Adds an integer number to the parameters.
MknnResolverParams * mknn_resolverParams_newEmpty()
Creates an empty object.
bool mknn_indexParams_getBool(MknnIndexParams *params, const char *name)
Returns a boolean value.
Definition: parameters.c:18
double mknn_distanceParams_getDouble(MknnDistanceParams *params, const char *name)
Returns a floating-point number.
void mknn_resolverParams_addDouble(MknnResolverParams *params, const char *name, double value)
Adds a floating point number to the parameters.
void mknn_resolverParams_setKnn(MknnResolverParams *params, int64_t knn)
Sets the K parameter for resolvers in k-NN searches.
Definition: parameters.c:336
void mknn_indexParams_addDouble(MknnIndexParams *params, const char *name, double value)
Adds a floating point number to the parameters.
void * mknn_resolverParams_getObject(MknnResolverParams *params, const char *name)
Returns a object reference.
void mknn_distanceParams_addString(MknnDistanceParams *params, const char *name, const char *value)
Adds a string to the parameters.
void mknn_indexParams_parseString(MknnIndexParams *params, const char *parameters_string)
Parses a string in the format: ID_INDEX,parameter1=value1,parameter2=value2
Definition: parameters.c:236
void mknn_resolverParams_addString(MknnResolverParams *params, const char *name, const char *value)
Adds a string to the parameters.
int64_t mknn_resolverParams_getMaxThreads(MknnResolverParams *params)
Definition: parameters.c:352
void mknn_resolverParams_addBool(MknnResolverParams *params, const char *name, bool value)
Adds an boolean value to the parameters.
MknnResolverParams * mknn_resolverParams_newParseString(int64_t knn, double range, int64_t max_threads, const char *parameters_string)
Creates an empty object and set parameters by calling methods: mknn_resolverParams_setKnn, mknn_resolverParams_setRange, mknn_resolverParams_setMaxThreads, mknn_resolverParams_parseString.
Definition: parameters.c:305
void mknn_resolverParams_addInt(MknnResolverParams *params, const char *name, int64_t value)
Adds an integer number to the parameters.
void * mknn_indexParams_getObject(MknnIndexParams *params, const char *name)
Returns a object reference.
void mknn_distanceParams_release(MknnDistanceParams *params)
Releases the parameters object.
void mknn_distanceParams_addObject(MknnDistanceParams *params, const char *name, void *value)
Adds an object number to the parameters.
void mknn_indexParams_addBool(MknnIndexParams *params, const char *name, bool value)
Adds an boolean value to the parameters.
void mknn_distanceParams_copyAll(MknnDistanceParams *params_to, MknnDistanceParams *params_from)
Copies all the key-values pairs in params_from and adds them to params_to.
MknnIndexParams * mknn_indexParams_newParseString(const char *parameters_string)
Creates an empty object and set parameters by calling method mknn_indexParams_parseString.
Definition: parameters.c:300
double mknn_resolverParams_getDouble(MknnResolverParams *params, const char *name)
Returns a floating-point number.
Definition: parameters.c:23
void mknn_distanceParams_setDistanceId(MknnDistanceParams *p, const char *id_dist)
Definition: parameters.c:318
int64_t mknn_distanceParams_getInt(MknnDistanceParams *params, const char *name)
Returns an integer number.
const char * mknn_resolverParams_toString(MknnResolverParams *params)
Returns a string with the parameters which can be parsed.
Definition: parameters.c:292
void mknn_distanceParams_parseString(MknnDistanceParams *params, const char *parameters_string)
Parses a string in the format: ID_DISTANCE,parameter1=value1,parameter2=value2
Definition: parameters.c:226
int64_t mknn_resolverParams_getInt(MknnResolverParams *params, const char *name)
Returns an integer number.
void mknn_resolverParams_release(MknnResolverParams *params)
Releases the parameters object.
int64_t mknn_indexParams_getInt(MknnIndexParams *params, const char *name)
Returns an integer number.
void mknn_resolverParams_addObject(MknnResolverParams *params, const char *name, void *value)
Adds an object number to the parameters.
void mknn_indexParams_addString(MknnIndexParams *params, const char *name, const char *value)
Adds a string to the parameters.
const char * mknn_resolverParams_getString(MknnResolverParams *params, const char *name)
Returns a string value.
void mknn_indexParams_copyAll(MknnIndexParams *params_to, MknnIndexParams *params_from)
Copies all the key-values pairs in params_from and adds them to params_to.
const char * mknn_distanceParams_getString(MknnDistanceParams *params, const char *name)
Returns a string value.
void mknn_resolverParams_copyAll(MknnResolverParams *params_to, MknnResolverParams *params_from)
Copies all the key-values pairs in params_from and adds them to params_to.
const char * mknn_distanceParams_toString(MknnDistanceParams *params)
Returns a string with the parameters which can be parsed.
Definition: parameters.c:272
void mknn_indexParams_addObject(MknnIndexParams *params, const char *name, void *value)
Adds an object number to the parameters.
bool mknn_distanceParams_getBool(MknnDistanceParams *params, const char *name)
Returns a boolean value.
bool mknn_resolverParams_getBool(MknnResolverParams *params, const char *name)
Returns a boolean value.
Definition: parameters.c:28
const char * mknn_distanceParams_getDistanceId(MknnDistanceParams *p)
Definition: parameters.c:324
const char * mknn_indexParams_toString(MknnIndexParams *params)
Returns a string with the parameters which can be parsed.
Definition: parameters.c:282
void mknn_resolverParams_setMaxThreads(MknnResolverParams *params, int64_t max_threads)
Sets the maximum number of threads to be used by a resolver.
Definition: parameters.c:348
MknnDistanceParams * mknn_distanceParams_newParseString(const char *parameters_string)
Creates an empty object and set parameters by calling method mknn_distanceParams_parseString.
Definition: parameters.c:255
void mknn_distanceParams_addBool(MknnDistanceParams *params, const char *name, bool value)
Adds an boolean value to the parameters.
void mknn_indexParams_setIndexId(MknnIndexParams *p, const char *id_index)
Definition: parameters.c:327
void mknn_distanceParams_addDouble(MknnDistanceParams *params, const char *name, double value)
Adds a floating point number to the parameters.
double mknn_indexParams_getDouble(MknnIndexParams *params, const char *name)
Returns a floating-point number.
void mknn_indexParams_addInt(MknnIndexParams *params, const char *name, int64_t value)
Adds an integer number to the parameters.
void mknn_resolverParams_parseString(MknnResolverParams *params, const char *parameters_string)
Parses a string in the format: parameter1=value1,parameter2=value2
Definition: parameters.c:246
const char * mknn_indexParams_getIndexId(MknnIndexParams *p)
Definition: parameters.c:332
void mknn_indexParams_release(MknnIndexParams *params)
Releases the parameters object.
int64_t mknn_resolverParams_getKnn(MknnResolverParams *params)
Definition: parameters.c:339
const char * mknn_indexParams_getString(MknnIndexParams *params, const char *name)
Returns a string value.
void * mknn_distanceParams_getObject(MknnDistanceParams *params, const char *name)
Returns a object reference.
void mknn_resolverParams_setRange(MknnResolverParams *params, double range)
Sets the range parameter for resolvers in range searches.
Definition: parameters.c:342
Powered by Download MetricKnn