#include <matrix.h>
Inheritance diagram for fl::MatrixAbstract< T >:

Public Methods | |
| virtual | ~MatrixAbstract () |
| virtual T & | operator() (const int row, const int column) const=0 |
| 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 * | duplicate () const=0 |
| 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)=0 |
| Change number of rows and columns. Does not preserve data. | |
| 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 void | normalize (const T scalar=1.0) |
| View matrix as vector and adjust so frob (2) == scalar. | |
| virtual T | dot (const MatrixAbstract &B) const |
| View both matrices as vectors and return dot product. Ie: returns the sum of the products of corresponding elements. | |
| virtual Matrix< T > | cross (const MatrixAbstract &B) const |
| View both matrices as vectors and return cross product. (Is there a better definition that covers 2D matrices?). | |
| virtual void | identity (const T scalar=1.0) |
| Set main diagonal to scalar and everything else to zero. | |
| virtual MatrixRegion< T > | row (const int r) const |
| Returns a view row r. The matrix is oriented "horizontal". | |
| virtual MatrixRegion< T > | column (const int c) const |
| Returns a view of column c. | |
| virtual MatrixRegion< T > | region (const int firstRow=0, const int firstColumn=0, int lastRow=-1, int lastColumn=-1) const |
| Same as call to MatrixRegion<T> (*this, firstRow, firstColumn, lastRow, lastColumn). | |
| virtual bool | operator== (const MatrixAbstract &B) const |
| Two matrices are equal if they have the same shape and the same elements. | |
| bool | operator!= (const MatrixAbstract &B) const |
| virtual Matrix< T > | operator * (const MatrixAbstract &B) const |
| Multiply matrices: this * B. | |
| virtual Matrix< T > | elementMultiply (const MatrixAbstract &B) const |
| Elementwise multiplication. This isn't a C operator, but certainly a basic operation. | |
| virtual Matrix< T > | operator+ (const MatrixAbstract &B) const |
| Elementwise sum. | |
| virtual Matrix< T > | operator- (const MatrixAbstract &B) const |
| Elementwise difference. | |
| virtual MatrixAbstract & | operator *= (const MatrixAbstract &B) |
| this = this * B | |
| virtual MatrixAbstract & | operator *= (const T scalar) |
| this = this * scalar | |
| virtual MatrixAbstract & | operator/= (const T scalar) |
| this = this / scalar | |
| virtual MatrixAbstract & | operator+= (const MatrixAbstract &B) |
| Elementwise sum, stored back to this. | |
| virtual MatrixAbstract & | operator-= (const MatrixAbstract &B) |
| Elementwise difference, stored back to this. | |
| virtual MatrixAbstract & | 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 |
Static Public Attributes | |
| int | displayWidth = 10 |
| Number of character positions per cell to use when printing out matrix. | |
| int | displayPrecision = 6 |
| Number of significant digits to output. | |
|
|||||||||
|
|
|
||||||||||
|
Set all elements to given value.
Reimplemented in fl::Matrix< T >, fl::MatrixPacked< T >, fl::MatrixSparse< T >, fl::MatrixIdentity< T >, fl::MatrixDiagonal< T >, fl::MatrixTranspose< T >, fl::MatrixRegion< T >, fl::Matrix< float >, fl::Matrix< bool >, and fl::MatrixSparse< int >. |
|
||||||||||
|
Returns a view of column c.
|
|
|||||||||
|
||||||||||
|
View both matrices as vectors and return cross product. (Is there a better definition that covers 2D matrices?).
|
|
||||||||||
|
View both matrices as vectors and return dot product. Ie: returns the sum of the products of corresponding elements.
|
|
|||||||||
|
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.
Implemented in fl::Matrix< T >, fl::Vector< T >, fl::MatrixPacked< T >, fl::MatrixSparse< T >, fl::MatrixIdentity< T >, fl::MatrixDiagonal< T >, fl::MatrixTranspose< T >, fl::MatrixRegion< T >, fl::Matrix2x2< T >, fl::Matrix3x3< T >, fl::Point, fl::Matrix< float >, fl::Matrix< bool >, fl::Vector< float >, fl::MatrixSparse< int >, fl::Matrix2x2< double >, and fl::Matrix2x2< float >. |
|
||||||||||
|
Elementwise multiplication. This isn't a C operator, but certainly a basic operation.
|
|
||||||||||
|
Generalized Frobenius norm: (sum_elements (element^n))^(1/n). Effectively: INFINITY is max, 1 is sum, 2 is standard Frobenius norm.
Reimplemented in fl::Matrix< T >, fl::MatrixSparse< T >, fl::Matrix< float >, fl::Matrix< bool >, and fl::MatrixSparse< int >. |
|
||||||||||
|
Set main diagonal to scalar and everything else to zero.
|
|
||||||||||
|
View matrix as vector and adjust so frob (2) == scalar.
|
|
||||||||||
|
Multiply matrices: this * B.
|
|
||||||||||
|
this = this * scalar
Reimplemented in fl::Matrix< T >, fl::Matrix2x2< T >, fl::Matrix< float >, fl::Matrix< bool >, fl::Matrix2x2< double >, and fl::Matrix2x2< float >. |
|
||||||||||
|
this = this * B
|
|
||||||||||
|
|
|
||||||||||||||||
|
||||||||||
|
Elementwise sum.
|
|
||||||||||
|
Elementwise sum, stored back to this.
|
|
||||||||||
|
Elementwise difference.
|
|
||||||||||
|
Decrease each element by scalar.
Reimplemented in fl::Matrix< T >, fl::Matrix< float >, and fl::Matrix< bool >. |
|
||||||||||
|
Elementwise difference, stored back to this.
|
|
||||||||||
|
this = this / scalar
Reimplemented in fl::Matrix< T >, fl::Matrix< float >, and fl::Matrix< bool >. |
|
||||||||||
|
Two matrices are equal if they have the same shape and the same elements.
|
|
||||||||||
|
Element access, treating us as a vector.
Reimplemented in fl::Matrix< T >, fl::MatrixPacked< T >, fl::MatrixDiagonal< T >, fl::MatrixTranspose< T >, fl::MatrixRegion< T >, fl::Matrix2x2< T >, fl::Matrix3x3< T >, fl::Point, fl::Matrix< float >, fl::Matrix< bool >, fl::Matrix2x2< double >, and fl::Matrix2x2< float >. |
|
||||||||||
|
||||||||||||||||||||||||
|
Same as call to MatrixRegion<T> (*this, firstRow, firstColumn, lastRow, lastColumn).
|
|
||||||||||||||||
|
Change number of rows and columns. Does not preserve data.
Implemented in fl::Matrix< T >, fl::Vector< T >, fl::MatrixPacked< T >, fl::MatrixSparse< T >, fl::MatrixIdentity< T >, fl::MatrixDiagonal< T >, fl::MatrixTranspose< T >, fl::MatrixRegion< T >, fl::Matrix2x2< T >, fl::Matrix3x3< T >, fl::Point, fl::Matrix< float >, fl::Matrix< bool >, fl::Vector< float >, fl::MatrixSparse< int >, fl::Matrix2x2< double >, and fl::Matrix2x2< float >. |
|
||||||||||
|
Returns a view row r. The matrix is oriented "horizontal".
|
|
|||||||||
|
|||||||||
|
Similar to frob(2), but without taking the square root.
Reimplemented in fl::Matrix< T >, fl::Matrix< float >, and fl::Matrix< bool >. |
|
||||||||||||||||
|
|||||
|
Number of significant digits to output.
|
|
|||||
|
Number of character positions per cell to use when printing out matrix.
|
1.2.18