Class xlifepp::VectorEigenDense#
-
template<typename K>
class VectorEigenDense : public xlifepp::Vector<K>#
-
Inheritence diagram for xlifepp::VectorEigenDense:
Collaboration diagram for xlifepp::VectorEigenDense:
Class (row) dense vector to deal with direct eigen problem solver.
This class provides some basic methods to support calculation of eigen problem dense matrix.
TODO Improve performance by reusing vector data
- Template Parameters:
-
Type – of scalar (real_t, complex_t)
Public Types
-
typedef VectorEigenDense::type_t Scalar#
-
useful typedefs to VectorEigenDense class
Public Functions
-
inline VectorEigenDense()#
-
default constructor
-
inline VectorEigenDense(const dimen_t l, const K v, AccessType ac = _col)#
-
Full constructor.
- Parameters:
-
l – [in] Size of vector (number of row or number of column)
v – [in] initial value
ac – [in] type of vector (column or row)
-
inline VectorEigenDense(const VectorEigenDense<K> &v)#
-
Copy constructor.
-
inline AccessType accessType() const#
-
return access type
-
inline K dotProduct(VectorEigenDense<K> &v) const#
-
Calculate inner product (hermitian product) of two vectors: inner product = vectorX * vectorY.
- Parameters:
-
v – [in] the second vector (Y)
- Returns:
-
inner product
-
inline VectorEigenDense<K> head(number_t headSize)#
-
Extract head a vector, return result into a new vector.
- Parameters:
-
headSize – [in] size of the extracted vector
- Returns:
-
extracted heading vector
-
inline void head(number_t headSize, VectorEigenDense<K> &v)#
-
Replace tail of a vector with a vector.
- Parameters:
-
headSize – [in] size of the new vector
v – [in] Input vector
-
inline void indexOutOfRange(const string_t &s, const size_t index, const size_t range) const#
-
error message when index out of range
-
inline void makeHouseHolder(VectorEigenDense<K> &essential, K &tau, real_t &beta) const#
-
Computes the elementary reflector H such that: \( H *this = [ beta 0 ... 0]^T \) where the transformation H is: \( H = I - tau v v^*\) and the vector v is: \( v^T = [1 essential^T] \).
On output:
- Parameters:
-
essential – the essential part of the vector
v
tau – the scaling factor of the Householder transformation
beta – the result of H *
*this
-
inline void makeHouseHolderInPlace(K &tau, real_t &beta)#
-
Computes the elementary reflector H such that: \( H *this = [ beta 0 ... 0]^T \) where the transformation H is: \( H = I - tau v v^*\) and the vector v is: \( v^T = [1 essential^T] \).
The essential part of the vector
v
is stored in *this.On output:
TODO This implementation is not so good. In deed, we can use directly one part of vector as the essential.
- Parameters:
-
tau – the scaling factor of the Householder transformation
beta – the result of H *
*this
-
inline void makeHouseHolderInPlace(K &tau, real_t &beta, number_t tail)#
-
Computes the elementary reflector H only for the tail part of vector: \( H *tail = [ beta 0 ... 0]^T \) where the transformation H is: \( H = I - tau v v^*\) and the vector v is: \( v^T = [1 essential^T] \).
The essential part of the vector
v
is stored in *this.On output:
TODO This implementation is not so good. In deed, we can use directly one part of vector as the essential.
- Parameters:
-
tau – the scaling factor of the Householder transformation
beta – the result of H *
*this
On Input:tail – size of the tail of vector on which the house holder transformation is taken place
-
inline void normalize()#
-
Normalize vector.
-
inline RealScalar normFrobenius() const#
-
compute Frobenius norm of a vector
-
inline void overSize(const string_t &s, const size_t r, const size_t c) const#
-
error message when incompatible sizes
-
inline VectorEigenDense<real_t> real()#
-
Real part of vector.
-
inline VectorEigenDense<K> segment(const int_t index, const int_t segmentLength)#
-
Extract segment of a vector.
- Parameters:
-
index – [in] beginning position of segment in vector
segmentLength – [in] segment length
- Returns:
-
segment vector
-
inline void segment(VectorEigenDense<K> &seg, const int_t index, const int_t segmentLength)#
-
Fill segment of a vector with a vector.
- Parameters:
-
index – [in] beginning position of segment in vector
segmentLength – [in] segment length
seg – [inout] vector to be modified
- Returns:
-
segment vector
-
inline void setZero()#
-
set a vector to zero
-
inline real_t sumAbs()#
-
Calculate sum of absolute value of all elements.
-
inline VectorEigenDense<K> tail(number_t tailSize)#
-
Tail a vector, return result into a new vector.
- Parameters:
-
tailSize – [in] size of the new vector
- Returns:
-
extracted tailing vector
-
inline void tail(number_t tailSize, VectorEigenDense<K> &v)#
-
Replace tail of a vector with a vector.
- Parameters:
-
tailSize – [in] size of the new vector
v – [in] Input vector