org.jscience.mathematics.analysis.expressions.symbolic
Class Mod

java.lang.Object
  extended by org.jscience.mathematics.analysis.expressions.OperatorExpression
      extended by org.jscience.mathematics.analysis.expressions.TernaryOperator
          extended by org.jscience.mathematics.analysis.expressions.symbolic.Mod
All Implemented Interfaces:
java.io.Serializable, Expression, JavaExpressible, XMLExpressible

public class Mod
extends TernaryOperator

Class representing the modulus function.

See Also:
TernaryOperator, Serialized Form

Field Summary
 
Fields inherited from class org.jscience.mathematics.analysis.expressions.TernaryOperator
secondOperand, thirdOperand
 
Fields inherited from class org.jscience.mathematics.analysis.expressions.OperatorExpression
firstOperand
 
Constructor Summary
Mod(Expression x, Expression a, Expression b)
          Creates an object that represents the modulus function.
 
Method Summary
 boolean equals(java.lang.Object e)
          DOCUMENT ME!
 double eval()
          Returns the value of the Expression object.
static double eval(double x, double a, double b)
          The static method can be used to normalize numbers.
 boolean isDifferentiable()
          The step function is not differentiable so we override the inherited isDifferentiable method.
 boolean isExpandable()
          The mod function is not expandable so we override the inherited isExpandable method.
 Expression optimize()
          DOCUMENT ME!
 Expression replace(Expression a, Expression b)
          DOCUMENT ME!
 java.lang.String toJava()
          DOCUMENT ME!
 java.lang.String toString()
          DOCUMENT ME!
 java.lang.String toXML()
          DOCUMENT ME!
 
Methods inherited from class org.jscience.mathematics.analysis.expressions.TernaryOperator
diff, getElements, getSecondOperand, getThirdOperand, setSecondOperand, setThirdOperand, toTaylorMap
 
Methods inherited from class org.jscience.mathematics.analysis.expressions.OperatorExpression
contains, factor, getFirstOperand, isolate, isolate, setFirstOperand
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Mod

public Mod(Expression x,
           Expression a,
           Expression b)
Creates an object that represents the modulus function. The modulus should return normalized value ysatisfying a<=y.

Parameters:
x - The Expression to be normalized.
a - An Expression representing the lower limit.
b - An Expression representing the upper limit.
Method Detail

eval

public double eval()
Description copied from interface: Expression
Returns the value of the Expression object.

Returns:
DOCUMENT ME!

replace

public Expression replace(Expression a,
                          Expression b)
DOCUMENT ME!

Parameters:
a - DOCUMENT ME!
b - DOCUMENT ME!
Returns:
DOCUMENT ME!

eval

public static double eval(double x,
                          double a,
                          double b)
The static method can be used to normalize numbers. The current implementation is horribly inefficient.

Parameters:
x - DOCUMENT ME!
a - DOCUMENT ME!
b - DOCUMENT ME!
Returns:
DOCUMENT ME!

isDifferentiable

public boolean isDifferentiable()
The step function is not differentiable so we override the inherited isDifferentiable method.

Specified by:
isDifferentiable in interface Expression
Overrides:
isDifferentiable in class TernaryOperator
Returns:
DOCUMENT ME!
See Also:
Expression.isDifferentiable()

isExpandable

public boolean isExpandable()
The mod function is not expandable so we override the inherited isExpandable method.

Specified by:
isExpandable in interface Expression
Overrides:
isExpandable in class TernaryOperator
Returns:
DOCUMENT ME!
See Also:
Expression.isExpandable()

equals

public boolean equals(java.lang.Object e)
DOCUMENT ME!

Overrides:
equals in class java.lang.Object
Parameters:
e - DOCUMENT ME!
Returns:
DOCUMENT ME!

toString

public java.lang.String toString()
DOCUMENT ME!

Overrides:
toString in class java.lang.Object
Returns:
DOCUMENT ME!

toJava

public java.lang.String toJava()
DOCUMENT ME!

Returns:
DOCUMENT ME!

optimize

public Expression optimize()
DOCUMENT ME!

Returns:
DOCUMENT ME!

toXML

public java.lang.String toXML()
DOCUMENT ME!

Returns:
DOCUMENT ME!