User Guide
nmodl::newton Namespace Reference

newton solver implementations More...

Detailed Description

newton solver implementations

Functions

template<int N, typename FUNC >
EIGEN_DEVICE_FUNC int 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<int N, typename FUNC >
EIGEN_DEVICE_FUNC int newton_numerical_diff_solver (Eigen::Matrix< double, N, 1 > &X, FUNC functor, double eps=EPS, int max_iter=MAX_ITER)
 Newton method without user-provided Jacobian. More...
 
template<typename FUNC , int N>
EIGEN_DEVICE_FUNC int 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 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 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 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 newton_solver (Eigen::Matrix< double, 4, 1 > &X, FUNC functor, double eps=EPS, int max_iter=MAX_ITER)
 

Variables

static constexpr int MAX_ITER = 1e3
 
static constexpr double EPS = 1e-12
 
static constexpr double SQUARE_ROOT_ULP = 1e-7
 
static constexpr double CUBIC_ROOT_ULP = 1e-5