#include "global.h"
#include <stdlib.h>
#include <assert.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
Go to the source code of this file.
|
void | set_default_parameters (KD_TREE_PARAMETERS *params) |
|
void | check_parameters (KD_TREE_PARAMETERS *params) |
|
void | partition_array_via_pivot (void *array, int count, int axis, int size_per_elt, FLOAT_TYPE pivot_value) |
|
void | swap_elements (void *p1, void *p2, int size_elt) |
|
void | copy_element (void *dest, const void *src, int size_elt) |
|
FLOAT_TYPE | squared (FLOAT_TYPE a) |
|
FLOAT_TYPE | kd_tree_dist (const FLOAT_TYPE *a, const FLOAT_TYPE *b, int dim) |
|
Sanity check for parameters
- Parameters
-
*params | Pointer to struct containg the parameters to be checked |
void copy_element |
( |
void * |
dest, |
|
|
const void * |
src, |
|
|
int |
size_elt |
|
) |
| |
|
inline |
Copies an element (used by kd_tree_split_training_patterns_via_pivot)
- Parameters
-
*dest | Pointer to the destination |
*src | Pointer to the source element |
size_elt | Number of bytes per element |
Computes the distance between point a and b in R^dim
- Parameters
-
*a | Pointer to first point |
*b | Pointer to second point |
dim | Dimensionality of points |
void partition_array_via_pivot |
( |
void * |
array, |
|
|
int |
count, |
|
|
int |
axis, |
|
|
int |
size_per_elt, |
|
|
FLOAT_TYPE |
pivot_value |
|
) |
| |
Partitions a given array based on a pivot element and a given axis
- Parameters
-
*array | The array that shall be processed |
count | The number of elements in the array |
axis | The axis that shall be used |
size_per_elt | Number of bytes a single element occupies |
pivot_value | The pivot element (FLOAT_TYPE) |
Sets default parameters.
- Parameters
-
*params | Pointer to struct containg the parameters to be updated |
Computes the square value a*a for a given a.
- Parameters
-
void swap_elements |
( |
void * |
p1, |
|
|
void * |
p2, |
|
|
int |
size_elt |
|
) |
| |
|
inline |
Swaps two elements (used by kd_tree_split_training_patterns_via_pivot)
- Parameters
-
*p1 | Pointer to first element |
*p2 | Pointer to second element |
size_elt | Number of bytes per element |