MetricKnn API
Fast Similarity Search using the Metric Space Approach
mknn_domain.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_DOMAIN_H_
10 #define MKNN_DOMAIN_H_
11 
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
15 
16 #include "../metricknn_c.h"
17 
48 
65 MknnDomain *mknn_domain_newVector(int64_t num_dimensions,
66  MknnDatatype dimension_datatype);
67 
75 
83 
90  int64_t num_vectors);
91 
99  void *vectors_array, int64_t pos_vector);
100 
109 
129 MknnDomain *mknn_domain_newMultiobject(int64_t length, MknnDomain **subdomains,
130 bool free_subdomains_on_domain_release);
131 
139 
149  int64_t num_subdomain);
150 
167 MknnDomain *mknn_domain_newCustomObject(int64_t custom_id, void *custom_data);
173 int64_t mknn_domain_custom_getId(MknnDomain *domain);
180 
190 
199 
208 
217 
238 bool mknn_domain_testEqual(MknnDomain *domain1, MknnDomain *domain2);
239 
253  MknnDomain *domain2);
254 
261 char *mknn_domain_toString(MknnDomain *domain);
262 
270 MknnDomain *mknn_domain_newParseString(const char *string_domain);
271 
279 
288 void mknn_domain_release(MknnDomain *domain);
289 
290 #ifdef __cplusplus
291 }
292 #endif
293 
294 #endif
bool mknn_domain_isGeneralDomainVector(MknnDomain *domain)
Returns true if the general domain is vector.
Definition: domain.c:74
bool mknn_domain_isGeneralDomainString(MknnDomain *domain)
Returns true if the general domain is string.
Definition: domain.c:77
void * mknn_domain_vector_createNewEmptyVectors(MknnDomain *domain, int64_t num_vectors)
Creates an array with the size to store consecutive num_vectors.
Definition: domain.c:96
int64_t mknn_domain_vector_getVectorLengthInBytes(MknnDomain *domain)
Returns total size in bytes for one vector, which corresponds to dimensions * sizeof(datatype), where the size of a datatype is given by mknn_datatype_sizeof.
Definition: domain.c:93
MknnDatatype mknn_domain_vector_getDimensionDataType(MknnDomain *domain)
Returns the dimension datatype of the vectors.
Definition: domain.c:90
char * mknn_domain_toString(MknnDomain *domain)
Creates a text representation of the domain and its attributes.
Definition: domain.c:175
bool mknn_domain_testEqual(MknnDomain *domain1, MknnDomain *domain2)
Two domains are equal if they coincide in their general domains and all their attributes.
Definition: domain.c:166
int64_t mknn_domain_multiobject_getLength(MknnDomain *domain)
The number of objects in the multi-object, i.e., the size of the void** array.
Definition: domain.c:105
int64_t mknn_domain_custom_getId(MknnDomain *domain)
Definition: domain.c:114
int64_t mknn_domain_vector_getNumDimensions(MknnDomain *domain)
Returns the number of dimensions of the vectors.
Definition: domain.c:87
MknnDomain * mknn_domain_newMultiobject(int64_t length, MknnDomain **subdomains, bool free_subdomains_on_domain_release)
Creates a new domain object that represents a multi-object, i.e., the combination of many objects in ...
Definition: domain.c:47
Represents a broad type of objects, like strings, vectors, etc.
Definition: metricknn_c.h:28
void * mknn_domain_vector_getVectorInArray(MknnDomain *domain, void *vectors_array, int64_t pos_vector)
Definition: domain.c:100
bool mknn_domain_testEqualExceptDatatype(MknnDomain *domain1, MknnDomain *domain2)
Two domains are equalExceptDatatype if they coincide in their general domains and all their attribute...
Definition: domain.c:170
bool mknn_domain_isGeneralDomainCustomObject(MknnDomain *domain)
Returns true if the general domain is custom-object.
Definition: domain.c:84
MknnDomain * mknn_domain_multiobject_getSubDomain(MknnDomain *domain, int64_t num_subdomain)
The domain of each object in the multi-object.
Definition: domain.c:108
MknnDomain * mknn_domain_newClone(MknnDomain *domain)
Duplicates a domain.
Definition: domain.c:238
bool mknn_domain_isGeneralDomainMultiObject(MknnDomain *domain)
Returns true if the general domain is multi-object.
Definition: domain.c:80
MknnDomain * mknn_domain_newCustomObject(int64_t custom_id, void *custom_data)
Creates a new domain object that represents a multi-object, i.e., the combination of many objects in ...
Definition: domain.c:60
void mknn_domain_release(MknnDomain *domain)
Releases the memory used by the domain.
Definition: domain.c:121
MknnGeneralDomain mknn_domain_getGeneralDomain(MknnDomain *domain)
Returns the general domain of the given domain object.
Definition: domain.c:68
MknnDomain * mknn_domain_newString()
Creates a new domain object that represents strings.
Definition: domain.c:29
MknnDomain * mknn_domain_newParseString(const char *string_domain)
Creates a new domain object by parsing a string representation generated by mknn_domain_toString.
Definition: domain.c:204
Represents a constant for a datatype, like integer 8bits, float 32 bits, etc.
Definition: metricknn_c.h:35
void * mknn_domain_custom_getData(MknnDomain *domain)
Definition: domain.c:117
Definition: domain.c:11
MknnDomain * mknn_domain_newVector(int64_t num_dimensions, MknnDatatype dimension_datatype)
Creates a new domain object that represents a vector of some fixed dimension and datatype.
Definition: domain.c:35
Powered by Download MetricKnn