From 5fa4d40f415e95303f17b7af34850eeeb0508602 Mon Sep 17 00:00:00 2001 From: Alexander Nozik Date: Wed, 28 Oct 2020 09:25:37 +0300 Subject: [PATCH] Remove Differentiable --- .../kmath/expressions/DifferentiableExpression.kt | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) 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))