iterative-solver 0.0
 
Loading...
Searching...
No Matches
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 set_metric (MetricKind kind, MetricStorage storage=MetricStorage::Stored) override
 Declares the metric of the subspace. Anything other than MetricKind::Identity creates the metric matrix EqnData::M. Only possible while the subspace is empty, unless it does not change anything.
 
MetricKind metric_kind () const override
 The kind of metric declared with set_metric()
 
MetricStorage metric_storage () const override
 How the actions of the metric declared with set_metric() are obtained.
 
void update_qspace (const CVecRef< R > &params, const CVecRef< R > &actions, const CVecRef< R > &metric_actions={}) override
 Update parameters in Q space and corresponding equation data.
 
void update_dspace (VecRef< Q > &params, VecRef< Q > &actions, const VecRef< Q > &metric_actions={}, const std::vector< size_t > &q_delete={}, const Matrix< value_type > &coefficients={}) override
 Replaces the old D space and the Q vectors q_delete by new D vectors, see IXSpace::update_dspace()
 
void update_pspace (const CVecRef< P > &params, const array::Span< value_type > &pp_action_matrix, const array::Span< value_type > &pp_metric_matrix={}) override
 
void add_rhs_equations (const CVecRef< R > &rhs)
 For a system of linear equations Ax=b, adds rhs vectors b.
 
CVecRef< Q > rhs () const
 Access RHS vectors in linear equations.
 
const std::vector< value_type_abs > & rhs_norm () const
 Norm of RHS vectors.
 
const Dimensions & dimensions () const override
 
void erase (size_t i) override
 Removes parameter i from the full subspace.
 
void eraseq (size_t i) override
 Removes parameter i from Q subspace.
 
void erasep (size_t i) override
 Removes parameter i from P subspace.
 
void erased (size_t i) override
 Removes parameter i from D subspace.
 
VecRef< P > paramsp () override
 
VecRef< Q > paramsq () override
 
VecRef< Q > actionsq () override
 
VecRef< Q > paramsd () override
 
VecRef< Q > actionsd () override
 
CVecRef< P > paramsp () const override
 
CVecRef< Q > paramsq () const override
 
CVecRef< Q > actionsq () const override
 
CVecRef< Q > paramsd () const override
 
CVecRef< Q > actionsd () const override
 
CVecRef< P > cparamsp () const override
 
CVecRef< Q > cparamsq () const override
 
CVecRef< Q > cactionsq () const override
 
CVecRef< Q > cparamsd () const override
 
CVecRef< Q > cactionsd () const override
 
CVecRef< Q > cmetric_actionsq () const override
 Actions of the metric on the Q space parameters, empty unless there is a metric.
 
CVecRef< Q > cmetric_actionsd () const override
 Actions of the metric on the D space parameters, empty unless there is a metric.
 
void set_logger (std::shared_ptr< Logger > logger) override
 
void set_hermiticity (bool hermitian)
 Set Hermiticity of the subspace. P space can only be used with Hermitian problems.
 
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.
 
bool stores_metric_actions () const
 Whether the actions of the metric on the Q and D vectors are kept.
 

Public Attributes

PSpace< R, P > pspace
 
QSpace< R, Q, P > qspace
 
DSpace< Q > dspace
 
- Public Attributes inherited from molpro::linalg::itsolv::subspace::IXSpace< R, Q, P >
SubspaceData< value_type > data
 Equation data in the subspace.
 

Protected Member Functions

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

Protected Attributes

std::shared_ptr< ArrayHandlers< R, Q, P > > m_handlers
 
std::shared_ptr< Logger > m_logger
 
Dimensions m_dim
 
std::vector< Q > m_rhs
 Right hand side vectors.
 
std::vector< value_type_abs > m_rhs_norm
 norm of RHS vectors
 
bool m_hermitian = false
 whether the matrix is Hermitian
 
bool m_action_dot_action = false
 whether the H matrix is action.action instead of action.parameter
 
MetricKind m_metric_kind = MetricKind::Identity
 the metric declared with set_metric()
 
MetricStorage m_metric_storage = MetricStorage::Stored
 whether the actions of the metric are kept
 

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

◆ cmetric_actionsd()

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

Actions of the metric on the D space parameters, empty unless there is a metric.

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

◆ cmetric_actionsq()

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

Actions of the metric on the Q space parameters, empty unless there is a metric.

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

◆ 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

◆ metric_kind()

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

The kind of metric declared with set_metric()

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

◆ metric_storage()

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

How the actions of the metric declared with set_metric() are obtained.

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

◆ 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.

◆ set_logger()

template<class R , class Q , class P >
void molpro::linalg::itsolv::subspace::XSpace< R, Q, P >::set_logger ( std::shared_ptr< Logger >  logger)
inlineoverridevirtual

◆ set_metric()

template<class R , class Q , class P >
void molpro::linalg::itsolv::subspace::XSpace< R, Q, P >::set_metric ( MetricKind  kind,
MetricStorage  storage = MetricStorage::Stored 
)
inlineoverridevirtual

Declares the metric of the subspace. Anything other than MetricKind::Identity creates the metric matrix EqnData::M. Only possible while the subspace is empty, unless it does not change anything.

Parameters
kindthe kind of metric
storagewhether the actions of the metric on the Q and D vectors are kept

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

◆ 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,
const VecRef< Q > &  metric_actions = {},
const std::vector< size_t > &  q_delete = {},
const Matrix< value_type > &  coefficients = {} 
)
inlineoverridevirtual

Replaces the old D space and the Q vectors q_delete by new D vectors, see IXSpace::update_dspace()

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,
const array::Span< value_type > &  pp_metric_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,
const CVecRef< R > &  metric_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

◆ 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_metric_kind

the metric declared with set_metric()

◆ m_metric_storage

whether the actions of the metric are kept

◆ 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

◆ qspace