5 template<
typename FunctorType,
typename Scalar>
7 const FunctorType &Functor,
11 DenseIndex ml, DenseIndex mu,
17 typedef DenseIndex
Index;
28 const Scalar epsmch = NumTraits<Scalar>::epsilon();
29 const Index n = x.size();
30 eigen_assert(fvec.size()==n);
34 eps =
sqrt((std::max)(epsfcn,epsmch));
38 for (j = 0; j < n; ++j) {
44 iflag = Functor(x, wa1);
48 fjac.col(j) = (wa1-fvec)/h;
53 for (k = 0; k < msum; ++k) {
54 for (j = k; (msum<0) ? (j>n): (j<n); j += msum) {
56 h = eps *
abs(wa2[j]);
60 iflag = Functor(x, wa1);
63 for (j = k; (msum<0) ? (j>n): (j<n); j += msum) {
65 h = eps *
abs(wa2[j]);
68 start = std::max<Index>(0,j-mu);
69 length = (std::min)(n-1, j+ml) - start + 1;
70 fjac.col(j).segment(start, length) = ( wa1.segment(start, length)-fvec.segment(start, length))/h;
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_sqrt_op< typename Derived::Scalar >, const Derived > sqrt(const Eigen::ArrayBase< Derived > &x)
Namespace containing all symbols from the Eigen library.
Derived & setZero(Index size)
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_abs_op< typename Derived::Scalar >, const Derived > abs(const Eigen::ArrayBase< Derived > &x)