forked from kscience/kmath
Fix Mean bug
This commit is contained in:
parent
663aaa8b4c
commit
d9f36365d9
@ -50,9 +50,9 @@ public class Mean<T>(
|
|||||||
@Deprecated("Use Long.mean instead")
|
@Deprecated("Use Long.mean instead")
|
||||||
public val long: Mean<Long> = Mean(LongRing) { sum, count -> sum / count }
|
public val long: Mean<Long> = Mean(LongRing) { sum, count -> sum / count }
|
||||||
|
|
||||||
public fun evaluate(buffer: Buffer<Double>): Double = double.evaluateBlocking(buffer)
|
public fun evaluate(buffer: Buffer<Double>): Double = Double.mean.evaluateBlocking(buffer)
|
||||||
public fun evaluate(buffer: Buffer<Int>): Int = int.evaluateBlocking(buffer)
|
public fun evaluate(buffer: Buffer<Int>): Int = Int.mean.evaluateBlocking(buffer)
|
||||||
public fun evaluate(buffer: Buffer<Long>): Long = long.evaluateBlocking(buffer)
|
public fun evaluate(buffer: Buffer<Long>): Long = Long.mean.evaluateBlocking(buffer)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ internal class StatisticTest {
|
|||||||
.take(100) // Take 100 data chunks from the source and accumulate them
|
.take(100) // Take 100 data chunks from the source and accumulate them
|
||||||
.last() //get 1e5 data samples average
|
.last() //get 1e5 data samples average
|
||||||
|
|
||||||
assertEquals(0.5,average, 1e-3)
|
assertEquals(0.5,average, 1e-2)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user