Create DiffResult object which can be used for storage of functions values and different orders of derivative results at the same time.

GradientResult(x)

JacobianResult(x, y = NULL)

HessianResult(x)

Arguments

x

a vector of same shape with potential input vectors.

y

a vector of same shape with potential output vectors. When it is NULL (default), it means that y has the same shape with x.