api / koma.ndarray / NumericalNDArray
NumericalNDArray
interface ~~NumericalNDArray~~<T> :
NDArray
<
T
>
Deprecated: Use NDArray<Double> and the math extensions instead of NumericalNDArray
An NDArray that holds a numerical type, such that math operations are available.
Inherited Properties
Name | Summary |
---|---|
size | open val size: Int |
Functions
Name | Summary |
---|---|
div | abstract operator fun div(other: T ): NumericalNDArray < T > |
minus | abstract operator fun minus(other: T ): NumericalNDArray < T > abstract operator fun minus(other: NDArray < T >): NumericalNDArray < T > |
plus | abstract operator fun plus(other: T ): NumericalNDArray < T > abstract operator fun plus(other: NDArray < T >): NumericalNDArray < T > |
pow | abstract infix fun pow(exponent: Int ): NumericalNDArray < T > |
times | abstract operator fun times(other: NDArray < T >): NumericalNDArray < T > abstract operator fun times(other: T ): NumericalNDArray < T > |
unaryMinus | abstract operator fun unaryMinus(): NumericalNDArray < T > |
Inherited Functions
Name | Summary |
---|---|
copy | abstract fun copy(): NDArray < T > |
getBaseArray | abstract fun getBaseArray(): Any |
getByte | open fun getByte(vararg indices: Int ): Byte open fun getByte(i: Int ): Byte |
getDouble | open fun getDouble(vararg indices: Int ): Double open fun getDouble(i: Int ): Double |
getFloat | open fun getFloat(vararg indices: Int ): Float open fun getFloat(i: Int ): Float |
getGeneric | open fun getGeneric(vararg indices: Int ): T abstract fun getGeneric(i: Int ): T |
getInt | open fun getInt(vararg indices: Int ): Int open fun getInt(i: Int ): Int |
getLinear | open fun ~~getLinear~~(index: Int ): T |
getLong | open fun getLong(vararg indices: Int ): Long open fun getLong(i: Int ): Long |
getShort | open fun getShort(vararg indices: Int ): Short open fun getShort(i: Int ): Short |
iterateIndices | open fun iterateIndices(): Iterable < IndexIterator > |
setByte | open fun setByte(vararg indices: Int , v: Byte ): Unit open fun setByte(i: Int , v: Byte ): Unit |
setDouble | open fun setDouble(vararg indices: Int , v: Double ): Unit open fun setDouble(i: Int , v: Double ): Unit |
setFloat | open fun setFloat(vararg indices: Int , v: Float ): Unit open fun setFloat(i: Int , v: Float ): Unit |
setGeneric | open fun setGeneric(vararg indices: Int , v: T ): Unit abstract fun setGeneric(i: Int , v: T ): Unit |
setInt | open fun setInt(vararg indices: Int , v: Int ): Unit open fun setInt(i: Int , v: Int ): Unit |
setLinear | open fun ~~setLinear~~(index: Int , value: T ): Unit |
setLong | open fun setLong(vararg indices: Int , v: Long ): Unit open fun setLong(i: Int , v: Long ): Unit |
setShort | open fun setShort(vararg indices: Int , v: Short ): Unit open fun setShort(i: Int , v: Short ): Unit |
shape | abstract fun shape(): List < Int > |
toIterable | open fun toIterable(): Iterable < T > |
toList | open fun toList(): List < T > Converts this NDArray into a one-dimensional List in row-major order. |
toMutableList | open fun toMutableList(): MutableList < T > Converts this NDArray into a one-dimensional MutableList in row-major order. |
Extension Functions
Name | Summary |
---|---|
checkIndices | fun <T> NDArray < T >.checkIndices(indices: IntArray ): IntArray |
checkLinearIndex | fun <T> NDArray < T >.checkLinearIndex(index: Int ): Int |
fill | fun <T> NDArray < T >.fill(f: (idx: IntArray ) -> T ): NDArray < T > |
fillBoth | fun <T> NDArray < T >.fillBoth(f: (nd: IntArray , linear: Int ) -> T ): NDArray < T > |
fillLinear | fun <T> NDArray < T >.fillLinear(f: (idx: Int ) -> T ): NDArray < T > |
forEach | fun <T> NDArray < T >.forEach(f: (ele: T ) -> Unit ): Unit Takes each element in a NDArray and passes them through f. |
forEachIndexed | fun <T> NDArray < T >.forEachIndexed(f: (idx: Int , ele: T ) -> Unit ): Unit Takes each element in a NDArray and passes them through f. Index given to f is a linear index, depending on the underlying storage major dimension. |
forEachIndexedN | fun <T> NDArray < T >.forEachIndexedN(f: (idx: IntArray , ele: T ) -> Unit ): Unit Takes each element in a NDArray and passes them through f. Index given to f is the full ND index of the element. |
get | operator fun <T> NDArray < T >.get(vararg indices: IntRange ): NDArray < T > operator fun <T> NDArray < T >.get(vararg indices: Int ): T |
linearToNIdx | fun <T> NDArray < T >.linearToNIdx(linear: Int ): IntArray Given the 1D index of an element in the underlying storage, find the corresponding ND index. Inverse of nIdxToLinear. |
map | fun <T> NDArray < T >.map(f: ( T ) -> T ): DefaultGenericNDArray < T > Takes each element in a NDArray, passes them through f, and puts the output of f into an output NDArray. |
mapIndexed | fun <T> NDArray < T >.mapIndexed(f: (idx: Int , ele: T ) -> T ): DefaultGenericNDArray < T > Takes each element in a NDArray, passes them through f, and puts the output of f into an output NDArray. Index given to f is a linear index, depending on the underlying storage major dimension. |
mapIndexedN | fun <T> NDArray < T >.mapIndexedN(f: (idx: IntArray , ele: T ) -> T ): NDArray < T > Takes each element in a NDArray, passes them through f, and puts the output of f into an output NDArray. Index given to f is the full ND index of the element. |
nIdxToLinear | fun <T> NDArray < T >.nIdxToLinear(indices: IntArray ): Int Given a ND index into this array, find the corresponding 1D index in the raw underlying 1D storage array. |
reshape | fun <T> NDArray < T >.reshape(vararg dims: Int ): NDArray < T > Returns a new NDArray with the given shape, populated with the data in this array. |
safeNIdxToLinear | fun <T> NDArray < T >.safeNIdxToLinear(indices: IntArray ): Int |
set | operator fun <T> NDArray < T >.set(vararg indices: Int , value: NDArray < T >): Unit operator fun <T> NDArray < T >.set(vararg indices: Int , value: T ): Unit |
toMatrixOrNull | fun <T> NDArray < T >.toMatrixOrNull(): Matrix < T >? |
toTypedArray | fun <T> NDArray < T >.toTypedArray(): Array < T > Converts this NDArray into a one-dimensional Array in row-major order. |
widthOfDims | fun <T> NDArray < T >.widthOfDims(): ArrayList < Int > |