13 #ifndef eli_mutil_nls_newton_raphson_system_method_hpp
14 #define eli_mutil_nls_newton_raphson_system_method_hpp
16 #include "eli/code_eli.hpp"
26 template<
typename data__,
size_t N__,
size_t NSOL__=1>
36 x0.setConstant(static_cast<data__>(0));
58 template<
typename f__,
typename g__>
63 data__ abs_tol_norm, rel_tol_norm;
69 eval2=(fx-f0).array()/f0.array();
80 while (!this->
test_converged(count, rel_tol_norm, abs_tol_norm) && !all_zero)
86 dx=-fpx.lu().solve(eval1);
95 for (
size_t i=0; i<N__; ++i)
98 if (std::abs(dx(i))>std::numeric_limits<data__>::epsilon())
103 if (std::abs(f0(i))<=std::numeric_limits<data__>::epsilon())
104 eval2(i)=std::numeric_limits<data__>::epsilon();
108 eval2(i)=eval1(i)/f0(i);
114 rel_tol_norm=
static_cast<data__
>(0);
bool max_iteration_reached(const iteration_type &it) const
Definition: iterative_root_base.hpp:261
const iterative_system_root_base< data__, N__, NSOL__ >::solution_matrix & get_initial_guess() const
Definition: newton_raphson_system_method.hpp:53
newton_raphson_system_method()
Definition: newton_raphson_system_method.hpp:33
Eigen::Matrix< data__, N__, NSOL__ > solution_matrix
Definition: iterative_system_root_base.hpp:28
Eigen::Matrix< data__, N__, N__ > jacobian_matrix
Definition: iterative_system_root_base.hpp:29
Definition: iterative_system_root_base.hpp:25
bool test_converged(const iteration_type &it, const tolerance_type &relv, const tolerance_type &absv) const
Definition: iterative_root_base.hpp:256
newton_raphson_system_method(const newton_raphson_system_method< data__, N__, NSOL__ > &nrm)
Definition: newton_raphson_system_method.hpp:39
void set_initial_guess(const typename iterative_system_root_base< data__, N__, NSOL__ >::solution_matrix &xg)
Definition: newton_raphson_system_method.hpp:48
data__ calculate_norm(const solution_matrix &mat) const
Definition: iterative_system_root_base.hpp:66
virtual iterative_system_root_base< data__, N__, NSOL__ >::solution_matrix calculate_delta_factor(const typename iterative_system_root_base< data__, N__, NSOL__ >::solution_matrix &, const typename iterative_system_root_base< data__, N__, NSOL__ >::solution_matrix &dx) const
Definition: newton_raphson_system_method.hpp:130
~newton_raphson_system_method()
Definition: newton_raphson_system_method.hpp:44
static const int hit_constraint
Definition: newton_raphson_system_method.hpp:30
iterative_system_root_base< data__, N__, NSOL__ >::solution_matrix x0
Definition: newton_raphson_system_method.hpp:137
static const int max_iteration
Definition: iterative_root_base.hpp:155
max_iteration_type::data_type iteration_type
Definition: iterative_root_base.hpp:161
Definition: newton_raphson_system_method.hpp:27
static const int converged
Definition: iterative_root_base.hpp:154
int find_root(typename iterative_system_root_base< data__, N__, NSOL__ >::solution_matrix &root, const f__ &fun, const g__ &fprime, const typename iterative_system_root_base< data__, N__, NSOL__ >::solution_matrix &f0) const
Definition: newton_raphson_system_method.hpp:59