lshkit::Matrix< T > Class Template Reference

Matrix. More...

#include <matrix.h>

List of all members.

Public Member Functions

void reset (int _dim, int _N)
 Reset the size of matrix.
void free (void)
 Release memory.
 Matrix ()
 Default constructor.
 Matrix (int _dim, int _N)
 Constructor, same as Matrix() followed immediately by reset().
 ~Matrix ()
const T * operator[] (int i) const
 Access the ith vector.
T * operator[] (int i)
 Access the ith vector.
T **const getVecs () const
 Get the list of vectors (be careful!).
int getDim () const
int getSize () const
void load (const std::string &path)
void save (const std::string &path)
void load (std::istream &is)
void save (std::ostream &os)
 Matrix (const std::string &path)
 Construct from a file.

Static Public Member Functions

static void peek (const std::string &path, int *elem_size, int *size, int *dim)
 Peek into a file to determine the size and dimension of the dataset.


class  Accessor
 An accessor class to be used with LSH index. More...

Detailed Description

template<class T>
class lshkit::Matrix< T >


An matrix of size (NxD) is used to store an array of N D-dimensional vectors.

Constructor & Destructor Documentation

template<class T>
lshkit::Matrix< T >::Matrix (  )  [inline]

Default constructor.

Allocates an empty matrix. Should invoke reset or load before using it.

Member Function Documentation

template<class T>
static void lshkit::Matrix< T >::peek ( const std::string &  path,
int *  elem_size,
int *  size,
int *  dim 
) [static]

Peek into a file to determine the size and dimension of the dataset.

path File to peek.
elem_size Size of the vector element.
size Number of vectors in the file.
dim Dimension of the vectors.
This function doesn't read the whole matrix into memory, so it is fast.

template<class T>
void lshkit::Matrix< T >::reset ( int  _dim,
int  _N 
) [inline]

Reset the size of matrix.

dim Dimension of each feature vector.
N Number of feature vectors.

The documentation for this class was generated from the following file:
Get LSHKIT at Fast, secure and Free Open Source software downloads doxygen