diff --git a/build.gradle b/build.gradle index 5a19080..7f1a650 100644 --- a/build.gradle +++ b/build.gradle @@ -1,8 +1,8 @@ group 'com.github.sanity' -version '1.4.7' +version '1.4.8' buildscript { - ext.kotlin_version = '1.1.50' + ext.kotlin_version = '1.1.60' ext.dokka_version = '0.9.9' repositories { diff --git a/src/main/kotlin/com/github/sanity/pav/PairAdjacentViolators.kt b/src/main/kotlin/com/github/sanity/pav/PairAdjacentViolators.kt index 68ecd6f..cd521ec 100644 --- a/src/main/kotlin/com/github/sanity/pav/PairAdjacentViolators.kt +++ b/src/main/kotlin/com/github/sanity/pav/PairAdjacentViolators.kt @@ -63,8 +63,11 @@ class PairAdjacentViolators @JvmOverloads constructor(originalPoints: Iterable

isotonicPoints.first().y } } else { when (strategy) { - SPLINE -> return { - MonotoneSpline(isotonicPoints).interpolate(it, extrapolation) + SPLINE -> { + val spline = MonotoneSpline(isotonicPoints) + return { + spline.interpolate(it, extrapolation) + } } } } @@ -75,9 +78,11 @@ class PairAdjacentViolators @JvmOverloads constructor(originalPoints: Iterable

isotonicPoints.first().x } } else { when (strategy) { - SPLINE -> return { + SPLINE -> { val spline = MonotoneSpline(isotonicPoints.map { Point(it.y, it.x) }) - spline.interpolate(it, extrapolation) + return { + spline.interpolate(it, extrapolation) + } } } }