Class VectorFieldSecondOrderDifferentiator
- java.lang.Object
-
- com.opengamma.strata.math.impl.differentiation.VectorFieldSecondOrderDifferentiator
-
- All Implemented Interfaces:
Differentiator<DoubleArray,DoubleArray,DoubleMatrix[]>
public class VectorFieldSecondOrderDifferentiator extends Object implements Differentiator<DoubleArray,DoubleArray,DoubleMatrix[]>
The Vector field second order differentiator.
-
-
Constructor Summary
Constructors Constructor Description VectorFieldSecondOrderDifferentiator()
Creates an instance using the default values.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Function<DoubleArray,DoubleMatrix[]>
differentiate(Function<DoubleArray,DoubleArray> function)
This computes the second derivative of a vector field, which is a rank 3 tensor field.Function<DoubleArray,DoubleMatrix[]>
differentiate(Function<DoubleArray,DoubleArray> function, Function<DoubleArray,Boolean> domain)
Provides a function that performs the differentiation.Function<DoubleArray,DoubleMatrix[]>
differentiateFull(Function<DoubleArray,DoubleArray> function)
Differentiate.Function<DoubleArray,DoubleMatrix>
differentiateNoCross(Function<DoubleArray,DoubleArray> function)
Computes the second derivative of a vector field, without cross derivatives.
-
-
-
Method Detail
-
differentiate
public Function<DoubleArray,DoubleMatrix[]> differentiate(Function<DoubleArray,DoubleArray> function)
This computes the second derivative of a vector field, which is a rank 3 tensor field. The tensor is represented as an array of DoubleMatrix, where each matrix is a Hessian (for the dependent variable y_i), so the indexing is H^i_{j,k} =\partial^2y_i/\partial x_j \partial x_k- Specified by:
differentiate
in interfaceDifferentiator<DoubleArray,DoubleArray,DoubleMatrix[]>
- Parameters:
function
- the function representing the vector field- Returns:
- a function representing the second derivative of the vector field (i.e. a rank 3 tensor field)
-
differentiate
public Function<DoubleArray,DoubleMatrix[]> differentiate(Function<DoubleArray,DoubleArray> function, Function<DoubleArray,Boolean> domain)
Description copied from interface:Differentiator
Provides a function that performs the differentiation.- Specified by:
differentiate
in interfaceDifferentiator<DoubleArray,DoubleArray,DoubleMatrix[]>
- Parameters:
function
- a function for which to get the differential functiondomain
- a function that returns false if the requested value is not in the domain, true otherwise- Returns:
- a function that calculates the differential
-
differentiateFull
public Function<DoubleArray,DoubleMatrix[]> differentiateFull(Function<DoubleArray,DoubleArray> function)
Differentiate.- Parameters:
function
- the function- Returns:
- the result
-
differentiateNoCross
public Function<DoubleArray,DoubleMatrix> differentiateNoCross(Function<DoubleArray,DoubleArray> function)
Computes the second derivative of a vector field, without cross derivatives. This creates a function returning a matrix whose {i,j} element is $H^i_{j} = \partial^2y_i/\partial x_j \partial x_j$.- Parameters:
function
- the function representing the vector field- Returns:
- a function representing the second derivative of the vector field (i.e. a rank 3 tensor field)
-
-