Fix function visibility for unit tests

This commit is contained in:
edwin
2019-11-04 13:55:48 +01:00
parent 7399f76eb5
commit ea28226825
2 changed files with 3 additions and 3 deletions

View File

@@ -89,9 +89,9 @@ private fun norm2(x: DoubleArray): Double {
return sqrt(x.sumByDouble { it * it })
}
private fun dot(x: DoubleArray, y: DoubleArray): Double = (x.mapIndexed { index, it -> it * y[index] }).sum()
internal fun dot(x: DoubleArray, y: DoubleArray): Double = (x.mapIndexed { index, it -> it * y[index] }).sum()
private fun dot(x: Array<DoubleArray>, y: DoubleArray): DoubleArray = DoubleArray(x.size) { dot(x[it], y) }
internal fun dot(x: Array<DoubleArray>, y: DoubleArray): DoubleArray = DoubleArray(x.size) { dot(x[it], y) }
class MinimizationResult(val solution: DoubleArray, val value: Double, val gradient: DoubleArray,
val inverseHessian: Array<DoubleArray>, val iterations: Int)

View File

@@ -1,5 +1,5 @@
package org.openrndr.extra.gradientdescent
import org.amshove.kluent.`should be equal to`
import org.openrndr.extra.gradientdescent.dot
import org.spekframework.spek2.Spek
import org.spekframework.spek2.style.specification.describe