![]() |
STAG C++
2.0.0
Spectral Toolkit of Algorithms for Graphs
|
#include <data.h>
A data point in d-dimensional space.
A point is defined by its dimension, and a pointer to a C-style array of coordinates. This structure uses C arrays in order that the calling code can use any structure desired to store the underlying data.
The calling code is always responsible for the underlying data, and ensuring that for the life of the DataPoint object, the underlying data array does not move.
For example, the data can be stored in C++ vectors or an Eigen matrix.
Public Member Functions | |
DataPoint (StagUInt d, StagReal *coords) | |
DataPoint (DenseMat &all_data, StagInt row_index) | |
DataPoint (std::vector< StagReal > &point_vector) | |
std::vector< StagReal > | to_vector () |
Public Attributes | |
StagUInt | dimension |
StagReal * | coordinates |
Initialise a data point with an explicit dimension, and a pointer to the data array.
d | the dimension of the data point |
coords | a pointer to the array of coordinates |
Initialise a data point to point to a given row of a dense matrix.
all_data | a dense matrix containing a full data set |
row_index | the index of the row containing this data point |
|
explicit |
Initialise a data point to point to the data array of a given vector.
point_vector | a vector containing one data point. |
std::vector< StagReal > stag::DataPoint::to_vector | ( | ) |
Convert the data point to a vector.
StagUInt stag::DataPoint::dimension |
The dimension of the data point.
StagReal* stag::DataPoint::coordinates |
A pointer to a C-style array containing the data point.