Package org.jetbrains.kotlinx.multik.ndarray.operations

Types

Link copied to clipboard
class Abs<T : Number> : Exp<T>
Link copied to clipboard
interface Arith
Link copied to clipboard
class Ceil<T : Number> : Exp<T>
Link copied to clipboard
enum CopyStrategy : Enum<CopyStrategy>
Link copied to clipboard
class Cos<T : Number> : Exp<T>
Link copied to clipboard
class Div<T, D : Dimension>(right: MultiArray<T, D>) : Exp<T> , Arith
Link copied to clipboard
sealed class Exp<T>
Link copied to clipboard
sealed class Inplace<T : Number, D : Dimension>(val base: MutableMultiArray<T, D>)
Link copied to clipboard
annotation class InplaceDslMarker
Link copied to clipboard
class InplaceMath<T : Number, D : Dimension>(base: MutableMultiArray<T, D>) : InplaceOperation<T, D>
Link copied to clipboard
open class InplaceOperation<T : Number, D : Dimension>(base: MutableMultiArray<T, D>) : Inplace<T, D>
Link copied to clipboard
class Log<T : Number> : Exp<T>
Link copied to clipboard
class Prod<T, D : Dimension>(right: MultiArray<T, D>) : Exp<T> , Arith
Link copied to clipboard
class Sin<T : Number> : Exp<T>
Link copied to clipboard
class Sub<T, D : Dimension>(right: MultiArray<T, D>) : Exp<T> , Arith
Link copied to clipboard
class Sum<T, D : Dimension>(right: MultiArray<T, D>) : Exp<T> , Arith
Link copied to clipboard
class Tan<T : Number> : Exp<T>

Functions

Link copied to clipboard
@JvmName(name = "inplaceAbsDouble")
fun <D : Dimension> InplaceMath<Double, D>.abs(): InplaceMath<Double, D>
@JvmName(name = "inplaceAbsFloat")
fun <D : Dimension> InplaceMath<Float, D>.abs(): InplaceMath<Float, D>
@JvmName(name = "inplaceAbsInt")
fun <D : Dimension> InplaceMath<Int, D>.abs(): InplaceMath<Int, D>
@JvmName(name = "inplaceAbsLong")
fun <D : Dimension> InplaceMath<Long, D>.abs(): InplaceMath<Long, D>
Link copied to clipboard
inline fun <T, D : Dimension> MultiArray<T, D>.all(predicate: (T) -> Boolean): Boolean

Returns true if all elements match the given predicate. If an ndarray is empty, then always returns true.

Link copied to clipboard
infix fun <T : Number, D : Dimension> MultiArray<T, D>.and(other: MultiArray<T, D>): NDArray<Int, D>
Link copied to clipboard
fun <T, D : Dimension> MultiArray<T, D>.any(): Boolean

Returns true if collection has at least one element.

inline fun <T, D : Dimension> MultiArray<T, D>.any(predicate: (T) -> Boolean): Boolean

Returns true if at least one element matches the given predicate. If an ndarray is empty, then always returns false.

Link copied to clipboard
fun <T, D : Dimension> MultiArray<T, D>.append(vararg value: T): D1Array<T>
infix fun <T, D : Dimension, ID : Dimension> MultiArray<T, D>.append(arr: MultiArray<T, ID>): D1Array<T>
fun <T, D : Dimension> MultiArray<T, D>.append(arr: MultiArray<T, D>, axis: Int): NDArray<T, D>
Link copied to clipboard
fun <T, D : Dimension> MultiArray<T, D>.asSequence(): Sequence<T>

Creates a Sequence instance that wraps the original collection returning its elements when being iterated.

Link copied to clipboard
inline fun <T, D : Dimension, K, V> MultiArray<T, D>.associate(transform: (T) -> Pair<K, V>): Map<K, V>

Returns a Map containing key-value pairs provided by transform function applied to elements of the given collection.

Link copied to clipboard
inline fun <T, D : Dimension, K> MultiArray<T, D>.associateBy(keySelector: (T) -> K): Map<K, T>

Returns a Map containing the elements from the given collection indexed by the key returned from keySelector function applied to each element.

inline fun <T, D : Dimension, K, V> MultiArray<T, D>.associateBy(keySelector: (T) -> K, valueTransform: (T) -> V): Map<K, V>

Returns a Map containing the values provided by valueTransform and indexed by keySelector functions applied to elements of the given collection.

Link copied to clipboard
inline fun <T, D : Dimension, K, M : MutableMap<in K, in T>> MultiArray<T, D>.associateByTo(destination: M, keySelector: (T) -> K): M

Populates and returns the destination mutable map with key-value pairs, where key is provided by the keySelector function applied to each element of the given collection and value is the element itself.

inline fun <T, D : Dimension, K, V, M : MutableMap<in K, in V>> MultiArray<T, D>.associateByTo(    destination: M,     keySelector: (T) -> K,     valueTransform: (T) -> V): M

Populates and returns the destination mutable map with key-value pairs, where key is provided by the keySelector function and and value is provided by the valueTransform function applied to elements of the given collection.

Link copied to clipboard
inline fun <T, D : Dimension, K, V, M : MutableMap<in K, in V>> MultiArray<T, D>.associateTo(destination: M, transform: (T) -> Pair<K, V>): M

Populates and returns the destination mutable map with key-value pairs provided by transform function applied to each element of the given collection.

Link copied to clipboard
inline fun <K, D : Dimension, V> MultiArray<K, D>.associateWith(valueSelector: (K) -> V): Map<K, V>

Returns a Map where keys are elements from the given collection and values are produced by the valueSelector function applied to each element.

Link copied to clipboard
inline fun <K, D : Dimension, V, M : MutableMap<in K, in V>> MultiArray<K, D>.associateWithTo(destination: M, valueSelector: (K) -> V): M

Populates and returns the destination mutable map with key-value pairs for each element of the given collection, where key is the element itself and value is provided by the valueSelector function applied to that key.

Link copied to clipboard
fun <T : Number, D : Dimension> MultiArray<T, D>.average(): Double

Returns an average value of elements in the ndarray.

Link copied to clipboard
@JvmName(name = "inplaceCeilDouble")
fun <D : Dimension> InplaceMath<Double, D>.ceil(): InplaceMath<Double, D>
@JvmName(name = "inplaceCeilFloat")
fun <D : Dimension> InplaceMath<Float, D>.ceil(): InplaceMath<Float, D>
Link copied to clipboard
fun <T, D : Dimension> MultiArray<T, D>.chunked(size: Int): NDArray<T, D2>

Splits this ndarray into a 2-D ndarray. The last elements in the resulting ndarray may be zero.

Link copied to clipboard
fun <T : Comparable<T>, Number, D : Dimension> MultiArray<T, D>.clip(min: T, max: T): NDArray<T, D>

Clips the values in ndarray if value is not in range min..max

Link copied to clipboard
operator fun <T, D : Dimension> MultiArray<T, D>.contains(element: T): Boolean

Returns true if element is found in the collection.

Link copied to clipboard
@JvmName(name = "inplaceCosDouble")
fun <D : Dimension> InplaceMath<Double, D>.cos(): InplaceMath<Double, D>
@JvmName(name = "inplaceCosFloat")
fun <D : Dimension> InplaceMath<Float, D>.cos(): InplaceMath<Float, D>
Link copied to clipboard
inline fun <T, D : Dimension> MultiArray<T, D>.count(): Int

Returns the number of elements in an ndarray.

inline fun <T, D : Dimension> MultiArray<T, D>.count(predicate: (T) -> Boolean): Int

Returns the number of elements matching the given predicate.

Link copied to clipboard
fun <T, D : Dimension> MultiArray<T, D>.distinct(): NDArray<T, D1>

Returns a new array containing only distinct elements from the given array.

Link copied to clipboard
inline fun <T, D : Dimension, K> MultiArray<T, D>.distinctBy(selector: (T) -> K): NDArray<T, D1>

Returns a new array containing only elements from the given array having distinct keys returned by the given selector function.

Link copied to clipboard
operator fun <D : Dimension> Byte.div(other: MultiArray<Byte, D>): NDArray<Byte, D>
operator fun <D : Dimension> Double.div(other: MultiArray<Double, D>): NDArray<Double, D>
operator fun <D : Dimension> Float.div(other: MultiArray<Float, D>): NDArray<Float, D>
operator fun <D : Dimension> Int.div(other: MultiArray<Int, D>): NDArray<Int, D>
operator fun <D : Dimension> Long.div(other: MultiArray<Long, D>): NDArray<Long, D>
operator fun <D : Dimension> Short.div(other: MultiArray<Short, D>): NDArray<Short, D>
operator fun <D : Dimension> ComplexDouble.div(other: MultiArray<ComplexDouble, D>): NDArray<ComplexDouble, D>
operator fun <D : Dimension> ComplexFloat.div(other: MultiArray<ComplexFloat, D>): NDArray<ComplexFloat, D>
operator fun <T, D : Dimension> MultiArray<T, D>.div(other: T): NDArray<T, D>

operator fun <T, D : Dimension> MultiArray<T, D>.div(other: MultiArray<T, D>): NDArray<T, D>

Create a new array as division of this by other.

Link copied to clipboard
operator fun <T, D : Dimension> MutableMultiArray<T, D>.divAssign(other: T)

Divide by other element-wise. Inplace operator.

operator fun <T, D : Dimension> MutableMultiArray<T, D>.divAssign(other: MultiArray<T, D>)

Divide this by other. Inplace operator.

Link copied to clipboard
fun <T> MultiArray<T, D1>.drop(n: Int): D1Array<T>

Drops first n elements.

Link copied to clipboard
inline fun <T> MultiArray<T, D1>.dropWhile(predicate: (T) -> Boolean): NDArray<T, D1>

Drops elements that don't satisfy the predicate.

Link copied to clipboard
@JvmName(name = "expandDimsD1")
fun <T> MultiArray<T, D1>.expandDims(axis: Int): MultiArray<T, D2>
@JvmName(name = "expandDimsD2")
fun <T> MultiArray<T, D2>.expandDims(axis: Int): MultiArray<T, D3>
@JvmName(name = "expandDimsD3")
fun <T> MultiArray<T, D3>.expandDims(axis: Int): MultiArray<T, D4>
@JvmName(name = "expandDimsD4")
fun <T> MultiArray<T, D4>.expandDims(axis: Int): MultiArray<T, DN>

Returns a ndarray with an expanded shape.

Link copied to clipboard
@JvmName(name = "expandDimsDN")
fun <T, D : Dimension> MultiArray<T, D>.expandNDims(vararg axes: Int): MultiArray<T, DN>

Returns a ndarray with an expanded shape.

Link copied to clipboard
inline fun <T, D : Dimension> MultiArray<T, D>.filter(predicate: (T) -> Boolean): D1Array<T>

Return a new array contains elements matching filter.

Link copied to clipboard
@JvmName(name = "filterD1Indexed")
inline fun <T> MultiArray<T, D1>.filterIndexed(predicate: (index: Int, T) -> Boolean): D1Array<T>

Return a new array contains elements matching filter.

Link copied to clipboard
@JvmName(name = "filterDNIndexed")
inline fun <T, D : Dimension> MultiArray<T, D>.filterMultiIndexed(predicate: (index: IntArray, T) -> Boolean): D1Array<T>

Return a new array contains elements matching filter.

Link copied to clipboard
inline fun <T, D : Dimension> MultiArray<T, D>.filterNot(predicate: (T) -> Boolean): D1Array<T>

Return a new array contains elements matching filter.

Link copied to clipboard
inline fun <T, D : Dimension> MultiArray<T, D>.find(predicate: (T) -> Boolean): T?

Returns the first element matching the given predicate, or null if no such element was found.

Link copied to clipboard
inline fun <T, D : Dimension> MultiArray<T, D>.findLast(predicate: (T) -> Boolean): T?

Returns the last element matching the given predicate, or null if no such element was found.

Link copied to clipboard
fun <T, D : Dimension> MultiArray<T, D>.first(): T

Returns first element.

inline fun <T, D : Dimension> MultiArray<T, D>.first(predicate: (T) -> Boolean): T

Returns the first element matching the given predicate.

Link copied to clipboard
fun <T, D : Dimension> MultiArray<T, D>.firstOrNull(): T?

Returns the first element, or null if the collection is empty.

inline fun <T, D : Dimension> MultiArray<T, D>.firstOrNull(predicate: (T) -> Boolean): T?

Returns the first element matching the given predicate, or null if element was not found.

Link copied to clipboard
inline fun <T, D : Dimension, R> MultiArray<T, D>.flatMap(transform: (T) -> Iterable<R>): D1Array<R>

Returns a flat ndarray of all elements resulting from calling the transform function on each element in this ndarray.

Link copied to clipboard
@JvmName(name = "flatMapD1Indexed")
inline fun <T, R> MultiArray<T, D1>.flatMapIndexed(transform: (index: Int, T) -> Iterable<R>): D1Array<R>

Returns a flat ndarray of all elements resulting from calling the transform function on each element and its single index in this d1 ndarray.

Link copied to clipboard
@JvmName(name = "flatMapDNIndexed")
inline fun <T, R> MultiArray<T, D1>.flatMapMultiIndexed(transform: (index: IntArray, T) -> Iterable<R>): D1Array<R>

Returns a flat ndarray of all elements resulting from calling the transform function on each element and its multi index in this dn ndarray.

Link copied to clipboard
inline fun <T, D : Dimension, R> MultiArray<T, D>.fold(initial: R, operation: (acc: R, T) -> R): R

Accumulates value starting with initial value and applying operation from left to right to current accumulator value and each element.

Link copied to clipboard
@JvmName(name = "foldD1Indexed")
inline fun <T, R> MultiArray<T, D1>.foldIndexed(initial: R, operation: (index: Int, acc: R, T) -> R): R

Accumulates value starting with initial value and applying operation from left to right to current accumulator value and each element with its index in the original ndarray.

Link copied to clipboard
@JvmName(name = "foldDNIndexed")
inline fun <T, D : Dimension, R> MultiArray<T, D>.foldMultiIndexed(initial: R, operation: (index: IntArray, acc: R, T) -> R): R

Accumulates value starting with initial value and applying operation from left to right to current accumulator value and each element with its index in the original ndarray.

Link copied to clipboard
inline fun <T, D : Dimension> MultiArray<T, D>.forEach(action: (T) -> Unit)

Performs the given action on each element.

Link copied to clipboard
@JvmName(name = "forEachD1Indexed")
inline fun <T> MultiArray<T, D1>.forEachIndexed(action: (index: Int, T) -> Unit)

Performs the given action on each element, providing sequential index with the element.

Link copied to clipboard
@JvmName(name = "forEachDNIndexed")
inline fun <T, D : Dimension> MultiArray<T, D>.forEachMultiIndexed(action: (index: IntArray, T) -> Unit)

Performs the given action on each element, providing sequential index with the element.

Link copied to clipboard
inline fun <T, D : Dimension, K> MultiArray<T, D>.groupingNDArrayBy(crossinline keySelector: (T) -> K): Grouping<T, K>

Creates a Grouping source from an ndarray to be used later with one of group-and-fold operations using the specified keySelector function to extract a key from each element.

Link copied to clipboard
inline fun <T, D : Dimension, K> MultiArray<T, D>.groupNDArrayBy(keySelector: (T) -> K): Map<K, NDArray<T, D1>>

Groups elements of a given ndarray by the key returned by keySelector for each element, and returns a map where each group key is associated with an ndarray of matching elements.

inline fun <T, D : Dimension, K, V : Number> MultiArray<T, D>.groupNDArrayBy(keySelector: (T) -> K, valueTransform: (T) -> V): Map<K, NDArray<V, D1>>

Groups values returned by valueTransform applied to each element of the given ndarray with the key returned by keySelector applied to each element, and returns a map where each group key is associated with an ndarray of matching values.

Link copied to clipboard
inline fun <T, D : Dimension, K, M : MutableMap<in K, NDArray<T, D1>>> MultiArray<T, D>.groupNDArrayByTo(destination: M, keySelector: (T) -> K): M

Groups elements of the given array by the key returned by keySelector function applied to each element and puts to the destination map each group key associated with an ndarray of corresponding elements.

inline fun <T, D : Dimension, K, V, M : MutableMap<in K, NDArray<V, D1>>> MultiArray<T, D>.groupNDArrayByTo(    destination: M,     keySelector: (T) -> K,     valueTransform: (T) -> V): M

Groups values returned by the valueTransform function applied to each element of the given ndarray by the key returned by keySelector function applied to the element and puts to the destination map each group key associated with an ndarray of corresponding values.

Link copied to clipboard
fun <T, D : Dimension> MultiArray<T, D>.indexOf(element: T): Int

Returns first index of element, or -1 if the collection does not contain element.

Link copied to clipboard
inline fun <T, D : Dimension> MultiArray<T, D>.indexOfFirst(predicate: (T) -> Boolean): Int

Returns index of the first element matching the given predicate, or -1 if the collection does not contain such element.

Link copied to clipboard
inline fun <T, D : Dimension> MultiArray<T, D>.indexOfLast(predicate: (T) -> Boolean): Int

Returns index of the last element matching the given predicate, or -1 if the collection does not contain such element.

Link copied to clipboard
fun <T : Number, D : Dimension> NDArray<T, D>.inplace(init: InplaceOperation<T, D>.() -> Unit)
Link copied to clipboard
infix fun <T, D : Dimension> MultiArray<T, D>.intersect(other: Iterable<T>): Set<T>

Returns a set containing all elements that are contained by both this collection and the specified collection.

Link copied to clipboard
fun <T, D : Dimension> MultiArray<T, D>.isTransposed(): Boolean
Link copied to clipboard
fun <T, D : Dimension, A : Appendable> MultiArray<T, D>.joinTo(    buffer: A,     separator: CharSequence = ", ",     prefix: CharSequence = "",     postfix: CharSequence = "",     limit: Int = -1,     truncated: CharSequence = "...",     transform: (T) -> CharSequence? = null): A

Appends the string from all the elements separated using separator and using the given prefix and postfix if supplied.

Link copied to clipboard
fun <T, D : Dimension> MultiArray<T, D>.joinToString(    separator: CharSequence = ", ",     prefix: CharSequence = "",     postfix: CharSequence = "",     limit: Int = -1,     truncated: CharSequence = "...",     transform: (T) -> CharSequence? = null): String

Creates a string from all the elements separated using separator and using the given prefix and postfix if supplied.

Link copied to clipboard
fun <T, D : Dimension> MultiArray<T, D>.last(): T

Returns the last element.

inline fun <T, D : Dimension> MultiArray<T, D>.last(predicate: (T) -> Boolean): T

Returns the last element matching the given predicate.

Link copied to clipboard
fun <T, D : Dimension> MultiArray<T, D>.lastIndexOf(element: T): Int

Returns last index of element, or -1 if the collection does not contain element.

Link copied to clipboard
fun <T, D : Dimension> MultiArray<T, D>.lastOrNull(): T?

Returns the last element, or null if the list is empty.

inline fun <T, D : Dimension> MultiArray<T, D>.lastOrNull(predicate: (T) -> Boolean): T?

Returns the last element matching the given predicate, or null if no such element was found.

Link copied to clipboard
@JvmName(name = "inplaceLogDouble")
fun <D : Dimension> InplaceMath<Double, D>.log(): InplaceMath<Double, D>
@JvmName(name = "inplaceLogFloat")
fun <D : Dimension> InplaceMath<Float, D>.log(): InplaceMath<Float, D>
Link copied to clipboard
inline fun <T, D : Dimension, R : Any> MultiArray<T, D>.map(transform: (T) -> R): NDArray<R, D>

Return a new array contains elements after applying transform.

Link copied to clipboard
@JvmName(name = "mapD1Indexed")
inline fun <T, R : Any> MultiArray<T, D1>.mapIndexed(transform: (index: Int, T) -> R): D1Array<R>

Return a new array contains elements after applying transform.

Link copied to clipboard
@JvmName(name = "mapD1IndexedNotNull")
inline fun <T, R : Any> MultiArray<T, D1>.mapIndexedNotNull(transform: (index: Int, T) -> R?): D1Array<R>

Return a new array contains elements after applying transform.

Link copied to clipboard
@JvmName(name = "mapDNIndexed")
inline fun <T, D : Dimension, R : Any> MultiArray<T, D>.mapMultiIndexed(transform: (index: IntArray, T) -> R): NDArray<R, D>

Return a new array contains elements after applying transform.

Link copied to clipboard
@JvmName(name = "mapDNIndexedNotNull")
inline fun <T, D : Dimension, R : Any> MultiArray<T, D>.mapMultiIndexedNotNull(transform: (index: IntArray, T) -> R?): NDArray<R, D>

Return a new array contains elements after applying transform.

Link copied to clipboard
inline fun <T, D : Dimension, R : Any> MultiArray<T, D>.mapNotNull(transform: (T) -> R?): NDArray<R, D>

Return a new array contains elements after applying transform.

Link copied to clipboard
@JvmName(name = "mathD1")
fun <T : Number> InplaceOperation<T, D1>.math(init: InplaceMath<T, D1>.() -> Unit)
@JvmName(name = "mathD2")
fun <T : Number> InplaceOperation<T, D2>.math(init: InplaceMath<T, D2>.() -> Unit)
@JvmName(name = "mathD3")
fun <T : Number> InplaceOperation<T, D3>.math(init: InplaceMath<T, D3>.() -> Unit)
@JvmName(name = "mathD4")
fun <T : Number> InplaceOperation<T, D4>.math(init: InplaceMath<T, D4>.() -> Unit)
@JvmName(name = "mathDN")
fun <T : Number> InplaceOperation<T, DN>.math(init: InplaceMath<T, DN>.() -> Unit)
Link copied to clipboard
fun <T : Number, D : Dimension> MultiArray<T, D>.max(): T?

Returns the largest element or null if there are no elements.

Link copied to clipboard
inline fun <T, D : Dimension, R : Comparable<R>> MultiArray<T, D>.maxBy(selector: (T) -> R): T?

Returns the first element yielding the largest value of the given function or null if there are no elements.

Link copied to clipboard
fun <T : Number, D : Dimension> MultiArray<T, D>.maximum(other: MultiArray<T, D>): NDArray<T, D>

Returns the element-wise maximum of array elements for this and other.

Link copied to clipboard
fun <T, D : Dimension> MultiArray<T, D>.maxWith(comparator: Comparator<in T>): T?

Returns the first element having the largest value according to the provided comparator or null if there are no elements.

Link copied to clipboard
fun <T : Number, Comparable<T>, D : Dimension> MultiArray<T, D>.min(): T?

Returns the smallest element or null if there are no elements.

Link copied to clipboard
inline fun <T, D : Dimension, R : Comparable<R>> MultiArray<T, D>.minBy(selector: (T) -> R): T?

Returns the first element yielding the smallest value of the given function or null if there are no elements.

Link copied to clipboard
fun <T : Number, D : Dimension> MultiArray<T, D>.minimum(other: MultiArray<T, D>): NDArray<T, D>

Returns the element-wise minimum of array elements for this and other.

Link copied to clipboard
operator fun <D : Dimension> Byte.minus(other: MultiArray<Byte, D>): NDArray<Byte, D>
operator fun <D : Dimension> Double.minus(other: MultiArray<Double, D>): NDArray<Double, D>
operator fun <D : Dimension> Float.minus(other: MultiArray<Float, D>): NDArray<Float, D>
operator fun <D : Dimension> Int.minus(other: MultiArray<Int, D>): NDArray<Int, D>
operator fun <D : Dimension> Long.minus(other: MultiArray<Long, D>): NDArray<Long, D>
operator fun <D : Dimension> Short.minus(other: MultiArray<Short, D>): NDArray<Short, D>
operator fun <D : Dimension> ComplexDouble.minus(other: MultiArray<ComplexDouble, D>): NDArray<ComplexDouble, D>
operator fun <D : Dimension> ComplexFloat.minus(other: MultiArray<ComplexFloat, D>): NDArray<ComplexFloat, D>
operator fun <T, D : Dimension> MultiArray<T, D>.minus(other: T): NDArray<T, D>

operator fun <T, D : Dimension> MultiArray<T, D>.minus(other: MultiArray<T, D>): NDArray<T, D>

Create a new array as difference between this and other.

Link copied to clipboard
operator fun <T, D : Dimension> MutableMultiArray<T, D>.minusAssign(other: T)

Subtract other element-wise. Inplace operator.

operator fun <T, D : Dimension> MutableMultiArray<T, D>.minusAssign(other: MultiArray<T, D>)

Subtract other from this. Inplace operator.

Link copied to clipboard
fun <T, D : Dimension> MultiArray<T, D>.minWith(comparator: Comparator<in T>): T?

Returns the first element having the smallest value according to the provided comparator or null if there are no elements.

Link copied to clipboard
inline fun <T, D : Dimension, C : MultiArray<T, D>> C.onEach(action: (T) -> Unit): C

Performs the given action on each element and returns the collection itself afterwards.

Link copied to clipboard
infix fun <T : Number, D : Dimension> MultiArray<T, D>.or(other: MultiArray<T, D>): NDArray<Int, D>
Link copied to clipboard
inline fun <T, D : Dimension> MultiArray<T, D>.partition(predicate: (T) -> Boolean): Pair<NDArray<T, D1>, NDArray<T, D1>>

Splits the original collection into pair of lists, where first list contains elements for which predicate yielded true, while second list contains elements for which predicate yielded false.

Link copied to clipboard
operator fun <D : Dimension> Byte.plus(other: MultiArray<Byte, D>): NDArray<Byte, D>
operator fun <D : Dimension> Double.plus(other: MultiArray<Double, D>): NDArray<Double, D>
operator fun <D : Dimension> Float.plus(other: MultiArray<Float, D>): NDArray<Float, D>
operator fun <D : Dimension> Int.plus(other: MultiArray<Int, D>): NDArray<Int, D>
operator fun <D : Dimension> Long.plus(other: MultiArray<Long, D>): NDArray<Long, D>
operator fun <D : Dimension> Short.plus(other: MultiArray<Short, D>): NDArray<Short, D>
operator fun <D : Dimension> ComplexDouble.plus(other: MultiArray<ComplexDouble, D>): NDArray<ComplexDouble, D>
operator fun <D : Dimension> ComplexFloat.plus(other: MultiArray<ComplexFloat, D>): NDArray<ComplexFloat, D>
operator fun <T, D : Dimension> MultiArray<T, D>.plus(other: T): NDArray<T, D>

operator fun <T, D : Dimension> MultiArray<T, D>.plus(other: MultiArray<T, D>): NDArray<T, D>

Create a new array as the sum of this and other.

Link copied to clipboard
operator fun <T, D : Dimension> MutableMultiArray<T, D>.plusAssign(other: T)

Add other element-wise. Inplace operator.

operator fun <T, D : Dimension> MutableMultiArray<T, D>.plusAssign(other: MultiArray<T, D>)

Add other to this. Inplace operator.

Link copied to clipboard
inline fun <S, D : Dimension, T : S> MultiArray<T, D>.reduce(operation: (acc: S, T) -> S): S

Accumulates value starting with the first element and applying operation from left to right to current accumulator value and each element.

Link copied to clipboard
@JvmName(name = "reduceD1Indexed")
inline fun <S, T : S> MultiArray<T, D1>.reduceIndexed(operation: (index: Int, acc: S, T) -> S): S

Accumulates value starting with the first element and applying operation from left to right to current accumulator value and each element with its index in the original collection.

Link copied to clipboard
@JvmName(name = "reduceDNIndexed")
inline fun <S, D : Dimension, T : S> MultiArray<T, D>.reduceMultiIndexed(operation: (index: IntArray, acc: S, T) -> S): S

Accumulates value starting with the first element and applying operation from left to right to current accumulator value and each element with its index in the original collection.

Link copied to clipboard
inline fun <S, D : Dimension, T : S> MultiArray<T, D>.reduceOrNull(operation: (acc: S, T) -> S): S?

Accumulates value starting with the first element and applying operation from left to right to current accumulator value and each element. Returns null if the collection is empty.

Link copied to clipboard
fun <T, D : Dimension> MultiArray<T, D>.repeat(n: Int): D1Array<T>
Link copied to clipboard
fun <T, D : Dimension> MultiArray<T, D>.reversed(): NDArray<T, D>
Link copied to clipboard
inline fun <T, D : Dimension, R : Any> MultiArray<T, D>.scan(initial: R, operation: (acc: R, T) -> R): NDArray<R, D>

Returns a list containing successive accumulation values generated by applying operation from left to right to each element and current accumulator value that starts with initial value.

Link copied to clipboard
@JvmName(name = "scanD1Indexed")
inline fun <T, R : Any> MultiArray<T, D1>.scanIndexed(initial: R, operation: (index: Int, acc: R, T) -> R): D1Array<R>

Return a flat ndarray containing successive accumulation values generated by applying operation from left to right to each element, its index in this d1 ndarray and current accumulator value that starts with initial value.

Link copied to clipboard
inline fun <T, D : Dimension, R : Any> MultiArray<T, D>.scanMultiIndexed(initial: R, operation: (index: IntArray, acc: R, T) -> R): NDArray<R, D>

Return a flat ndarray containing successive accumulation values generated by applying operation from left to right to each element, its multi index in this dn ndarray and current accumulator value that starts with initial value.

Link copied to clipboard
@JvmName(name = "inplaceSinDouble")
fun <D : Dimension> InplaceMath<Double, D>.sin(): InplaceMath<Double, D>
@JvmName(name = "inplaceSinFloat")
fun <D : Dimension> InplaceMath<Float, D>.sin(): InplaceMath<Float, D>
Link copied to clipboard
fun <T : Number, D : Dimension> MultiArray<T, D>.sorted(): NDArray<T, D>
Link copied to clipboard
@JvmName(name = "stackD1")
fun <T> Multik.stack(vararg arr: MultiArray<T, D1>, axis: Int = 0): NDArray<T, D2>
@JvmName(name = "stackD2")
fun <T> Multik.stack(vararg arr: MultiArray<T, D2>, axis: Int = 0): NDArray<T, D3>
@JvmName(name = "stackD3")
fun <T> Multik.stack(vararg arr: MultiArray<T, D3>, axis: Int = 0): NDArray<T, D4>
@JvmName(name = "stackD4")
fun <T> Multik.stack(vararg arr: MultiArray<T, D4>, axis: Int = 0): NDArray<T, DN>
@JvmName(name = "stackD1")
fun <T> Multik.stack(arrays: List<MultiArray<T, D1>>, axis: Int = 0): NDArray<T, D2>
@JvmName(name = "stackD2")
fun <T> Multik.stack(arrays: List<MultiArray<T, D2>>, axis: Int = 0): NDArray<T, D3>
@JvmName(name = "stackD3")
fun <T> Multik.stack(arrays: List<MultiArray<T, D3>>, axis: Int = 0): NDArray<T, D4>
@JvmName(name = "stackD4")
fun <T> Multik.stack(arrays: List<MultiArray<T, D4>>, axis: Int = 0): NDArray<T, DN>
Link copied to clipboard
fun <T : Number, D : Dimension> MultiArray<T, D>.sum(): T

Returns the sum of all elements in the collection.

Link copied to clipboard
inline fun <T, D : Dimension> MultiArray<T, D>.sumBy(selector: (T) -> ComplexDouble): ComplexDouble
inline fun <T, D : Dimension> MultiArray<T, D>.sumBy(selector: (T) -> ComplexFloat): ComplexFloat
inline fun <T : Number, D : Dimension> MultiArray<T, D>.sumBy(selector: (T) -> Double): Double
inline fun <T : Number, D : Dimension> MultiArray<T, D>.sumBy(selector: (T) -> Int): Int

Returns the sum of all values produced by selector function applied to each element in the collection.

Link copied to clipboard
@JvmName(name = "inplaceTanDouble")
fun <D : Dimension> InplaceMath<Double, D>.tan(): InplaceMath<Double, D>
@JvmName(name = "inplaceTanFloat")
fun <D : Dimension> InplaceMath<Float, D>.tan(): InplaceMath<Float, D>
Link copied to clipboard
operator fun <D : Dimension> Byte.times(other: MultiArray<Byte, D>): NDArray<Byte, D>
operator fun <D : Dimension> Double.times(other: MultiArray<Double, D>): NDArray<Double, D>
operator fun <D : Dimension> Float.times(other: MultiArray<Float, D>): NDArray<Float, D>
operator fun <D : Dimension> Int.times(other: MultiArray<Int, D>): NDArray<Int, D>
operator fun <D : Dimension> Long.times(other: MultiArray<Long, D>): NDArray<Long, D>
operator fun <D : Dimension> Short.times(other: MultiArray<Short, D>): NDArray<Short, D>
operator fun <D : Dimension> ComplexDouble.times(other: MultiArray<ComplexDouble, D>): NDArray<ComplexDouble, D>
operator fun <D : Dimension> ComplexFloat.times(other: MultiArray<ComplexFloat, D>): NDArray<ComplexFloat, D>
operator fun <T, D : Dimension> MultiArray<T, D>.times(other: T): NDArray<T, D>

operator fun <T, D : Dimension> MultiArray<T, D>.times(other: MultiArray<T, D>): NDArray<T, D>

Create a new array as product of this and other.

Link copied to clipboard
operator fun <T, D : Dimension> MutableMultiArray<T, D>.timesAssign(other: T)

Multiply other element-wise. Inplace operator.

operator fun <T, D : Dimension> MutableMultiArray<T, D>.timesAssign(other: MultiArray<T, D>)

Multiply this by other. Inplace operator.

Link copied to clipboard
fun MultiArray<Double, D2>.toArray(): Array<DoubleArray>
fun MultiArray<Double, D3>.toArray(): Array<Array<DoubleArray>>
fun MultiArray<Double, D4>.toArray(): Array<Array<Array<DoubleArray>>>
fun MultiArray<Float, D2>.toArray(): Array<FloatArray>
fun MultiArray<Float, D3>.toArray(): Array<Array<FloatArray>>
fun MultiArray<Float, D4>.toArray(): Array<Array<Array<FloatArray>>>
fun MultiArray<Int, D2>.toArray(): Array<IntArray>
fun MultiArray<Int, D3>.toArray(): Array<Array<IntArray>>
fun MultiArray<Int, D4>.toArray(): Array<Array<Array<IntArray>>>
fun MultiArray<Long, D2>.toArray(): Array<LongArray>
fun MultiArray<Long, D3>.toArray(): Array<Array<LongArray>>
fun MultiArray<Long, D4>.toArray(): Array<Array<Array<LongArray>>>
fun MultiArray<ComplexDouble, D2>.toArray(): Array<ComplexDoubleArray>
fun MultiArray<ComplexDouble, D3>.toArray(): Array<Array<ComplexDoubleArray>>
fun MultiArray<ComplexDouble, D4>.toArray(): Array<Array<Array<ComplexDoubleArray>>>
fun MultiArray<ComplexFloat, D2>.toArray(): Array<ComplexFloatArray>
fun MultiArray<ComplexFloat, D3>.toArray(): Array<Array<ComplexFloatArray>>
fun MultiArray<ComplexFloat, D4>.toArray(): Array<Array<Array<ComplexFloatArray>>>
Link copied to clipboard
fun <T, D : Dimension, C : MutableCollection<in T>> MultiArray<T, D>.toCollection(destination: C): C

Appends all elements to the given destination collection.

Link copied to clipboard
Link copied to clipboard
fun <D : Dimension> MultiArray<ComplexFloat, D>.toComplexFloatArray(): ComplexFloatArray
Link copied to clipboard
fun <D : Dimension> MultiArray<Double, D>.toDoubleArray(): DoubleArray
Link copied to clipboard
fun <D : Dimension> MultiArray<Float, D>.toFloatArray(): FloatArray
Link copied to clipboard
fun <T, D : Dimension> MultiArray<T, D>.toHashSet(): HashSet<T>

Returns a HashSet of all elements.

Link copied to clipboard
fun <D : Dimension> MultiArray<Int, D>.toIntArray(): IntArray
Link copied to clipboard
fun <T, D : Dimension> MultiArray<T, D>.toList(): List<T>

Returns a List containing all elements.

Link copied to clipboard
fun <T> MultiArray<T, D2>.toListD2(): List<List<T>>

Returns a List> containing all elements.

Link copied to clipboard
fun <T> MultiArray<T, D3>.toListD3(): List<List<List<T>>>

Returns a List>> containing all elements.

Link copied to clipboard
fun <T> MultiArray<T, D4>.toListD4(): List<List<List<List<T>>>>

Returns a List>>> containing all elements.

Link copied to clipboard
fun <D : Dimension> MultiArray<Long, D>.toLongArray(): LongArray
Link copied to clipboard
fun <T, D : Dimension> MultiArray<T, D>.toMutableList(): MutableList<T>

Returns a MutableList filled with all elements of this collection.

Link copied to clipboard
fun <T, D : Dimension> MultiArray<T, D>.toMutableSet(): MutableSet<T>

Returns a mutable set containing all distinct elements from the given collection.

Link copied to clipboard
fun <T, D : Dimension> MultiArray<T, D>.toSet(): Set<T>

Returns a Set of all elements.

Link copied to clipboard
fun <T : Number, D : Dimension> MultiArray<T, D>.toSortedSet(): SortedSet<T>
fun <T, D : Dimension> MultiArray<T, D>.toSortedSet(comparator: Comparator<in T>): SortedSet<T>

Returns a SortedSet of all elements.

Link copied to clipboard
inline fun <T, O : Any, D : Dimension> MultiArray<T, D>.toType(copy: CopyStrategy = CopyStrategy.FULL): NDArray<O, D>
fun <T, O : Any, D : Dimension> MultiArray<T, D>.toType(dtype: DataType, copy: CopyStrategy = CopyStrategy.FULL): NDArray<O, D>
Link copied to clipboard
operator fun <T, D : Dimension> MultiArray<T, D>.unaryMinus(): NDArray<T, D>
Link copied to clipboard
fun <T, D : Dimension> MultiArray<T, D>.windowed(    size: Int,     step: Int = 1,     limit: Boolean = true): NDArray<T, D2>

Returns a 2-D ndarray of window segments of the specified size, sliding over this ndarray with the specified step.