9 #ifndef MKNN_DATASET_LOADER_H_
10 #define MKNN_DATASET_LOADER_H_
16 #include "../metricknn_c.h"
44 typedef void *(*mknn_function_dataset_getObject)(
void *data_pointer,
101 MknnDomain *domain,
bool free_domain_on_dataset_release);
124 bool free_each_object_on_dataset_release,
125 bool free_object_array_on_dataset_release,
126 bool free_domain_on_dataset_release);
148 bool free_vectors_header_on_dataset_release, int64_t num_vectors,
149 int64_t vector_dimensions,
MknnDatatype vector_dimension_datatype);
172 bool free_vectors_header_on_dataset_release, int64_t num_vectors,
173 MknnDomain *domain,
bool free_domain_on_dataset_release);
205 MknnDataset **subdatasets,
bool free_subdatasets_on_dataset_release);
216 int64_t position_start, int64_t length,
217 bool free_superdataset_on_release);
228 int64_t *positions, int64_t num_positions,
229 bool free_superdataset_on_release);
240 double sample_size_or_fraction,
bool free_superdataset_on_release);
254 int64_t dimension,
double dimension_minValueIncluded,
255 double dimension_maxValueNotIncluded,
271 MknnDataset **subdatasets,
bool free_subdatasets_on_dataset_release);
282 bool free_domain_on_dataset_release);
292 bool free_superdataset_on_release);
304 int64_t start_position,
305 bool free_superdataset_on_release);
MknnDataset * mknn_datasetLoader_SubsetRandomSample(MknnDataset *superdataset, double sample_size_or_fraction, bool free_superdataset_on_release)
Creates a new dataset as a random sample of superdataset.
Definition: dataset_subset_positions.c:48
void(* mknn_function_dataset_releaseDataPointer)(void *data_pointer)
Function parameter for mknn_datasetLoader_Custom.
Definition: mknn_dataset_loader.h:63
MknnDataset * mknn_datasetLoader_SubsetSegment(MknnDataset *superdataset, int64_t position_start, int64_t length, bool free_superdataset_on_release)
Creates a new dataset which is a subset of a bigger dataset.
Definition: dataset_subset_segment.c:31
Definition: distance.c:17
MknnDataset * mknn_datasetLoader_PointerArray(void **object_array, int64_t num_objects, MknnDomain *domain, bool free_each_object_on_dataset_release, bool free_object_array_on_dataset_release, bool free_domain_on_dataset_release)
Creates a new dataset from an array of objects.
Definition: dataset_pointersArray.c:39
MknnDataset * mknn_datasetLoader_SubsetPositions(MknnDataset *superdataset, int64_t *positions, int64_t num_positions, bool free_superdataset_on_release)
Creates a new dataset which is a subset of a bigger dataset.
Definition: dataset_subset_positions.c:33
void(* mknn_function_dataset_pushObject)(void *data_pointer, void *object)
Function parameter for mknn_datasetLoader_Custom.
Definition: mknn_dataset_loader.h:54
MknnDataset * mknn_datasetLoader_reorderNearestNeighbor(MknnDataset *superdataset, MknnDistance *distance, int64_t start_position, bool free_superdataset_on_release)
Creates a new dataset which is a permutation of superdataset, where the first position is given by st...
Definition: dataset_reorder.c:48
int64_t(* mknn_function_dataset_getNumObjects)(void *data_pointer)
Function parameter for mknn_datasetLoader_Custom.
Definition: mknn_dataset_loader.h:35
MknnDataset * mknn_datasetLoader_ParseStringsFile(const char *filename)
Creates a new dataset by reading a text file with strings.
Definition: dataset_parse.c:64
MknnDataset * mknn_datasetLoader_UniformRandomVectors(int64_t num_objects, int64_t dimension, double dimension_minValueIncluded, double dimension_maxValueNotIncluded, MknnDatatype vectors_dimension_datatype)
Creates a new dataset with random vectors of the given datatype.
Definition: dataset_random.c:79
MknnDataset * mknn_datasetLoader_MultiObject(int64_t num_subdatasets, MknnDataset **subdatasets, bool free_subdatasets_on_dataset_release)
Creates a new dataset where each object is a multi-object.
Definition: dataset_multiobject.c:40
MknnDataset * mknn_datasetLoader_PointerCompactVectors_alt(void *vectors_header, bool free_vectors_header_on_dataset_release, int64_t num_vectors, MknnDomain *domain, bool free_domain_on_dataset_release)
Creates a new dataset from a data array.
Definition: dataset_compactVectors.c:34
void(* mknn_function_dataset_releaseObject)(void *object_pointer)
Function parameter for mknn_dataset_pushObject Releases the storage of the object.
Definition: mknn_dataset_loader.h:71
MknnDataset * mknn_datasetLoader_Empty(MknnDomain *domain, bool free_domain_on_dataset_release)
Creates a new empty dataset that can dynamically grow as new objects are added.
Definition: dataset_dynamic.c:35
MknnDataset * mknn_datasetLoader_ParseVectorFile(const char *filename, MknnDatatype datatype)
Creates a new dataset by reading a text file with vectors.
Definition: dataset_parse.c:11
MknnDataset * mknn_datasetLoader_PointerCompactVectors(void *vectors_header, bool free_vectors_header_on_dataset_release, int64_t num_vectors, int64_t vector_dimensions, MknnDatatype vector_dimension_datatype)
Creates a new dataset from a data array.
Definition: dataset_compactVectors.c:54
MknnDataset * mknn_datasetLoader_Concatenate(int64_t num_subdatasets, MknnDataset **subdatasets, bool free_subdatasets_on_dataset_release)
Creates a new dataset which is the concatenation of one or more datasets.
Definition: dataset_concatenate.c:40
Represents a constant for a datatype, like integer 8bits, float 32 bits, etc.
Definition: metricknn_c.h:35
void *(* mknn_function_dataset_getObject)(void *data_pointer, int64_t pos)
Function parameter for mknn_datasetLoader_Custom.
Definition: mknn_dataset_loader.h:44
MknnDataset * mknn_datasetLoader_reorderRandomPermutation(MknnDataset *superdataset, bool free_superdataset_on_release)
Creates a new dataset as a random permutation of superdataset.
Definition: dataset_reorder.c:11
MknnDataset * mknn_datasetLoader_Custom(void *data_pointer, mknn_function_dataset_getNumObjects func_getNumObjects, mknn_function_dataset_getObject func_getObject, mknn_function_dataset_pushObject func_pushObject, mknn_function_dataset_releaseDataPointer func_releaseDataPointer, MknnDomain *domain, bool free_domain_on_dataset_release)
Creates a new custom dataset.
Definition: dataset.c:24