Package org.djutils.means
Class HarmonicMean<V extends Number,W extends Number>
- java.lang.Object
-
- org.djutils.means.AbstractMean<HarmonicMean<V,W>,V,W>
-
- org.djutils.means.HarmonicMean<V,W>
-
- Type Parameters:
V
- value typeW
- weight type
public class HarmonicMean<V extends Number,W extends Number> extends AbstractMean<HarmonicMean<V,W>,V,W>
Compute the harmonic (weighted) mean of a set of values.Copyright (c) 2013-2021 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See DJUTILS License.- Version:
- $Revision$, $LastChangedDate$, by $Author$, initial version Oct 26, 2018
- Author:
- Alexander Verbraeck, Peter Knoppers
-
-
Constructor Summary
Constructors Constructor Description HarmonicMean()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HarmonicMean<V,W>
addImpl(V value, Number weight)
Adds a value with weight.double
getMean()
Returns the weighted mean of accumulated data.String
toString()
-
-
-
Method Detail
-
getMean
public final double getMean()
Returns the weighted mean of accumulated data.
-
addImpl
public final HarmonicMean<V,W> addImpl(V value, Number weight)
Adds a value with weight.
-
-