iterative-solver 0.0
Morse_problem Class Reference
Inheritance diagram for Morse_problem:
Collaboration diagram for Morse_problem:

Public Member Functions

 Morse_problem (Interpolate::point p0, Interpolate::point p1)
 
value_t residual (const R &parameters, R &residual) const override
 Calculate the residual vector. Used by non-linear solvers (NonLinearEquations, Optimize) only. More...
 
- Public Member Functions inherited from molpro::linalg::itsolv::Problem< R, P >
 Problem ()=default
 
virtual ~Problem ()=default
 
virtual value_t residual (const R &parameters, R &residual) const
 Calculate the residual vector. Used by non-linear solvers (NonLinearEquations, Optimize) only. More...
 
virtual void action (const CVecRef< R > &parameters, const VecRef< R > &action) const
 Calculate the action of the kernel matrix on a set of parameters. Used by linear solvers, but not by the non-linear solvers (NonLinearEquations, Optimize). More...
 
virtual bool diagonals (container_t &d) const
 Optionally provide the diagonal elements of the underlying kernel. If implemented and returning true, the provided diagonals will be used by IterativeSolver for preconditioning (and therefore the precondition() function does not need to be implemented), and, in the case of linear problems, for selection of the P space. Otherwise, preconditioning will be done with precondition(), and any P space has to be provided manually. More...
 
virtual void precondition (const VecRef< R > &residual, const std::vector< value_t > &shift) const
 Apply preconditioning to a residual vector in order to predict a step towards the solution. More...
 
virtual void precondition (const VecRef< R > &residual, const std::vector< value_t > &shift, const R &diagonals) const
 Apply preconditioning to a residual vector in order to predict a step towards the solution. More...
 
virtual bool RHS (R &RHS, unsigned int instance) const
 Return the inhomogeneous part of a linear equation system. More...
 
virtual std::vector< double > pp_action_matrix (const std::vector< P > &pparams) const
 Calculate the kernel matrix in the P space. More...
 
virtual void p_action (const std::vector< std::vector< value_t > > &p_coefficients, const CVecRef< P > &pparams, const VecRef< container_t > &actions) const
 Calculate the action of the kernel matrix on a set of vectors in the P space. More...
 
virtual bool test_parameters (unsigned int instance, R &parameters) const
 Provide values of R vectors for testing the problem class. For use in a non-linear solver, the first vector (instance=0) should be a reference point, and the remainder (instance>0) should be close to it, such that meaningful numerical differentation can be done to test the residual function. More...
 

Additional Inherited Members

- Public Types inherited from molpro::linalg::itsolv::Problem< R, P >
using container_t = R
 
using value_t = typename R::value_type
 

Constructor & Destructor Documentation

◆ Morse_problem()

Morse_problem::Morse_problem ( Interpolate::point  p0,
Interpolate::point  p1 
)
inline

Member Function Documentation

◆ residual()

value_t Morse_problem::residual ( const R &  parameters,
R &  residual 
) const
inlineoverridevirtual

Calculate the residual vector. Used by non-linear solvers (NonLinearEquations, Optimize) only.

Parameters
parametersThe trial solution for which the residual is to be calculated
residualThe residual vector
Returns
In the case where the residual is an exact differential, the corresponding function value. Used by Optimize but not NonLinearEquations.

Reimplemented from molpro::linalg::itsolv::Problem< R, P >.