#include <matrix.h>
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 () | |
| Destructor. | |
| 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. | |
Classes | |
| class | Accessor |
| An accessor class to be used with LSH index. More... | |
An matrix of size (NxD) is used to store an array of N D-dimensional vectors.
| lshkit::Matrix< T >::Matrix | ( | ) | [inline] |
Default constructor.
Allocates an empty matrix. Should invoke reset or load before using it.
| 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. |
| 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. |