diff --git a/examples/src/main/kotlin/kscience/kmath/structures/ParallelRealNDField.kt b/examples/src/main/kotlin/kscience/kmath/structures/ParallelRealNDField.kt index bce625f7f..e13f5dd47 100644 --- a/examples/src/main/kotlin/kscience/kmath/structures/ParallelRealNDField.kt +++ b/examples/src/main/kotlin/kscience/kmath/structures/ParallelRealNDField.kt @@ -12,12 +12,14 @@ import java.util.stream.IntStream * A demonstration implementation of NDField over Real using Java [DoubleStream] for parallel execution */ @OptIn(UnstableKMathAPI::class) -public class StreamRealNDField( - shape: IntArray, -) : BufferedNDField(shape, RealField, Buffer.Companion::real), +class StreamRealNDField( + override val shape: IntArray, +) : NDField, RingWithNumbers>, ExtendedField> { + private val strides = DefaultStrides(shape) + override val elementContext: RealField get() = RealField override val zero: NDBuffer by lazy { produce { zero } } override val one: NDBuffer by lazy { produce { one } } @@ -26,7 +28,7 @@ public class StreamRealNDField( return produce { d } } - override val NDStructure.buffer: RealBuffer + private val NDStructure.buffer: RealBuffer get() = when { !shape.contentEquals(this@StreamRealNDField.shape) -> throw ShapeMismatchException( this@StreamRealNDField.shape,