MADNESS  version 0.9
Public Member Functions | Public Attributes | List of all members
madness::XNonlinearSolver< T, C, Alloc > Class Template Reference

Generalized version of NonlinearSolver not limited to a single madness function. More...

#include <nonlinsol.h>

Public Member Functions

 XNonlinearSolver (const Alloc &alloc=Alloc())
 
 XNonlinearSolver (const XNonlinearSolver &other)
 
std::vector< T > & get_ulist ()
 
std::vector< T > & get_rlist ()
 
void set_maxsub (int maxsub)
 
update (const T &u, const T &r, const double rcondtol=1e-8, const double cabsmax=1000.0)
 Computes next trial solution vector. More...
 

Public Attributes

bool do_print
 

Detailed Description

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 $r(u) = 0$ 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.

Constructor & Destructor Documentation

template<class T, class C = double, class Alloc = default_allocator<T>>
madness::XNonlinearSolver< T, C, Alloc >::XNonlinearSolver ( const Alloc &  alloc = Alloc())
inline
template<class T, class C = double, class Alloc = default_allocator<T>>
madness::XNonlinearSolver< T, C, Alloc >::XNonlinearSolver ( const XNonlinearSolver< T, C, Alloc > &  other)
inline

Member Function Documentation

template<class T, class C = double, class Alloc = default_allocator<T>>
std::vector<T>& madness::XNonlinearSolver< T, C, Alloc >::get_rlist ( )
inline
template<class T, class C = double, class Alloc = default_allocator<T>>
std::vector<T>& madness::XNonlinearSolver< T, C, Alloc >::get_ulist ( )
inline
template<class T, class C = double, class Alloc = default_allocator<T>>
void madness::XNonlinearSolver< T, C, Alloc >::set_maxsub ( int  maxsub)
inline
template<class T, class C = double, class Alloc = default_allocator<T>>
T madness::XNonlinearSolver< T, C, Alloc >::update ( const T &  u,
const T &  r,
const double  rcondtol = 1e-8,
const double  cabsmax = 1000.0 
)
inline

Computes next trial solution vector.

You are responsible for performing step restriction or line search (not necessary for linear problems).

Parameters
uCurrent solution vector
rCorresponding residual
Returns
Next trial solution vector
Parameters
[in]rcondtolrcond less than this will cause the subspace to be shrunk due to linear dependence
[in]cabsmaxmaximum element of c greater than this will cause the subspace to be shrunk due to li

References c, madness::check_linear_dependence(), madness::copy(), madness::inner(), madness::KAIN(), madness::print(), and std::tr1::T().

Referenced by iterate_xy(), and madness::TDA::solve_sequential().

Member Data Documentation

template<class T, class C = double, class Alloc = default_allocator<T>>
bool madness::XNonlinearSolver< T, C, Alloc >::do_print

The documentation for this class was generated from the following file: