JScience v4.3

org.jscience.mathematics.function
Class DiscreteFunction<X,Y>

java.lang.Object
  extended by org.jscience.mathematics.function.Function<X,Y>
      extended by org.jscience.mathematics.function.DiscreteFunction<X,Y>
All Implemented Interfaces:
java.io.Serializable, javolution.lang.Realtime

public final class DiscreteFunction<X,Y>
extends Function<X,Y>

This class represents a function defined from a mapping betweem two sets (points and values).

Instance of this class can be used to approximate continuous functions or to numerically solve differential systems.

Version:
3.0, February 13, 2006
Author:
Jean-Marie Dautelle
See Also:
Serialized Form

Constructor Summary
DiscreteFunction(java.util.SortedMap<X,Y> pointValues, Interpolator<X,Y> interpolator, Variable<X> variable)
          Creates the discrete function for the specified point-value entries.
 
Method Summary
 Y evaluate()
          Evaluates this function using its variables current values.
 Interpolator<X,Y> getInterpolator()
          Returns the interpolator used by this discrete function.
 java.util.SortedMap<X,Y> getPointValues()
          Returns the point-value entries of this discrete function.
 java.util.List<Variable<X>> getVariables()
          Returns a lexically ordered list of the variables (or arguments) for this function (empty list for constant functions).
 javolution.text.Text toText()
          Returns the textual representation of this real-time object (equivalent to toString except that the returned value can be allocated from the local context space).
 
Methods inherited from class org.jscience.mathematics.function.Function
compose, differentiate, divide, equals, evaluate, evaluate, getVariable, hashCode, integrate, minus, plus, pow, times, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DiscreteFunction

public DiscreteFunction(java.util.SortedMap<X,Y> pointValues,
                        Interpolator<X,Y> interpolator,
                        Variable<X> variable)
Creates the discrete function for the specified point-value entries.

Parameters:
pointValues - the point-value entries of this function.
interpolator - the interpolator.
variable - this function variable.
Method Detail

getPointValues

public java.util.SortedMap<X,Y> getPointValues()
Returns the point-value entries of this discrete function.

Returns:
the point-value mapping.

getInterpolator

public Interpolator<X,Y> getInterpolator()
Returns the interpolator used by this discrete function.

Returns:
the interpolator used to estimate the value between two points.

evaluate

public Y evaluate()
Description copied from class: Function
Evaluates this function using its variables current values.

Specified by:
evaluate in class Function<X,Y>
Returns:
the evaluation of this function.

getVariables

public java.util.List<Variable<X>> getVariables()
Description copied from class: Function
Returns a lexically ordered list of the variables (or arguments) for this function (empty list for constant functions).

Specified by:
getVariables in class Function<X,Y>
Returns:
this function current unset variables (sorted).

toText

public javolution.text.Text toText()
Description copied from class: Function
Returns the textual representation of this real-time object (equivalent to toString except that the returned value can be allocated from the local context space).

Specified by:
toText in interface javolution.lang.Realtime
Specified by:
toText in class Function<X,Y>
Returns:
this object's textual representation.

JScience v4.3

Copyright © 2006 JScience.