Documentation API of the 'org.jscience.mathematics.function.Function' Java class
Function
org.jscience.mathematics.function

Class Function<X,Y>

  • All Implemented Interfaces:
    Serializable, javolution.lang.Realtime
    Direct Known Subclasses:
    DiscreteFunction, Polynomial, RationalFunction


    public abstract class Function<X,Y>extends Objectimplements Serializable, javolution.lang.Realtime

    This abstract class represents a mapping between two sets such that there is a unique element in the second set assigned to each element in the first set.

    Functions can be discrete or continuous and multivariate functions (functions with multiple variables) are also supported as illustrated below:

             // Defines local variables.         Variable.Local<Rational> varX = new Variable.Local<Rational>("x");         Variable.Local<Rational> varY = new Variable.Local<Rational>("y");                  // f(x, y) =  x\xc2\xb2 + x\xc2\xb7y + 1;         Polynomial<Rational> x = Polynomial.valueOf(Rational.ONE, varX);         Polynomial<Rational> y = Polynomial.valueOf(Rational.ONE, varY);         Polynomial<Rational> fx_y = x.pow(2).plus(x.times(y)).plus(Rational.ONE);         System.out.println("f(x,y) = " + fx_y);          // Evaluates f(1,0)          System.out.println("f(1,0) = " + fx_y.evaluate(Rational.ONE, Rational.ZERO));          // Calculates df(x,y)/dx         System.out.println("df(x,y)/dx = " + fx_y.differentiate(varX));                   > f(x,y) = [1/1]x^2 + [1/1]xy + [1/1]         > f(1,0) = 2/1         > df(x,y)/dx = [2/1]x + [1/1]y     

    Functions are often given by formula (e.g. f(x) = x\xc2\xb2-x+1, f(x,y)= x\xc2\xb7y) but the general function instance might tabulate the values, solve an equation, etc.

    See Also:
    Wikipedia: Functions (mathematics), Serialized Form

Warning: You cannot see the full API documentation of this class since the access to the DatMelt documentation for third-party Java classes is denied. Guests can only view jhplot Java API. To view the complete description of this class and its methods, please request the full DataMelt membership.

If you are already a full member, please login to the DataMelt member area before visiting this documentation.