RBNutilities
Class SmallDouble

java.lang.Object
  extended by RBNutilities.SmallDouble
All Implemented Interfaces:
java.util.Comparator

public class SmallDouble
extends java.lang.Object
implements java.util.Comparator

Provides static methods for handling very small double values d represented as pairs d[0],d[1]. The value of d is equal to d[0]*1E-d[1]


Constructor Summary
SmallDouble()
           
 
Method Summary
static double[] add(double[] sd1, double[] sd2)
           
 int compare(java.lang.Object sd1, java.lang.Object sd2)
           
static int compareSD(java.lang.Object sd1, java.lang.Object sd2)
           
static double[] divide(double[] sd1, double d2)
           
static double[] divide(double[] sd1, double[] sd2)
          computes sd1/sd2
static double[] divide(double[] sd1, int i2)
           
static double[] multiply(double[] sd1, double d2)
           
static double[] multiply(double[] sd1, double[] sd2)
           
static double nthRoot(double[] sd, double n)
           
static double[] subtract(double[] sd1, double[] sd2)
           
static double toStandardDouble(double[] sd)
           
static double[] toStandardDoubleArray(double[][] sdarr)
          Takes an array sdarr of SmallDoubles and returns an array of doubles representing a scaled version of the vector represented by sdarr Example: sdarr= (1.2E-4,20.0) (4.3E-7,40.0) (6.4E-2,140.0) return toStandardDouble(1.2E-4,0)=1.2E-4 toStandardDouble(4.3E-7,20.0)=4.3E-27 toStandardDouble(6.4E-2,120)=0
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

SmallDouble

public SmallDouble()
Method Detail

add

public static double[] add(double[] sd1,
                           double[] sd2)

multiply

public static double[] multiply(double[] sd1,
                                double[] sd2)

multiply

public static double[] multiply(double[] sd1,
                                double d2)

divide

public static double[] divide(double[] sd1,
                              double[] sd2)
computes sd1/sd2


divide

public static double[] divide(double[] sd1,
                              double d2)

divide

public static double[] divide(double[] sd1,
                              int i2)

subtract

public static double[] subtract(double[] sd1,
                                double[] sd2)

toStandardDouble

public static double toStandardDouble(double[] sd)

compareSD

public static int compareSD(java.lang.Object sd1,
                            java.lang.Object sd2)

compare

public int compare(java.lang.Object sd1,
                   java.lang.Object sd2)
Specified by:
compare in interface java.util.Comparator

nthRoot

public static double nthRoot(double[] sd,
                             double n)

toStandardDoubleArray

public static double[] toStandardDoubleArray(double[][] sdarr)
Takes an array sdarr of SmallDoubles and returns an array of doubles representing a scaled version of the vector represented by sdarr Example: sdarr= (1.2E-4,20.0) (4.3E-7,40.0) (6.4E-2,140.0) return toStandardDouble(1.2E-4,0)=1.2E-4 toStandardDouble(4.3E-7,20.0)=4.3E-27 toStandardDouble(6.4E-2,120)=0

Parameters:
sdarr -
Returns: