iterative-solver 0.0
molpro::linalg::itsolv::subspace::SubspaceSolverOptBFGS< RT, QT, PT > Class Template Reference

Solves subspace problem for minimisation using the Steepest Descent algorithm. More...

#include <SubspaceSolverOptBFGS.h>

Inheritance diagram for molpro::linalg::itsolv::subspace::SubspaceSolverOptBFGS< RT, QT, PT >:
Collaboration diagram for molpro::linalg::itsolv::subspace::SubspaceSolverOptBFGS< RT, QT, PT >:

Detailed Description

template<class RT, class QT, class PT>
class molpro::linalg::itsolv::subspace::SubspaceSolverOptBFGS< RT, QT, PT >

Solves subspace problem for minimisation using the Steepest Descent algorithm.

Public Types

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

Public Member Functions

 SubspaceSolverOptBFGS (std::shared_ptr< Logger > logger)
 
void solve (IXSpace< R, Q, P > &xspace, const size_t nroots_max) override
 Solve the subspace problem. More...
 
void set_error (int root, value_type_abs error) override
 Set error value for solution root More...
 
void set_error (const std::vector< int > &roots, const std::vector< value_type_abs > &errors) override
 Update errors for a group of roots. More...
 
const Matrix< value_type > & solutions () const override
 Access solutions from the last solve() call. More...
 
const std::vector< value_type > & eigenvalues () const override
 Access eigenvalues from the last solve() call. More...
 
const std::vector< value_type_abs > & errors () const override
 Access errors corresponding to each solution. More...
 
size_t size () const override
 Number of solutions. More...
 
- Public Member Functions inherited from molpro::linalg::itsolv::subspace::ISubspaceSolver< RT, QT, PT >
virtual ~ISubspaceSolver ()=default
 
virtual void solve (IXSpace< R, Q, P > &xspace, size_t nroots_max)=0
 Solve the subspace problem. More...
 
virtual void set_error (int root, value_type_abs error)=0
 Update the error associated with a given root. More...
 
virtual void set_error (const std::vector< int > &roots, const std::vector< value_type_abs > &errors)=0
 Update errors for a group of roots. More...
 
virtual const Matrix< value_type > & solutions () const =0
 Access solutions from the last solve() call. More...
 
virtual const std::vector< value_type > & eigenvalues () const =0
 Access eigenvalues from the last solve() call. More...
 
virtual const std::vector< value_type_abs > & errors () const =0
 Access errors corresponding to each solution. More...
 
virtual size_t size () const =0
 Number of solutions stored in this object. More...
 

Protected Attributes

Matrix< value_typem_solutions
 solution matrix with row vectors More...
 
std::vector< value_type_absm_errors
 errors in subspace solutions More...
 
std::shared_ptr< Loggerm_logger {}
 

Member Typedef Documentation

◆ P

template<class RT , class QT , class PT >
using molpro::linalg::itsolv::subspace::SubspaceSolverOptBFGS< RT, QT, PT >::P = typename ISubspaceSolver<RT, QT, PT>::P

◆ Q

template<class RT , class QT , class PT >
using molpro::linalg::itsolv::subspace::SubspaceSolverOptBFGS< RT, QT, PT >::Q = typename ISubspaceSolver<RT, QT, PT>::Q

◆ R

template<class RT , class QT , class PT >
using molpro::linalg::itsolv::subspace::SubspaceSolverOptBFGS< RT, QT, PT >::R = typename ISubspaceSolver<RT, QT, PT>::R

◆ value_type

template<class RT , class QT , class PT >
using molpro::linalg::itsolv::subspace::SubspaceSolverOptBFGS< RT, QT, PT >::value_type = typename ISubspaceSolver<RT, QT, PT>::value_type

◆ value_type_abs

template<class RT , class QT , class PT >
using molpro::linalg::itsolv::subspace::SubspaceSolverOptBFGS< RT, QT, PT >::value_type_abs = typename ISubspaceSolver<RT, QT, PT>::value_type_abs

Constructor & Destructor Documentation

◆ SubspaceSolverOptBFGS()

template<class RT , class QT , class PT >
molpro::linalg::itsolv::subspace::SubspaceSolverOptBFGS< RT, QT, PT >::SubspaceSolverOptBFGS ( std::shared_ptr< Logger logger)
inlineexplicit

Member Function Documentation

◆ eigenvalues()

template<class RT , class QT , class PT >
const std::vector< value_type > & molpro::linalg::itsolv::subspace::SubspaceSolverOptBFGS< RT, QT, PT >::eigenvalues ( ) const
inlineoverridevirtual

Access eigenvalues from the last solve() call.

Implements molpro::linalg::itsolv::subspace::ISubspaceSolver< RT, QT, PT >.

◆ errors()

template<class RT , class QT , class PT >
const std::vector< value_type_abs > & molpro::linalg::itsolv::subspace::SubspaceSolverOptBFGS< RT, QT, PT >::errors ( ) const
inlineoverridevirtual

Access errors corresponding to each solution.

Implements molpro::linalg::itsolv::subspace::ISubspaceSolver< RT, QT, PT >.

◆ set_error() [1/2]

template<class RT , class QT , class PT >
void molpro::linalg::itsolv::subspace::SubspaceSolverOptBFGS< RT, QT, PT >::set_error ( const std::vector< int > &  roots,
const std::vector< value_type_abs > &  errors 
)
inlineoverridevirtual

Update errors for a group of roots.

Parameters
rootsgroup of roots
errorserrors corresponding to each root

Implements molpro::linalg::itsolv::subspace::ISubspaceSolver< RT, QT, PT >.

◆ set_error() [2/2]

template<class RT , class QT , class PT >
void molpro::linalg::itsolv::subspace::SubspaceSolverOptBFGS< RT, QT, PT >::set_error ( int  root,
value_type_abs  error 
)
inlineoverridevirtual

Set error value for solution root

Implements molpro::linalg::itsolv::subspace::ISubspaceSolver< RT, QT, PT >.

◆ size()

template<class RT , class QT , class PT >
size_t molpro::linalg::itsolv::subspace::SubspaceSolverOptBFGS< RT, QT, PT >::size ( ) const
inlineoverridevirtual

◆ solutions()

template<class RT , class QT , class PT >
const Matrix< value_type > & molpro::linalg::itsolv::subspace::SubspaceSolverOptBFGS< RT, QT, PT >::solutions ( ) const
inlineoverridevirtual

Access solutions from the last solve() call.

Implements molpro::linalg::itsolv::subspace::ISubspaceSolver< RT, QT, PT >.

◆ solve()

template<class RT , class QT , class PT >
void molpro::linalg::itsolv::subspace::SubspaceSolverOptBFGS< RT, QT, PT >::solve ( IXSpace< R, Q, P > &  xspace,
const size_t  nroots_max 
)
inlineoverridevirtual

Solve the subspace problem.

Parameters
xspacedefinition of the subspace
nroots_maxmaximum number of roots to calculate

Implements molpro::linalg::itsolv::subspace::ISubspaceSolver< RT, QT, PT >.

Member Data Documentation

◆ m_errors

template<class RT , class QT , class PT >
std::vector<value_type_abs> molpro::linalg::itsolv::subspace::SubspaceSolverOptBFGS< RT, QT, PT >::m_errors
protected

errors in subspace solutions

◆ m_logger

template<class RT , class QT , class PT >
std::shared_ptr<Logger> molpro::linalg::itsolv::subspace::SubspaceSolverOptBFGS< RT, QT, PT >::m_logger {}
protected

◆ m_solutions

template<class RT , class QT , class PT >
Matrix<value_type> molpro::linalg::itsolv::subspace::SubspaceSolverOptBFGS< RT, QT, PT >::m_solutions
protected

solution matrix with row vectors