diff --git a/kmath-core/src/commonMain/kotlin/scientifik/kmath/structures/LazyStructure.kt b/kmath-core/src/commonMain/kotlin/scientifik/kmath/structures/LazyStructure.kt deleted file mode 100644 index 0428535f9..000000000 --- a/kmath-core/src/commonMain/kotlin/scientifik/kmath/structures/LazyStructure.kt +++ /dev/null @@ -1,20 +0,0 @@ -package scientifik.kmath.structures - -// -//class LazyStructureField(val field: Field): Field>{ -// -//} -// -//class LazyStructure : NDStructure { -// -// override val shape: IntArray -// get() = TODO("not implemented") //To change initializer of created properties use File | Settings | File Templates. -// -// override fun get(index: IntArray): T { -// TODO("not implemented") //To change body of created functions use File | Settings | File Templates. -// } -// -// override fun iterator(): Iterator> { -// TODO("not implemented") //To change body of created functions use File | Settings | File Templates. -// } -//} \ No newline at end of file diff --git a/kmath-coroutines/src/commonMain/kotlin/scientifik/kmath/structures/LazyField.kt b/kmath-coroutines/src/commonMain/kotlin/scientifik/kmath/structures/LazyField.kt deleted file mode 100644 index d534d3eb3..000000000 --- a/kmath-coroutines/src/commonMain/kotlin/scientifik/kmath/structures/LazyField.kt +++ /dev/null @@ -1,7 +0,0 @@ -package scientifik.kmath.structures - -// -//class LazyField: Field { -//} -// -//class LazyValue(): \ No newline at end of file diff --git a/kmath-coroutines/src/commonMain/kotlin/scientifik/kmath/structures/LazyNDField.kt b/kmath-coroutines/src/commonMain/kotlin/scientifik/kmath/structures/LazyNDField.kt index bf823d64b..ad38100cb 100644 --- a/kmath-coroutines/src/commonMain/kotlin/scientifik/kmath/structures/LazyNDField.kt +++ b/kmath-coroutines/src/commonMain/kotlin/scientifik/kmath/structures/LazyNDField.kt @@ -67,10 +67,10 @@ fun > NDElement.lazy(scope: CoroutineScope = GlobalScope): } } -inline fun > LazyNDStructure.transformIndexed(crossinline action: suspend F.(IntArray, T) -> T) = LazyNDStructure(context) { index -> +inline fun > LazyNDStructure.mapIndexed(crossinline action: suspend F.(IntArray, T) -> T) = LazyNDStructure(context) { index -> action.invoke(this, index, await(index)) } -inline fun > LazyNDStructure.transform(crossinline action: suspend F.(T) -> T) = LazyNDStructure(context) { index -> +inline fun > LazyNDStructure.map(crossinline action: suspend F.(T) -> T) = LazyNDStructure(context) { index -> action.invoke(this, await(index)) } \ No newline at end of file diff --git a/kmath-coroutines/src/commonTest/kotlin/scientifik/kmath/structures/LazyNDFieldTest.kt b/kmath-coroutines/src/commonTest/kotlin/scientifik/kmath/structures/LazyNDFieldTest.kt index b5594cbdb..6e712f2a8 100644 --- a/kmath-coroutines/src/commonTest/kotlin/scientifik/kmath/structures/LazyNDFieldTest.kt +++ b/kmath-coroutines/src/commonTest/kotlin/scientifik/kmath/structures/LazyNDFieldTest.kt @@ -9,7 +9,7 @@ class LazyNDFieldTest { @Test fun testLazyStructure() { var counter = 0 - val regularStructure = NDElements.generic(intArrayOf(2, 2, 2), IntField) { it[0] + it[1] - it[2] } + val regularStructure = NDField.generic(intArrayOf(2, 2, 2), IntField).produce { it[0] + it[1] - it[2] } val result = (regularStructure.lazy() + 2).transform { counter++ it * it