diff --git a/kmath-ast/src/commonMain/kotlin/space/kscience/kmath/ast/MstAlgebra.kt b/kmath-ast/src/commonMain/kotlin/space/kscience/kmath/ast/MstAlgebra.kt index a65027147..16fdfbeac 100644 --- a/kmath-ast/src/commonMain/kotlin/space/kscience/kmath/ast/MstAlgebra.kt +++ b/kmath-ast/src/commonMain/kotlin/space/kscience/kmath/ast/MstAlgebra.kt @@ -50,7 +50,7 @@ public object MstGroup : Group, NumericAlgebra, ScaleOperations { */ @OptIn(UnstableKMathAPI::class) public object MstRing : Ring, NumbersAddOperations, ScaleOperations { - public override val zero: MST.Numeric = MstGroup.zero + public override val zero: MST.Numeric get() = MstGroup.zero public override val one: MST.Numeric = number(1.0) public override fun number(value: Number): MST.Numeric = MstGroup.number(value) @@ -109,8 +109,8 @@ public object MstField : Field, NumbersAddOperations, ScaleOperations< * [ExtendedField] over [MST] nodes. */ public object MstExtendedField : ExtendedField, NumericAlgebra { - public override val zero: MST.Numeric = MstField.zero - public override val one: MST.Numeric = MstField.one + public override val zero: MST.Numeric get() = MstField.zero + public override val one: MST.Numeric get() = MstField.one public override fun bindSymbol(value: String): MST.Symbolic = MstField.bindSymbol(value) public override fun number(value: Number): MST.Numeric = MstRing.number(value) diff --git a/kmath-viktor/src/main/kotlin/space/kscience/kmath/viktor/ViktorNDStructure.kt b/kmath-viktor/src/main/kotlin/space/kscience/kmath/viktor/ViktorNDStructure.kt index f5697cea2..d791ed675 100644 --- a/kmath-viktor/src/main/kotlin/space/kscience/kmath/viktor/ViktorNDStructure.kt +++ b/kmath-viktor/src/main/kotlin/space/kscience/kmath/viktor/ViktorNDStructure.kt @@ -40,11 +40,9 @@ public class ViktorNDField(public override val shape: IntArray) : NDField produce { this@f64Buffer[it] }.f64Buffer } - public override val zero: ViktorNDStructure - get() = F64Array.full(init = 0.0, shape = shape).asStructure() + public override val zero: ViktorNDStructure by lazy { F64Array.full(init = 0.0, shape = shape).asStructure() } - public override val one: ViktorNDStructure - get() = F64Array.full(init = 1.0, shape = shape).asStructure() + public override val one: ViktorNDStructure by lazy { F64Array.full(init = 1.0, shape = shape).asStructure() } private val strides: Strides = DefaultStrides(shape)