1.5.1
CCC
 
ball_algorithm.cpp File Reference

Functions

double ** copy_double_arrAsVVD (const VectorVectorDouble &arr)
 
double ** copy_double_arr (const double **arr, int row, int col)
 
VectorVectorDouble copy_double_toVVD (const double **arr, int row, int col)
 
int ** copy_int_arr (const int **arr, int row, int col)
 
VectorVectorInt copy_int_toVVI (const int **arr, int row, int col)
 
void swap (int *arr, int i1, int i2)
 
void btree_zero (t_btree *b)
 
int init_node (t_btree *b, int i_node, int idx_start, int idx_end)
 
int find_node_split_dim (double **data, const int *node_indices, int n_features, int n_points)
 
int partition_node_indices (double **data, int *node_indices, int split_dim, int n_points, int split_index)
 
void recursive_build (t_btree *b, int i_node, int idx_start, int idx_end)
 
void define_dist_function (double(*dist_function)(const double *x1, const double *x2, int size), int default_distance_function)
 
t_btreebtree_init (const double **data, int n_samples, int n_features, double(*dist_function)(const double *x1, const double *x2, int size), int leaf_size, int default_distance_function)
 
double min_dist (t_btree *tree, int i_node, const double *pt)
 
int query_depth_first (t_btree *b, int i_node, const double *pt, int i_pt, t_nheap *heap, double dist)
 
void free_2d_double (double **arr, int row)
 
void free_2d_int (int **arr, int row)
 
void free_tree (t_btree *tree)
 
void btree_display (const t_btree *tree, int level)
 
double manhattan_distance (const double *x1, const double *x2, int size)
 
double euclidean_distance (const double *x1, const double *x2, int size)
 

Variables

static double(* st_distance_function )(const double *, const double *, int) = euclidean_distance
 

Function Documentation

◆ btree_display()

void btree_display ( const t_btree tree,
int  level 
)

◆ btree_init()

t_btree* btree_init ( const double **  data,
int  n_samples,
int  n_features,
double(*)(const double *x1, const double *x2, int size)  dist_function,
int  leaf_size,
int  default_distance_function 
)

◆ btree_zero()

void btree_zero ( t_btree b)

◆ copy_double_arr()

double** copy_double_arr ( const double **  arr,
int  row,
int  col 
)

◆ copy_double_arrAsVVD()

double** copy_double_arrAsVVD ( const VectorVectorDouble arr)

◆ copy_double_toVVD()

VectorVectorDouble copy_double_toVVD ( const double **  arr,
int  row,
int  col 
)

◆ copy_int_arr()

int** copy_int_arr ( const int **  arr,
int  row,
int  col 
)

◆ copy_int_toVVI()

VectorVectorInt copy_int_toVVI ( const int **  arr,
int  row,
int  col 
)

◆ define_dist_function()

void define_dist_function ( double(*)(const double *x1, const double *x2, int size)  dist_function,
int  default_distance_function 
)

◆ euclidean_distance()

double euclidean_distance ( const double *  x1,
const double *  x2,
int  size 
)

Returns the Standard distance between two points

Parameters
x1Vector of coordinates for the first point
x2Vector of coordinates for the second point
sizeNumber of coordinates
Returns

◆ find_node_split_dim()

int find_node_split_dim ( double **  data,
const int *  node_indices,
int  n_features,
int  n_points 
)

◆ free_2d_double()

void free_2d_double ( double **  arr,
int  row 
)

◆ free_2d_int()

void free_2d_int ( int **  arr,
int  row 
)

◆ free_tree()

void free_tree ( t_btree tree)

◆ init_node()

int init_node ( t_btree b,
int  i_node,
int  idx_start,
int  idx_end 
)

◆ manhattan_distance()

double manhattan_distance ( const double *  x1,
const double *  x2,
int  size 
)

Returns the Manhattan distance between two points

Parameters
x1Vector of coordinates for the first point
x2Vector of coordinates for the second point
sizeNumber of coordinates
Returns

◆ min_dist()

double min_dist ( t_btree tree,
int  i_node,
const double *  pt 
)

◆ partition_node_indices()

int partition_node_indices ( double **  data,
int *  node_indices,
int  split_dim,
int  n_points,
int  split_index 
)

◆ query_depth_first()

int query_depth_first ( t_btree b,
int  i_node,
const double *  pt,
int  i_pt,
t_nheap heap,
double  dist 
)

◆ recursive_build()

void recursive_build ( t_btree b,
int  i_node,
int  idx_start,
int  idx_end 
)

◆ swap()

void swap ( int *  arr,
int  i1,
int  i2 
)

Variable Documentation

◆ st_distance_function

double(* st_distance_function) (const double *, const double *, int) ( const double *  ,
const double *  ,
int   
) = euclidean_distance
static