kylm.util
Class KylmMathUtils

java.lang.Object
  extended by kylm.util.KylmMathUtils

public class KylmMathUtils
extends java.lang.Object

A collection of functions that handle functions regarding mathematics.

Author:
neubig

Constructor Summary
KylmMathUtils()
           
 
Method Summary
static float logAddition(float a, float b)
          Add two values (probabilities) that are in log format
static float sum(float[] arr)
          return the sum of a float array
static int sum(int[] arr)
          return the sum of an int array
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KylmMathUtils

public KylmMathUtils()
Method Detail

sum

public static final float sum(float[] arr)
return the sum of a float array

Parameters:
arr - the array
Returns:
the sum

sum

public static final int sum(int[] arr)
return the sum of an int array

Parameters:
arr - the array
Returns:
the sum

logAddition

public static final float logAddition(float a,
                                      float b)
Add two values (probabilities) that are in log format

Parameters:
a - The first value
b - The second value
Returns:
The sum of a and b