Constructs an R function that wraps a call to a C++ function and compiles the
C++ code used to define the function.
The code must define a function having arguments of the type const ADmat& and
a return type of ADmat. The ADmat type is a type definition for a dynamically sized
matrix from the Eigen linear algebra library. (Guennebaud G, Jacob B and
others 2010). The function can employ methods from the Eigen library, such as all of the standard
operators from linear algebra, and a wide range of
functions for calculating inverses, decompositions and so on. See Guennebaud G, Jacob B and
others (2010) for further details.
The returned function can then be used
as an argument to J or H which provide functions that apply algorithmic differentiation
to calculate the Jacobian or Hessian matrices. The functions produced by J or H evaluate
the partial derivatives with respect to the elements of the argument located at the position in the functions argument
list that is specified by the wrt argument of sourceCppAD.