ru.sstu.math.ep
Class Expression

java.lang.Object
  extended by ru.sstu.math.ep.Expression

public final class Expression
extends Object

Expression class holds mathematical expression as tree, can be evaluated, and can be differentiated.

Since:
Math 1.0
Author:
Denis A. Murashev

Method Summary
 Expression derivative(String arg)
          Differentiates expression.
 double evaluate(Map<String,? extends Number> arg)
          Evaluates expression.
 void simplify()
          Simplifies compiled expression.
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

evaluate

public double evaluate(Map<String,? extends Number> arg)
                throws org.apache.commons.math.MathException
Evaluates expression.

Parameters:
arg - arguments
Returns:
expression value
Throws:
org.apache.commons.math.MathException - if cannot evaluate expression

simplify

public void simplify()
              throws org.apache.commons.math.MathException
Simplifies compiled expression.

Throws:
org.apache.commons.math.MathException - if some error occurs

derivative

public Expression derivative(String arg)
                      throws org.apache.commons.math.MathException
Differentiates expression.

Parameters:
arg - name of variable
Returns:
derivative
Throws:
org.apache.commons.math.MathException - if some error occurs

toString

public String toString()

Overrides:
toString in class Object


Copyright © 2011 TFI branch of Engels Instutute of Technology. All Rights Reserved.