1#ifndef LINEARALGEBRA_SRC_MOLPRO_LINALG_ITSOLV_SUBSPACE_SUBSPACESOLVEROPTBFGS_H
2#define LINEARALGEBRA_SRC_MOLPRO_LINALG_ITSOLV_SUBSPACE_SUBSPACESOLVEROPTBFGS_H
3#include <molpro/linalg/itsolv/subspace/ISubspaceSolver.h>
4#include <molpro/linalg/itsolv/subspace/IXSpace.h>
5#include <molpro/linalg/itsolv/subspace/Matrix.h>
6#include <molpro/linalg/itsolv/Logger.h>
15template <
class RT,
class QT,
class PT>
27 m_logger->trace(
"SubspaceSolverOptBFGS::solve");
54 for (
size_t i = 0;
i <
roots.size(); ++
i)
60 throw std::logic_error(
"eigenvalues() not available in non-linear method");
62 const std::vector<value_type_abs>&
errors()
const override {
return m_errors; }
Full subspace.
Definition IXSpace.h:19
SubspaceData< value_type > data
Equation data in the subspace.
Definition IXSpace.h:28
size_t size() const
Number of vectors forming the subspace.
Definition IXSpace.h:31
Matrix container that allows simple data access, slicing, copying and resizing without loosing data.
Definition Matrix.h:32
Slice slice(coord_type upper_left, coord_type bottom_right)
Access a rectangular slice of the matrix.
Definition Matrix.h:101
void resize(const coord_type &dims)
Resize the matrix. The old data is preserved and any new rows/cols are zeroed.
Definition Matrix.h:130
index_type rows() const
Definition Matrix.h:169
Solves subspace problem for minimisation using the Steepest Descent algorithm.
Definition SubspaceSolverOptBFGS.h:16
std::shared_ptr< Logger > m_logger
Definition SubspaceSolverOptBFGS.h:72
typename ISubspaceSolver< RT, QT, PT >::R R
Definition SubspaceSolverOptBFGS.h:20
typename ISubspaceSolver< RT, QT, PT >::Q Q
Definition SubspaceSolverOptBFGS.h:21
void set_logger(std::shared_ptr< Logger > logger) override
Definition SubspaceSolverOptBFGS.h:67
typename ISubspaceSolver< RT, QT, PT >::value_type value_type
Definition SubspaceSolverOptBFGS.h:18
const std::vector< value_type > & eigenvalues() const override
Access eigenvalues from the last solve() call.
Definition SubspaceSolverOptBFGS.h:59
void solve(IXSpace< R, Q, P > &xspace, const size_t nroots_max) override
Solve the subspace problem.
Definition SubspaceSolverOptBFGS.h:26
typename ISubspaceSolver< RT, QT, PT >::value_type_abs value_type_abs
Definition SubspaceSolverOptBFGS.h:19
std::vector< value_type_abs > m_errors
errors in subspace solutions
Definition SubspaceSolverOptBFGS.h:71
void set_error(const std::vector< int > &roots, const std::vector< value_type_abs > &errors) override
Update errors for a group of roots.
Definition SubspaceSolverOptBFGS.h:53
Matrix< value_type > m_solutions
solution matrix with row vectors
Definition SubspaceSolverOptBFGS.h:70
SubspaceSolverOptBFGS(std::shared_ptr< Logger > logger)
Definition SubspaceSolverOptBFGS.h:24
size_t size() const override
Number of solutions.
Definition SubspaceSolverOptBFGS.h:65
void set_error(int root, value_type_abs error) override
Set error value for solution root
Definition SubspaceSolverOptBFGS.h:52
const Matrix< value_type > & solutions() const override
Access solutions from the last solve() call.
Definition SubspaceSolverOptBFGS.h:58
typename ISubspaceSolver< RT, QT, PT >::P P
Definition SubspaceSolverOptBFGS.h:22
const std::vector< value_type_abs > & errors() const override
Access errors corresponding to each solution.
Definition SubspaceSolverOptBFGS.h:62
std::unique_ptr< LinearEigensystem< R, Q, P > > create_LinearEigensystem(const LinearEigensystemOptions &options, const std::shared_ptr< ArrayHandlers< R, Q, P > > &handlers=std::make_shared< molpro::linalg::itsolv::ArrayHandlers< R, Q, P > >())
Definition SolverFactory.h:111
Manages solution of the subspace problem and storage of those solutions.
Definition ISubspaceSolver.h:21
typename array::ArrayHandler< R, R >::value_type value_type
Definition ISubspaceSolver.h:25
typename array::ArrayHandler< R, R >::value_type_abs value_type_abs
Definition ISubspaceSolver.h:26
PT P
Definition ISubspaceSolver.h:24
QT Q
Definition ISubspaceSolver.h:23
RT R
Definition ISubspaceSolver.h:22