commonMain.dev.inmo.micro_utils.matrix.MatrixFactories.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of micro_utils.matrix Show documentation
Show all versions of micro_utils.matrix Show documentation
It is set of projects with micro tools for avoiding of routines coding
package dev.inmo.micro_utils.matrix
fun matrix(block: MatrixBuilder.() -> Unit): Matrix {
return MatrixBuilder().also(block).matrix
}
fun flatMatrix(block: RowBuilder.() -> Unit): Matrix {
return MatrixBuilder().apply {
row(block)
}.matrix
}
fun flatMatrix(vararg elements: T): Matrix {
return MatrixBuilder().apply {
row { elements.forEach { +it } }
}.matrix
}