8#include <kernel/solver/linesearch.hpp> 
   21    template<
typename Functional_, 
typename Filter_>
 
   30        typedef typename Functional_::DataType 
DataType;
 
   56        bool keep_iterates = 
false) :
 
   57          BaseClass(
"FS-LS", functional, filter, keep_iterates),
 
   82        Functional_& functional, Filter_& filter) :
 
   83          BaseClass(
"FS-LS", section_name, section, functional, filter),
 
   90            auto step_length_p = section->
query(
"step_length");
 
   91            if(step_length_p.second)
 
   97              XABORTM(
name()+
" config section is missing the mandatory step_length key!");
 
  110          return "Fixed-Step-Linesearch";
 
  194    template<
typename Functional_, 
typename Filter_>
 
  196      Functional_& functional, Filter_& filter, 
typename Functional_::DataType step_length, 
bool keep_iterates = 
false)
 
  199          std::make_shared<FixedStepLinesearch<Functional_, Filter_>>(functional, filter, step_length, keep_iterates);
 
  220    template<
typename Functional_, 
typename Filter_>
 
  222      const String& section_name, 
const PropertyMap* section, Functional_& functional, Filter_& filter)
 
  225          std::make_shared<FixedStepLinesearch<Functional_, Filter_>>(section_name, section, functional, filter);
 
#define XABORTM(msg)
Abortion macro definition with custom message.
#define XASSERT(expr)
Assertion macro definition.
A class organizing a tree of key-value pairs.
std::pair< String, bool > query(String key_path) const
Queries a value by its key path.
Linesearch< Functional_, Filter_ > BaseClass
Our base class.
virtual DataType get_rel_update() const override
Get the relative update of the solver application.
Functional_::VectorTypeR VectorType
Input vector type for the functional's gradient.
virtual String name() const override
Returns a descriptive string.
virtual Status apply(VectorType &vec_cor, const VectorType &vec_dir) override
Applies the solver, setting the initial guess to zero.
virtual void set_step_length(DataType step_length)
Sets the step length.
virtual ~FixedStepLinesearch()
Functional_::DataType DataType
Underlying floating point type.
Filter_ FilterType
Filter type to be applied to the gradient of the functional.
virtual Status correct(VectorType &vec_sol, const VectorType &vec_dir) override
Applies the solver, making use of an initial guess.
FixedStepLinesearch(Functional_ &functional, Filter_ &filter, const DataType step_length, bool keep_iterates=false)
Standard constructor.
DataType _step_length
The length of the step.
FixedStepLinesearch(const String §ion_name, const PropertyMap *section, Functional_ &functional, Filter_ &filter)
Constructor using a PropertyMap.
void set_max_iter(Index max_iter)
Sets the maximum iteration count for the solver.
VectorType _vec_grad
Gradient vector.
DataType _norm_dir
The 2-norm of the search direction.
Functional_ & _functional
The (nonlinear) functional.
DataType _fval_min
Functional functional value.
Filter_ & _filter
The filter to be applied to the functional's gradient.
DataType _alpha_min
Line search parameter.
String class implementation.
std::shared_ptr< FixedStepLinesearch< Functional_, Filter_ > > new_fixed_step_linesearch(Functional_ &functional, Filter_ &filter, typename Functional_::DataType step_length, bool keep_iterates=false)
Creates a new FixedStepLinesearch object.
Status
Solver status return codes enumeration.
@ success
solving successful (convergence criterion fulfilled)