|
Arithmetic Operators |
These are all the basic matrix arithmetic operations that you'd expect. Note that the templated scalar multiplication makes actual matrix multiplication a partial specialization. This might be too much for older MS compilers.
|
| template<typename Z> |
| Matrix< Z > | operator+ (const Matrix< Z > &, const Matrix< Z > &) |
| template<typename Z> |
| Matrix< Z > | operator- (const Matrix< Z > &, const Matrix< Z > &) |
| template<typename Z> |
| Matrix< Z > | operator * (const Z &, const Matrix< Z > &) |
| template<typename Z, typename S> |
| Matrix< Z > | operator * (const S &, const Matrix< Z > &) |
| template<typename Z> |
| Matrix< Z > | operator * (const Matrix< Z > &, const Matrix< Z > &) |
Matrix Functions |
Basic matrix functions like the Adjoint, Determinant etc that don't require any involved calculation. For the 'other' sort of matrix function see the Lapack interface Note that all these functions have reference arguments. This is to avoid an expensive copying of the Matrix argument, but contains a little gotcha. On most compilers (MS VC++ being the exception) this means that things like aren't possible. You should do instead. This wouldn't happen if the functions took const refererences, but then we wouldn be able to use the element access operator M(i,j) in these functions. 'Unresolved Issue' :P
|
| template<typename Z> |
| Matrix< Z > | Adjoint (const Matrix< Z > &) |
| | Adjoint or Transpose (depending on Z).
|
| template<typename Z> |
| Z | Trace (Matrix< Z > &) |
| | Normal Trace.
|
| template<typename Z> |
| Matrix< Z > | PTrace (Matrix< Z > &R, unsigned dA, unsigned dB) |
| | Partial Trace.
|
| template<typename Z> |
| Matrix< Z > | TensorProduct (Matrix< Z > &A, Matrix< Z > &B) |
| | Tensor (or Kronecker or Outer) Product .
|
| template<typename Z> |
| Z | Determinant (Matrix< Z > &M) |
| | Determinant.
|
| template<typename Z> |
| void | SubMatrix (Matrix< Z > &M, Matrix< Z > &S, unsigned i, unsigned j) |
| | Submatrix formed by removing a given row and column.
|
Defines |
| #define | PI 3.1415926535897932384626 |
| #define | SQRT2 1.41421356237309504880169 |
| #define | EABS(a) (abs(a)<1e-15?0.0:abs(a)) |
| #define | EVAL(a) (abs(a)<1e-14?0.0:a) |
Functions |
| template<typename Z> |
| static Z | gconj (const Z &other) |
| template<> |
| static std::complex< double > | gconj< std::complex< double > > (const std::complex< double > &other) |
| template<typename Z> |
| std::ostream & | operator<< (std::ostream &output, const Matrix< Z > &A) |