#include <matrix.h>
Public Member Functions | |
| Matrix (void) | |
| Matrix (unsigned int Rows, unsigned int Cols) | |
| Empty Constructor. | |
| Matrix (Z *elements, unsigned int Rows, unsigned int Cols) | |
| Initilizing constructor. | |
| Matrix (const Matrix &A) | |
| Assignment Constructor. | |
| Matrix & | operator= (const Matrix &C) |
| Copy Constructor. | |
| ~Matrix () | |
| Z & | operator() (unsigned int i, unsigned int j) |
| Elementwise Access. | |
| const Z & | operator() (unsigned i, unsigned j) const |
| Matrix & | operator+= (const Matrix &M) |
| In place addition. | |
| Matrix & | operator-= (const Matrix &M) |
| In place subtraction (see above). | |
| Matrix & | operator *= (Matrix M) |
| In place multiplication. | |
| template<typename S> | |
| Matrix & | operator *= (const S &s) |
| In place scalar multiplication. | |
| void | dump (const char *filename) |
| Dump matrix to filename. | |
| void | read (const char *filename) |
| Read matrix from file created by dump(const char*). | |
Public Attributes | |
| Z * | A |
| Pointer to the matrix elements. | |
| unsigned int | M |
| Number of Rows. | |
| unsigned int | N |
| Number of Columns. | |
| Z * | scratch |
| Scratch space for working. | |
Friends | |
| std::ostream & | operator<< (std::ostream &, const Matrix &) |
| Output operator. | |
|
||||||||||
|
|
|
||||||||||||||||
|
Empty Constructor. Takes two arguments specifying the rows and columns |
|
||||||||||||||||||||
|
Initilizing constructor. This takes an additional pointer to an initilizing array containing the matrix elements. For example int a[] = {1,2,3,4}; Matrix<int> A(a,2,2); |
|
||||||||||
|
Assignment Constructor.
|
|
|||||||||
|
|
|
||||||||||
|
Dump matrix to filename.
|
|
||||||||||||||
|
In place scalar multiplication.
|
|
||||||||||
|
In place multiplication.
|
|
||||||||||||||||
|
|
|
||||||||||||||||
|
Elementwise Access.
|
|
||||||||||
|
In place addition. This performs A = A+B. It is usually preferably to do addition like this when you're worried about performance as it doesn't require any temporary variables or copying of return values |
|
||||||||||
|
In place subtraction (see above).
|
|
||||||||||
|
Copy Constructor.
|
|
||||||||||
|
Read matrix from file created by dump(const char*).
|
|
||||||||||||||||
|
Output operator.
|
|
|||||
|
Pointer to the matrix elements.
|
|
|||||
|
Number of Rows.
|
|
|||||
|
Number of Columns.
|
|
|||||
|
Scratch space for working.
|
1.4.1