Package org.carrot2.math
Class MathUtils
java.lang.Object
org.carrot2.math.MathUtils
public final class MathUtils extends Object
Some simple mathematical computation utility methods.
-
Method Summary
Modifier and Type Method Description static doublearithmeticMean(double v1, double v2, double w1, double w2)Returns the arithmetic mean ofv1andv2, weighting them byw1andw2, respectively.static doubleharmonicMean(double v1, double v2)Returns the harmonic mean ofv1andv2, giving both arguments equal weight.static doubleharmonicMean(double v1, double v2, double w1, double w2)Returns the harmonic mean ofv1andv2, weighting them byw1andw2, respectively.
-
Method Details
-
harmonicMean
public static double harmonicMean(double v1, double v2)Returns the harmonic mean ofv1andv2, giving both arguments equal weight. -
harmonicMean
public static double harmonicMean(double v1, double v2, double w1, double w2)Returns the harmonic mean ofv1andv2, weighting them byw1andw2, respectively. -
arithmeticMean
public static double arithmeticMean(double v1, double v2, double w1, double w2)Returns the arithmetic mean ofv1andv2, weighting them byw1andw2, respectively.
-