JSci.maths.symbolic
Class Function

java.lang.Object
  extended by JSci.maths.symbolic.Expression
      extended by JSci.maths.symbolic.Function
All Implemented Interfaces:
java.io.Serializable, Field.Member, Ring.Member, AbelianGroup.Member, Member

public class Function
extends Expression

A function like sin(x), exp(x) or sqrt(x).
This will be substituted by Evaluation.

See Also:
Serialized Form

Field Summary
static java.lang.String ACOS
           
static java.lang.String ACOSH
           
static java.lang.String ASIN
           
static java.lang.String ASINH
           
static java.lang.String ATAN
           
static java.lang.String ATANH
           
static java.lang.String COS
           
static java.lang.String COSH
           
static java.lang.String EXP
           
static java.lang.String LOG
           
static java.lang.String SIN
           
static java.lang.String SINH
           
static java.lang.String SQRT
           
static java.lang.String TAN
           
static java.lang.String TANH
           
 
Constructor Summary
Function(java.lang.String n, Expression a)
           
 
Method Summary
 Expression differentiate(Variable x)
          Differentiation of the expression with respect to a variable
 boolean equals(java.lang.Object o)
           
 Expression evaluate()
          This method substitutes the variable with the variable values, if non-null; they can be Contants or other Expressions.
 int getPriority()
          Get the priority of the operator described by the expression.
 java.lang.Object getSet()
           
 java.lang.String toString()
           
 
Methods inherited from class JSci.maths.symbolic.Expression
add, difference, differentiate, divide, divide, inverse, inverse, main, multiply, negate, negative, power, product, product, rise, subtract, sum, sum
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SIN

public static final java.lang.String SIN
See Also:
Constant Field Values

COS

public static final java.lang.String COS
See Also:
Constant Field Values

TAN

public static final java.lang.String TAN
See Also:
Constant Field Values

ASIN

public static final java.lang.String ASIN
See Also:
Constant Field Values

ACOS

public static final java.lang.String ACOS
See Also:
Constant Field Values

ATAN

public static final java.lang.String ATAN
See Also:
Constant Field Values

SINH

public static final java.lang.String SINH
See Also:
Constant Field Values

COSH

public static final java.lang.String COSH
See Also:
Constant Field Values

TANH

public static final java.lang.String TANH
See Also:
Constant Field Values

ASINH

public static final java.lang.String ASINH
See Also:
Constant Field Values

ACOSH

public static final java.lang.String ACOSH
See Also:
Constant Field Values

ATANH

public static final java.lang.String ATANH
See Also:
Constant Field Values

EXP

public static final java.lang.String EXP
See Also:
Constant Field Values

LOG

public static final java.lang.String LOG
See Also:
Constant Field Values

SQRT

public static final java.lang.String SQRT
See Also:
Constant Field Values
Constructor Detail

Function

public Function(java.lang.String n,
                Expression a)
Parameters:
n - the name (type) of the function; for example, Function.SIN
a - the argument
Method Detail

toString

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

getPriority

public int getPriority()
Description copied from class: Expression
Get the priority of the operator described by the expression. This is needed only for allowing toString() to generate the parenthesis when needed.

Specified by:
getPriority in class Expression
Returns:
the priority

differentiate

public Expression differentiate(Variable x)
Description copied from class: Expression
Differentiation of the expression with respect to a variable

Specified by:
differentiate in class Expression
Parameters:
x - the variable

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

getSet

public java.lang.Object getSet()

evaluate

public Expression evaluate()
Description copied from class: Expression
This method substitutes the variable with the variable values, if non-null; they can be Contants or other Expressions. Simplification is performed.

Specified by:
evaluate in class Expression
Returns:
the evaluated Expression. Can be a Constant.