Loading [MathJax]/extensions/tex2jax.js
1.7.0
Geostatistics & Machine Learning toolbox | https://gstlearn.org
 
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Ball Class Reference

#include <Ball.hpp>

Public Member Functions

 Ball (const double **data=nullptr, int n_samples=0, int n_features=0, double(*dist_function)(const double *x1, const double *x2, int n_features)=nullptr, int leaf_size=10, int default_distance_function=1)
 
 Ball (const Db *dbin, const Db *dbout=nullptr, double(*dist_function)(const double *x1, const double *x2, int n_features)=nullptr, int leaf_size=10, bool has_constraints=false, int default_distance_function=1, bool useSel=false)
 
 Ball (const AMesh *mesh, double(*dist_function)(const double *x1, const double *x2, int n_features)=nullptr, int leaf_size=10, bool has_constraints=false, int default_distance_function=1)
 Construct a new Ball object based on the barycenters of the meshes.
 
 Ball (const Ball &r)
 
Balloperator= (const Ball &p)
 
virtual ~Ball ()
 
void init (const Db *db, double(*dist_function)(const double *x1, const double *x2, int n_features)=nullptr, int leaf_size=10, int default_distance_function=1, bool useSel=false)
 
KNN query (const double **test, int n_samples, int n_features, int n_neighbors=1)
 
KNN queryAsVVD (const VectorVectorDouble &test, int n_neighbors=1)
 
KNN queryOne (const double *test, int n_features, int n_neighbors=1)
 
KNN queryOneAsVD (const VectorDouble &test, int n_neighbors=1)
 
KNN queryOneAsVDFromSP (const SpacePoint &Pt, int n_neighbors=1)
 
VectorInt getIndices (const SpacePoint &Pt, int n_neighbors=1)
 
int queryClosest (const VectorDouble &test)
 
int queryOneInPlace (const VectorDouble &test, int n_neighbors, VectorInt &indices, VectorDouble &distances, int rank=0)
 
void display (int level=-1) const
 Ask for information regarding the Ball Tree organization.
 
int setConstraint (int rank, bool status)
 
int resetConstraints (bool status)
 
bool empty () const
 

Constructor & Destructor Documentation

◆ Ball() [1/4]

Ball::Ball ( const double **  data = nullptr,
int  n_samples = 0,
int  n_features = 0,
double(*)(const double *x1, const double *x2, int n_features)  dist_function = nullptr,
int  leaf_size = 10,
int  default_distance_function = 1 
)

◆ Ball() [2/4]

Ball::Ball ( const Db dbin,
const Db dbout = nullptr,
double(*)(const double *x1, const double *x2, int n_features)  dist_function = nullptr,
int  leaf_size = 10,
bool  has_constraints = false,
int  default_distance_function = 1,
bool  useSel = false 
)

◆ Ball() [3/4]

Ball::Ball ( const AMesh mesh,
double(*)(const double *x1, const double *x2, int n_features)  dist_function = nullptr,
int  leaf_size = 10,
bool  has_constraints = false,
int  default_distance_function = 1 
)

Construct a new Ball object based on the barycenters of the meshes.

Parameters
meshAMesh description
dist_functiontemplate distance function
leaf_sizeNumber of elements in the leafs of the Ball tree
has_constraintsTrue if constraints are applied on the Ball Tree
default_distance_function1 for Euclidean distance, 2 for Manhattan

◆ Ball() [4/4]

Ball::Ball ( const Ball r)

◆ ~Ball()

Ball::~Ball ( )
virtual

Member Function Documentation

◆ display()

void Ball::display ( int  level = -1) const

Ask for information regarding the Ball Tree organization.

Parameters
levelLevel of details -1 Just the general volumetry information 0 List of the different nodes 1 List of Leaves and attached list of samples

◆ empty()

bool Ball::empty ( ) const
inline

◆ getIndices()

VectorInt Ball::getIndices ( const SpacePoint Pt,
int  n_neighbors = 1 
)

◆ init()

void Ball::init ( const Db db,
double(*)(const double *x1, const double *x2, int n_features)  dist_function = nullptr,
int  leaf_size = 10,
int  default_distance_function = 1,
bool  useSel = false 
)

◆ operator=()

Ball & Ball::operator= ( const Ball p)

◆ query()

KNN Ball::query ( const double **  test,
int  n_samples,
int  n_features,
int  n_neighbors = 1 
)

◆ queryAsVVD()

KNN Ball::queryAsVVD ( const VectorVectorDouble test,
int  n_neighbors = 1 
)

◆ queryClosest()

int Ball::queryClosest ( const VectorDouble test)

◆ queryOne()

KNN Ball::queryOne ( const double *  test,
int  n_features,
int  n_neighbors = 1 
)

◆ queryOneAsVD()

KNN Ball::queryOneAsVD ( const VectorDouble test,
int  n_neighbors = 1 
)

◆ queryOneAsVDFromSP()

KNN Ball::queryOneAsVDFromSP ( const SpacePoint Pt,
int  n_neighbors = 1 
)

◆ queryOneInPlace()

int Ball::queryOneInPlace ( const VectorDouble test,
int  n_neighbors,
VectorInt indices,
VectorDouble distances,
int  rank = 0 
)

◆ resetConstraints()

int Ball::resetConstraints ( bool  status)

◆ setConstraint()

int Ball::setConstraint ( int  rank,
bool  status 
)

The documentation for this class was generated from the following files: