bufferkdtree (C sources)
C source code for the Python bufferkdtree implementation
 All Classes Files Functions Variables Typedefs Macros
Functions
util.c File Reference
#include "include/util.h"
Include dependency graph for util.c:

Functions

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)
 

Function Documentation

void check_parameters ( KD_TREE_PARAMETERS params)

Sanity check for parameters

Parameters
*paramsPointer 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
*destPointer to the destination
*srcPointer to the source element
size_eltNumber of bytes per element
FLOAT_TYPE kd_tree_dist ( const FLOAT_TYPE a,
const FLOAT_TYPE b,
int  dim 
)
inline

Computes the distance between point a and b in R^dim

Parameters
*aPointer to first point
*bPointer to second point
dimDimensionality 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
*arrayThe array that shall be processed
countThe number of elements in the array
axisThe axis that shall be used
size_per_eltNumber of bytes a single element occupies
pivot_valueThe pivot element (FLOAT_TYPE)
void set_default_parameters ( KD_TREE_PARAMETERS params)

Sets default parameters.

Parameters
*paramsPointer to struct containg the parameters to be updated
FLOAT_TYPE squared ( FLOAT_TYPE  a)
inline

Computes the square value a*a for a given a.

Parameters
aThe value to be squared
void swap_elements ( void *  p1,
void *  p2,
int  size_elt 
)
inline

Swaps two elements (used by kd_tree_split_training_patterns_via_pivot)

Parameters
*p1Pointer to first element
*p2Pointer to second element
size_eltNumber of bytes per element