From f7d159bc036d2fa2496906e612db67fa6ce42e06 Mon Sep 17 00:00:00 2001 From: Gleb Minaev <43728100+lounres@users.noreply.github.com> Date: Tue, 12 Jul 2022 02:05:29 +0300 Subject: [PATCH] Made IntModulo implement ScaleOperations. --- .../space/kscience/kmath/functions/testUtils/IntModulo.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test-utils-functions/src/commonMain/kotlin/space/kscience/kmath/functions/testUtils/IntModulo.kt b/test-utils-functions/src/commonMain/kotlin/space/kscience/kmath/functions/testUtils/IntModulo.kt index 933c4dc4c..21095d858 100644 --- a/test-utils-functions/src/commonMain/kotlin/space/kscience/kmath/functions/testUtils/IntModulo.kt +++ b/test-utils-functions/src/commonMain/kotlin/space/kscience/kmath/functions/testUtils/IntModulo.kt @@ -8,6 +8,7 @@ package space.kscience.kmath.functions.testUtils import space.kscience.kmath.operations.Ring +import space.kscience.kmath.operations.ScaleOperations public class IntModulo { @@ -108,7 +109,7 @@ public class IntModulo { } @Suppress("EXTENSION_SHADOWED_BY_MEMBER", "OVERRIDE_BY_INLINE") -public class IntModuloRing : Ring { +public class IntModuloRing : Ring, ScaleOperations { public val modulus: Int @@ -130,4 +131,6 @@ public class IntModuloRing : Ring { override inline fun IntModulo.minus(arg: IntModulo): IntModulo = this - arg override inline fun IntModulo.times(arg: IntModulo): IntModulo = this * arg public inline fun IntModulo.div(arg: IntModulo): IntModulo = this / arg + + override fun scale(a: IntModulo, value: Double): IntModulo = a * value.toInt() } \ No newline at end of file