diff --git a/README.md b/README.md index 5678fc530..0df279889 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,8 @@ can be used for a wide variety of purposes from high performance calculations to * **Streaming** Streaming operations on mathematical objects and objects buffers. +* **Type-safe dimensions** Type-safe dimensions for matrix operations. + * **Commons-math wrapper** It is planned to gradually wrap most parts of [Apache commons-math](http://commons.apache.org/proper/commons-math/) library in Kotlin code and maybe rewrite some parts to better suit the Kotlin programming paradigm, however there is no fixed roadmap for that. Feel free to submit a feature request if you want something to be done first. diff --git a/examples/src/main/kotlin/scientifik/kmath/structures/typeSafeDimensions.kt b/examples/src/main/kotlin/scientifik/kmath/structures/typeSafeDimensions.kt index 8693308ca..9169c7d7b 100644 --- a/examples/src/main/kotlin/scientifik/kmath/structures/typeSafeDimensions.kt +++ b/examples/src/main/kotlin/scientifik/kmath/structures/typeSafeDimensions.kt @@ -14,14 +14,14 @@ fun DMatrixContext.simple() { m1.transpose() + m2 } -object D5: Dimension{ +object D5 : Dimension { override val dim: UInt = 5u } fun DMatrixContext.custom() { - val m1 = produce { i, j -> (i+j).toDouble() } - val m2 = produce { i, j -> (i-j).toDouble() } - val m3 = produce { i, j -> (i-j).toDouble() } + val m1 = produce { i, j -> (i + j).toDouble() } + val m2 = produce { i, j -> (i - j).toDouble() } + val m3 = produce { i, j -> (i - j).toDouble() } (m1 dot m2) + m3 }