knncolle
Collection of KNN methods in C++
|
Compile-time interface for matrix data. More...
#include <MockMatrix.hpp>
Classes | |
struct | Workspace |
Workspace for consecutive access to all observations. More... | |
Public Types | |
typedef double | data_type |
typedef int | index_type |
typedef int | dimension_type |
Public Member Functions | |
index_type | num_observations () const |
dimension_type | num_dimensions () const |
Workspace | create_workspace () const |
const data_type * | get_observation (Workspace &workspace) const |
Compile-time interface for matrix data.
This defines the expectations for a matrix of observation-level data to be used in Builder::build_raw()
. Each matrix should support extraction of the vector of coordinates for each observation.
typedef double knncolle::MockMatrix::data_type |
Type of the data. Any floating-point type may be used here.
typedef int knncolle::MockMatrix::dimension_type |
Integer type for the dimension indices. Any integer type may be used here.
typedef int knncolle::MockMatrix::index_type |
Type for the observation indices. Any integer type may be used here.
|
inline |
get_observation()
. workspace | Workspace for consecutive access. |
num_dimensions()
, containing the coordinates for the next observation.For a newly created Workspace
, the first call to get_observation()
should return the coordinates of the first observation in the dataset; the next call should return the coordinates of the second observation; and so on, for up to num_observations()
calls, after which the Workspace
should no longer be used.
|
inline |
|
inline |