Class ValueDerivatives

  • All Implemented Interfaces:
    java.io.Serializable, Bean, ImmutableBean

    public final class ValueDerivatives
    extends java.lang.Object
    implements ImmutableBean, java.io.Serializable
    A value and its derivatives.

    This defines a standard way to return a value and its derivatives to certain inputs. It is in particular used as a return object for Algorithmic Differentiation versions of some functions.

    See Also:
    Serialized Form
    • Method Detail

      • of

        public static ValueDerivatives of​(double value,
                                          DoubleArray derivatives)
        Obtains an instance from a value and array of derivatives.
        Parameters:
        value - the value
        derivatives - the derivatives of the value
        Returns:
        the object
      • getDerivative

        public double getDerivative​(int index)
        Gets the derivative of the variable with respect to an input.
        Parameters:
        index - the zero-based derivative to obtain
        Returns:
        the derivative
        Throws:
        java.lang.IndexOutOfBoundsException - if the index is invalid
      • getValue

        public double getValue()
        Gets the value of the variable.
        Returns:
        the value of the property
      • getDerivatives

        public DoubleArray getDerivatives()
        Gets the derivatives of the variable with respect to some inputs.
        Returns:
        the value of the property, not null
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object