net.sourceforge.jabm.util
Class MathUtil

java.lang.Object
  extended by net.sourceforge.jabm.util.MathUtil

public class MathUtil
extends java.lang.Object

Miscalleneous mathematical functions.

 

Field Summary
static double DEFAULT_ERROR
           
 
Constructor Summary
MathUtil()
           
 
Method Summary
static boolean approxEqual(double x, double y)
           
static boolean approxEqual(double x, double y, double error)
          Returns true if the difference between x and y is less than error.
static double diffSq(double x, double y)
          Calculate the squared difference of x and y.
static long factorial(int n)
          Deprecated.  
static double squared(double x)
          Calculate the square of x.
static double sum(double[] series)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_ERROR

public static final double DEFAULT_ERROR
See Also:
Constant Field Values
Constructor Detail

MathUtil

public MathUtil()
Method Detail

squared

public static double squared(double x)
Calculate the square of x.


diffSq

public static double diffSq(double x,
                            double y)
Calculate the squared difference of x and y.


approxEqual

public static boolean approxEqual(double x,
                                  double y,
                                  double error)
Returns true if the difference between x and y is less than error.


approxEqual

public static boolean approxEqual(double x,
                                  double y)

sum

public static double sum(double[] series)

factorial

public static long factorial(int n)
Deprecated. 

Use cern.jet.random.Arithmetic.factorial instead.