MTF
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
gnn::GNN< DistType > Class Template Reference
Inheritance diagram for gnn::GNN< DistType >:
gnn::FGNN< DistType >

Public Types

typedef GNNParams ParamType
 
typedef std::shared_ptr< const DistType > DistTypePtr
 

Public Member Functions

 GNN (DistTypePtr _dist_func, int _n_samples, int _n_dims, bool _is_symmetrical=true, const ParamType *gnn_params=nullptr)
 
void computeDistances (const double *dataset)
 
void buildGraph (const double *dataset)
 
void searchGraph (const double *query, const double *dataset, int *nn_ids, double *nn_dists, int K=1)
 
void saveGraph (const char *file_name)
 
void loadGraph (const char *file_name)
 
void buildGraph (const double *X, int k)
 
int searchGraph (const double *Xq, const double *X, int NNs, int K)
 

Protected Member Functions

int getRandNum (int lb, int ub)
 
template<typename ScalarT >
void swap (ScalarT *i, ScalarT *j)
 
void knnSearch2 (const double *Q, IndxDist *dists, const double *X, int rows, int cols, int k)
 
void knnSearch11 (const double *Q, IndxDist *dists, const double *X, int rows, int cols, int k, int *X_inds)
 
int min (int a, int b)
 
void pickKNNs (IndxDist *vis_nodes, int visited, IndxDist **gnn_dists, int K, int *gnns_cap)
 
void addNode (Node *node_i, int nn)
 

Protected Attributes

DistTypePtr dist_func
 
const int n_samples
 
const int n_dims
 
const bool is_symmetrical
 
ParamType params
 
std::vector< Nodenodes
 
MatrixXd dataset_distances
 
int start_node_idx
 
bool dist_computed
 

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