User Guide
newton.hpp File Reference

Implementation of Newton method for solving system of non-linear equations. More...

Detailed Description

Implementation of Newton method for solving system of non-linear equations.

Definition in file newton.hpp.

#include <crout/crout.hpp>
#include <Eigen/Dense>
#include <Eigen/LU>

Go to the source code of this file.

Namespaces

 nmodl
 encapsulates code generation backend implementations
 
 nmodl::newton
 newton solver implementations
 

Functions

template<int N>
EIGEN_DEVICE_FUNC bool nmodl::newton::is_converged (const Eigen::Matrix< double, N, 1 > &X, const Eigen::Matrix< double, N, N > &J, const Eigen::Matrix< double, N, 1 > &F, double eps)
 
template<int N, typename FUNC >
EIGEN_DEVICE_FUNC int nmodl::newton::newton_solver (Eigen::Matrix< double, N, 1 > &X, FUNC functor, double eps=EPS, int max_iter=MAX_ITER)
 Newton method with user-provided Jacobian. More...
 
template<typename FUNC , int N>
EIGEN_DEVICE_FUNC int nmodl::newton::newton_solver_small_N (Eigen::Matrix< double, N, 1 > &X, FUNC functor, double eps, int max_iter)
 Newton method template specializations for \(N <= 4\) Use explicit inverse of F instead of LU decomposition. More...
 
template<typename FUNC >
EIGEN_DEVICE_FUNC int nmodl::newton::newton_solver (Eigen::Matrix< double, 1, 1 > &X, FUNC functor, double eps=EPS, int max_iter=MAX_ITER)
 
template<typename FUNC >
EIGEN_DEVICE_FUNC int nmodl::newton::newton_solver (Eigen::Matrix< double, 2, 1 > &X, FUNC functor, double eps=EPS, int max_iter=MAX_ITER)
 
template<typename FUNC >
EIGEN_DEVICE_FUNC int nmodl::newton::newton_solver (Eigen::Matrix< double, 3, 1 > &X, FUNC functor, double eps=EPS, int max_iter=MAX_ITER)
 
template<typename FUNC >
EIGEN_DEVICE_FUNC int nmodl::newton::newton_solver (Eigen::Matrix< double, 4, 1 > &X, FUNC functor, double eps=EPS, int max_iter=MAX_ITER)
 

Variables

static constexpr int nmodl::newton::MAX_ITER = 50
 
static constexpr double nmodl::newton::EPS = 1e-13