Copy DerivativeStructure from Commons Math to multiplatform #402

Merged
CommanderTvis merged 8 commits from commandertvis/diff into dev 2022-07-16 10:05:59 +03:00
2 changed files with 4 additions and 4 deletions
Showing only changes of commit bfadf5b33d - Show all commits

View File

@ -439,7 +439,7 @@ public class DSField<T, A : ExtendedField<T>>(
}
@UnstableKMathAPI
public class DerivativeStructureFieldExpression<T, A : ExtendedField<T>>(
public class DSFieldExpression<T, A : ExtendedField<T>>(
public val algebra: A,
public val bufferFactory: MutableBufferFactory<T>,
public val function: DSField<T, A>.() -> DS<T, A>,

View File

@ -30,7 +30,7 @@ internal class AutoDiffTest {
private val y by symbol
@Test
fun derivativeStructureFieldTest() {
fun dsAlgebraTest() {
diff(2, x to 1.0, y to 1.0) {
val x = bindSymbol(x)//by binding()
val y = bindSymbol("y")
@ -44,8 +44,8 @@ internal class AutoDiffTest {
}
@Test
fun autoDifTest() {
val f = DerivativeStructureFieldExpression(DoubleField, ::DoubleBuffer) {
fun dsExpressionTest() {
val f = DSFieldExpression(DoubleField, ::DoubleBuffer) {
val x by binding
val y by binding
x.pow(2) + 2 * x * y + y.pow(2) + 1