iterative-solver 0.0
molpro::linalg::itsolv::subspace::XSpace< R, Q, P > Class Template Reference

#include <XSpace.h>

Inheritance diagram for molpro::linalg::itsolv::subspace::XSpace< R, Q, P >:
Collaboration diagram for molpro::linalg::itsolv::subspace::XSpace< R, Q, P >:

Public Member Functions

 XSpace (const std::shared_ptr< ArrayHandlers< R, Q, P > > &handlers, const std::shared_ptr< Logger > &logger)
 
void update_qspace (const CVecRef< R > &params, const CVecRef< R > &actions) override
 Update parameters in Q space and corresponding equation data. More...
 
void update_dspace (VecRef< Q > &params, VecRef< Q > &actions) override
 Clears old D space container and stores new params and actions. More...
 
void update_pspace (const CVecRef< P > &params, const array::Span< value_type > &pp_action_matrix) override
 
void add_rhs_equations (const CVecRef< R > &rhs)
 For a system of linear equations Ax=b, adds rhs vectors b. More...
 
CVecRef< Qrhs () const
 Access RHS vectors in linear equations. More...
 
const std::vector< value_type_abs > & rhs_norm () const
 Norm of RHS vectors. More...
 
const Dimensionsdimensions () const override
 
void erase (size_t i) override
 Removes parameter i from the full subspace. More...
 
void eraseq (size_t i) override
 Removes parameter i from Q subspace. More...
 
void erasep (size_t i) override
 Removes parameter i from P subspace. More...
 
void erased (size_t i) override
 Removes parameter i from D subspace. More...
 
VecRef< Pparamsp () override
 
VecRef< Qparamsq () override
 
VecRef< Qactionsq () override
 
VecRef< Qparamsd () override
 
VecRef< Qactionsd () override
 
CVecRef< Pparamsp () const override
 
CVecRef< Qparamsq () const override
 
CVecRef< Qactionsq () const override
 
CVecRef< Qparamsd () const override
 
CVecRef< Qactionsd () const override
 
CVecRef< Pcparamsp () const override
 
CVecRef< Qcparamsq () const override
 
CVecRef< Qcactionsq () const override
 
CVecRef< Qcparamsd () const override
 
CVecRef< Qcactionsd () const override
 
void set_hermiticity (bool hermitian)
 Set Hermiticity of the subspace. P space can only be used with Hermitian problems. More...
 
bool get_hermiticity ()
 
void set_action_action ()
 
- Public Member Functions inherited from molpro::linalg::itsolv::subspace::IXSpace< R, Q, P >
 IXSpace ()=default
 
virtual ~IXSpace ()=default
 
size_t size () const
 Number of vectors forming the subspace. More...
 
virtual void erase (size_t i)=0
 Removes parameter i from the full subspace. More...
 
virtual void eraseq (size_t i)=0
 Removes parameter i from Q subspace. More...
 
virtual void erasep (size_t i)=0
 Removes parameter i from P subspace. More...
 
virtual void erased (size_t i)=0
 Removes parameter i from D subspace. More...
 
virtual void update_pspace (const CVecRef< P > &params, const array::Span< value_type > &pp_action_matrix)=0
 Adds parameters to the P space. More...
 
virtual void update_qspace (const CVecRef< R > &params, const CVecRef< R > &actions)=0
 Adds parameters to the Q space. More...
 
virtual void update_dspace (VecRef< Q > &params, VecRef< Q > &actions)=0
 Updates D space with the new parameters. More...
 
virtual VecRef< Pparamsp ()=0
 
virtual CVecRef< Pparamsp () const=0
 
virtual VecRef< Qparamsq ()=0
 
virtual CVecRef< Qparamsq () const=0
 
virtual VecRef< Qactionsq ()=0
 
virtual CVecRef< Qactionsq () const=0
 
virtual VecRef< Qparamsd ()=0
 
virtual CVecRef< Qparamsd () const=0
 
virtual VecRef< Qactionsd ()=0
 
virtual CVecRef< Qactionsd () const=0
 
virtual CVecRef< Pcparamsp () const=0
 
virtual CVecRef< Qcparamsq () const=0
 
virtual CVecRef< Qcactionsq () const=0
 
virtual CVecRef< Qcparamsd () const=0
 
virtual CVecRef< Qcactionsd () const=0
 
virtual const Dimensionsdimensions () const=0
 

Public Attributes

PSpace< R, Ppspace
 
QSpace< R, Q, Pqspace
 
DSpace< Qdspace
 
- Public Attributes inherited from molpro::linalg::itsolv::subspace::IXSpace< R, Q, P >
SubspaceData data
 Equation data in the subspace. More...
 

Protected Member Functions

void update_dimensions ()
 
auto update_rhs_with_pspace ()
 Update projection of RHS data onto P space. More...
 
void remove_data (size_t i)
 

Protected Attributes

std::shared_ptr< ArrayHandlers< R, Q, P > > m_handlers
 
std::shared_ptr< Loggerm_logger
 
Dimensions m_dim
 
std::vector< Qm_rhs
 Right hand side vectors. More...
 
std::vector< value_type_absm_rhs_norm
 norm of RHS vectors More...
 
bool m_hermitian = false
 whether the matrix is Hermitian More...
 
bool m_action_dot_action = false
 whether the H matrix is action.action instead of action.parameter More...
 

Additional Inherited Members

- Public Types inherited from molpro::linalg::itsolv::subspace::IXSpace< R, Q, P >
using R = R
 
using Q = Q
 
using P = P
 
using value_type = typename array::ArrayHandler< R, R >::value_type
 
using value_type_abs = typename array::ArrayHandler< R, R >::value_type_abs
 

Constructor & Destructor Documentation

◆ XSpace()

template<class R , class Q , class P >
molpro::linalg::itsolv::subspace::XSpace< R, Q, P >::XSpace ( const std::shared_ptr< ArrayHandlers< R, Q, P > > &  handlers,
const std::shared_ptr< Logger > &  logger 
)
inlineexplicit

Member Function Documentation

◆ actionsd() [1/2]

template<class R , class Q , class P >
CVecRef< Q > molpro::linalg::itsolv::subspace::XSpace< R, Q, P >::actionsd ( ) const
inlineoverridevirtual

◆ actionsd() [2/2]

template<class R , class Q , class P >
VecRef< Q > molpro::linalg::itsolv::subspace::XSpace< R, Q, P >::actionsd ( )
inlineoverridevirtual

◆ actionsq() [1/2]

template<class R , class Q , class P >
CVecRef< Q > molpro::linalg::itsolv::subspace::XSpace< R, Q, P >::actionsq ( ) const
inlineoverridevirtual

◆ actionsq() [2/2]

template<class R , class Q , class P >
VecRef< Q > molpro::linalg::itsolv::subspace::XSpace< R, Q, P >::actionsq ( )
inlineoverridevirtual

◆ add_rhs_equations()

template<class R , class Q , class P >
void molpro::linalg::itsolv::subspace::XSpace< R, Q, P >::add_rhs_equations ( const CVecRef< R > &  rhs)
inline

For a system of linear equations Ax=b, adds rhs vectors b.

◆ cactionsd()

template<class R , class Q , class P >
CVecRef< Q > molpro::linalg::itsolv::subspace::XSpace< R, Q, P >::cactionsd ( ) const
inlineoverridevirtual

◆ cactionsq()

template<class R , class Q , class P >
CVecRef< Q > molpro::linalg::itsolv::subspace::XSpace< R, Q, P >::cactionsq ( ) const
inlineoverridevirtual

◆ cparamsd()

template<class R , class Q , class P >
CVecRef< Q > molpro::linalg::itsolv::subspace::XSpace< R, Q, P >::cparamsd ( ) const
inlineoverridevirtual

◆ cparamsp()

template<class R , class Q , class P >
CVecRef< P > molpro::linalg::itsolv::subspace::XSpace< R, Q, P >::cparamsp ( ) const
inlineoverridevirtual

◆ cparamsq()

template<class R , class Q , class P >
CVecRef< Q > molpro::linalg::itsolv::subspace::XSpace< R, Q, P >::cparamsq ( ) const
inlineoverridevirtual

◆ dimensions()

template<class R , class Q , class P >
const Dimensions & molpro::linalg::itsolv::subspace::XSpace< R, Q, P >::dimensions ( ) const
inlineoverridevirtual

◆ erase()

template<class R , class Q , class P >
void molpro::linalg::itsolv::subspace::XSpace< R, Q, P >::erase ( size_t  i)
inlineoverridevirtual

Removes parameter i from the full subspace.

Implements molpro::linalg::itsolv::subspace::IXSpace< R, Q, P >.

◆ erased()

template<class R , class Q , class P >
void molpro::linalg::itsolv::subspace::XSpace< R, Q, P >::erased ( size_t  i)
inlineoverridevirtual

Removes parameter i from D subspace.

Implements molpro::linalg::itsolv::subspace::IXSpace< R, Q, P >.

◆ erasep()

template<class R , class Q , class P >
void molpro::linalg::itsolv::subspace::XSpace< R, Q, P >::erasep ( size_t  i)
inlineoverridevirtual

Removes parameter i from P subspace.

Implements molpro::linalg::itsolv::subspace::IXSpace< R, Q, P >.

◆ eraseq()

template<class R , class Q , class P >
void molpro::linalg::itsolv::subspace::XSpace< R, Q, P >::eraseq ( size_t  i)
inlineoverridevirtual

Removes parameter i from Q subspace.

Implements molpro::linalg::itsolv::subspace::IXSpace< R, Q, P >.

◆ get_hermiticity()

template<class R , class Q , class P >
bool molpro::linalg::itsolv::subspace::XSpace< R, Q, P >::get_hermiticity ( )
inline

◆ paramsd() [1/2]

template<class R , class Q , class P >
CVecRef< Q > molpro::linalg::itsolv::subspace::XSpace< R, Q, P >::paramsd ( ) const
inlineoverridevirtual

◆ paramsd() [2/2]

template<class R , class Q , class P >
VecRef< Q > molpro::linalg::itsolv::subspace::XSpace< R, Q, P >::paramsd ( )
inlineoverridevirtual

◆ paramsp() [1/2]

template<class R , class Q , class P >
CVecRef< P > molpro::linalg::itsolv::subspace::XSpace< R, Q, P >::paramsp ( ) const
inlineoverridevirtual

◆ paramsp() [2/2]

template<class R , class Q , class P >
VecRef< P > molpro::linalg::itsolv::subspace::XSpace< R, Q, P >::paramsp ( )
inlineoverridevirtual

◆ paramsq() [1/2]

template<class R , class Q , class P >
CVecRef< Q > molpro::linalg::itsolv::subspace::XSpace< R, Q, P >::paramsq ( ) const
inlineoverridevirtual

◆ paramsq() [2/2]

template<class R , class Q , class P >
VecRef< Q > molpro::linalg::itsolv::subspace::XSpace< R, Q, P >::paramsq ( )
inlineoverridevirtual

◆ remove_data()

template<class R , class Q , class P >
void molpro::linalg::itsolv::subspace::XSpace< R, Q, P >::remove_data ( size_t  i)
inlineprotected

◆ rhs()

template<class R , class Q , class P >
CVecRef< Q > molpro::linalg::itsolv::subspace::XSpace< R, Q, P >::rhs ( ) const
inline

Access RHS vectors in linear equations.

◆ rhs_norm()

template<class R , class Q , class P >
const std::vector< value_type_abs > & molpro::linalg::itsolv::subspace::XSpace< R, Q, P >::rhs_norm ( ) const
inline

Norm of RHS vectors.

◆ set_action_action()

template<class R , class Q , class P >
void molpro::linalg::itsolv::subspace::XSpace< R, Q, P >::set_action_action ( )
inline

◆ set_hermiticity()

template<class R , class Q , class P >
void molpro::linalg::itsolv::subspace::XSpace< R, Q, P >::set_hermiticity ( bool  hermitian)
inline

Set Hermiticity of the subspace. P space can only be used with Hermitian problems.

◆ update_dimensions()

template<class R , class Q , class P >
void molpro::linalg::itsolv::subspace::XSpace< R, Q, P >::update_dimensions ( )
inlineprotected

◆ update_dspace()

template<class R , class Q , class P >
void molpro::linalg::itsolv::subspace::XSpace< R, Q, P >::update_dspace ( VecRef< Q > &  params,
VecRef< Q > &  actions 
)
inlineoverridevirtual

Clears old D space container and stores new params and actions.

Parameters
lin_trans_only_RR space component of D

Implements molpro::linalg::itsolv::subspace::IXSpace< R, Q, P >.

◆ update_pspace()

template<class R , class Q , class P >
void molpro::linalg::itsolv::subspace::XSpace< R, Q, P >::update_pspace ( const CVecRef< P > &  params,
const array::Span< value_type > &  pp_action_matrix 
)
inlineoverridevirtual
Warning
Subspace should be empty

Implements molpro::linalg::itsolv::subspace::IXSpace< R, Q, P >.

◆ update_qspace()

template<class R , class Q , class P >
void molpro::linalg::itsolv::subspace::XSpace< R, Q, P >::update_qspace ( const CVecRef< R > &  params,
const CVecRef< R > &  actions 
)
inlineoverridevirtual

Update parameters in Q space and corresponding equation data.

Implements molpro::linalg::itsolv::subspace::IXSpace< R, Q, P >.

◆ update_rhs_with_pspace()

template<class R , class Q , class P >
auto molpro::linalg::itsolv::subspace::XSpace< R, Q, P >::update_rhs_with_pspace ( )
inlineprotected

Update projection of RHS data onto P space.

Warning
Subspace should contain only P space

Member Data Documentation

◆ dspace

template<class R , class Q , class P >
DSpace<Q> molpro::linalg::itsolv::subspace::XSpace< R, Q, P >::dspace

◆ m_action_dot_action

template<class R , class Q , class P >
bool molpro::linalg::itsolv::subspace::XSpace< R, Q, P >::m_action_dot_action = false
protected

whether the H matrix is action.action instead of action.parameter

◆ m_dim

template<class R , class Q , class P >
Dimensions molpro::linalg::itsolv::subspace::XSpace< R, Q, P >::m_dim
protected

◆ m_handlers

template<class R , class Q , class P >
std::shared_ptr<ArrayHandlers<R, Q, P> > molpro::linalg::itsolv::subspace::XSpace< R, Q, P >::m_handlers
protected

◆ m_hermitian

template<class R , class Q , class P >
bool molpro::linalg::itsolv::subspace::XSpace< R, Q, P >::m_hermitian = false
protected

whether the matrix is Hermitian

◆ m_logger

template<class R , class Q , class P >
std::shared_ptr<Logger> molpro::linalg::itsolv::subspace::XSpace< R, Q, P >::m_logger
protected

◆ m_rhs

template<class R , class Q , class P >
std::vector<Q> molpro::linalg::itsolv::subspace::XSpace< R, Q, P >::m_rhs
protected

Right hand side vectors.

◆ m_rhs_norm

template<class R , class Q , class P >
std::vector<value_type_abs> molpro::linalg::itsolv::subspace::XSpace< R, Q, P >::m_rhs_norm
protected

norm of RHS vectors

◆ pspace

template<class R , class Q , class P >
PSpace<R, P> molpro::linalg::itsolv::subspace::XSpace< R, Q, P >::pspace

◆ qspace

template<class R , class Q , class P >
QSpace<R, Q, P> molpro::linalg::itsolv::subspace::XSpace< R, Q, P >::qspace