#include <smat.h>
Public Member Functions | |
~NRSMat () | |
NRSMat () | |
default constructor of null-matrix | |
NRSMat (const int n, const GPUID loc=undefined) | |
default constructor | |
NRSMat (const T &a, const int n) | |
constructor initializing the matrix being created by given scalar value | |
NRSMat (const T *a, const int n) | |
constructor initializing the matrix being created by data located at given memory position | |
NRSMat (const NRSMat &rhs) | |
copy constructor | |
NRSMat (const typename LA_traits_complex< T >::NRSMat_Noncomplex_type &rhs, bool imagpart=false) | |
constructor converting real matrix to its complex counterpart | |
NRSMat (const NRMat< T > &rhs) | |
constructor creating symmetric part of a general matrix | |
NRSMat (const NRVec< T > &rhs, const int n) | |
construct symmetric matrix by filling the lower triangle with data stored in a vector | |
NRSMat & | operator= (const NRSMat &rhs) |
assignment operator performing shallow copy | |
NRSMat & | operator|= (const NRSMat &rhs) |
assignment operator performing deep copy | |
void | randomize (const typename LA_traits< T >::normtype &x) |
fill the matrix with pseudorandom numbers (uniform distribution) | |
NRSMat & | operator= (const T &a) |
assign scalar value to diagonal elements | |
int | getcount () const |
GPUID | getlocation () const |
void | moveto (const GPUID dest) |
const bool | operator!= (const NRSMat &rhs) const |
relational operator for testing nonequality | |
const bool | operator== (const NRSMat &rhs) const |
relational operator for testing equality | |
NRSMat & | operator*= (const T &a) |
NRSMat & | operator+= (const T &a) |
NRSMat & | operator-= (const T &a) |
NRSMat & | operator+= (const NRSMat &rhs) |
NRSMat & | operator-= (const NRSMat &rhs) |
const NRSMat | operator- () const |
const NRSMat | operator* (const T &a) const |
const NRSMat | operator+ (const T &a) const |
const NRSMat | operator- (const T &a) const |
const NRSMat | operator+ (const NRSMat &rhs) const |
const NRSMat | operator- (const NRSMat &rhs) const |
const NRMat< T > | operator+ (const NRMat< T > &rhs) const |
const NRMat< T > | operator- (const NRMat< T > &rhs) const |
const NRMat< T > | operator* (const NRSMat &rhs) const |
const NRMat< T > | operator* (const NRMat< T > &rhs) const |
const T | dot (const NRSMat &rhs) const |
const T | dot (const NRVec< T > &rhs) const |
const NRVec< T > | operator* (const NRVec< T > &rhs) const |
const NRVec< complex< T > > | operator* (const NRVec< complex< T > > &rhs) const |
const T * | diagonalof (NRVec< T > &, const bool divide=0, bool cache=false) const |
void | gemv (const T beta, NRVec< T > &r, const char trans, const T alpha, const NRVec< T > &x) const |
void | gemv (const T beta, NRVec< complex< T > > &r, const char trans, const T alpha, const NRVec< complex< T > > &x) const |
const T & | operator[] (const int ij) const |
T & | operator[] (const int ij) |
const T & | operator() (const int i, const int j) const |
T & | operator() (const int i, const int j) |
int | nrows () const |
int | ncols () const |
int | size () const |
bool | transp (const int i, const int j) const |
const LA_traits< T >::normtype | norm (const T scalar=(T) 0) const |
void | axpy (const T alpha, const NRSMat &x) |
const T | amax () const |
const T | amin () const |
const T | trace () const |
void | get (int fd, bool dimensions=1, bool transp=0) |
void | put (int fd, bool dimensions=1, bool transp=0) const |
void | copyonwrite () |
void | clear () |
void | resize (const int n) |
operator T * () | |
operator const T * () const | |
void | fprintf (FILE *f, const char *format, const int modulo) const |
void | fscanf (FILE *f, const char *format) |
NRSMat (const SparseMat< T > &rhs) | |
NRSMat (const SparseSMat< T > &rhs) | |
void | simplify () |
bool | issymmetric () const |
template<> | |
const NRSMat< double > | operator- () const |
template<> | |
const NRSMat< complex< double > > | operator- () const |
template<> | |
void | randomize (const double &x) |
template<> | |
void | randomize (const double &x) |
template<> | |
const NRMat< double > | operator* (const NRMat< double > &rhs) const |
template<> | |
const NRMat< complex< double > > | operator* (const NRMat< complex< double > > &rhs) const |
template<> | |
const NRMat< double > | operator* (const NRSMat< double > &rhs) const |
template<> | |
const NRMat< complex< double > > | operator* (const NRSMat< complex< double > > &rhs) const |
template<> | |
const double | dot (const NRSMat< double > &rhs) const |
template<> | |
const complex< double > | dot (const NRSMat< complex< double > > &rhs) const |
template<> | |
const double | dot (const NRVec< double > &rhs) const |
template<> | |
const complex< double > | dot (const NRVec< complex< double > > &rhs) const |
template<> | |
const double | norm (const double scalar) const |
template<> | |
const double | norm (const complex< double > scalar) const |
template<> | |
void | axpy (const double alpha, const NRSMat< double > &x) |
template<> | |
void | axpy (const complex< double > alpha, const NRSMat< complex< double > > &x) |
template<> | |
NRSMat (const NRSMat< double > &rhs, bool imagpart) | |
template<> | |
NRSMat< double > & | operator*= (const double &a) |
template<> | |
NRSMat< complex< double > > & | operator*= (const complex< double > &a) |
template<> | |
NRSMat< double > & | operator+= (const NRSMat< double > &rhs) |
template<> | |
NRSMat< complex< double > > & | operator+= (const NRSMat< complex< double > > &rhs) |
template<> | |
NRSMat< double > & | operator-= (const NRSMat< double > &rhs) |
template<> | |
NRSMat< complex< double > > & | operator-= (const NRSMat< complex< double > > &rhs) |
template<> | |
const double | amax () const |
template<> | |
const double | amin () const |
template<> | |
const complex< double > | amax () const |
template<> | |
const complex< double > | amin () const |
Protected Attributes | |
int | nn |
number of rows/columns of this symmetric matrix | |
T * | v |
internal pointer to the underlying data structure | |
int * | count |
pointer to the reference counter | |
Friends | |
class | NRVec< T > |
class | NRMat< T > |
LA::NRSMat< T >::~NRSMat | ( | ) | [inline] |
destructor for general type T
LA::NRSMat< T >::NRSMat | ( | const int | n, | |
const GPUID | loc = undefined | |||
) | [inline, explicit] |
LA::NRSMat< T >::NRSMat | ( | const T & | a, | |
const int | n | |||
) | [inline] |
constructor initializing the matrix being created by given scalar value
constructor of a symmetric matrix stored in packed form (default location in used)
[in] | a | set all matrix elements equal to this value |
[in] | n | number of rows of the matrix being created |
LA::NRSMat< T >::NRSMat | ( | const T * | a, | |
const int | n | |||
) | [inline] |
constructor initializing the matrix being created by data located at given memory position
constructor of a symmetric matrix stored in packed form (default location in used)
[in] | a | pointer to data of type T used for matrix inicialization |
[in] | n | number of rows of the matrix being created |
LA::NRSMat< T >::NRSMat | ( | const NRSMat< T > & | rhs | ) | [inline] |
LA::NRSMat< T >::NRSMat | ( | const NRMat< T > & | rhs | ) | [inline, explicit] |
constructor creating symmetric part of a general matrix
constructor symmetrizing given matrix of general type
T
yielding
[in] | rhs | matrix ![]() |
LA::NRSMat< T >::NRSMat | ( | const NRVec< T > & | rhs, | |
const int | n | |||
) | [inline, explicit] |
construct symmetric matrix by filling the lower triangle with data stored in a vector
constructor interpreting a vector of elements as a symmetric matrix stored in packed form having
rows
[in] | rhs | reference matrix being copied |
[in] | n | count of rows of the matrix being created |
LA::NRSMat< complex< double > >::NRSMat | ( | const NRSMat< double > & | rhs, | |
bool | imagpart | |||
) | [inline] |
create hermitian matrix from given real double-precision symmetric matrix
[in] | rhs | real double-precision symmetric matrix ![]() |
[in] | imagpart | flag determining whether ![]() ![]() |
const complex< double > LA::NRSMat< complex< double > >::amax | ( | ) | const [inline] |
for this complex symmetric matrix , determine the first element with largest "absolute value"
const double LA::NRSMat< double >::amax | ( | ) | const [inline] |
for this real symmetric matrix , determine the first element with largest absolute value
const complex< double > LA::NRSMat< complex< double > >::amin | ( | ) | const [inline] |
for this complex symmetric matrix , determine the first element with smallest "absolute value"
const double LA::NRSMat< double >::amin | ( | ) | const [inline] |
for this real symmetric matrix , determine the first element with smallest absolute value
void LA::NRSMat< complex< double > >::axpy | ( | const complex< double > | alpha, | |
const NRSMat< complex< double > > & | x | |||
) | [inline] |
for this complex double-precision hermitian matrix stored in packed form, complex scalar value
and complex double-precision hermitian matrix
, compute
void LA::NRSMat< double >::axpy | ( | const double | alpha, | |
const NRSMat< double > & | x | |||
) | [inline] |
for this real double-precision symmetric matrix stored in packed form, real scalar value
and real double-precision symmetric matrix
, compute
void LA::NRSMat< T >::copyonwrite | ( | ) | [inline] |
detach this NRSMat<T> object and create own physical copy of the data
const T * LA::NRSMat< T >::diagonalof | ( | NRVec< T > & | r, | |
const bool | divide = 0 , |
|||
bool | cache = false | |||
) | const [inline] |
get or divide by the diagonal of real symmetric double-precision matrix
[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 const complex< double > LA::NRSMat< complex< double > >::dot | ( | const NRVec< complex< double > > & | rhs | ) | const [inline] |
compute inner product of this complex double-precision hermitian matrix of order
with given complex double-precision vector
of length
[in] | rhs | complex double-precision vector ![]() |
const double LA::NRSMat< double >::dot | ( | const NRVec< double > & | rhs | ) | const [inline] |
compute inner product of this real double-precision symmetric matrix of order
with given real double-precision vector
of length
[in] | rhs | real double-precision vector ![]() |
const complex< double > LA::NRSMat< complex< double > >::dot | ( | const NRSMat< complex< double > > & | rhs | ) | const [inline] |
compute inner product of this complex symmetric matrix with given complex symmetric matrix
i.e. determine the value of
[in] | rhs | matrix ![]() |
const double LA::NRSMat< double >::dot | ( | const NRSMat< double > & | rhs | ) | const [inline] |
compute inner product of this real symmetric matrix with given real symmetric matrix
i.e. determine the value of
[in] | rhs | matrix ![]() |
void LA::NRSMat< T >::fprintf | ( | FILE * | file, | |
const char * | format, | |||
const int | modulo | |||
) | const [inline] |
routine for formatted output via lawritemat
[in] | file | pointer to FILE structure representing the output file |
[in] | format | format specification in standard printf-like form |
[in] | modulo |
void LA::NRSMat< T >::fscanf | ( | FILE * | f, | |
const char * | format | |||
) | [inline] |
routine for formatted input via fscanf
[in] | f | pointer to FILE structure representing the input file |
[in] | format | format specification in standard printf-like form |
void LA::NRSMat< T >::get | ( | int | fd, | |
bool | dim = 1 , |
|||
bool | transp = 0 | |||
) | [inline] |
routine for raw input
[in] | fd | file descriptor for input |
[in] | dim | number of elements intended for input |
[in] | transp | reserved |
int LA::NRSMat< T >::ncols | ( | ) | const [inline] |
T
const double LA::NRSMat< complex< double > >::norm | ( | const complex< double > | scalar | ) | const [inline] |
compute the Frobenius norm of this complex double-precision hermitian matrix
[in] | scalar | subtract this scalar value from the diagonal elements before the norm computation |
const double LA::NRSMat< double >::norm | ( | const double | scalar | ) | const [inline] |
compute the Frobenius norm of this real double-precision symmetric matrix
[in] | scalar | subtract this scalar value from the diagonal elements before the norm computation |
int LA::NRSMat< T >::nrows | ( | ) | const [inline] |
T
LA::NRSMat< T >::operator const T * | ( | ) | const [inline] |
LA::NRSMat< T >::operator T * | ( | ) | [inline] |
T & LA::NRSMat< T >::operator() | ( | const int | i, | |
const int | j | |||
) | [inline] |
determine matrix element of this symmetric matrix of general type T
[in] | i | row index running from 0 |
[in] | j | column index running from 0 |
const T & LA::NRSMat< T >::operator() | ( | const int | i, | |
const int | j | |||
) | const [inline] |
determine matrix element of this symmetric matrix of general type T
[in] | i | row index running from 0 |
[in] | j | column index running from 0 |
const NRMat< complex< double > > LA::NRSMat< complex< double > >::operator* | ( | const NRSMat< complex< double > > & | rhs | ) | const [inline] |
multiply this complex double-precision symmetric matrix stored in packed form with complex double-precision symmetric matrix
const NRMat< double > LA::NRSMat< double >::operator* | ( | const NRSMat< double > & | rhs | ) | const [inline] |
multiply this real double-precision symmetric matrix stored in packed form with real double-precision symmetric matrix
const NRMat< complex< double > > LA::NRSMat< complex< double > >::operator* | ( | const NRMat< complex< double > > & | rhs | ) | const [inline] |
multiply this real double-precision symmetric matrix stored in packed form with real double-precision dense matrix
[in] | rhs | real double-precision matrix ![]() |
const NRMat< double > LA::NRSMat< double >::operator* | ( | const NRMat< double > & | rhs | ) | const [inline] |
multiply this real double-precision symmetric matrix stored in packed form with real double-precision dense matrix
[in] | rhs | real double-precision matrix ![]() |
NRSMat< complex< double > > & LA::NRSMat< complex< double > >::operator*= | ( | const complex< double > & | a | ) | [inline] |
multiply this complex symmetric matrix with complex scalar value
[in] | a | complex multiplicative factor |
NRSMat< double > & LA::NRSMat< double >::operator*= | ( | const double & | a | ) | [inline] |
multiply this real symmetric matrix with real scalar value
[in] | a | real multiplicative factor |
NRSMat< T > & LA::NRSMat< T >::operator*= | ( | const T & | a | ) | [inline] |
multiply this symmetric matrix of general type T
stored in packed form with scalar value of type T
[in] | a | multiplicative factor of type T |
const NRMat< T > LA::NRSMat< T >::operator+ | ( | const NRMat< T > & | rhs | ) | const [inline] |
add up given dense matrix of general type T
with this symmetric matrix of type T
[in] | rhs | dense matrix of type T to be added |
NRSMat< complex< double > > & LA::NRSMat< complex< double > >::operator+= | ( | const NRSMat< complex< double > > & | rhs | ) | [inline] |
add up this complex symmetric matrix with given symmetric matrix
[in] | rhs | complex symmetric matrix to be added |
NRSMat< double > & LA::NRSMat< double >::operator+= | ( | const NRSMat< double > & | rhs | ) | [inline] |
add up this real symmetric matrix with given symmetric matrix
[in] | rhs | real symmetric matrix to be added |
NRSMat< T > & LA::NRSMat< T >::operator+= | ( | const NRSMat< T > & | rhs | ) | [inline] |
add up this symmetric matrix of general type T
with given symmetric matrix
[in] | rhs | complex matrix of general type T to be added |
NRSMat< T > & LA::NRSMat< T >::operator+= | ( | const T & | a | ) | [inline] |
add a scalar value of general type
T
to the diagonal elements of this symmetric matrix of type T
[in] | a | scalar value ![]() |
const NRSMat< complex< double > > LA::NRSMat< complex< double > >::operator- | ( | ) | const [inline] |
implements unary minus operator for this hermitian matrix
const NRSMat< double > LA::NRSMat< double >::operator- | ( | ) | const [inline] |
implements unary minus operator for this real symmetric matrix
const NRMat< T > LA::NRSMat< T >::operator- | ( | const NRMat< T > & | rhs | ) | const [inline] |
subtracts given dense matrix of general type T
from this symmetric matrix of type T
[in] | rhs | dense matrix of type T to be added |
const NRSMat< T > LA::NRSMat< T >::operator- | ( | ) | const [inline] |
implements unary minus operator for this symmetric matrix of general type T
NRSMat< complex< double > > & LA::NRSMat< complex< double > >::operator-= | ( | const NRSMat< complex< double > > & | rhs | ) | [inline] |
subtracts given complex symmetric matrix from this complex symmetric matrix
[in] | rhs | complex symmetric matrix to be subtracted |
NRSMat< double > & LA::NRSMat< double >::operator-= | ( | const NRSMat< double > & | rhs | ) | [inline] |
subtracts given real symmetric matrix from this real symmetric matrix
[in] | rhs | real symmetric matrix to be subtracted |
NRSMat< T > & LA::NRSMat< T >::operator-= | ( | const NRSMat< T > & | rhs | ) | [inline] |
subtracts given symmetric matrix of general type T
from this symmetric matrix of type T
[in] | rhs | symmetric matrix of general type T to be subtracted |
NRSMat< T > & LA::NRSMat< T >::operator-= | ( | const T & | a | ) | [inline] |
subtract a scalar value of general type
T
from the diagonal elements of this symmetric matrix of type T
[in] | a | scalar value ![]() |
NRSMat< T > & LA::NRSMat< T >::operator= | ( | const T & | a | ) | [inline] |
assign scalar value to diagonal elements
zero out this symmetric matrix of general type T
and then set the diagonal elements to prescribed value
[in] | a | scalar value to be assigned to the diagonal |
NRSMat< T > & LA::NRSMat< T >::operator= | ( | const NRSMat< T > & | rhs | ) | [inline] |
assignment operator performing shallow copy
assignment operator implementing shallow copy of reference NRSMat<T> object
T & LA::NRSMat< T >::operator[] | ( | const int | ij | ) | [inline] |
determine matrix element of this symmetric matrix of general type T
using cumulative index increasing in a row-major way and corresponding to the lower triangular part of the respective dense matrix
[in] | ij | index of the requested element |
const T & LA::NRSMat< T >::operator[] | ( | const int | ij | ) | const [inline] |
determine matrix element of this symmetric matrix of general type T
using cumulative index increasing in a row-major way and corresponding to the lower triangular part of the respective dense matrix, i.e. for
corresponds to cumulative index
[in] | ij | index of the requested element |
NRSMat< T > & LA::NRSMat< T >::operator|= | ( | const NRSMat< T > & | rhs | ) | [inline] |
assignment operator performing deep copy
assigment operator implementing deep copy of the reference NRSMat<T> object
void LA::NRSMat< T >::put | ( | int | fd, | |
bool | dim = 1 , |
|||
bool | transp = 0 | |||
) | const [inline] |
routine for raw output
[in] | fd | file descriptor for output |
[in] | dim | number of elements intended for output |
[in] | transp | reserved |
void LA::NRSMat< complex< double > >::randomize | ( | const double & | x | ) | [inline] |
Fill this hermitian matrix with pseudorandom numbers generated from uniform distribution. The real and imaginary parts are generated independently.
void LA::NRSMat< double >::randomize | ( | const double & | x | ) | [inline] |
fill this real symmetric matrix with pseudorandom numbers generated from uniform distribution
void LA::NRSMat< T >::resize | ( | const int | n | ) | [inline] |
resize this symmetric matrix of general type T
[in] | n | requested number of rows (columns) |
int LA::NRSMat< T >::size | ( | ) | const [inline] |
T
const T LA::NRSMat< T >::trace | ( | ) | const [inline] |