next up previous contents index
Next: Subroutine n_linmin Up: Module minimization_module Previous: Interface test_gradient   Contents   Index

Interface n_test_gradient


\begin{boxedminipage}{\textwidth}
\begin{verbatim}call n_test_gradient(xx,func,dfunc[,dir])\end{verbatim}
\end{boxedminipage}

Test a function against its gradient by evaluating the gradient from the function by symmetric finite differnces. We can only test the gradient if energy and force functions are pure in that they do not change the input vector (e.g. no capping of parameters). The interface for func(x) and dfunc(x)are the same as for minim above.

xx -- real(dp), intent(in), dimension(:)

Position

dir -- real(dp), intent(in), optional, target, dimension(:)

direction along which to test

Function func(x) -- real(dp)

x -- real(dp), dimension(:)

Function dfunc(x) -- real(dp), dimension(size(x))

x -- real(dp), dimension(:)

n_linmin subroutine

gabor 2009-06-30