[orx-gradient-descent] convert to MPP
This commit is contained in:
14
orx-gradient-descent/src/jvmTest/kotlin/TestMinimize.kt
Normal file
14
orx-gradient-descent/src/jvmTest/kotlin/TestMinimize.kt
Normal file
@@ -0,0 +1,14 @@
|
||||
import org.openrndr.extra.gradientdescent.minimize
|
||||
import org.spekframework.spek2.Spek
|
||||
import org.spekframework.spek2.style.specification.describe
|
||||
|
||||
object TestMinimize : Spek({
|
||||
describe("a simple 1d function") {
|
||||
fun parabola(x: DoubleArray): Double {
|
||||
return (x[0]+1) * (x[0]+1)
|
||||
}
|
||||
it("it can be minimized") {
|
||||
val result = minimize(doubleArrayOf(10.0), f = ::parabola)
|
||||
}
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user