Add function contracts and perform some refactoring #130

Merged
CommanderTvis merged 4 commits from refactor-and-contracts into dev 2020-08-22 12:57:32 +03:00
3 changed files with 3 additions and 3 deletions
Showing only changes of commit 1b8ddedfe3 - Show all commits

View File

@ -29,4 +29,4 @@ class SamplerSpace<T : Any>(val space: Space<T>) : Space<Sampler<T>> {
override fun multiply(a: Sampler<T>, k: Number): Sampler<T> = BasicSampler { generator -> override fun multiply(a: Sampler<T>, k: Number): Sampler<T> = BasicSampler { generator ->
a.sample(generator).map { space { it * k.toDouble() } } a.sample(generator).map { space { it * k.toDouble() } }
} }
} }

View File

@ -93,4 +93,4 @@ class Median<T>(private val comparator: Comparator<T>) : Statistic<T, T> {
companion object { companion object {
val real: Median<Double> = Median(Comparator { a: Double, b: Double -> a.compareTo(b) }) val real: Median<Double> = Median(Comparator { a: Double, b: Double -> a.compareTo(b) })
} }
} }

View File

@ -17,4 +17,4 @@ inline class ViktorBuffer(val flatArray: F64FlatArray) : MutableBuffer<Double> {
} }
override operator fun iterator(): Iterator<Double> = flatArray.data.iterator() override operator fun iterator(): Iterator<Double> = flatArray.data.iterator()
} }