#include <mat.h>
Public Member Functions | |
~NRMat () | |
standard destructor | |
NRMat () | |
inlined constructor creating zero matrix of general type T | |
NRMat (const int n, const int m, const GPUID loc=undefined) | |
Inlined constructor creating matrix of given size and location. Because of performance reasons, no incialization is done. | |
NRMat (const T &a, const int n, const int m, const GPUID loc) | |
inlined constructor creating matrix of given size filled with prescribed value and stored at given location | |
NRMat (const T &a, const int n, const int m) | |
inlined constructor creating matrix of given size filled with prescribed value | |
NRMat (const T *a, const int n, const int m) | |
inlined constructor creating matrix of given size filled with data located at given memory location | |
NRMat (const NRMat &rhs) | |
inlined copy-constructor | |
NRMat (const typename LA_traits_complex< T >::NRMat_Noncomplex_type &rhs, bool imagpart=false) | |
complexifying constructor | |
NRMat (const NRSMat< T > &rhs) | |
explicit constructor converting symmetric matrix stored in packed form into a NRMat<T> object | |
NRMat (const NRVec< T > &rhs, const int n, const int m, const int offset=0) | |
explicit constructor converting vector into a NRMat<T> object | |
const bool | operator!= (const NRMat &rhs) const |
const bool | operator== (const NRMat &rhs) const |
int | getcount () const |
determine the count of references to this object | |
void | copyonwrite () |
ensure that the data of this matrix are referenced exactly once | |
GPUID | getlocation () const |
void | moveto (const GPUID dest) |
void | randomize (const typename LA_traits< T >::normtype &x) |
fill the matrix with pseudorandom numbers (uniform distribution) | |
NRMat & | operator= (const NRMat &rhs) |
assigment operator performing shallow copy | |
NRMat & | operator|= (const NRMat &rhs) |
assigment operator performing deep copy | |
NRMat & | operator= (const T &a) |
assign scalar value to the diagonal elements | |
NRMat & | operator+= (const T &a) |
add scalar value to the diagonal elements | |
NRMat & | operator-= (const T &a) |
subtract scalar value to the diagonal elements | |
NRMat & | operator*= (const T &a) |
multiply by a scalar value | |
NRMat & | operator+= (const NRMat &rhs) |
add given matrix | |
NRMat & | operator-= (const NRMat &rhs) |
subtract given matrix | |
NRMat & | operator^= (const NRMat< T > &rhs) |
Hadamard element-wise product. | |
NRMat & | operator+= (const NRSMat< T > &rhs) |
add symmetric matrix stored in packed form | |
NRMat & | operator-= (const NRSMat< T > &rhs) |
subtract symmetric matrix stored in packed form | |
const NRMat | operator- () const |
unary minus | |
const NRMat | operator+ (const T &a) const |
add scalar value to all matrix elements and return the result by value | |
const NRMat | operator- (const T &a) const |
subtract scalar value from all matrix elements and return the result by value | |
const NRMat | operator* (const T &a) const |
multiply all matrix elements by a scalar value and return the result by value | |
const NRMat | operator+ (const NRMat &rhs) const |
add given matrix and return the result by value | |
const NRMat | operator+ (const NRSMat< T > &rhs) const |
add given symmetric matrix stored in packed form and return the result by value | |
const NRMat | operator- (const NRMat &rhs) const |
subtract given matrix and return the result by value | |
const NRMat | operator- (const NRSMat< T > &rhs) const |
subtract given symmetric matrix stored in packed form and return the result by value | |
const NRMat | operator* (const NRMat &rhs) const |
multiply by given matrix and return the result by value | |
const NRMat | operator* (const NRSMat< T > &rhs) const |
multiply by given symmetric matrix stored in packed form and return the result by value | |
const NRMat | operator& (const NRMat &rhs) const |
direct sum of two matrices | |
const NRMat | operator| (const NRMat< T > &rhs) const |
direct product of two matrices | |
const NRVec< T > | operator* (const NRVec< T > &rhs) const |
multiply by a vector | |
const NRVec< complex< T > > | operator* (const NRVec< complex< T > > &rhs) const |
multiply this matrix of general type T by vector of type complex<T> | |
const T | dot (const NRMat &rhs) const |
inner product of two matrices (taking conjugation into account in the complex case) | |
const NRMat | oplus (const NRMat &rhs) const |
direct sum | |
const NRMat | otimes (const NRMat &rhs, bool reversecolumns=false) const |
direct product | |
void | diagmultl (const NRVec< T > &rhs) |
multiply by diagonal matrix from left | |
void | diagmultr (const NRVec< T > &rhs) |
multiply by diagonal matrix from right | |
const NRSMat< T > | transposedtimes () const |
for this matrix ![]() ![]() | |
const NRSMat< T > | timestransposed () const |
for this matrix ![]() ![]() | |
const NRVec< T > | rsum () const |
sum the rows | |
const NRVec< T > | csum () const |
sum the columns | |
void | orthonormalize (const bool rowcol, const NRSMat< T > *metric=NULL) |
orthonormalize this matrix | |
const NRVec< T > | row (const int i, int l=-1) const |
get the ith row | |
const NRVec< T > | column (const int j, int l=-1) const |
get the jth column | |
const T * | diagonalof (NRVec< T > &, const bool divide=0, bool cache=false) const |
extract the digonal elements of this matrix and store them into a vector | |
void | diagonalset (const NRVec< T > &) |
set diagonal elements | |
void | gemv (const T beta, NRVec< T > &r, const char trans, const T alpha, const NRVec< T > &x) const |
perform the gemv operation with vector of type T | |
void | gemv (const T beta, NRVec< complex< T > > &r, const char trans, const T alpha, const NRVec< complex< T > > &x) const |
perform the gemv operation with vector of type complex<T> | |
T * | operator[] (const int i) |
determine the pointer to the ith row | |
const T * | operator[] (const int i) const |
determine the const pointer to the ith row | |
T & | operator() (const int i, const int j) |
get the reference to the element with indices (i,j) | |
const T & | operator() (const int i, const int j) const |
get the const reference to the element with indices (i,j) | |
const T | get_ij (const int i, const int j) const |
get the copy of the element with indices (i,j) | |
int | nrows () const |
get the number of rows | |
int | ncols () const |
get the number of columns | |
int | size () const |
get the number of matrix elements | |
void | get (int fd, bool dimensions=1, bool transposed=false) |
unformatted input | |
void | put (int fd, bool dimensions=1, bool transposed=false) const |
unformatted output | |
void | fprintf (FILE *f, const char *format, const int modulo) const |
formatted output | |
void | fscanf (FILE *f, const char *format) |
formatted input | |
void | clear () |
set all matrix elements equal to zero | |
void | resize (int n, int m) |
resize the matrix | |
operator T * () | |
get the pointer to the data | |
operator const T * () const | |
get the const pointer to the data | |
NRMat & | transposeme (const int n=0) |
in case of square matrix, transpose the leading minor of order n | |
NRMat & | conjugateme () |
conjugate a square matrix | |
const NRMat | transpose (bool conj=false) const |
transpose this matrix and return the result by value | |
const NRMat | conjugate () const |
conjugate this matrix and return the result by value | |
const NRMat | submatrix (const int fromrow, const int torow, const int fromcol, const int tocol) const |
extract specified submatrix | |
void | storesubmatrix (const int fromrow, const int fromcol, const NRMat &rhs) |
store given matrix at given position into the current matrix | |
void | gemm (const T &beta, const NRMat &a, const char transa, const NRMat &b, const char transb, const T &alpha) |
perform the gemm operation | |
const LA_traits< T >::normtype | norm (const T scalar=(T) 0) const |
compute the norm of this matrix | |
void | axpy (const T alpha, const NRMat &x) |
add up a scalar multiple of given matrix to the current matrix | |
const T | amax () const |
maximal element in the absolute value | |
const T | amin () const |
minimal element in the absolute value | |
const T | trace () const |
determine the sum of the diagonal elements | |
NRMat & | swap_rows () |
swap the order of the rows of the current matrix | |
NRMat & | swap_cols () |
swap the order of the columns of the current matrix | |
NRMat & | swap_rows_cols () |
swap the order of the rows and columns of the current matrix | |
SparseSMat< T > | operator* (const SparseSMat< T > &rhs) const |
multiply by sparse matrix | |
NRMat (const SparseMat< T > &rhs) | |
explicit constructor converting sparse matrix into NRMat<T> object | |
NRMat (const SparseSMat< T > &rhs) | |
explicit constructor converting sparse symmetric matrix into NRMat<T> object | |
NRMat & | operator+= (const SparseMat< T > &rhs) |
add up given sparse matrix | |
NRMat & | operator-= (const SparseMat< T > &rhs) |
subtract given sparse matrix | |
void | gemm (const T &beta, const SparseMat< T > &a, const char transa, const NRMat &b, const char transb, const T &alpha) |
perform the gemm operation | |
void | simplify () |
bool | issymmetric () const |
void | strassen (const T beta, const NRMat &a, const char transa, const NRMat &b, const char transb, const T alpha) |
Strassen's multiplication (better than ![]() | |
void | s_cutoff (const int, const int, const int, const int) const |
template<> | |
NRMat< double > & | operator= (const double &a) |
template<> | |
NRMat< complex< double > > & | operator= (const complex< double > &a) |
template<> | |
NRMat< double > & | operator+= (const double &a) |
template<> | |
NRMat< complex< double > > & | operator+= (const complex< double > &a) |
template<> | |
NRMat< double > & | operator-= (const double &a) |
template<> | |
NRMat< complex< double > > & | operator-= (const complex< double > &a) |
template<> | |
const NRMat< double > | operator- () const |
template<> | |
const NRMat< complex< double > > | operator- () const |
template<> | |
const NRVec< double > | csum () const |
template<> | |
const NRVec< complex< double > > | csum () const |
template<> | |
const NRVec< double > | rsum () const |
template<> | |
const NRVec< complex< double > > | rsum () const |
template<> | |
NRMat (const NRMat< double > &rhs, bool imagpart) | |
template<> | |
const NRSMat< double > | transposedtimes () const |
template<> | |
const NRSMat< complex< double > > | transposedtimes () const |
template<> | |
const NRSMat< double > | timestransposed () const |
template<> | |
const NRSMat< complex< double > > | timestransposed () const |
template<> | |
void | randomize (const double &x) |
template<> | |
void | randomize (const double &x) |
template<> | |
NRMat< double > & | operator*= (const double &a) |
template<> | |
NRMat< complex< double > > & | operator*= (const complex< double > &a) |
template<> | |
NRMat< double > & | operator+= (const NRMat< double > &rhs) |
template<> | |
NRMat< complex< double > > & | operator+= (const NRMat< complex< double > > &rhs) |
template<> | |
NRMat< double > & | operator-= (const NRMat< double > &rhs) |
template<> | |
NRMat< complex< double > > & | operator-= (const NRMat< complex< double > > &rhs) |
template<> | |
NRMat< double > & | operator+= (const NRSMat< double > &rhs) |
template<> | |
NRMat< complex< double > > & | operator+= (const NRSMat< complex< double > > &rhs) |
template<> | |
NRMat< double > & | operator-= (const NRSMat< double > &rhs) |
template<> | |
NRMat< complex< double > > & | operator-= (const NRSMat< complex< double > > &rhs) |
template<> | |
const double | dot (const NRMat< double > &rhs) const |
template<> | |
const complex< double > | dot (const NRMat< complex< double > > &rhs) const |
template<> | |
const NRMat< double > | operator* (const NRMat< double > &rhs) const |
template<> | |
const NRMat< complex< double > > | operator* (const NRMat< complex< double > > &rhs) const |
template<> | |
void | diagmultl (const NRVec< double > &rhs) |
template<> | |
void | diagmultl (const NRVec< complex< double > > &rhs) |
template<> | |
void | diagmultr (const NRVec< double > &rhs) |
template<> | |
void | diagmultr (const NRVec< complex< double > > &rhs) |
template<> | |
const NRMat< double > | operator* (const NRSMat< double > &rhs) const |
template<> | |
const NRMat< complex< double > > | operator* (const NRSMat< complex< double > > &rhs) const |
template<> | |
NRMat< double > & | conjugateme () |
template<> | |
NRMat< complex< double > > & | conjugateme () |
template<> | |
const NRMat< double > | transpose (bool conj) const |
template<> | |
const NRMat< complex< double > > | transpose (bool conj) const |
template<> | |
void | gemm (const double &beta, const NRMat< double > &a, const char transa, const NRMat< double > &b, const char transb, const double &alpha) |
template<> | |
void | gemm (const complex< double > &beta, const NRMat< complex< double > > &a, const char transa, const NRMat< complex< double > > &b, const char transb, const complex< double > &alpha) |
template<> | |
const double | norm (const double scalar) const |
template<> | |
const double | norm (const complex< double > scalar) const |
template<> | |
void | axpy (const double alpha, const NRMat< double > &mat) |
template<> | |
void | axpy (const complex< double > alpha, const NRMat< complex< double > > &mat) |
template<> | |
const double * | diagonalof (NRVec< double > &r, const bool divide, bool cache) const |
template<> | |
void | diagonalset (const NRVec< double > &r) |
template<> | |
void | diagonalset (const NRVec< complex< double > > &r) |
template<> | |
void | orthonormalize (const bool rowcol, const NRSMat< double > *metric) |
template<> | |
NRMat< double > & | swap_rows () |
template<> | |
NRMat< complex< double > > & | swap_rows () |
template<> | |
NRMat< double > & | swap_cols () |
template<> | |
NRMat< complex< double > > & | swap_cols () |
template<> | |
NRMat< double > & | swap_rows_cols () |
template<> | |
NRMat< complex< double > > & | swap_rows_cols () |
template<> | |
const double | amax () const |
template<> | |
const double | amin () const |
template<> | |
const complex< double > | amax () const |
template<> | |
const complex< double > | amin () const |
template<> | |
void | gemm (const complex< double > &beta, const SparseMat< complex< double > > &a, const char transa, const NRMat< complex< double > > &b, const char transb, const complex< double > &alpha) |
template<> | |
void | gemm (const double &beta, const SparseMat< double > &a, const char transa, const NRMat< double > &b, const char transb, const double &alpha) |
template<> | |
void | s_cutoff (const int c, const int c1, const int c2, const int c3) const |
template<> | |
void | strassen (const double beta, const NRMat< double > &a, const char transa, const NRMat< double > &b, const char transb, const double alpha) |
Protected Attributes | |
int | nn |
number of rows | |
int | mm |
number of columns | |
T * | v |
pointer to the data stored continuously in emmory | |
int * | count |
reference counter | |
Friends | |
class | NRVec< T > |
class | NRSMat< T > |
LA::NRMat< T >::NRMat | ( | const int | n, | |
const int | m, | |||
const GPUID | loc = undefined | |||
) | [inline] |
Inlined constructor creating matrix of given size and location. Because of performance reasons, no incialization is done.
[in] | n | vector size (count of elements) |
[in] | loc | location of the underlying data (CPU/GPU) |
[in] | n | number of rows of the matrix being created |
[in] | m | number of cols of the matrix being created |
[in] | loc | location for storing the matrix |
LA::NRMat< T >::NRMat | ( | const T & | a, | |
const int | n, | |||
const int | m, | |||
const GPUID | loc | |||
) | [inline] |
inlined constructor creating matrix of given size filled with prescribed value and stored at given location
matrix constructor
[in] | a | value of type T intended for matrix inicialization |
[in] | n | number of rows of the matrix being created |
[in] | m | number of cols of the matrix being created |
inlined constructor creating matrix of given size filled with data located at given memory location
matrix constructor
[in] | a | pointer to values of type T intended for matrix inicialization |
[in] | n | number of rows of the matrix being created |
[in] | m | number of cols of the matrix being created |
LA::NRMat< T >::NRMat | ( | const NRVec< T > & | rhs, | |
const int | n, | |||
const int | m, | |||
const int | offset = 0 | |||
) | [inline, explicit] |
explicit constructor converting vector into a NRMat<T>
object
create matrix from a vector (shallow copy)
[in] | rhs | NRVec vector containing the data |
[in] | n | number of rows of the matrix being created |
[in] | m | number of cols of the matrix being created |
< make just shallow copy
< therefore increase the reference counter
LA::NRMat< complex< double > >::NRMat | ( | const NRMat< double > & | rhs, | |
bool | imagpart | |||
) | [inline] |
icreate complex double-precision matrix from real double-precision matrix
[in] | rhs | real double-precision matrix ![]() |
[in] | imagpart | flag indicating whether the matrix ![]() |
const complex< double > LA::NRMat< complex< double > >::amax | ( | ) | const [inline] |
for this complex matrix , determine the smallest index of the maximum magnitude element, i.e. maximal element in the 1-norm
const double LA::NRMat< double >::amax | ( | ) | const [inline] |
for this real matrix , determine the first element with largest absolute value
const complex< double > LA::NRMat< complex< double > >::amin | ( | ) | const [inline] |
for this complex matrix , determine the smallest index of the minimum magnitude element, i.e. minimal element in the 1-norm
const double LA::NRMat< double >::amin | ( | ) | const [inline] |
for this real matrix , determine the first element with smallest absolute value
void LA::NRMat< complex< double > >::axpy | ( | const complex< double > | alpha, | |
const NRMat< complex< double > > & | mat | |||
) | [inline] |
perform the axpy operation on the current complex matrix , i.e.
for real matrix
[in] | alpha | complex parameter ![]() |
[in] | mat | complex matrix ![]() |
void LA::NRMat< double >::axpy | ( | const double | alpha, | |
const NRMat< double > & | mat | |||
) | [inline] |
perform the axpy operation on the current real matrix , i.e.
for real matrix
[in] | alpha | ![]() |
[in] | mat | real matrix ![]() |
conjugate this complex matrix , i.e. do nothing :-)
conjugate this real matrix , i.e. do nothing :-)
void LA::NRMat< T >::copyonwrite | ( | ) | [inline] |
ensure that the data of this matrix are referenced exactly once
create own deep copy
sum up the columns of the current double-precision complex matrix
sum up the columns of the current double-precision real matrix
sum the columns
sum up the columns of the current matrix of general type T
void LA::NRMat< complex< double > >::diagmultl | ( | const NRVec< complex< double > > & | rhs | ) | [inline] |
multiply this complex matrix by diagonal complex matrix
from left because of cuBlas implementation,
is required to be placed in CPU memory
[in] | rhs | complex vector represeting the diagonal of matrix ![]() |
multiply this real matrix by diagonal real matrix
from left because of cuBlas implementation,
is required to be placed in CPU memory
[in] | rhs | real vector represeting the diagonal of matrix ![]() |
void LA::NRMat< complex< double > >::diagmultr | ( | const NRVec< complex< double > > & | rhs | ) | [inline] |
multiply this complex matrix by diagonal complex matrix
from left
[in] | rhs | complex vector represeting the diagonal of matrix ![]() |
multiply this real matrix by diagonal real matrix
from right because of cuBlas implementation,
is required to be placed in CPU memory
[in] | rhs | real vector represeting the diagonal of matrix ![]() |
const double * LA::NRMat< double >::diagonalof | ( | NRVec< double > & | r, | |
const bool | divide, | |||
bool | cache | |||
) | const [inline] |
get or divide by the diagonal of real double-precision matrix in case of nonsquare matrix , use the diagonal of
[in,out] | r | vector for storing the diagonal |
[in] | divide |
|
[in] | cache | reserved |
divide == true
NULL divide == false
pointer to the first element of r < temporary variable for storing the scaling factor
void LA::NRMat< complex< double > >::diagonalset | ( | const NRVec< complex< double > > & | r | ) | [inline] |
sets the diagonal of complex matrix to a given complex vector
[in] | r | complex vector which is supposed to be assigned to the diagonal |
sets the diagonal of real matrix to a given real vector
[in] | r | real vector which is supposed to be assigned to the diagonal |
const complex< double > LA::NRMat< complex< double > >::dot | ( | const NRMat< complex< double > > & | rhs | ) | const [inline] |
compute scalar product of this matrix with given complex matrix
i.e. determine
[in] | rhs | matrix ![]() |
compute scalar product of this matrix with given real matrix
i.e. determine
[in] | rhs | matrix ![]() |
void LA::NRMat< T >::fprintf | ( | FILE * | file, | |
const char * | format, | |||
const int | modulo | |||
) | const [inline] |
formatted output
output of a matrix of general type via lawritemat
void LA::NRMat< T >::fscanf | ( | FILE * | f, | |
const char * | format | |||
) | [inline] |
formatted input
input of a matrix of general type via lawritemat
void LA::NRMat< double >::gemm | ( | const double & | beta, | |
const NRMat< double > & | a, | |||
const char | transa, | |||
const NRMat< double > & | b, | |||
const char | transb, | |||
const double & | alpha | |||
) | [inline] |
perform the gemm operation for this real matrix , i.e. compute
[in] | beta | ![]() |
[in] | a | real matrix ![]() |
[in] | transa | transposition flag of matrix ![]() |
[in] | b | real matrix ![]() |
[in] | transb | transposition flag of matrix ![]() |
[in] | alpha | ![]() |
void LA::NRMat< T >::get | ( | int | fd, | |
bool | dim = 1 , |
|||
bool | transp = false | |||
) | [inline] |
unformatted input
routine for raw input
[in] | fd | file descriptor for input |
[in] | dim | number of elements intended for input, for dim=0 perform copyonwrite |
[in] | transp | reserved |
const T LA::NRMat< T >::get_ij | ( | const int | i, | |
const int | j | |||
) | const [inline] |
get the copy of the element with indices (i,j)
for a given matrix , determine the element with indices (i,j)
[in] | i | row number |
[in] | j | col number |
Reimplemented in LA::NRMat_from1< T >.
GPUID LA::NRMat< T >::getlocation | ( | ) | const [inline] |
routines for CUDA related stuff
getlocation()
gets the protected data member location moveto(const GPUID)
moves underlying data between CPU/GPU memory int LA::NRMat< T >::ncols | ( | ) | const [inline] |
get the number of columns
const double LA::NRMat< complex< double > >::norm | ( | const complex< double > | scalar | ) | const [inline] |
compute the Frobenius norm of the current complex matrix , i.e.
where and
is the number of rows and columns, respectively
[in] | scalar | complex value subtracted from the diagonal elements |
const double LA::NRMat< double >::norm | ( | const double | scalar | ) | const [inline] |
compute the Frobenius norm of the current real matrix , i.e.
where and
is the number of rows and columns, respectively
[in] | scalar | real value subtracted from the diagonal elements |
int LA::NRMat< T >::nrows | ( | ) | const [inline] |
get the number of rows
LA::NRMat< T >::operator const T * | ( | ) | const [inline] |
get the const pointer to the data
LA::NRMat< T >::operator T * | ( | ) | [inline] |
get the pointer to the data
const T & LA::NRMat< T >::operator() | ( | const int | i, | |
const int | j | |||
) | const [inline] |
get the const reference to the element with indices (i,j)
for a given matrix , determine the element with indices (i,j)
[in] | i | row number |
[in] | j | col number |
Reimplemented in LA::NRMat_from1< T >.
T & LA::NRMat< T >::operator() | ( | const int | i, | |
const int | j | |||
) | [inline] |
get the reference to the element with indices (i,j)
for a given matrix , determine the element with indices (i,j)
[in] | i | row number |
[in] | j | col number |
Reimplemented in LA::NRMat_from1< T >.
const NRMat< complex< double > > LA::NRMat< complex< double > >::operator* | ( | const NRSMat< complex< double > > & | rhs | ) | const [inline] |
multiply this complex matrix by symmetric complex matrix
is stored in packed form, therefore zhpmv routine is used
[in] | rhs | complex symmetric matrix ![]() |
const NRMat< double > LA::NRMat< double >::operator* | ( | const NRSMat< double > & | rhs | ) | const [inline] |
multiply this real matrix by symmetric matrix
is stored in packed form, therefore dspmv routine is used
[in] | rhs | real symmetric matrix ![]() |
const NRMat< complex< double > > LA::NRMat< complex< double > >::operator* | ( | const NRMat< complex< double > > & | rhs | ) | const [inline] |
compute product of this matrix with given complex matrix
[in] | rhs | matrix ![]() |
const NRMat< double > LA::NRMat< double >::operator* | ( | const NRMat< double > & | rhs | ) | const [inline] |
compute product of this matrix with given real matrix
[in] | rhs | matrix ![]() |
NRMat< complex< double > > & LA::NRMat< complex< double > >::operator*= | ( | const complex< double > & | a | ) | [inline] |
scale complex matrix with a complex factor
[in] | a | scaling factor |
scale real matrix with a real factor
[in] | a | scaling factor |
multiply by a scalar value
scale matrix of type T with a factor
[in] | a | scaling factor |
const NRMat< T > LA::NRMat< T >::operator+ | ( | const NRSMat< T > & | rhs | ) | const [inline] |
NRMat< complex< double > > & LA::NRMat< complex< double > >::operator+= | ( | const NRSMat< complex< double > > & | rhs | ) | [inline] |
add a given sparse complex matrix stored in packed form to the current complex matrix
[in] | rhs | symmetric complex matrix ![]() |
NRMat< double > & LA::NRMat< double >::operator+= | ( | const NRSMat< double > & | rhs | ) | [inline] |
add a given sparse real matrix stored in packed form to the current real matrix
[in] | rhs | symmetric real matrix ![]() |
NRMat< complex< double > > & LA::NRMat< complex< double > >::operator+= | ( | const NRMat< complex< double > > & | rhs | ) | [inline] |
add a given complex matrix to the current complex matrix
[in] | rhs | complex matrix ![]() |
NRMat< double > & LA::NRMat< double >::operator+= | ( | const NRMat< double > & | rhs | ) | [inline] |
add a given real matrix to the current real matrix
[in] | rhs | matrix ![]() |
NRMat< complex< double > > & LA::NRMat< complex< double > >::operator+= | ( | const complex< double > & | a | ) | [inline] |
adds a double-precision complex scalar value to the diagonal elements of this double-precision complex matrix
[in] | a | double-precision complex scalar value |
adds a double-precision real scalar value to the diagonal elements of this double-precision real matrix
[in] | a | double-precision real scalar value |
add symmetric matrix stored in packed form
add a given general sparse matrix stored in packed form to the current general matrix (of type T)
[in] | rhs | symmetric general matrix ![]() |
add given matrix
add a given general matrix (type T) to the current complex matrix
[in] | rhs | matrix ![]() |
add scalar value to the diagonal elements
add a scalar value of type T
to the diagonal elements of this matrix of general type T
const NRMat< complex< double > > LA::NRMat< complex< double > >::operator- | ( | ) | const [inline] |
implements unary minus operator for this double-precision complex matrix
implements unary minus operator for this double-recision real matrix
const NRMat< T > LA::NRMat< T >::operator- | ( | const NRSMat< T > & | rhs | ) | const [inline] |
unary minus
implements unary minus operator for this matrix of general type T
NRMat< complex< double > > & LA::NRMat< complex< double > >::operator-= | ( | const NRSMat< complex< double > > & | rhs | ) | [inline] |
subtract a given sparse complex matrix stored in packed form from the current complex matrix
[in] | rhs | symmetric complex matrix ![]() |
NRMat< double > & LA::NRMat< double >::operator-= | ( | const NRSMat< double > & | rhs | ) | [inline] |
subtract a given sparse real matrix stored in packed form from the current real matrix
[in] | rhs | symmetric real matrix ![]() |
NRMat< complex< double > > & LA::NRMat< complex< double > >::operator-= | ( | const NRMat< complex< double > > & | rhs | ) | [inline] |
subtract a given complex matrix from the current complex matrix
[in] | rhs | matrix ![]() |
NRMat< double > & LA::NRMat< double >::operator-= | ( | const NRMat< double > & | rhs | ) | [inline] |
subtract a given real matrix from the current real matrix
[in] | rhs | matrix ![]() |
NRMat< complex< double > > & LA::NRMat< complex< double > >::operator-= | ( | const complex< double > & | a | ) | [inline] |
subtracts a double-precision complex scalar value from the diagonal elements of this double-precision complex matrix
[in] | a | double-precision complex scalar value |
subtracts a double-precision real scalar value from the diagonal elements of this double-precision real matrix
[in] | a | double-precision real scalar value |
subtract symmetric matrix stored in packed form
subtract a given general sparse matrix stored in packed form from the current general matrix (of type T)
[in] | rhs | symmetric general matrix ![]() |
subtract given matrix
subtract a given general matrix (type T) from the current matrix
[in] | rhs | matrix ![]() |
subtract scalar value to the diagonal elements
subtracts a scalar value of type T
from the diagonal elements of this matrix of general type T
NRMat< complex< double > > & LA::NRMat< complex< double > >::operator= | ( | const complex< double > & | a | ) | [inline] |
assigns a double-precision complex scalar value to the diagonal elements of this double-precision complex matrix
[in] | a | double-precision complex scalar value |
assigns a double-precision real scalar value to the diagonal elements of this double-precision real matrix
[in] | a | double-precision real scalar value |
assign scalar value to the diagonal elements
assigns a scalar value of general type T
to the diagonal elements of this matrix of general type T
[in] | a | scalar value of type T |
const T * LA::NRMat< T >::operator[] | ( | const int | i | ) | const [inline] |
determine the const pointer to the ith row
[in] | i | row number |
T * LA::NRMat< T >::operator[] | ( | const int | i | ) | [inline] |
determine the pointer to the ith row
[in] | i | row number |
Hadamard element-wise product.
compute Hadamard (component-wise) product with a given matrix
[in] | rhs | matrix ![]() |
const NRMat< T > LA::NRMat< T >::oplus | ( | const NRMat< T > & | rhs | ) | const [inline] |
direct sum
implements direct sum with a given matrix via storesubmatrix()
[in] | rhs | input matrix ![]() |
void LA::NRMat< double >::orthonormalize | ( | const bool | rowcol, | |
const NRSMat< double > * | metric | |||
) | [inline] |
perform straightforward orthonormalization via modified Gram-Schmidt process
[in] | rowcol | flag regarding the interpretation of the current matrix
|
[in] | metric | pointer to real symmetric matrix stored in packed form which is used in computing the inner products in the process, the standard inner product is taken into account for metric == NULL |
const NRMat< T > LA::NRMat< T >::otimes | ( | const NRMat< T > & | rhs, | |
bool | reversecolumns = false | |||
) | const [inline] |
direct product
implements direct product with a given matrix
[in] | rhs | input matrix ![]() |
void LA::NRMat< T >::put | ( | int | fd, | |
bool | dim = 1 , |
|||
bool | transp = false | |||
) | const [inline] |
unformatted output
routine for raw output
[in] | fd | file descriptor for output |
[in] | dim | number of elements intended for output |
[in] | transp | reserved |
void LA::NRMat< complex< double > >::randomize | ( | const double & | x | ) | [inline] |
fill given complex matrix with random numbers real/imaginary components are generated independently
[in] | x | generate random numbers from the interval [0, x] |
void LA::NRMat< double >::randomize | ( | const double & | x | ) | [inline] |
fill given real matrix with random numbers
[in] | x | generate random numbers from the interval [0, x] |
void LA::NRMat< T >::resize | ( | int | n, | |
int | m | |||
) | [inline] |
resize the matrix
resize given matrix
[in] | n | number of rows |
[in] | m | number of cols |
const NRVec< T > LA::NRMat< T >::row | ( | const int | i, | |
int | l = -1 | |||
) | const [inline] |
get the ith row
extract given row of this matrix of general type T
[in] | i | row index starting from zero |
[in] | l | consider this value as the count of columns |
sum up the rows of the current double-precision complex matrix
sum up the rows of the current double-precision real matrix
sum the rows
sum up the rows of the current matrix of general type T
int LA::NRMat< T >::size | ( | ) | const [inline] |
get the number of matrix elements
void LA::NRMat< T >::storesubmatrix | ( | const int | fromrow, | |
const int | fromcol, | |||
const NRMat< T > & | rhs | |||
) | [inline] |
store given matrix at given position into the current matrix
places given matrix as submatrix at given position
[in] | fromrow | row-coordinate of top left corner |
[in] | fromcol | col-coordinate of top left corner |
[in] | rhs | input matrix |
const NRMat< T > LA::NRMat< T >::submatrix | ( | const int | fromrow, | |
const int | torow, | |||
const int | fromcol, | |||
const int | tocol | |||
) | const [inline] |
extract specified submatrix
extract block submatrix
[in] | fromrow | starting row |
[in] | torow | final row |
[in] | fromcol | starting column |
[in] | tocol | final column |
interchange the order of the columns of the current (complex) matrix
interchange the order of the columns of the current (real) matrix
swap the order of the columns of the current matrix
interchange the order of the columns of the current general matrix of type T because of the cuBlas implementation, the GPU version requires that sizeof(T)sizeof(float)==0
interchange the order of the rows of the current (complex) matrix
interchange the order of the rows of the current (real) matrix
swap the order of the rows of the current matrix
interchange the order of the rows of the current general matrix of type T for GPU computations, the condition sizeof(T)sizeof(float) is required
interchange the order of the rows and columns of the current complex matrix of type T, i.e. perform the operation
where and
interchange the order of the rows and columns of the current real matrix of type T, i.e. perform the operation
where and
swap the order of the rows and columns of the current matrix
interchange the order of the rows and columns of the current general matrix of type T, i.e. perform the operation
where and
const NRSMat< complex< double > > LA::NRMat< complex< double > >::timestransposed | ( | ) | const [inline] |
for a given complex matrix compute
for a given real matrix compute
< resulting matrix has nn rows
for this matrix compute
for a given matrix (general type) compute
const T LA::NRMat< T >::trace | ( | ) | const [inline] |
determine the sum of the diagonal elements
compute the trace of current genenal square matrix , i.e.
where is the order of the matrix
const NRMat< complex< double > > LA::NRMat< complex< double > >::transpose | ( | bool | conj | ) | const [inline] |
compute transpose (optionally conjugated) of this real matrix
[in] | conj | conjugation flag |
compute transpose (optionally conjugated) of this real matrix
[in] | conj | conjugation flag, unused for real matrices |
const NRSMat< complex< double > > LA::NRMat< complex< double > >::transposedtimes | ( | ) | const [inline] |
for a given complex matrix compute
for a given real matrix compute
< resulting matrix has mm rows
for this matrix compute
for a given matrix (general type) compute
in case of square matrix, transpose the leading minor of order n
compute matrix transposition for a principal leading minor
[in] | _n | order of the leading minor |
< transpose the entire matrix