Enum FiniteDifferenceType
- java.lang.Object
-
- java.lang.Enum<FiniteDifferenceType>
-
- com.opengamma.strata.math.impl.differentiation.FiniteDifferenceType
-
- All Implemented Interfaces:
Serializable
,Comparable<FiniteDifferenceType>
public enum FiniteDifferenceType extends Enum<FiniteDifferenceType>
Enum representing the various differencing types that can be used to estimate the gradient of a function.Forward: $\frac{f(x + \epsilon) - f(x)}{\epsilon}$
Central: $\frac{f(x + \epsilon) - f(x - \epsilon)}{2 * \epsilon}$
Backward: $\frac{f(x) - f(x - \epsilon)}{\epsilon}$
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static FiniteDifferenceType
valueOf(String name)
Returns the enum constant of this type with the specified name.static FiniteDifferenceType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
FORWARD
public static final FiniteDifferenceType FORWARD
Forward differencing
-
CENTRAL
public static final FiniteDifferenceType CENTRAL
Central differencing
-
BACKWARD
public static final FiniteDifferenceType BACKWARD
Backward differencing
-
-
Method Detail
-
values
public static FiniteDifferenceType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (FiniteDifferenceType c : FiniteDifferenceType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static FiniteDifferenceType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
-