Generalized version of NonlinearSolver not limited to a single madness function.
More...
template<class T, class C = double, class Alloc = default_allocator<T>>
class madness::XNonlinearSolver< T, C, Alloc >
Generalized version of NonlinearSolver not limited to a single madness function.
This solves the equation where u and r are both of type 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.
template<class T , class C = double, class Alloc = default_allocator<T>>
Computes next trial solution vector.
You are responsible for performing step restriction or line search (not necessary for linear problems).
- Parameters
-
u | Current solution vector |
r | Corresponding residual |
- Returns
- Next trial solution vector
- Parameters
-
[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 |
References madness::XNonlinearSolver< T, C, Alloc >::alloc, madness::XNonlinearSolver< T, C, Alloc >::c, madness::check_linear_dependence(), madness::copy(), madness::XNonlinearSolver< T, C, Alloc >::do_print, madness::inner(), madness::KAIN(), madness::XNonlinearSolver< T, C, Alloc >::maxsub, madness::print(), madness::XNonlinearSolver< T, C, Alloc >::Q, madness::XNonlinearSolver< T, C, Alloc >::rlist, T(), u(), and madness::XNonlinearSolver< T, C, Alloc >::ulist.
Referenced by iterate(), madness::Zcis::iterate(), and madness::PNO::t_solve().