ndarrayOf

fun Multik.ndarrayOf(vararg items: Byte): D1Array<Byte>
fun Multik.ndarrayOf(vararg items: Short): D1Array<Short>
fun Multik.ndarrayOf(vararg items: Long): D1Array<Long>
fun Multik.ndarrayOf(vararg items: Float): D1Array<Float>
fun Multik.ndarrayOf(vararg items: Double): D1Array<Double>
fun Multik.ndarrayOf(vararg items: ComplexFloat): D1Array<ComplexFloat>
fun Multik.ndarrayOf(vararg items: ComplexDouble): D1Array<ComplexDouble>

Returns a new 1-dimension array from items.


fun Multik.ndarrayOf(vararg items: Int): D1Array<Int>

Returns a new 1-dimension array from items.

Samples

import org.jetbrains.kotlinx.multik.api.*
import org.jetbrains.kotlinx.multik.ndarray.data.D2
import org.jetbrains.kotlinx.multik.ndarray.data.D3
import org.jetbrains.kotlinx.multik.ndarray.data.DN
import org.jetbrains.kotlinx.multik.ndarray.data.DataType
import kotlin.test.Test
fun main() { 
   //sampleStart 
   val ndarray = mk.ndarrayOf(1, 2, 3)
println(ndarray) // [1, 2, 3] 
   //sampleEnd
}