|
MADNESS 0.10.1
|
Generalized version of NonlinearSolver not limited to a single madness function. More...
#include <nonlinsol.h>

Public Member Functions | |
| XNonlinearSolver (const Alloc &alloc=Alloc(), bool print=false) | |
| XNonlinearSolver (const XNonlinearSolver &other) | |
| void | clear_subspace () |
| Tensor< C > | get_c () const |
| std::vector< T > & | get_plist () |
| std::vector< T > & | get_rlist () |
| std::vector< T > & | get_ulist () |
| void | initialize (const T &u_initial) |
| void | set_maxsub (int maxsub) |
| T | update (const T &u, const T &r, const double rcondtol=1e-8, const double cabsmax=1000.0) |
| Computes next trial solution vector. | |
| T | update (const T &u_preliminary, const double rcondtol=1e-8, const double cabsmax=1000.0) |
| Computes next trial solution vector. | |
Public Attributes | |
| bool | do_print |
Private Attributes | |
| Alloc | alloc |
| Tensor< C > | c |
| coefficients for linear combination | |
| unsigned int | maxsub |
| Maximum size of subspace dimension. | |
| std::vector< T > | plist |
| Subspace information. | |
| Tensor< C > | Q |
| std::vector< T > | rlist |
| std::vector< T > | ulist |
Generalized version of NonlinearSolver not limited to a single madness function.
This solves the equation 
T and inner products between two items of type T produce a number of type C (defaulting to double). The type T must support storage in an STL vector, scaling by a constant of type C, inplace addition (+=), subtraction, allocation with value zero, and inner products computed with the interface inner(a,b). Have a look in examples/testsolver.cc for a simple but complete example, and in examples/h2dynamic.cc for a more complex example.
I've not yet tested with anything except C=double and I think that the KAIN routine will need extending for anything else.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Referenced by test_with_function().
|
inline |
Referenced by iterate(), run(), DF::solve_occupied(), and madness::PNO::t_solve().
|
inline |
Computes next trial solution vector.
You are responsible for performing step restriction or line search (not necessary for linear problems).
| u | Current solution vector |
| r | Corresponding residual |
| [in] | rcondtol | rcond less than this will cause the subspace to be shrunk due to linear dependence |
| [in] | cabsmax | maximum element of c greater than this will cause the subspace to be shrunk due to li |
Referenced by iterate(), madness::Zcis::iterate(), madness::PNO::t_solve(), and test_with_function().
|
inline |
Computes next trial solution vector.
this version of update avoids using the residual by computing it on the fly note the distinction between u_preliminary (input) and u_kain (output) residual[i] = u_kain[i] - u_preliminary[i+1] ulist[i] = u_kain[i] plist[i] = u_preliminary[i]
| [in] | u_preliminary | new solution before KAIN |
| [out] | u_kain | new solution after KAIN |
|
private |
Referenced by madness::XNonlinearSolver< std::vector< Function< double, 3 > >, double, vector_function_allocator< double, 3 > >::initialize(), madness::XNonlinearSolver< std::vector< Function< double, 3 > >, double, vector_function_allocator< double, 3 > >::update(), and madness::XNonlinearSolver< std::vector< Function< double, 3 > >, double, vector_function_allocator< double, 3 > >::update().
|
private |
coefficients for linear combination
| bool madness::XNonlinearSolver< T, C, Alloc >::do_print |
Referenced by iterate(), and madness::PNO::t_solve().
|
private |
Maximum size of subspace dimension.
|
private |
Subspace information.
|
private |
|
private |
|
private |