#include <matrix.h>
Inheritance diagram for PLib::Matrix< T >:
Public Member Functions | |
Matrix (const int r, const int c) | |
Matrix (const Matrix< T > &M) | |
Matrix (T *p, const int r, const int c) | |
Matrix< T > & | operator= (const Matrix< T > &) |
T | operator= (const T v) |
void | submatrix (int i, int j, Matrix< T > &) |
void | as (int rw, int cl, Matrix< T > &) |
Matrix< T > | get (int rw, int cl, int nr, int nc) const |
Matrix< T > & | operator+= (const Matrix< T > &) |
Matrix< T > & | operator-= (const Matrix< T > &) |
Matrix< T > & | operator+= (double d) |
Matrix< T > & | operator-= (double d) |
Matrix< T > & | operator *= (double d) |
Matrix< T > & | operator/= (double d) |
Matrix< T > | herm () const |
Matrix< T > | transpose () const |
Matrix< T > | flop () const |
T | trace () const |
double | norm (void) |
void | diag (const T fv) |
Vector< T > | getDiag () |
void | qSort () |
int | read (char *filename) |
int | read (char *filename, int rows, int cols) |
int | write (char *filename) |
int | writeRaw (char *filename) |
Friends | |
class | LAPACK |
Matrix< T > | operator+ (const Matrix< T > &, const Matrix< T > &) |
Matrix< T > | operator- (const Matrix< T > &, const Matrix< T > &) |
Matrix< T > | operator * (const Matrix< T > &, const Matrix< T > &) |
Matrix< T > | operator * (const double, const Matrix< T > &) |
Matrix< T > | operator * (const Complex &, const Matrix< T > &) |
Vector< T > | operator * (const Matrix< T > &, const Vector< T > &) |
int | operator== (const Matrix< T > &, const Matrix< T > &) |
int | operator!= (const Matrix< T > &a, const Matrix< T > &b) |
This is a matrix class which has basic mathematical operators and some routines for input/output.
|
copies a matrix into this matrix starting at index (rw,cl)
|
|
sets the diagonal of the matrix to a Sets the diagonal points of the matrix to a. The diagonal points are (0,0),(1,1),(2,2),etc.
|
|
returns the matrix flopped The flop pixel (i,j) = (i,cols-j-1)
|
|
returns the matrix of size (nr,nc) starting at (rw,cl).
|
|
returns the diagonal of the matrix Returns a vector with the component [i] being set to the component (i,i) of the matrix.
|
|
computes the hermitian of the matrix This functions returns a matrix for which every elements (i,j) correspond to the element (j,i) of the original matrix.
|
|
Finds the first norm of the matrix.
|
|
multiply every elements by a double
|
|
increase every elements by a double
|
|
adds a matrix to itself
|
|
decrease every elements by a double
|
|
self substraction This will substract the matrix a from the matrix. The result is thus matrix = matrix - a.
|
|
divide every elements by a double
|
|
assignment operator
Reimplemented in PLib::MatrixRT< T >. |
|
read a raw file containing a matrix of size $(r,c)$ Reads a file containing raw data of a matrix of size $(r,c)$.
|
|
read a matrix file Reads a matrix file. The format of a file is { rows() cols() data...}, where rows() and cols() are int and data is a vector of the matrix type.
|
|
sets the submatrix (s_r,s_c) to a .
|
|
The sum of all diagonal elements.
|
|
returns the transpose of the matrix
|
|
write a matrix into a Matrix file Writes a matrix file. The format of the file is { rows() cols() data...}, where rows() and cols() are int and data is a vector of the matrix type.
|
|
write the raw data to a file Writes the raw data to a file. The size information is {not} written to the file.
|
|
multiplies a matrix with a vector
|
|
multiplies a matrix with a complex value
|
|
the multiplication operator
|
|
the addition operator
|
|
the substraction operator
|
|
the equality operator Every elements are compared with each others. If one of them in matrix a is not equal to the one in matrix b, then the result is negative.
|