diff --git a/kmath-core/src/commonMain/kotlin/kscience/kmath/expressions/DifferentiableExpression.kt b/kmath-core/src/commonMain/kotlin/kscience/kmath/expressions/DifferentiableExpression.kt index 705839b57..4fe73f283 100644 --- a/kmath-core/src/commonMain/kotlin/kscience/kmath/expressions/DifferentiableExpression.kt +++ b/kmath-core/src/commonMain/kotlin/kscience/kmath/expressions/DifferentiableExpression.kt @@ -1,20 +1,15 @@ package kscience.kmath.expressions /** - * And object that could be differentiated + * An expression that provides derivatives */ -public interface Differentiable { - public fun derivativeOrNull(orders: Map): T? +public interface DifferentiableExpression : Expression{ + public fun derivativeOrNull(orders: Map): Expression? } -public fun Differentiable.derivative(orders: Map): T = +public fun DifferentiableExpression.derivative(orders: Map): Expression = derivativeOrNull(orders) ?: error("Derivative with orders $orders not provided") -/** - * An expression that provid - */ -public interface DifferentiableExpression : Differentiable>, Expression - public fun DifferentiableExpression.derivative(vararg orders: Pair): Expression = derivative(mapOf(*orders))