template<class R, class Q = R, class P = std::map<size_t, typename R::value_type>>
class molpro::linalg::itsolv::OptimizeSD< R, Q, P >
A class that optimises a function using a simple steepest-descent method.
- Template Parameters
-
R | The class encapsulating solution and residual vectors |
Q | Used internally as a class for storing vectors on backing store |
|
| OptimizeSD (const std::shared_ptr< ArrayHandlers< R, Q, P > > &handlers, const std::shared_ptr< Logger > &logger_=std::make_shared< Logger >()) |
|
bool | nonlinear () const override |
| Report whether the class is a non-linear solver. More...
|
|
size_t | end_iteration (const VecRef< R > ¶meters, const VecRef< R > &action) override |
| Behaviour depends on the solver. More...
|
|
size_t | end_iteration (std::vector< R > ¶meters, std::vector< R > &action) override |
|
void | set_value_errors () override |
| Implementation class should overload this to set errors in the current values (e.g. change in eigenvalues) More...
|
|
void | set_options (const Options &options) override |
|
std::shared_ptr< Options > | get_options () const override |
|
void | report (std::ostream &cout, bool endl=true) const override |
| Writes a report to cout output stream. More...
|
|
int | add_vector (R ¶meters, R &residual, value_type value) override |
|
size_t | end_iteration (R ¶meters, R &actions) override |
|
void | report (std::ostream &cout, bool endl=true) const override |
| Writes a report to cout output stream. More...
|
|
void | report () const override |
| Writes a report to std::cout. More...
|
|
| IterativeSolverTemplate ()=delete |
|
| IterativeSolverTemplate (const IterativeSolverTemplate< Optimize, R, R, std::map< size_t, typename R::value_type > > &)=delete |
|
| IterativeSolverTemplate (IterativeSolverTemplate< Optimize, R, R, std::map< size_t, typename R::value_type > > &&) noexcept=default |
|
IterativeSolverTemplate< Optimize, R, R, std::map< size_t, typename R::value_type > > & | operator= (const IterativeSolverTemplate< Optimize, R, R, std::map< size_t, typename R::value_type > > &)=delete |
|
IterativeSolverTemplate< Optimize, R, R, std::map< size_t, typename R::value_type > > & | operator= (IterativeSolverTemplate< Optimize, R, R, std::map< size_t, typename R::value_type > > &&) noexcept=default |
|
int | add_vector (const VecRef< R > ¶meters, const VecRef< R > &actions) override |
|
int | add_vector (std::vector< R > ¶meters, std::vector< R > &actions) override |
|
int | add_vector (R ¶meters, R &actions, value_type value=0) override |
|
size_t | add_p (const CVecRef< std::map< size_t, typename R::value_type > > &pparams, const array::Span< value_type > &pp_action_matrix, const VecRef< R > ¶meters, const VecRef< R > &actions, fapply_on_p_type apply_p) override |
|
void | clearP () override |
|
void | solution (const std::vector< int > &roots, const VecRef< R > ¶meters, const VecRef< R > &residual) override |
|
void | solution (const std::vector< int > &roots, std::vector< R > ¶meters, std::vector< R > &residual) override |
|
void | solution (R ¶meters, R &residual) override |
|
void | solution_params (const std::vector< int > &roots, std::vector< R > ¶meters) override |
|
void | solution_params (const std::vector< int > &roots, const VecRef< R > ¶meters) override |
|
void | solution_params (R ¶meters) override |
|
std::vector< size_t > | suggest_p (const CVecRef< R > &solution, const CVecRef< R > &residual, size_t max_number, double threshold) override |
|
const std::vector< int > & | working_set () const override |
|
size_t | n_roots () const override |
|
void | set_n_roots (size_t roots) override |
|
void | set_options (const Options &options) override |
|
std::shared_ptr< Options > | get_options () const override |
|
const std::vector< scalar_type > & | errors () const override |
|
const Statistics & | statistics () const override |
|
void | report (std::ostream &cout, bool endl=true) const override |
|
void | report () const override |
|
void | set_convergence_threshold (double thresh) override |
|
double | convergence_threshold () const override |
|
void | set_convergence_threshold_value (double thresh) override |
|
double | convergence_threshold_value () const override |
|
void | set_verbosity (Verbosity v) override |
|
void | set_verbosity (int v) override |
|
Verbosity | get_verbosity () const override |
|
void | set_max_iter (int n) override |
|
int | get_max_iter () const override |
|
void | set_max_p (int n) override |
|
int | get_max_p () const override |
|
void | set_p_threshold (double threshold) override |
|
double | get_p_threshold () const override |
|
const subspace::Dimensions & | dimensions () const override |
| Access dimensions of the subspace. More...
|
|
scalar_type | value () const override |
|
void | set_profiler (molpro::profiler::Profiler &profiler) override |
|
const std::shared_ptr< molpro::profiler::Profiler > & | profiler () const override |
|
bool | solve (const VecRef< R > ¶meters, const VecRef< R > &actions, const Problem< R > &problem, bool generate_initial_guess=false) override |
|
bool | solve (R ¶meters, R &actions, const Problem< R > &problem, bool generate_initial_guess=false) override |
|
bool | solve (std::vector< R > ¶meters, std::vector< R > &actions, const Problem< R > &problem, bool generate_initial_guess=false) override |
|
bool | test_problem (const Problem< R > &problem, R &v0, R &v1, int verbosity, double threshold) const override |
|
virtual | ~IterativeSolver ()=default |
|
| IterativeSolver ()=default |
|
| IterativeSolver (const IterativeSolver< R, R, std::map< size_t, typename R::value_type > > &)=delete |
|
| IterativeSolver (IterativeSolver< R, R, std::map< size_t, typename R::value_type > > &&) noexcept=default |
|
IterativeSolver< R, R, std::map< size_t, typename R::value_type > > & | operator= (const IterativeSolver< R, R, std::map< size_t, typename R::value_type > > &)=delete |
|
IterativeSolver< R, R, std::map< size_t, typename R::value_type > > & | operator= (IterativeSolver< R, R, std::map< size_t, typename R::value_type > > &&) noexcept=default |
|
virtual bool | solve (const VecRef< R > ¶meters, const VecRef< R > &actions, const Problem< R > &problem, bool generate_initial_guess=false)=0 |
| Simplified one-call solver. More...
|
|
virtual bool | solve (R ¶meters, R &actions, const Problem< R > &problem, bool generate_initial_guess=false)=0 |
|
virtual bool | solve (std::vector< R > ¶meters, std::vector< R > &actions, const Problem< R > &problem, bool generate_initial_guess=false)=0 |
|
virtual int | add_vector (const VecRef< R > ¶meters, const VecRef< R > &actions)=0 |
| Take, typically, a current solution and residual, and add it to the solution space. More...
|
|
virtual int | add_vector (std::vector< R > ¶meters, std::vector< R > &action)=0 |
|
virtual int | add_vector (R ¶meters, R &action, value_type value=0)=0 |
|
virtual size_t | add_p (const CVecRef< std::map< size_t, typename R::value_type > > &pparams, const array::Span< value_type > &pp_action_matrix, const VecRef< R > ¶meters, const VecRef< R > &action, fapply_on_p_type apply_p)=0 |
| Add P-space vectors to the expansion set for linear methods. More...
|
|
virtual void | clearP ()=0 |
|
virtual void | solution (const std::vector< int > &roots, const VecRef< R > ¶meters, const VecRef< R > &residual)=0 |
| Construct solution and residual for a given set of roots. More...
|
|
virtual void | solution (const std::vector< int > &roots, std::vector< R > ¶meters, std::vector< R > &residual)=0 |
|
virtual void | solution (R ¶meters, R &residual)=0 |
|
virtual void | solution_params (const std::vector< int > &roots, const VecRef< R > ¶meters)=0 |
| Constructs parameters of selected roots. More...
|
|
virtual void | solution_params (const std::vector< int > &roots, std::vector< R > ¶meters)=0 |
|
virtual void | solution_params (R ¶meters)=0 |
|
virtual size_t | end_iteration (const VecRef< R > ¶meters, const VecRef< R > &residual)=0 |
| Behaviour depends on the solver. More...
|
|
virtual size_t | end_iteration (std::vector< R > ¶meters, std::vector< R > &action)=0 |
|
virtual size_t | end_iteration (R ¶meters, R &action)=0 |
|
virtual bool | end_iteration_needed ()=0 |
| signal whether end_iteration should be called More...
|
|
virtual std::vector< size_t > | suggest_p (const CVecRef< R > &solution, const CVecRef< R > &residual, size_t max_number, double threshold)=0 |
| Get the solver's suggestion of which degrees of freedom would be best to add to the P-space. More...
|
|
virtual const std::vector< int > & | working_set () const=0 |
| Working set of roots that are not yet converged. More...
|
|
virtual std::vector< scalar_type > | working_set_eigenvalues () const |
|
virtual size_t | n_roots () const=0 |
|
virtual void | set_n_roots (size_t nroots)=0 |
|
virtual const std::vector< scalar_type > & | errors () const=0 |
|
virtual const Statistics & | statistics () const=0 |
|
virtual void | report (std::ostream &cout, bool endl=true) const=0 |
| Writes a report to cout output stream. More...
|
|
virtual void | report () const=0 |
| Writes a report to std::cout. More...
|
|
virtual void | set_convergence_threshold (double thresh)=0 |
| Sets the convergence threshold. More...
|
|
virtual double | convergence_threshold () const=0 |
| Reports the convergence threshold. More...
|
|
virtual void | set_convergence_threshold_value (double thresh)=0 |
| Sets the value convergence threshold. More...
|
|
virtual double | convergence_threshold_value () const=0 |
| Reports the value convergence threshold. More...
|
|
virtual void | set_verbosity (Verbosity v)=0 |
|
virtual void | set_verbosity (int v)=0 |
|
virtual Verbosity | get_verbosity () const=0 |
|
virtual void | set_max_iter (int n)=0 |
|
virtual int | get_max_iter () const=0 |
|
virtual void | set_max_p (int n)=0 |
|
virtual int | get_max_p () const=0 |
|
virtual void | set_p_threshold (double thresh)=0 |
|
virtual double | get_p_threshold () const=0 |
|
virtual const subspace::Dimensions & | dimensions () const=0 |
|
virtual void | set_options (const Options &options)=0 |
|
virtual std::shared_ptr< Options > | get_options () const=0 |
|
virtual scalar_type | value () const=0 |
| Report the function value for the current optimum solution. More...
|
|
virtual bool | nonlinear () const=0 |
| Report whether the class is a non-linear solver. More...
|
|
virtual void | set_profiler (molpro::profiler::Profiler &profiler)=0 |
| Attach a profiler in order to collect performance data. More...
|
|
virtual const std::shared_ptr< molpro::profiler::Profiler > & | profiler () const=0 |
|
virtual bool | test_problem (const Problem< R > &problem, R &v0, R &v1, int verbosity=0, double threshold=1e-5) const=0 |
| Test a supplied problem class. More...
|
|