iterative-solver 0.0
molpro::linalg::itsolv::detail::DSpaceResetter< Q > Class Template Reference

Resets D space constructing full solutions as the new working set, removing instabilities from Q space, and clearing D space. More...

#include <DSpaceResetter.h>

Detailed Description

template<class Q>
class molpro::linalg::itsolv::detail::DSpaceResetter< Q >

Resets D space constructing full solutions as the new working set, removing instabilities from Q space, and clearing D space.

Resetting can happen over multiple iterations if size of the working set is less than the number of solutions. In such cases, D space is still cleared at the start, so only the first batch of solutions will be reproduced at that iteration with the other possibly showing larger errors than before. By the end of resetting, all previous solutions will be in the Q space and previous energies and residuals will be reproduced.

After resetting, the size of Q space can be reduced. The maximum size can be controlled via set_max_Qsize().

Template Parameters
Q

Public Member Functions

 DSpaceResetter ()=default
 
 DSpaceResetter (int nreset, int max_Qsize)
 
bool do_reset (size_t iter, const subspace::Dimensions &dims)
 Whether reset operation should be run. More...
 
void set_nreset (size_t i)
 
auto get_nreset () const
 
void set_max_Qsize (size_t i)
 
auto get_max_Qsize () const
 
template<class R , class P , typename value_type , typename value_type_abs >
std::vector< int > run (const VecRef< R > &rparams, subspace::IXSpace< R, Q, P > &xspace, const subspace::Matrix< value_type > &solutions, const value_type_abs norm_thresh, const value_type_abs svd_thresh, ArrayHandlers< R, Q, P > &handlers, Logger &logger)
 Run the reset operation. More...
 

Protected Attributes

int m_nreset = std::numeric_limits<int>::max()
 reset D space every n iterations More...
 
int m_max_Qsize_after_reset = std::numeric_limits<int>::max()
 maximum size of Q space after reset More...
 
std::list< Q > solution_params
 all current solutions that will be moved to the Q space More...
 

Constructor & Destructor Documentation

◆ DSpaceResetter() [1/2]

template<class Q >
molpro::linalg::itsolv::detail::DSpaceResetter< Q >::DSpaceResetter ( )
default

◆ DSpaceResetter() [2/2]

template<class Q >
molpro::linalg::itsolv::detail::DSpaceResetter< Q >::DSpaceResetter ( int  nreset,
int  max_Qsize 
)
inline

Member Function Documentation

◆ do_reset()

template<class Q >
bool molpro::linalg::itsolv::detail::DSpaceResetter< Q >::do_reset ( size_t  iter,
const subspace::Dimensions dims 
)
inline

Whether reset operation should be run.

◆ get_max_Qsize()

template<class Q >
auto molpro::linalg::itsolv::detail::DSpaceResetter< Q >::get_max_Qsize ( ) const
inline

◆ get_nreset()

template<class Q >
auto molpro::linalg::itsolv::detail::DSpaceResetter< Q >::get_nreset ( ) const
inline

◆ run()

template<class Q >
template<class R , class P , typename value_type , typename value_type_abs >
std::vector< int > molpro::linalg::itsolv::detail::DSpaceResetter< Q >::run ( const VecRef< R > &  rparams,
subspace::IXSpace< R, Q, P > &  xspace,
const subspace::Matrix< value_type > &  solutions,
const value_type_abs  norm_thresh,
const value_type_abs  svd_thresh,
ArrayHandlers< R, Q, P > &  handlers,
Logger logger 
)
inline

Run the reset operation.

◆ set_max_Qsize()

template<class Q >
void molpro::linalg::itsolv::detail::DSpaceResetter< Q >::set_max_Qsize ( size_t  i)
inline

◆ set_nreset()

template<class Q >
void molpro::linalg::itsolv::detail::DSpaceResetter< Q >::set_nreset ( size_t  i)
inline

Member Data Documentation

◆ m_max_Qsize_after_reset

template<class Q >
int molpro::linalg::itsolv::detail::DSpaceResetter< Q >::m_max_Qsize_after_reset = std::numeric_limits<int>::max()
protected

maximum size of Q space after reset

◆ m_nreset

template<class Q >
int molpro::linalg::itsolv::detail::DSpaceResetter< Q >::m_nreset = std::numeric_limits<int>::max()
protected

reset D space every n iterations

◆ solution_params

template<class Q >
std::list<Q> molpro::linalg::itsolv::detail::DSpaceResetter< Q >::solution_params
protected

all current solutions that will be moved to the Q space