From 7399f76eb526c5abafb3f8cafb947de7da7e3c43 Mon Sep 17 00:00:00 2001 From: edwin Date: Mon, 4 Nov 2019 10:40:29 +0100 Subject: [PATCH] Reduce public api of orx-gradient-descent --- orx-gradient-descent/src/main/kotlin/GradientDescent.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/orx-gradient-descent/src/main/kotlin/GradientDescent.kt b/orx-gradient-descent/src/main/kotlin/GradientDescent.kt index a1b325be..f4bbf713 100644 --- a/orx-gradient-descent/src/main/kotlin/GradientDescent.kt +++ b/orx-gradient-descent/src/main/kotlin/GradientDescent.kt @@ -89,9 +89,9 @@ private fun norm2(x: DoubleArray): Double { return sqrt(x.sumByDouble { it * it }) } -fun dot(x: DoubleArray, y: DoubleArray): Double = (x.mapIndexed { index, it -> it * y[index] }).sum() +private fun dot(x: DoubleArray, y: DoubleArray): Double = (x.mapIndexed { index, it -> it * y[index] }).sum() -fun dot(x: Array, y: DoubleArray): DoubleArray = DoubleArray(x.size) { dot(x[it], y) } +private fun dot(x: Array, y: DoubleArray): DoubleArray = DoubleArray(x.size) { dot(x[it], y) } class MinimizationResult(val solution: DoubleArray, val value: Double, val gradient: DoubleArray, val inverseHessian: Array, val iterations: Int)