unikl.disco.math.functions
Interface Function

All Known Subinterfaces:
PWLFunction
All Known Implementing Classes:
Curve

public interface Function

Interface for functions that can be displayed with FunctionView and processed by the various operators.

Author:
Frank A. Zdarsky

Method Summary
 double f(double x)
          Returns the function value at the given x-coordinate.
 java.lang.String getAlias()
          Returns a string with a user-defined alias name for the function.
 double getGradientAt(double x)
          Returns the gradient at the given x-coordinate or Double.NaN if it does not exist or is not implemented for this function.
 java.lang.String getLabel()
          Returns a string with an automatically created label for the function.
 double getMaxX()
          Returns the maximum x-coordinate for which the function is defined (mainly for drawing purposes).
 double getMinX()
          Returns the minimum x-coordinate for which the function is defined (mainly for drawing purposes).
 void setAlias(java.lang.String alias)
          Allows the user to set an alias name for the function which overrides the automatically created label.
 

Method Detail

getMinX

double getMinX()
Returns the minimum x-coordinate for which the function is defined (mainly for drawing purposes).

Returns:
the lower bound of the function's definition interval

getMaxX

double getMaxX()
Returns the maximum x-coordinate for which the function is defined (mainly for drawing purposes).

Returns:
the upper bound of the function's definition interval

f

double f(double x)
Returns the function value at the given x-coordinate.

Parameters:
x - the x-coordinate
Returns:
the function value

getGradientAt

double getGradientAt(double x)
Returns the gradient at the given x-coordinate or Double.NaN if it does not exist or is not implemented for this function.

Parameters:
x - the x-coordinate
Returns:
the gradient at the x-coordinate or Double.NaN if not defined

getLabel

java.lang.String getLabel()
Returns a string with an automatically created label for the function. May be an empty string, but not null.

Returns:
the label

getAlias

java.lang.String getAlias()
Returns a string with a user-defined alias name for the function. If no alias is set, must return the function's label.

Returns:
the alias name

setAlias

void setAlias(java.lang.String alias)
Allows the user to set an alias name for the function which overrides the automatically created label. The alias is used for displaying purposes and for the creation of labels for derived functions.

Parameters:
alias - the alias name