|
Public Methods |
| | Matrix () |
| | Matrix (const int rows, const int columns=1) |
| | Matrix (const MatrixAbstract< T > &that) |
| template<class T2> | Matrix (const MatrixAbstract< T2 > &that) |
| | Matrix (std::istream &stream) |
| | Matrix (T *that, const int rows, const int columns=1) |
| | Attach to memory block pointed to by that.
|
| | Matrix (Pointer &that, const int rows=-1, const int columns=1) |
| | Share memory block with that. rows == -1 or columns == -1 means infer number from size of memory. At least one of {rows, columns} must be positive.
|
| virtual | ~Matrix () |
| void | detach () |
| | Set the state of this matrix as if it has no data. Releases (but only frees if appropriate) any memory.
|
| virtual T & | operator() (const int row, const int column) const |
| | Element accesss.
|
| virtual T & | operator[] (const int row) const |
| | Element access, treating us as a vector.
|
| virtual int | rows () const |
| virtual int | columns () const |
| virtual MatrixAbstract< T > * | duplicate () const |
| | Make a new instance of self on the heap, with shallow copy semantics. Used for views. Since this is class sensitive, it must be overridden.
|
| virtual void | clear (const T scalar=(T) 0) |
| | Set all elements to given value.
|
| virtual void | resize (const int rows, const int columns=1) |
| | Change number of rows and columns. Does not preserve data.
|
| virtual void | copyFrom (const Matrix< T > &that) |
| virtual Matrix | reshape (const int rows, const int columns=1) const |
| virtual T | frob (T n) const |
| | Generalized Frobenius norm: (sum_elements (element^n))^(1/n). Effectively: INFINITY is max, 1 is sum, 2 is standard Frobenius norm.
|
| virtual T | sumSquares () const |
| | Similar to frob(2), but without taking the square root.
|
| virtual T | dot (const Matrix &B) const |
| virtual Matrix | transposeSquare () const |
| | Computes the upper triangular part of the symmetric matrix (~this * this).
|
| virtual MatrixTranspose< T > | operator~ () const |
| virtual Matrix | operator * (const MatrixAbstract< T > &B) const |
| virtual Matrix | operator * (const Matrix &B) const |
| virtual Matrix | operator * (const T scalar) const |
| virtual Matrix | operator/ (const T scalar) const |
| virtual Matrix | operator+ (const Matrix &B) const |
| virtual Matrix | operator- (const Matrix &B) const |
| virtual Matrix & | operator *= (const Matrix &B) |
| virtual MatrixAbstract< T > & | operator *= (const T scalar) |
| | this = this * scalar
|
| virtual MatrixAbstract< T > & | operator/= (const T scalar) |
| | this = this / scalar
|
| virtual Matrix & | operator+= (const Matrix &B) |
| virtual Matrix & | operator-= (const Matrix &B) |
| virtual MatrixAbstract< T > & | operator-= (const T scalar) |
| | Decrease each element by scalar.
|
| virtual void | read (std::istream &stream) |
| virtual void | write (std::ostream &stream, bool withName=false) const |
Public Attributes |
| Pointer | data |
| int | rows_ |
| int | columns_ |