5 template<
typename FunctorType,
typename Scalar>
7 const FunctorType &Functor,
29 const Index n = x.size();
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;
IntermediateState sqrt(const Expression &arg)
iterative scaling algorithm to equilibrate rows and column norms in matrices
Holds information about the various numeric (i.e. scalar) types allowed by Eigen. ...
EIGEN_STRONG_INLINE const CwiseUnaryOp< internal::scalar_abs_op< Scalar >, const Derived > abs() const
Derived & setZero(Index size)
EIGEN_DEFAULT_DENSE_INDEX_TYPE DenseIndex
DenseIndex fdjac1(const FunctorType &Functor, Matrix< Scalar, Dynamic, 1 > &x, Matrix< Scalar, Dynamic, 1 > &fvec, Matrix< Scalar, Dynamic, Dynamic > &fjac, DenseIndex ml, DenseIndex mu, Scalar epsfcn)