org.apache.commons.nabla.core
Interface UnivariateDerivative


public interface UnivariateDerivative

Interface for univariate functions derivatives.

This interface represent a simple function which computes both the value and the first derivative of a mathematical function. The derivative is computed with respect to the input variable.

Classes implementing this interface are automatically built by the differentiators provided by the Nabla library.

See Also:
UnivariateDifferentiable, UnivariateDifferentiator

Method Summary
 DifferentialPair f(DifferentialPair t)
          Simple mathematical function.
 UnivariateDifferentiable getPrimitive()
          Get the primitive function associated with this differential.
 

Method Detail

getPrimitive

UnivariateDifferentiable getPrimitive()
Get the primitive function associated with this differential.

Each UnivariateDerivative instance is tightly bound to an UnivariateDifferentiable instance. If the state of the primitive instance changes in any way that affects the differential computation, this binding allows this change to be immediately seen by the derivative instance, there is no need to differentiate the primitive again. The existing instance is aware of the primitive changes.

In other words in the following code snippet, the three values f1, f2 and f3 should be equal (at least at machine tolerance level)

    UnivariateDerivative derivative = differentiator.differentiate(derivable);
    derivable.someFunctionThatMutatesHeavilyTheInstance();
    double f1 = derivable.f(t);
    double f2 = derivative.getPrimitive().f(t);
    double f3 = detivative.f(DifferentialPair.newVariable(t)).getU0();
 

Returns:
primitive function bound to this derivative

f

DifferentialPair f(DifferentialPair t)
Simple mathematical function.

UnivariateDerivative classes compute both the value and the first derivative of the function.

Parameters:
t - function input value
Returns:
function result


Copyright © 2008-2009 The Apache Software Foundation. All Rights Reserved.