Scythe-1.0.3
template<matrix_order RO, matrix_style RS, typename T , matrix_order PO, matrix_style PS, typename FUNCTOR >
Matrix<T,RO,RS> scythe::jacfdif ( FUNCTOR  fun,
const Matrix< T, PO, PS > &  theta 
)

Calculate the Jacobian of a function using a forward difference formula.

This function numerically calculates the Jacobian of a vector-valued function using a forward difference formula.

Parameters:
funThe function to calculate the Jacobian of. This function should both take and return a Matrix (vector) of type T.
thetaThe column vector of parameter values at which to take the Jacobian of fun.
See also:
gradfdif(FUNCTOR fun, const Matrix<T,PO,PS>& theta)
gradfdifls(FUNCTOR fun, T alpha, const Matrix<T,PO1,PS1>& theta, const Matrix<T,PO2,PS2>& p)
hesscdif(FUNCTOR fun, const Matrix<T,PO,PS>& theta)
Exceptions:
scythe_dimension_error(Level 1)
Note:
Users will typically wish to implement fun in terms of a functor. Using a functor provides a generic way in which to evaluate functions with more than one parameter. Furthermore, although one can pass a function pointer to this routine, the compiler cannot inline and fully optimize code referenced by function pointers.

XXX ??

References scythe::Matrix_base< ORDER, STYLE >::isColVector(), scythe::Matrix_base< ORDER, STYLE >::rows(), SCYTHE_CHECK_10, and sqrt().

Referenced by nls_broyden().