Class xlifepp::MultiVecAdapter#

template<class ScalarType>
class MultiVecAdapter : public xlifepp::MultiVec<ScalarType>#

Inheritence diagram for xlifepp::MultiVecAdapter:

digraph { graph [bgcolor="#00000000"] node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2] edge [color="#1414CE"] "2" [label="xlifepp::MultiVec< ScalarType >" tooltip="xlifepp::MultiVec< ScalarType >"] "1" [label="xlifepp::MultiVecAdapter< ScalarType >" tooltip="xlifepp::MultiVecAdapter< ScalarType >" fillcolor="#BFBFBF"] "1" -> "2" [dir=forward tooltip="public-inheritance"] }

Collaboration diagram for xlifepp::MultiVecAdapter:

digraph { graph [bgcolor="#00000000"] node [shape=rectangle style=filled fillcolor="#FFFFFF" font=Helvetica padding=2] edge [color="#1414CE"] "4" [label="std::vector< T >" tooltip="std::vector< T >"] "3" [label="std::vector< VectorPointer >" tooltip="std::vector< VectorPointer >"] "5" [label="std::vector< bool >" tooltip="std::vector< bool >"] "2" [label="xlifepp::MultiVec< ScalarType >" tooltip="xlifepp::MultiVec< ScalarType >"] "1" [label="xlifepp::MultiVecAdapter< ScalarType >" tooltip="xlifepp::MultiVecAdapter< ScalarType >" fillcolor="#BFBFBF"] "3" -> "4" [dir=forward tooltip="template-instance"] "5" -> "4" [dir=forward tooltip="template-instance"] "1" -> "2" [dir=forward tooltip="public-inheritance"] "1" -> "3" [dir=forward tooltip="usage"] "1" -> "5" [dir=forward tooltip="usage"] }

This class implements all the virtual functions of its ancestor.

Public Functions

inline MultiVecAdapter(const MultiVecAdapter &rhs)#

Copy constructor, performs a deep copy.

inline MultiVecAdapter(const number_t length, const dimen_t numberVecs)#

Constructor for a numberVecs vectors of length length.

inline MultiVecAdapter(const number_t length, const std::vector<VectorPointer> &rhs)#

Constructor with already allocated memory.

inline ~MultiVecAdapter()#

Destructor.

inline virtual MultiVecAdapter *clone(const dimen_t numberVecs) const#

Returns a clone of the current mult-vector with a number of vector.

If numberVecs is less than the number of current multi-vector then its first numberVecs vector will be clone.

Parameters:

numberVecs[in] number of vector in multivector

Returns:

cloned multi-vector

inline virtual MultiVecAdapter *cloneCopy() const#

Returns a clone of the current multi-vector.

inline virtual MultiVecAdapter *cloneCopy(const std::vector<int> &index) const#

Returns a clone copy of specified vectors by their index.

Vector index must have size equal or less than the number of vector of the current multi-vector.

Parameters:

index[in] index of vectors of the current multi-vector which are cloned

Returns:

cloned multi-vector

inline virtual const MultiVecAdapter *cloneView(const std::vector<int> &index) const#

Returns a view of current vector (shallow copy), const version.

inline virtual MultiVecAdapter *cloneViewNonConst(const std::vector<int> &index)#

Returns a view of specified vectors (shallow copy) by their index.

Vector index must have size equal or less than the number of vector of the current multi-vector.

Parameters:

index[in] index of vectors of the current multi-vector which are cloned

Returns:

cloned multi-vector

inline virtual dimen_t getNumberVecs() const#

Return the number of vector in multi-vector.

inline virtual number_t getVecLength() const#

Return length of vector in multi-vector.

inline virtual void mvAddMv(ScalarType alpha, const MultiVec<ScalarType> &A, ScalarType beta, const MultiVec<ScalarType> &B)#

Replace *this with alpha * A + beta * B.

Parameters:
  • alpha[in] alpha

  • A[in] multi-vector A

  • B[in] multi-vector B

  • beta[in] beta

inline virtual void mvDot(const MultiVec<ScalarType> &A, std::vector<ScalarType> &b) const#

Compute a vector b whose components are the individual dot-products, i.e.b[i] = A[i]^H*this[i] where A[i] is the i-th column of A.

Parameters:
  • A[in] multi-vector A

  • b[out] std::vector b

inline virtual void mvInit(ScalarType alpha)#

Replace each element of the vectors in *this with alpha.

inline virtual void mvLoadFromFile(const char *f)#

Print *this multivector to the os output stream.

inline void mvNorm(std::vector<typename NumTraits<ScalarType>::magnitudeType> &normvec) const#

Compute square norm of each vector of multivector in a result vector.

Parameters:

normvec[out] vector contains result of normalization

inline virtual void mvPrint(std::ostream &os) const#

Print *this multivector to the os output stream.

inline virtual void mvRandom()#

Fill all the vectors in *this with random numbers.

inline virtual void mvScale(const std::vector<ScalarType> &alpha)#

Scale each element of the i-th vector in *this with alpha[i].

inline virtual void mvScale(ScalarType alpha)#

Scale each element of the vectors in *this with alpha.

inline virtual void mvTimesMatAddMv(ScalarType alpha, const MultiVec<ScalarType> &A, const MatrixEigenDense<ScalarType> &B, ScalarType beta)#

Update *this with alpha * A * B + beta * (*this).

In this case, multi-vector is consider a (dense) matrix whose column is formed by a vector

Parameters:
  • alpha[in] alpha

  • A[in] multi-vector A

  • B[in] dense matrix B

  • beta[in] beta

inline virtual void mvTransMv(ScalarType alpha, const MultiVec<ScalarType> &A, MatrixEigenDense<ScalarType> &B) const#

Compute a dense matrix B through the matrix-matrix multiply alpha * A^H * (*this).

Parameters:
  • alpha[in] alpha

  • A[in] multi-vector A

  • B[out] dense matrix B

inline virtual ScalarType &operator()(const int i, const int j)#

Print *this multivector to the os output stream.

inline virtual const ScalarType &operator()(const int i, const int j) const#

Print *this multivector to the os output stream.

inline virtual std::vector<ScalarType> *operator[](int v)#

Print *this multivector to the os output stream.

inline virtual std::vector<ScalarType> *operator[](int v) const#

Print *this multivector to the os output stream.

inline virtual void setBlock(const MultiVec<ScalarType> &A, const std::vector<int> &index)#

Copy the vectors in A to a set of vectors in *this.

The numvecs vectors in A are copied to a subset of vectors in *this indicated by the indices given in index.

Parameters:
  • A[in] multi-vector whose vectors are copied to a subset of vectors in *this

  • index[in] index specifying the subset of vectors in *this to be copied

template<typename ScalarType>
std::ostream &operator<<(std::ostream &os, const MultiVecAdapter<ScalarType> &obj)#

Output stream operator for handling the printing of MultiVecAdapter.