kmeans
A C++ library for k-means
|
Compile-time interface for matrix data. More...
#include <MockMatrix.hpp>
Classes | |
struct | ConsecutiveAccessWorkspace |
Workspace for access to consecutive observations. More... | |
struct | IndexedAccessWorkspace |
Workspace for access to a indexed subset of observations. More... | |
struct | RandomAccessWorkspace |
Workspace for random access to observations. More... | |
Public Types | |
typedef double | data_type |
typedef int | index_type |
typedef int | dimension_type |
Compile-time interface for matrix data.
This defines the expectations for a matrix of observation-level data to be used in Initialize::run()
and Refine::run()
. Each matrix should support extraction of the vector of coordinates for each observation.
Type of the data. Any floating-point type may be used here. Note that this type is only used for data storage; all calculations are done using the Float_
type in Refine
and Initialize
.
Integer type for the dimension indices. Any integer type may be used here, as long as it is large enough to hold the number of dimensions..
Type for the observation indices. Any integer type may be used here, as long as it is large enough to hold the number of observations.
|
inline |
get_observation()
.
|
inline |
[in] | sequence | Pointer to an array of sorted and unique indices of observations, to be accessed in the provided order. It is assumed that the vector will not be deallocated before the destruction of the returned IndexedAccessWorkspace . |
length | Number of observations in sequence . |
get_observation()
.
|
inline |
start | Start of the contiguous block to be accessed consecutively. |
length | Length of the contiguous block to be accessed consecutively. |
get_observation()
.
|
inline |
workspace | Consecutive access workspace. |
num_dimensions()
, containing the coordinates for the next observation.
|
inline |
workspace | Indexed access workspace. |
num_dimensions()
, containing the coordinates for the next observation in the sequence.
|
inline |
i | Index of the observation . |
workspace | Random-access workspace. |
num_dimensions()
, containing the coordinates for observation i
.
|
inline |
|
inline |