#include <vec.h>
Public Types | |
typedef T | ROWTYPE |
Public Member Functions | |
~NRVec () | |
standard destructor | |
NRVec () | |
NRVec (const int n, const GPUID loc=undefined) | |
NRVec (const T &a, const int n) | |
inlined constructor creating vector of given size filled with prescribed value | |
NRVec (const T *a, const int n) | |
inlined constructor creating vector of given size filled with data located at given memory location | |
NRVec (T *a, const int n, bool skeleton) | |
inlined constructor creating vector of given size filled with data located at given memory location | |
NRVec (const NRVec &rhs) | |
inlined copy constructor | |
NRVec (const typename LA_traits_complex< T >::NRVec_Noncomplex_type &rhs, bool imagpart=false) | |
complexifying constructor | |
NRVec (const NRSMat< T > &S) | |
explicit inlined constructor converting symmetric matrix into a vector | |
NRVec (const NRMat< T > &rhs) | |
GPUID | getlocation () const |
void | moveto (const GPUID dest) |
void | copyonwrite () |
create separate copy of the data corresponding to this vector | |
void | clear () |
purge this vector | |
NRVec & | operator= (const NRVec &rhs) |
assignment operator assigns given vector | |
NRVec & | operator= (const T &a) |
assigment operator assigns given scalar to each element of this vector | |
void | randomize (const typename LA_traits< T >::normtype &x) |
fills in this vector with pseudo-random numbers generated using uniform distribution | |
NRVec & | operator|= (const NRVec &rhs) |
perform deep-copy of given vector | |
const bool | operator!= (const NRVec &rhs) const |
relational operators | |
const bool | operator== (const NRVec &rhs) const |
const bool | operator> (const NRVec &rhs) const |
const bool | operator< (const NRVec &rhs) const |
const bool | operator>= (const NRVec &rhs) const |
const bool | operator<= (const NRVec &rhs) const |
const NRVec | operator- () const |
unary minus | |
NRVec & | operator+= (const NRVec &rhs) |
bunch of vector-vector arithmetic operators defined element-wise | |
NRVec & | operator-= (const NRVec &rhs) |
NRVec & | operator*= (const NRVec &rhs) |
NRVec & | operator/= (const NRVec &rhs) |
const NRVec | operator+ (const NRVec &rhs) const |
const NRVec | operator- (const NRVec &rhs) const |
NRVec & | operator+= (const T &a) |
bunch of scalar-vector arithmetic operators defined element-wise | |
NRVec & | operator-= (const T &a) |
NRVec & | operator*= (const T &a) |
const NRVec | operator+ (const T &a) const |
const NRVec | operator- (const T &a) const |
const NRVec | operator* (const T &a) const |
int | getcount () const |
determine the actual value of the reference counter | |
const T | operator* (const NRVec &rhs) const |
compute the Euclidean inner product (with conjugation in complex case) | |
const T | dot (const NRVec &rhs) const |
const T | dot (const T *a, const int stride=1) const |
compute the Euclidean inner product (with conjugation in complex case) with a stride-vector | |
void | gemv (const T beta, const NRMat< T > &a, const char trans, const T alpha, const NRVec &x) |
void | gemv (const T beta, const NRSMat< T > &a, const char trans, const T alpha, const NRVec &x) |
void | gemv (const T beta, const SparseMat< T > &a, const char trans, const T alpha, const NRVec &x, const bool treat_as_symmetric=false) |
void | gemv (const typename LA_traits_complex< T >::Component_type beta, const typename LA_traits_complex< T >::NRMat_Noncomplex_type &a, const char trans, const typename LA_traits_complex< T >::Component_type alpha, const NRVec &x) |
void | gemv (const typename LA_traits_complex< T >::Component_type beta, const typename LA_traits_complex< T >::NRSMat_Noncomplex_type &a, const char trans, const typename LA_traits_complex< T >::Component_type alpha, const NRVec &x) |
const NRVec | operator* (const NRMat< T > &mat) const |
multiply given matrix with this vector from left | |
const NRVec | operator* (const NRSMat< T > &mat) const |
multiply given symmetric matrix in packed form with this vector from left | |
const NRVec | operator* (const SparseMat< T > &mat) const |
multiply given sparse matrix with this vector from left | |
const NRMat< T > | otimes (const NRVec< T > &rhs, const bool conjugate=false, const T &scale=1) const |
compute the outer product of two vectors | |
const NRMat< T > | operator| (const NRVec< T > &rhs) const |
opeartor for outer product computation | |
const T | sum () const |
compute the sum of the vector elements | |
const LA_traits< T >::normtype | asum () const |
compute the sum of the absolute values of the elements of this vector | |
T & | operator[] (const int i) |
indexing operator - index running from zero | |
const T & | operator[] (const int i) const |
void | setcoldim (int i) |
dummy routine | |
operator T * () | |
get the pointer to the underlying data structure | |
operator const T * () const | |
get the constant pointer to the underlying data structure | |
void | axpy (const T alpha, const NRVec &x) |
add up a scalar multiple of a given vector | |
void | axpy (const T alpha, const T *x, const int stride=1) |
add up a scalar multiple of a given vector with given stride | |
int | size () const |
determine the number of elements | |
void | resize (const int n) |
resize the current vector | |
const LA_traits< T >::normtype | norm () const |
determine the norm of this vector | |
NRVec & | normalize (typename LA_traits< T >::normtype *norm=0) |
normalize this vector and optionally save the norm | |
const NRVec | unitvector () const |
get normalized copy of this vector | |
const T | amax () const |
determine the maximal element (in the absolute value) of this vector | |
const T | amin () const |
determine the minimal element (in the absolute value) of this vector | |
void | fprintf (FILE *f, const char *format, const int modulo) const |
routine for formatted output | |
void | put (int fd, bool dimensions=1, bool transp=0) const |
routine for unformatted output | |
void | fscanf (FILE *f, const char *format) |
routine for formatted input | |
void | get (int fd, bool dimensions=1, bool transp=0) |
routine for unformatted input | |
NRVec (const SparseMat< T > &rhs) | |
constructor creating vector from sparse matrix | |
void | simplify () |
routine for compatibility with sparse types | |
bool | bigger (int i, int j) const |
determine whether the ith element is bigger than the jth element | |
bool | smaller (int i, int j) const |
determine whether the ith element is bigger than the jth element | |
void | swap (int i, int j) |
swap the ith and jth element | |
int | sort (int direction=0, int from=0, int to=-1, int *perm=NULL) |
sort by default in ascending order and return the parity of corresponding permutation resulting to this order | |
NRVec & | call_on_me (T(*_F)(const T &)) |
apply given function to each element | |
template<> | |
const NRVec< double > | operator- () const |
template<> | |
const NRVec< complex< double > > | operator- () const |
template<> | |
void | randomize (const double &x) |
template<> | |
void | randomize (const double &x) |
template<> | |
NRVec (const NRVec< double > &rhs, bool imagpart) | |
template<> | |
void | axpy (const double alpha, const NRVec< double > &x) |
template<> | |
void | axpy (const complex< double > alpha, const NRVec< complex< double > > &x) |
template<> | |
void | axpy (const double alpha, const double *x, const int stride) |
template<> | |
void | axpy (const complex< double > alpha, const complex< double > *x, const int stride) |
template<> | |
NRVec< double > & | operator= (const double &a) |
template<> | |
NRVec< complex< double > > & | operator= (const complex< double > &a) |
template<> | |
NRVec< double > & | normalize (double *norm) |
template<> | |
NRVec< complex< double > > & | normalize (double *norm) |
template<> | |
void | gemv (const double beta, const NRMat< double > &A, const char trans, const double alpha, const NRVec &x) |
template<> | |
void | gemv (const double beta, const NRMat< double > &A, const char trans, const double alpha, const NRVec< complex< double > > &x) |
template<> | |
void | gemv (const complex< double > beta, const NRMat< complex< double > > &A, const char trans, const complex< double > alpha, const NRVec< complex< double > > &x) |
template<> | |
void | gemv (const double beta, const NRSMat< double > &A, const char trans, const double alpha, const NRVec &x) |
template<> | |
void | gemv (const double beta, const NRSMat< double > &A, const char trans, const double alpha, const NRVec< complex< double > > &x) |
template<> | |
void | gemv (const complex< double > beta, const NRSMat< complex< double > > &A, const char trans, const complex< double > alpha, const NRVec< complex< double > > &x) |
template<> | |
const NRMat< double > | otimes (const NRVec< double > &b, const bool conj, const double &scale) const |
template<> | |
const NRMat< complex< double > > | otimes (const NRVec< complex< double > > &b, const bool conj, const complex< double > &scale) const |
template<> | |
NRVec< double > & | operator+= (const double &a) |
template<> | |
NRVec< complex< double > > & | operator+= (const complex< double > &a) |
template<> | |
NRVec< double > & | operator-= (const double &a) |
template<> | |
NRVec< complex< double > > & | operator-= (const complex< double > &a) |
template<> | |
NRVec< double > & | operator+= (const NRVec< double > &rhs) |
template<> | |
NRVec< complex< double > > & | operator+= (const NRVec< complex< double > > &rhs) |
template<> | |
NRVec< double > & | operator-= (const NRVec< double > &rhs) |
template<> | |
NRVec< complex< double > > & | operator-= (const NRVec< complex< double > > &rhs) |
template<> | |
NRVec< double > & | operator*= (const double &a) |
template<> | |
NRVec< complex< double > > & | operator*= (const complex< double > &a) |
template<> | |
const double | operator* (const NRVec< double > &rhs) const |
template<> | |
const complex< double > | operator* (const NRVec< complex< double > > &rhs) const |
template<> | |
const double | dot (const double *y, const int stride) const |
template<> | |
const complex< double > | dot (const complex< double > *y, const int stride) const |
template<> | |
const double | asum () const |
template<> | |
const double | asum () const |
template<> | |
const double | norm () const |
template<> | |
const double | norm () const |
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 |
size of the vector | |
T * | v |
pointer to the underlying data structure | |
int * | count |
pointer to the reference-counter | |
Friends | |
class | NRSMat< T > |
class | NRMat< T > |
template<typename U > | |
NRVec< complex< U > > | complexify (const NRVec< U > &) |
standard destructor
generate operators involving vector and scalar generate operators involving vector and vector destructor for general vector decreases the reference count and performs deallocation if neccessary
inlined constructor creating zero vector of general type T
LA::NRVec< T >::NRVec | ( | const int | n, | |
const GPUID | loc = undefined | |||
) | [inline, explicit] |
Explicit inlined constructor creating vector 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) |
inlined constructor creating vector of given size filled with prescribed value
inline constructor creating vector of given size filled with prescribed value
[in] | a | value to be assigned to all vector elements |
[in] | n | required vector size |
inlined constructor creating vector of given size filled with data located at given memory location
inline constructor creating vector of given size filled with given data
[in] | a | pointer to the data |
[in] | n | required vector size |
inlined constructor creating vector of given size filled with data located at given memory location
inline constructor creating vector of given size filled with given data
[in] | a | pointer to the data |
[in] | n | required vector size |
[in] | skeleton | if equal to true, only the internal data pointer is modified and reference counter is set to two, i.e. no data deallocation occurs in destructor |
inlined copy constructor
inline copy constructor
[in] | rhs | reference vector being copied |
explicit inlined constructor converting symmetric matrix into a vector
inline constructor interpreting symmetric matrix of order stored in packed form as a linear vector consisting of
elements
[in] | rhs | symmetric matrix of type NRSMat<T> |
using macro NN2 defined in smat.h
conversion constructor interpreting a given matrix with rows and
columns of general type
T
as a vector of elements
[in] | rhs | matrix being converted |
LA::NRVec< complex< double > >::NRVec | ( | const NRVec< double > & | rhs, | |
bool | imagpart | |||
) | [inline] |
constructor creating complex vector from a real one
[in] | rhs | the real vector being converted into the complex one |
[in] | imagpart |
|
false
current vector is bigger than vector rhs
true
current vector is smaller than vector rhs
const complex< double > LA::NRVec< complex< double > >::amax | ( | ) | const [inline] |
for a given complex vector , determine the smallest index of the maximum magnitude element, i.e. maximal element in the 1-norm
const double LA::NRVec< double >::amax | ( | ) | const [inline] |
for this real vector determine the element with largest absolute value
const complex< double > LA::NRVec< complex< double > >::amin | ( | ) | const [inline] |
for a given complex vector , determine the smallest index of the minimum magnitude element, i.e. minimal element in the 1-norm
const double LA::NRVec< double >::amin | ( | ) | const [inline] |
for this real vector determine the element with smallest absolute value
const double LA::NRVec< complex< double > >::asum | ( | ) | const [inline] |
for this complex vector compute the expression
const double LA::NRVec< double >::asum | ( | ) | const [inline] |
computes the sum of the absolute values of the elements of this real vector
void LA::NRVec< complex< double > >::axpy | ( | const complex< double > | alpha, | |
const complex< double > * | x, | |||
const int | stride | |||
) | [inline] |
perform the axpy operation on the current complex vector , i.e.
[in] | alpha | double-precision complex parameter ![]() |
[in] | x | pointer to double-precision complex data |
[in] | stride | sets the stride |
void LA::NRVec< double >::axpy | ( | const double | alpha, | |
const double * | x, | |||
const int | stride | |||
) | [inline] |
perform the axpy operation on the current real vector , i.e.
[in] | alpha | ![]() |
[in] | x | pointer to double-precision real data |
[in] | stride | sets the stride |
void LA::NRVec< complex< double > >::axpy | ( | const complex< double > | alpha, | |
const NRVec< complex< double > > & | x | |||
) | [inline] |
perform the axpy operation on the current complex vector , i.e.
[in] | alpha | ![]() |
[in] | x | complex vector ![]() |
void LA::NRVec< double >::axpy | ( | const double | alpha, | |
const NRVec< double > & | x | |||
) | [inline] |
perform the axpy operation on the current real vector , i.e.
[in] | alpha | double-precision real parameter ![]() |
[in] | x | double-precision real vector ![]() |
void LA::NRVec< T >::copyonwrite | ( | ) | [inline] |
create separate copy of the data corresponding to this vector
make own copy of the underlying data connected with this vector
const complex< double > LA::NRVec< complex< double > >::dot | ( | const complex< double > * | y, | |
const int | stride | |||
) | const [inline] |
computes the inner product of this complex vector with given complex data
[in] | y | pointer to the double-precision complex array (sufficient length assumed) |
[in] | stride | specifies the stride regarding the data pointe to by y |
const double LA::NRVec< double >::dot | ( | const double * | y, | |
const int | stride | |||
) | const [inline] |
computes the inner product of this real vector with given real data
[in] | y | pointer to the double-precision real array (sufficient length assumed) |
[in] | stride | specifies the stride regarding the data pointe to by y |
void LA::NRVec< T >::fprintf | ( | FILE * | file, | |
const char * | format, | |||
const int | modulo | |||
) | const [inline] |
routine for formatted output
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::NRVec< T >::fscanf | ( | FILE * | f, | |
const char * | format | |||
) | [inline] |
routine for formatted input
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::NRVec< complex< double > >::gemv | ( | const complex< double > | beta, | |
const NRSMat< complex< double > > & | A, | |||
const char | trans, | |||
const complex< double > | alpha, | |||
const NRVec< complex< double > > & | x | |||
) | [inline] |
perform the gemv operation on this complex vector , i.e.
[in] | beta | complex parameter ![]() |
[in] | A | complex Hermitian matrix ![]() |
[in] | trans | not used |
[in] | alpha | complex parameter ![]() |
[in] | x | complex vector ![]() |
void LA::NRVec< complex< double > >::gemv | ( | const double | beta, | |
const NRSMat< double > & | A, | |||
const char | trans, | |||
const double | alpha, | |||
const NRVec< complex< double > > & | x | |||
) | [inline] |
perform the gemv
operation on this complex vector , i.e.
[in] | beta | real parameter ![]() |
[in] | A | real symmetric matrix ![]() |
[in] | trans | if trans == 'n' use ![]() ![]() |
[in] | alpha | real parameter ![]() |
[in] | x | complex vector ![]() |
void LA::NRVec< double >::gemv | ( | const double | beta, | |
const NRSMat< double > & | A, | |||
const char | trans, | |||
const double | alpha, | |||
const NRVec< T > & | x | |||
) | [inline] |
perform the gemv operation on this real vector , i.e.
[in] | beta | real parameter ![]() |
[in] | A | real symmetric matrix ![]() |
[in] | trans | if trans == 'n' use ![]() ![]() |
[in] | alpha | real parameter ![]() |
[in] | x | real vector ![]() |
void LA::NRVec< complex< double > >::gemv | ( | const complex< double > | beta, | |
const NRMat< complex< double > > & | A, | |||
const char | trans, | |||
const complex< double > | alpha, | |||
const NRVec< complex< double > > & | x | |||
) | [inline] |
perform the gemv operation on this complex vector , i.e.
[in] | beta | complex parameter ![]() |
[in] | A | complex matrix ![]() |
[in] | trans | if trans == 'n' use ![]() ![]() |
[in] | alpha | complex parameter ![]() |
[in] | x | real vector ![]() |
void LA::NRVec< complex< double > >::gemv | ( | const double | beta, | |
const NRMat< double > & | A, | |||
const char | trans, | |||
const double | alpha, | |||
const NRVec< complex< double > > & | x | |||
) | [inline] |
perform the gemv operation on this complex vector , i.e.
[in] | beta | real parameter ![]() |
[in] | A | real matrix ![]() |
[in] | trans | if trans == 'n' use ![]() ![]() |
[in] | alpha | real parameter ![]() |
[in] | x | real vector ![]() |
void LA::NRVec< double >::gemv | ( | const double | beta, | |
const NRMat< double > & | A, | |||
const char | trans, | |||
const double | alpha, | |||
const NRVec< T > & | x | |||
) | [inline] |
perform the gemv operation on this real vector , i.e.
[in] | beta | real parameter ![]() |
[in] | A | real matrix ![]() |
[in] | trans | if trans == 'n' use ![]() ![]() |
[in] | alpha | real parameter ![]() |
[in] | x | real vector ![]() |
void LA::NRVec< T >::gemv | ( | const T | beta, | |
const NRSMat< T > & | a, | |||
const char | trans, | |||
const T | alpha, | |||
const NRVec< T > & | x | |||
) |
trans | just for compatibility reasons |
void LA::NRVec< T >::get | ( | int | fd, | |
bool | dim = 1 , |
|||
bool | transp = 0 | |||
) | [inline] |
routine for 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 |
GPUID LA::NRVec< 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 const double LA::NRVec< complex< double > >::norm | ( | ) | const [inline] |
for this complex vector (of
elements) determine the Frobenius norm
const double LA::NRVec< double >::norm | ( | ) | const [inline] |
for this real vector (of
elements) determine the Frobenius norm
NRVec< complex< double > > & LA::NRVec< complex< double > >::normalize | ( | double * | norm | ) | [inline] |
normalize current complex vector (in the Euclidean norm)
[in] | norm | if not NULL, the norm of this vector is stored into *norm |
normalize current real vector (in the Euclidean norm)
[in] | norm | if not NULL, the norm of this vector is stored into *norm |
LA::NRVec< T >::operator const T * | ( | ) | const [inline] |
get the constant pointer to the underlying data structure
get the constant pointer to the underlying data of this vector
LA::NRVec< T >::operator T * | ( | ) | [inline] |
get the pointer to the underlying data structure
get the pointer to the underlying data of this vector
const complex< double > LA::NRVec< complex< double > >::operator* | ( | const NRVec< complex< double > > & | rhs | ) | const [inline] |
computes the inner product of this complex vector with given complex vector
taking conjugation of vector
into account
[in] | rhs | complex vector ![]() |
const double LA::NRVec< double >::operator* | ( | const NRVec< double > & | rhs | ) | const [inline] |
computes the inner product of this real vector with given real vector
[in] | rhs | real vector ![]() |
compute the Euclidean inner product (with conjugation in complex case)
compute scalar product of this vector
of general type
T
with given vector of type
T
and order
[in] | rhs | general vector ![]() |
NRVec< complex< double > > & LA::NRVec< complex< double > >::operator*= | ( | const complex< double > & | a | ) | [inline] |
multiplies this complex vector by a complex scalar value
[in] | a | complex scalar value ![]() |
multiplies this real vector by a real scalar value
[in] | a | real scalar value ![]() |
multiply this general vector by scalar value
[in] | a | scalar value ![]() |
multiplies this vector componentwise by general vector
[in] | rhs | general vector ![]() |
NRVec< complex< double > > & LA::NRVec< complex< double > >::operator+= | ( | const NRVec< complex< double > > & | rhs | ) | [inline] |
adds a complex vector to this complex vector
[in] | rhs | complex vector ![]() |
NRVec< double > & LA::NRVec< double >::operator+= | ( | const NRVec< double > & | rhs | ) | [inline] |
adds a real vector to this real vector
[in] | rhs | real vector ![]() |
NRVec< complex< double > > & LA::NRVec< complex< double > >::operator+= | ( | const complex< double > & | a | ) | [inline] |
adds a complex scalar value to all elements of this complex vector
[in] | a | complex scalar value ![]() |
routine for moving vector data between CPU and GPU memory
[in] | dest | required location |
[in] | a | real scalar value ![]() |
bunch of scalar-vector arithmetic operators defined element-wise
adds given scalar value of type T to all vector elements
[in] | a | scalar value being added |
bunch of vector-vector arithmetic operators defined element-wise
adds a vector of general type
T
to this vector
[in] | rhs | vector ![]() T |
const NRVec< complex< double > > LA::NRVec< complex< double > >::operator- | ( | ) | const [inline] |
unary minus operator in case of complex double-precision vector
unary minus operator in case of real double-precision vector
unary minus
unary minus operator for vector of general type
NRVec< complex< double > > & LA::NRVec< complex< double > >::operator-= | ( | const NRVec< complex< double > > & | rhs | ) | [inline] |
subtracts a complex vector from this complex vector
[in] | rhs | double-precision complex vector ![]() |
NRVec< double > & LA::NRVec< double >::operator-= | ( | const NRVec< double > & | rhs | ) | [inline] |
subtracts a real vector from this real vector
[in] | rhs | real vector ![]() |
NRVec< complex< double > > & LA::NRVec< complex< double > >::operator-= | ( | const complex< double > & | a | ) | [inline] |
subtracts a complex scalar value from all elements of this complex vector
[in] | a | complex scalar value ![]() |
subtracts a real scalar value from all elements of this real vector
[in] | a | real scalar value ![]() |
subtracts given scalar value of type T from all vector elements
[in] | a | scalar value being subtracted |
subtracts given vector from this vector
[in] | rhs | vector ![]() |
divides this vector componentwise by general vector
[in] | rhs | general vector ![]() |
const bool LA::NRVec< T >::operator< | ( | const NRVec< T > & | rhs | ) | const [inline] |
comparison operator (lexicographical order)
[in] | rhs | vector intended for comparison |
false
current vector is bigger than vector rhs
true
current vector is smaller than vector rhs
NRVec< complex< double > > & LA::NRVec< complex< double > >::operator= | ( | const complex< double > & | a | ) | [inline] |
assign complex scalar value to every element of the current vector
[in] | a | scalar value to be assigned |
assign real scalar value to every element of the current vector
[in] | a | scalar value to be assigned |
assigment operator assigns given scalar to each element of this vector
assign scalar value to every element of the current vector of general type T
[in] | a | scalar value to be assigned |
assignment operator assigns given vector
assigns general vector to this vector
const bool LA::NRVec< T >::operator> | ( | const NRVec< T > & | rhs | ) | const [inline] |
comparison operator (lexicographical order)
[in] | rhs | vector intended for comparison |
true
current vector is bigger than vector rhs
false
current vector is smaller than vector rhs
const T & LA::NRVec< T >::operator[] | ( | const int | i | ) | const [inline] |
indexing operator giving the element at given position with range checking in the DEBUG mode
[in] | i | position of the required vector element (starting from 0) |
T & LA::NRVec< T >::operator[] | ( | const int | i | ) | [inline] |
indexing operator - index running from zero
indexing operator giving the element at given position with range checking in the DEBUG mode
[in] | i | position of the required vector element (starting from 0) |
perform deep-copy of given vector
perfrom deep copy
[in] | rhs | vector being copied |
const NRMat< complex< double > > LA::NRVec< complex< double > >::otimes | ( | const NRVec< complex< double > > & | b, | |
const bool | conj, | |||
const complex< double > & | scale | |||
) | const [inline] |
computes the outer product of this complex vector with given complex vector
and scales the resulting matrix with factor
, i.e. the matrix elements of the final matrix
can be expressed as
in case conj = true
, the result is
[in] | b | complex vector ![]() |
[in] | conj | determines whther the vector ![]() |
[in] | scale | complex scaling factor ![]() |
const NRMat< double > LA::NRVec< double >::otimes | ( | const NRVec< double > & | b, | |
const bool | conj, | |||
const double & | scale | |||
) | const [inline] |
computes the outer product of this real vector with given real vector
and scales the resulting matrix with factor
, i.e. the matrix elements of the final matrix
can be expressed as
[in] | b | real vector ![]() |
[in] | conj | not used |
[in] | scale | real factor ![]() |
void LA::NRVec< T >::put | ( | int | fd, | |
bool | dim = 1 , |
|||
bool | transp = 0 | |||
) | const [inline] |
routine for 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::NRVec< complex< double > >::randomize | ( | const double & | x | ) | [inline] |
fill the complex vector with pseudorandom numbers generated using uniform distribution the real and imaginary parts are generated independently
[in] | x | specification of the interval ![]() |
false
current vector is bigger than vector rhs
true
current vector is smaller than vector rhs
void LA::NRVec< double >::randomize | ( | const double & | x | ) | [inline] |
fill the real vector with pseudorandom numbers generated using uniform distribution
[in] | x | specification of the interval ![]() |
void LA::NRVec< T >::resize | ( | const int | n | ) | [inline] |
resize the current vector
resizes this vector
[in] | n | requested size |
int LA::NRVec< T >::size | ( | ) | const [inline] |
determine the number of elements
determine the number of elements of this vector
get normalized copy of this vector
create normalized copy of this vector