9 #ifndef MKNN_DISTANCE_H_
10 #define MKNN_DISTANCE_H_
16 #include "../metricknn_c.h"
62 typedef void* (*mknn_function_distanceEval_createState)(
MknnDomain *domain_left,
81 void *object_left,
void *object_right,
double current_threshold);
106 void **out_state_distEval,
115 void *state_factory);
127 bool free_parameters_on_distance_release);
const char * mknn_distance_getIdPredefinedDistance(MknnDistance *distance)
The id of the predefined distance.
Definition: distance.c:230
Definition: parameters.c:18
void *(* mknn_function_distanceEval_createState)(MknnDomain *domain_left, MknnDomain *domain_right)
The function of a custom distance that creates a new state.
Definition: mknn_distance.h:62
Definition: distance.c:17
MknnDistanceParams * mknn_distance_getParameters(MknnDistance *distance)
Return the parameters used to create the predefined distance.
Definition: distance.c:235
MknnDistance * mknn_distance_newCustom(mknn_function_distanceEval_createState func_createState, mknn_function_distanceEval_eval func_eval, mknn_function_distanceEval_releaseState func_releaseState)
Creates a new custom distance.
Definition: distance.c:150
void mknn_distance_release(MknnDistance *distance)
Releases the distance.
Definition: distance.c:215
void(* mknn_function_distanceEval_releaseState)(void *state_distEval)
The function of a custom distance that releases a state.
Definition: mknn_distance.h:92
void(* mknn_function_distanceFactory_releaseFactory)(void *state_factory)
The function to release the state of the distance factory.
Definition: mknn_distance.h:114
void(* mknn_function_distanceFactory_createDistEval)(void *state_factory, MknnDomain *domain_left, MknnDomain *domain_right, void **out_state_distEval, mknn_function_distanceEval_eval *out_func_eval, mknn_function_distanceEval_releaseState *out_func_releaseState)
The function of a custom distance factory.
Definition: mknn_distance.h:104
MknnDistance * mknn_distance_newPredefined(MknnDistanceParams *parameters, bool free_parameters_on_distance_release)
Creates a new distance for the given parameters.
Definition: distance.c:139
double(* mknn_function_distanceEval_eval)(void *state_distEval, void *object_left, void *object_right, double current_threshold)
Computes the distance between two objects.
Definition: mknn_distance.h:80
void mknn_distance_save(MknnDistance *distance, const char *filename_write)
The distance is saved to a file.
Definition: distance.c:171
MknnDistanceEval * mknn_distance_newDistanceEval(MknnDistance *distance, MknnDomain *domain_left, MknnDomain *domain_right)
Creates a distance for computing distances between objects of the given domains.
Definition: distance.c:256
MknnDistance * mknn_distance_newCustomFactory(void *state_factory, mknn_function_distanceFactory_createDistEval func_factory, mknn_function_distanceFactory_releaseFactory func_release)
Creates a new custom distance, using a factory method.
Definition: distance.c:161
Definition: distance.c:241
MknnDistance * mknn_distance_restore(const char *filename_read, MknnDistanceParams *more_parameters, bool free_parameters_on_distance_release)
Loads a distance from a file.
Definition: distance.c:188