#include <matrix.h>
Inheritance diagram for PLib::Matrix:
Public Methods | |
Matrix (const int r, const int c) | |
Matrix () | |
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.
Definition at line 67 of file matrix.h.
|
copies a matrix into this matrix starting at index (rw,cl).
Definition at line 157 of file matrix.cpp. References PLib::Basic2DArray::cols, PLib::Basic2DArray::m, and PLib::Basic2DArray::rows. |
|
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.
Definition at line 284 of file matrix.cpp. References PLib::Basic2DArray::cols, and PLib::Basic2DArray::rows. Referenced by PLib::MatrixRT::MatrixRT, and PLib::MatrixRT::translate. |
|
returns the matrix flopped.
The flop pixel (i,j) = (i,cols-j-1)
Definition at line 795 of file matrix.cpp. References PLib::Basic2DArray::cols, and PLib::Basic2DArray::rows. |
|
returns the matrix of size (nr,nc) starting at (rw,cl).
Definition at line 208 of file matrix.cpp. References PLib::Basic2DArray::cols, PLib::Basic2DArray::m, and PLib::Basic2DArray::rows. Referenced by PLib::NurbsCurve::leastSquares, and PLib::NurbsCurve::leastSquaresH. |
|
returns the diagonal of the matrix.
Returns a vector with the component [i] being set to the component (i,i) of the matrix.
Definition at line 309 of file matrix.cpp. References PLib::Basic2DArray::cols, and PLib::Basic2DArray::rows. |
|
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.
Definition at line 771 of file matrix.cpp. References PLib::Basic2DArray::cols, and PLib::Basic2DArray::rows. |
|
Finds the first norm of the matrix.
Definition at line 250 of file matrix.cpp. References PLib::Basic2DArray::cols, PLib::Basic2DArray::init, PLib::Basic2DArray::m, and PLib::Basic2DArray::rows. |
|
multiply every elements by a double.
Definition at line 368 of file matrix.cpp. References PLib::Basic2DArray::cols, PLib::Basic2DArray::m, and PLib::Basic2DArray::rows. |
|
increase every elements by a double.
Definition at line 328 of file matrix.cpp. References PLib::Basic2DArray::cols, PLib::Basic2DArray::m, and PLib::Basic2DArray::rows. |
|
adds a matrix to itself.
Definition at line 409 of file matrix.cpp. References PLib::Basic2DArray::cols, PLib::Basic2DArray::m, and PLib::Basic2DArray::rows. |
|
decrease every elements by a double.
Definition at line 348 of file matrix.cpp. References PLib::Basic2DArray::cols, PLib::Basic2DArray::m, and PLib::Basic2DArray::rows. |
|
self substraction.
This will substract the matrix a from the matrix. The result is thus matrix = matrix - a.
Definition at line 469 of file matrix.cpp. References PLib::Basic2DArray::cols, PLib::Basic2DArray::m, and PLib::Basic2DArray::rows. |
|
divide every elements by a double.
Definition at line 388 of file matrix.cpp. References PLib::Basic2DArray::cols, PLib::Basic2DArray::m, and PLib::Basic2DArray::rows. |
|
assignment operator.
Reimplemented in PLib::MatrixRT. Definition at line 51 of file matrix.cpp. References PLib::Basic2DArray::by_columns, PLib::Basic2DArray::cols, PLib::Basic2DArray::m, PLib::Basic2DArray::resize, and PLib::Basic2DArray::rows. |
|
read a raw file containing a matrix of size $(r,c)$ Reads a file containing raw data of a matrix of size $(r,c)$.
Definition at line 877 of file matrix.cpp. References PLib::Basic2DArray::m, and PLib::Basic2DArray::resize. |
|
read a matrix file Reads a matrix file. The format of a file is {\tt rows() cols() data...}, where rows() and cols() are int and data is a vector of the matrix type.
Definition at line 844 of file matrix.cpp. References PLib::Basic2DArray::m, and PLib::Basic2DArray::resize. |
|
sets the submatrix (s_r,s_c) to a .
Definition at line 99 of file matrix.cpp. References PLib::Basic2DArray::cols, PLib::Basic2DArray::m, and PLib::Basic2DArray::rows. |
|
The sum of all diagonal elements.
Definition at line 743 of file matrix.cpp. References PLib::Basic2DArray::cols, and PLib::Basic2DArray::rows. |
|
returns the transpose of the matrix.
Definition at line 816 of file matrix.cpp. References PLib::Basic2DArray::cols, and PLib::Basic2DArray::rows. |
|
write a matrix into a Matrix file Writes a matrix file. The format of the file is {\tt rows() cols() data...}, where rows() and cols() are int and data is a vector of the matrix type.
Definition at line 902 of file matrix.cpp. References PLib::Basic2DArray::cols, PLib::Basic2DArray::m, and PLib::Basic2DArray::rows. |
|
write the raw data to a file Writes the raw data to a file. The size information is {not} written to the file.
Definition at line 926 of file matrix.cpp. References PLib::Basic2DArray::cols, PLib::Basic2DArray::m, and PLib::Basic2DArray::rows. |
|
multiplies a matrix with a vector.
Definition at line 640 of file matrix.cpp. |
|
multiplies a matrix with a complex value.
Definition at line 614 of file matrix.cpp. |
|
multiplication of a double and a matrix.
Definition at line 588 of file matrix.cpp. |
|
the multiplication operator.
Definition at line 532 of file matrix.cpp. |
|
the addition operator.
Definition at line 447 of file matrix.cpp. |
|
the substraction operator.
Definition at line 511 of file matrix.cpp. |
|
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.
Definition at line 688 of file matrix.cpp. |