1#ifndef KNNCOLLE_MOCK_MATRIX_HPP
2#define KNNCOLLE_MOCK_MATRIX_HPP
22 MockMatrix(
int num_dim,
int num_obs,
const double* data) : my_num_dim(num_dim), my_num_obs(num_obs), my_data(data), my_long_num_dim(num_dim) {}
50 size_t my_long_num_dim;
101 return my_data + (workspace.at++) * my_long_num_dim;
115template<
typename Dim_,
typename Index_,
typename Data_>
124 SimpleMatrix(Dim_ num_dimensions, Index_ num_observations,
const Data_* data) :
125 my_num_dim(num_dimensions), my_num_obs(num_observations), my_data(data), my_long_num_dim(num_dimensions) {}
130 const Data_* my_data;
131 size_t my_long_num_dim;
137 typedef Data_ data_type;
139 typedef Index_ index_type;
141 typedef Dim_ dimension_type;
148 Index_ num_observations()
const {
152 dimension_type num_dimensions()
const {
156 Workspace create_workspace()
const {
160 const data_type* get_observation(Workspace& workspace)
const {
161 return my_data + (workspace.at++) * my_long_num_dim;
Compile-time interface for matrix data.
Definition MockMatrix.hpp:17
double data_type
Definition MockMatrix.hpp:32
const data_type * get_observation(Workspace &workspace) const
Definition MockMatrix.hpp:100
int dimension_type
Definition MockMatrix.hpp:44
Workspace create_workspace() const
Definition MockMatrix.hpp:88
index_type num_observations() const
Definition MockMatrix.hpp:56
dimension_type num_dimensions() const
Definition MockMatrix.hpp:63
int index_type
Definition MockMatrix.hpp:38
Simple wrapper for an in-memory matrix.
Definition MockMatrix.hpp:116
SimpleMatrix(Dim_ num_dimensions, Index_ num_observations, const Data_ *data)
Definition MockMatrix.hpp:124
Collection of KNN algorithms.
Definition Bruteforce.hpp:22
Workspace for consecutive access to all observations.
Definition MockMatrix.hpp:75