CPPDescent 80d9539 (with uncommitted changes)
A C++ KNN-Graph creation library
Loading...
Searching...
No Matches
Classes | Functions | Variables
cppdescent.cpp File Reference

Implementation of the cppdescent library. More...

#include "cppdescent/cppdescent.hpp"
#include <gsl/gsl_blas.h>
#include <gsl/gsl_vector.h>
#include <omp.h>
#include <cmath>
#include <cstdint>
#include <iostream>
Include dependency graph for cppdescent.cpp:

Classes

struct  sets
 

Functions

void destroyEdges (GraphVertexPair *pair)
 
GraphsampleGraph (Vector *data, int K)
 Creates a random graph, where each vertex has K random neighbors.
 
int updateNN (Graph *graph, int K, Pointer u1, Pointer u2, float dist, DistanceFunc distance)
 
struct sets getSets (Vector *neighbors, int K, float rho)
 Get the Sets object.
 

Variables

bool verbose = true
 

Detailed Description

Implementation of the cppdescent library.

Author
Konstantinos Chousos
Version
0.1
Date
2023-10-27

Function Documentation

◆ getSets()

struct sets getSets ( Vector neighbors,
int  K,
float  rho 
)

Get the Sets object.

Returns a sets struct containing a vector pointer to the new[v] set and another to the old[v] set.

The first contains rho*K of direct neighbors with their flag equal to true and rho*K reverse neighbors with true. In other words, it contains 2*rho*K neighbors with flag = true.

The second contains all of the direct neighbors with flag = false, which in the worst case will be K, and rho*K of the reverse neighbors with flag = false. In other words, K + rho*K neighbors with flag = false.

Parameters
neighbors
K
rho
Returns
struct sets

◆ sampleGraph()

Graph * sampleGraph ( Vector data,
int  K 
)

Creates a random graph, where each vertex has K random neighbors.

The user is responsible for deallocating the graph.

Parameters
dataThe Vector with all the points.
K
compare
distance
Returns
Graph* The created graph.