This class plays a similar role to DerivativeStructure, with
a focus on efficiency when dealing with large number of independent variables
and most computation depend only on a few of them, and when only first derivative
is desired. When these conditions are met, this class should be much faster than
DerivativeStructure and use less memory.
| Modifier and Type | Field and Description |
|---|---|
| private final Map | derivatives
Stored derivative, each key representing a different independent variable. |
| private static final long | serialVersionUID
Serializable UID. |
| private double | value
Value of the calculation. |
| Access | Constructor and Description |
|---|---|
| private | SparseGradient(final double
value of the function value, final Map<Integer, Double> derivatives map, a deep copy will be performed,
so the map given here will remain safe from changes in the new instance,
may be null to create an empty derivatives map, i.e. a constant value derivatives)Internal constructor. |
| private | SparseGradient(final double
value of the function value, final double scaling factor to apply to all derivatives scale, final Map<Integer, Double> derivatives map, a deep copy will be performed,
so the map given here will remain safe from changes in the new instance,
may be null to create an empty derivatives map, i.e. a constant value derivatives)Internal constructor. |
| Modifier and Type | Method and Description |
|---|---|
| public SparseGradient | |
| public SparseGradient | |
| public SparseGradient | acosh()
Implements org. Inverse hyperbolic cosine operation. |
| public SparseGradient | add(final SparseGradient
element to add a)Implements org. Compute this + a. |
| public SparseGradient | add(final double
right hand side parameter of the operator c)Implements org. '+' operator. |
| public void | |
| public SparseGradient | |
| public SparseGradient | asinh()
Implements org. Inverse hyperbolic sine operation. |
| public SparseGradient | |
| public SparseGradient | atan2(final SparseGradient
second argument of the arc tangent x)Implements org. Two arguments arc tangent operation. |
| public static SparseGradient | Returns: atan2(y, x)first argument of the arc tangent y, final SparseGradient second argument of the arc tangent x)Two arguments arc tangent operation. |
| public SparseGradient | atanh()
Implements org. Inverse hyperbolic tangent operation. |
| public SparseGradient | |
| public SparseGradient | ceil()
Implements org. Get the smallest whole number larger than instance. |
| public SparseGradient | Returns: f(this)value of the function at (i.e. f( f0, final double getValue()))first derivative of the function at
the current point (i.e. f'( f1)getValue()))Compute composition of the instance by a univariate function. |
| public SparseGradient | copySign(final SparseGradient
the sign for the returned value sign)Implements org. Returns the instance with the sign of the argument. |
| public SparseGradient | copySign(final double
the sign for the returned value sign)Implements org. Returns the instance with the sign of the argument. |
| public SparseGradient | |
| public SparseGradient | |
| public static SparseGradient | Returns: a new instancevalue of the constant value)Factory method creating a constant. |
| public static SparseGradient | Returns: a new instanceindex of the variable idx, final double value of the variable value)Factory method creating an independent variable. |
| public SparseGradient | divide(final SparseGradient
element to divide by a)Implements org. Compute this ÷ a. |
| public SparseGradient | divide(final double
right hand side parameter of the operator c)Implements org. '÷' operator. |
| public boolean | Returns: true if two sparse gradients are equalObject to test for equality to this other)Overrides java. Test for the equality of two sparse gradients. |
| public SparseGradient | |
| public SparseGradient | |
| public SparseGradient | floor()
Implements org. Get the largest whole number smaller than instance. |
| public double | Returns: derivative with respect to a particular index variableindex to differentiate with. index)Get the derivative with respect to a particular index variable. |
| public Field | getField()
Implements org. Get the |
| public double | getReal()
Implements org. Get the real value of the number. |
| public double | |
| public int | Returns: a hash code value for this objectOverrides java. Get a hashCode for the derivative structure. |
| public SparseGradient | hypot(final SparseGradient
a value y)Implements org. Returns the hypotenuse of a triangle with sides |
| public static SparseGradient | Returns: sqrt(x2 +y2)a value x, final SparseGradient a value y)Returns the hypotenuse of a triangle with sides |
| public SparseGradient | linearCombination(final SparseGradient[]
Factors. a, final SparseGradient[] Factors. b)Implements org. Compute a linear combination. |
| public SparseGradient | linearCombination(final double[]
Factors. a, final SparseGradient[] Factors. b)Implements org. Compute a linear combination. |
| public SparseGradient | linearCombination(final SparseGradient
first factor of the first term a1, final SparseGradient second factor of the first term b1, final SparseGradient first factor of the second term a2, final SparseGradient second factor of the second term b2)Implements org. Compute a linear combination. |
| public SparseGradient | linearCombination(final double
first factor of the first term a1, final SparseGradient second factor of the first term b1, final double first factor of the second term a2, final SparseGradient second factor of the second term b2)Implements org. Compute a linear combination. |
| public SparseGradient | linearCombination(final SparseGradient
first factor of the first term a1, final SparseGradient second factor of the first term b1, final SparseGradient first factor of the second term a2, final SparseGradient second factor of the second term b2, final SparseGradient first factor of the third term a3, final SparseGradient second factor of the third term b3)Implements org. Compute a linear combination. |
| public SparseGradient | linearCombination(final double
first factor of the first term a1, final SparseGradient second factor of the first term b1, final double first factor of the second term a2, final SparseGradient second factor of the second term b2, final double first factor of the third term a3, final SparseGradient second factor of the third term b3)Implements org. Compute a linear combination. |
| public SparseGradient | linearCombination(final SparseGradient
first factor of the first term a1, final SparseGradient second factor of the first term b1, final SparseGradient first factor of the second term a2, final SparseGradient second factor of the second term b2, final SparseGradient first factor of the third term a3, final SparseGradient second factor of the third term b3, final SparseGradient first factor of the third term a4, final SparseGradient second factor of the third term b4)Implements org. Compute a linear combination. |
| public SparseGradient | linearCombination(final double
first factor of the first term a1, final SparseGradient second factor of the first term b1, final double first factor of the second term a2, final SparseGradient second factor of the second term b2, final double first factor of the third term a3, final SparseGradient second factor of the third term b3, final double first factor of the third term a4, final SparseGradient second factor of the third term b4)Implements org. Compute a linear combination. |
| public SparseGradient | |
| public SparseGradient | |
| public SparseGradient | |
| public SparseGradient | multiply(final SparseGradient
element to multiply a)Implements org. Compute this × a. |
| public SparseGradient | multiply(final double
right hand side parameter of the operator c)Implements org. '×' operator. |
| public SparseGradient | multiply(final int
Number of times n)this must be added to itself.Implements org. Compute n × this.</center> |
| public void | |
| public SparseGradient | negate()
Implements org. Returns the additive inverse of |
| public int | |
| public SparseGradient | pow(final double
power to apply p)Implements org. Power operation. |
| public SparseGradient | pow(final int
power to apply n)Implements org. Integer power operation. |
| public SparseGradient | pow(final SparseGradient
exponent e)Implements org. Power operation. |
| public static SparseGradient | Returns: axnumber to exponentiate a, final SparseGradient power to apply x)Compute ax where a is a double and x a |
| public SparseGradient | reciprocal()
Implements org. Returns the multiplicative inverse of |
| public SparseGradient | remainder(final double
right hand side parameter of the operator a)Implements org. IEEE remainder operator. |
| public SparseGradient | remainder(final SparseGradient
right hand side parameter of the operator a)Implements org. IEEE remainder operator. |
| public SparseGradient | rint()
Implements org. Get the whole number that is the nearest to the instance, or the even one if x is exactly half way between two integers. |
| public SparseGradient | rootN(final int
order of the root n)Implements org. Nth root. |
| public long | round()
Implements org. Get the closest long to instance value. |
| public SparseGradient | scalb(final int
power of 2 n)Implements org. Multiply the instance by a power of 2. |
| public SparseGradient | signum()
Implements org. Compute the signum of the instance. |
| public SparseGradient | |
| public SparseGradient | |
| public SparseGradient | |
| public SparseGradient | subtract(final SparseGradient
element to subtract a)Implements org. Compute this - a. |
| public SparseGradient | subtract(double
right hand side parameter of the operator c)Implements org. '-' operator. |
| public SparseGradient | |
| public SparseGradient | |
| public double | Returns: value of the Taylor expansion at x + Δx, y + Δy, ...parameters offsets (Δx, Δy, ...) delta)Evaluate Taylor expansion of a sparse gradient. |
| public SparseGradient | Returns: instance converted into degreesConvert radians to degrees, with error of less than 0.5 ULP |
| public SparseGradient | Returns: instance converted into radiansConvert degrees to radians, with error of less than 0.5 ULP |