AnimaL |
Tutorial |
Documentation |
#include <matrix.h>
Size is given to the constructor and can not be modified. In debug mode,range checking is performed on row indices. No range checking is performed on column indices.
Linear algebra operations defined in linear.h (see linear.readme) can be applied.
Definition at line 35 of file matrix.h.
Public Member Functions | |
Matrix (int nrow=0, int ncol=0) | |
Constructor using number of rows and columns. | |
void | resize (int r, int c) |
Resize to r rows and c columns. Data is lost. | |
void | fill (const T &v) |
Assign all entries to v. | |
void | setIdentity () |
Assign to identity. Undefined result if the matrix is not square. Checked by an assert unless -NDEBUG is use as a compile flag. | |
T * | operator[] (int r) |
Access row. | |
const T * | operator[] (int r) const |
Access row read-only. | |
int | nrows () const |
Number of rows. | |
int | ncols () const |
Number of columns. | |
Private Attributes | |
std::vector< T > | value |
the values | |
int | nr |
number of rows | |
int | nc |
number of cols | |
Friends | |
template<class U> friend::std::ostream & | operator<< (::std::ostream &out, const Matrix< U > &m) |
Output operator. | |
template<class U> friend::std::istream & | operator>> (::std::istream &in, animal::Matrix< U > &m) |
Input operator. |
|
Constructor using number of rows and columns.
Definition at line 39 of file matrix.h. References animal::Matrix< T >::nc, animal::Matrix< T >::nr, and animal::Matrix< T >::value. |
|
Assign all entries to v.
Definition at line 55 of file matrix.h. References animal::Matrix< T >::value. Referenced by animal::Matrix< T >::setIdentity(). |
|
Number of columns.
Definition at line 87 of file matrix.h. References animal::Matrix< T >::nc. Referenced by animal::octree::getMatrixInverse(), animal::ncols(), and animal::Matrix< T >::setIdentity(). |
|
Number of rows.
Definition at line 84 of file matrix.h. References animal::Matrix< T >::nr. Referenced by animal::octree::getMatrixInverse(), animal::nrows(), and animal::Matrix< T >::setIdentity(). |
|
Access row read-only.
Definition at line 77 of file matrix.h. References animal::Matrix< T >::nc, animal::Matrix< T >::nr, and animal::Matrix< T >::value. |
|
Access row.
Definition at line 70 of file matrix.h. References animal::Matrix< T >::nc, animal::Matrix< T >::nr, and animal::Matrix< T >::value. |
|
Resize to r rows and c columns. Data is lost.
Definition at line 48 of file matrix.h. References animal::Matrix< T >::nc, animal::Matrix< T >::nr, and animal::Matrix< T >::value. Referenced by animal::octree::Frame::Frame(). |
|
Assign to identity. Undefined result if the matrix is not square. Checked by an assert unless -NDEBUG is use as a compile flag.
Definition at line 62 of file matrix.h. References animal::Matrix< T >::fill(), animal::Matrix< T >::ncols(), animal::Matrix< T >::nr, and animal::Matrix< T >::nrows(). |
|
Output operator.
|
|
Input operator.
|
|
number of cols
Definition at line 114 of file matrix.h. Referenced by animal::Matrix< T >::Matrix(), animal::Matrix< T >::ncols(), animal::Matrix< T >::operator[](), and animal::Matrix< T >::resize(). |
|
number of rows
Definition at line 113 of file matrix.h. Referenced by animal::Matrix< T >::Matrix(), animal::Matrix< T >::nrows(), animal::Matrix< T >::operator[](), animal::Matrix< T >::resize(), and animal::Matrix< T >::setIdentity(). |
|
the values
Definition at line 112 of file matrix.h. Referenced by animal::Matrix< T >::fill(), animal::Matrix< T >::Matrix(), animal::Matrix< T >::operator[](), and animal::Matrix< T >::resize(). |