uk.ac.essex.common.util
Class MathFunctions

java.lang.Object
  extended by uk.ac.essex.common.util.MathFunctions

public final class MathFunctions
extends java.lang.Object

A final class with some mathmatical functions as static methods


Constructor Summary
MathFunctions()
           
 
Method Summary
static void main(java.lang.String[] argStrings)
           
static float[] normalize(float[] data)
          Normalizes an array of floats ie/ makes a resulting array whose elements sum up to 1.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MathFunctions

public MathFunctions()
Method Detail

normalize

public static float[] normalize(float[] data)
Normalizes an array of floats ie/ makes a resulting array whose elements sum up to 1. This appoximates the function and will round up the last entry (so the sum==1) to remove rounding errors.

Parameters:
data - - The array to noramalize
Returns:
the sum of the entries in the array

main

public static void main(java.lang.String[] argStrings)
Parameters:
argStrings -