iglu.util
Class NumberUtils

java.lang.Object
  |
  +--iglu.util.NumberUtils

public class NumberUtils
extends java.lang.Object

A collection of useful numerical utilities.


Constructor Summary
NumberUtils()
          prevent instantiation
 
Method Summary
static double[] convert(java.lang.Double[] values)
          convert from array of Doubles to array of doubles
static double distance(int x1, int y1, int x2, int y2)
          returns the distance between these points.
static int max(double[] nums)
          Returns the index of the greatest value
static int max(int[] nums)
          Returns the index of the greatest value
static double mean(double[] values)
          computes the mean
static double round(double num, int n)
          Round doubles to n decimal points
static double stdDev(double[] values)
          computes the standard deviation
static double stdDev(java.lang.Double[] values)
          computes the standard deviation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NumberUtils

public NumberUtils()
prevent instantiation

Method Detail

round

public static double round(double num,
                           int n)
Round doubles to n decimal points


max

public static int max(double[] nums)
Returns the index of the greatest value


max

public static int max(int[] nums)
Returns the index of the greatest value


distance

public static double distance(int x1,
                              int y1,
                              int x2,
                              int y2)
returns the distance between these points.


convert

public static double[] convert(java.lang.Double[] values)
convert from array of Doubles to array of doubles


mean

public static double mean(double[] values)
computes the mean


stdDev

public static double stdDev(java.lang.Double[] values)
computes the standard deviation


stdDev

public static double stdDev(double[] values)
computes the standard deviation