arrays

vecxt.arrays
object arrays

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
arrays.type

Members list

Value members

Concrete fields

final val spb: VectorSpecies[Byte]
final val spbl: Int
final val spd: VectorSpecies[Double]
final val spdl: Int
final val spi: VectorSpecies[Integer]
final val spil: Int

Extensions

Extensions

extension (d: Double)
inline def *(arr: Array[Double]): Array[Double]
inline def +(arr: Array[Double]): Array[Double]
inline def -(arr: Array[Double]): Array[Double]
inline def /(arr: Array[Double]): Array[Double]
extension (vec: Array[Boolean])
inline def &&(thatIdx: Array[Boolean]): Array[Boolean]
inline def allTrue: Boolean
inline def any: Boolean
inline def trues: Int
inline def ||(thatIdx: Array[Boolean]): Array[Boolean]
extension (vec: Array[Int])
inline def !:=(num: Array[Int]): Array[Boolean]
inline def !:=(num: Int): Array[Boolean]
inline def +(vec2: Array[Int])(using inline boundsCheck: BoundsCheck): Array[Int]
inline def +=(vec2: Array[Int])(using inline boundsCheck: BoundsCheck): Unit
inline def -(vec2: Array[Int])(using inline boundsCheck: BoundsCheck): Array[Int]
inline def -=(vec2: Array[Int])(using inline boundsCheck: BoundsCheck): Unit
inline def <(num: Array[Int]): Array[Boolean]
inline def <(num: Int): Array[Boolean]
inline def <=(num: Array[Int]): Array[Boolean]
inline def <=(num: Int): Array[Boolean]
inline def =:=(num: Array[Int]): Array[Boolean]
inline def =:=(num: Int): Array[Boolean]
inline def >(num: Array[Int]): Array[Boolean]
inline def >(num: Int): Array[Boolean]
inline def >=(num: Array[Int]): Array[Boolean]
inline def >=(num: Int): Array[Boolean]
inline def dot(vec2: Array[Int])(using inline boundsCheck: BoundsCheck): Int
inline def gt(num: Array[Int]): Array[Boolean]
inline def gt(num: Int): Array[Boolean]
inline def gte(num: Array[Int]): Array[Boolean]
inline def gte(num: Int): Array[Boolean]
inline def increments: Array[Int]
inline def logicalIdx(inline op: Comparison, vec2: Array[Int]): Array[Boolean]
inline def logicalIdx(inline op: Comparison, num: Int): Array[Boolean]
inline def lt(num: Array[Int]): Array[Boolean]
inline def lt(num: Int): Array[Boolean]
inline def lte(num: Array[Int]): Array[Boolean]
inline def lte(num: Int): Array[Boolean]
inline def sumSIMD: Int
extension [A](vec: Array[A])(using ClassTag[A])
inline def apply(index: Array[Boolean])(using inline boundsCheck: BoundsCheck): Array[A]
extension (vec: Array[Double])
inline def !:=(num: Double): Array[Boolean]
inline def *(d: Array[Double])(using inline boundsCheck: BoundsCheck): Array[Double]
inline def *(d: Double): Array[Double]
inline def *=(d: Double): Array[Double]
inline def +(d: Double): Array[Double]
inline def +(vec2: Array[Double])(using inline boundsCheck: BoundsCheck): Array[Double]
inline def +:+(d: Double): Array[Double]
inline def +:+=(d: Double): Unit
inline def +=(d: Double): Unit
inline def +=(vec2: Array[Double])(using inline boundsCheck: BoundsCheck): Unit
inline def -(vec2: Array[Double])(using inline boundsCheck: BoundsCheck): Array[Double]
inline def -(d: Double): Array[Double]
inline def -!: Unit
inline def -=(vec2: Array[Double])(using inline boundsCheck: BoundsCheck): Unit
inline def -=(d: Double): Unit
inline def /(d: Array[Double])(using inline boundsCheck: BoundsCheck): Array[Double]
inline def /(d: Double): Array[Double]
inline def /=(d: Double): Array[Double]
inline def <(num: Double): Array[Boolean]
inline def <=(num: Double): Array[Boolean]
inline def =:=(num: Double): Array[Boolean]
inline def >(num: Double): Array[Boolean]
inline def >=(num: Double): Array[Boolean]
inline def abs: Array[Double]
inline def abs!: Unit
inline def acos: Array[Double]
inline def acos!: Unit
inline def add(d: Array[Double])(using inline boundsCheck: BoundsCheck): Array[Double]
def argmax: Int

Returns the index of the maximum element in the array using SIMD operations for performance.

Returns the index of the maximum element in the array using SIMD operations for performance.

This method processes the array in blocks to maximize instruction-level parallelism (ILP) and minimize synchronization overhead.

https://en.algorithmica.org/hpc/algorithms/argmin/

For small arrays, perhaps 2x slower. For larger arrays (e.g. 1000 elements, at least 2x faster)

Attributes

Returns

The index of the maximum element, or -1 if the array is empty.

def argmin: Int

Returns the index of the minimum element in the array using SIMD operations for performance.

Returns the index of the minimum element in the array using SIMD operations for performance.

This method processes the array in blocks to maximize instruction-level parallelism (ILP) and minimize synchronization overhead.

For small arrays, perhaps 2x slower. For larger arrays (e.g. 1000 elements, at least 2x faster)

Attributes

Returns

The index of the minimum element, or -1 if the array is empty.

inline def asin: Array[Double]
inline def asin!: Unit
inline def atan: Array[Double]
inline def atan!: Unit
inline def cbrt: Array[Double]
inline def cbrt!: Unit
inline def clamp(floor: Double, ceil: Double): Array[Double]
inline def clamp!(floor: Double, ceil: Double): Unit

Clamps the values in the array to a specified range.

Clamps the values in the array to a specified range.

Value parameters

ceil

The maximum value to clamp to.

floor

The minimum value to clamp to.

Attributes

Returns

A new array with values clamped to the specified range.

inline def clampMax(ceil: Double): Array[Double]

Clamps the values in the array to a maximum value.

Clamps the values in the array to a maximum value.

Value parameters

floor

The maximum value to clamp to.

Attributes

Returns

A new array with values clamped to the specified maximum.

inline def clampMin(floor: Double): Array[Double]

Clamps the values in the array to a minimum value.

Clamps the values in the array to a minimum value.

Value parameters

ceil

The minimum value to clamp to.

Attributes

Returns

A new array with values clamped to the specified minimum.

inline def corr(thatVector: Array[Double])(using inline boundsCheck: BoundsCheck): Double
inline def cos: Array[Double]
inline def cos!: Unit
inline def cosh: Array[Double]
inline def cosh!: Unit
def covariance(thatVector: Array[Double]): Double
inline def cumsum: Array[Double]
inline def cumsum!: Unit
inline def dot(v1: Array[Double])(using inline boundsCheck: BoundsCheck): Double
inline def elementRanks: Array[Double]
inline def exp: Array[Double]
inline def exp!: Unit
inline def expm1: Array[Double]
inline def expm1!: Unit
inline def fma(multiply: Double, add: Double): Array[Double]
inline def fma!(multiply: Double, add: Double): Unit
inline def increments: Array[Double]
inline def log: Array[Double]
inline def log!: Unit
inline def log10: Array[Double]
inline def log10!: Unit
inline def log1p: Array[Double]
inline def log1p!: Unit
inline def logSumExp: Double

The formula for the logarithm of the sum of exponentials is:

The formula for the logarithm of the sum of exponentials is:

logSumExp(x) = log(sum(exp(x_i))) for i = 1 to n

This is computed in a numerically stable way by subtracting the maximum value in the array before taking the exponentials:

logSumExp(x) = max(x) + log(sum(exp(x_i - max(x)))) for i = 1 to n

Attributes

inline def logicalIdx(inline op: Comparison, num: Double): Array[Boolean]
inline def max: Double
inline def maxClamp(ceil: Double): Array[Double]
inline def maxClamp!(ceil: Double): Unit
inline def maxSIMD: Double
inline def mean: Double
inline def min: Double
inline def minClamp(floor: Double): Array[Double]
inline def minClamp!(floor: Double): Unit
inline def minSIMD: Double
inline def multInPlace(d: Double): Array[Double]
inline def norm: Double
inline def outer(other: Array[Double])(using ClassTag[Double]): Matrix[Double]
inline def pearsonCorrelationCoefficient(thatVector: Array[Double])(using inline boundsCheck: BoundsCheck): Double
inline def product: Double
inline def productExceptSelf: Array[Double]

Given an array nums of n integers where n > 1, returns an array output such that output[i] is equal to the product of all the elements of nums except nums[i].

Given an array nums of n integers where n > 1, returns an array output such that output[i] is equal to the product of all the elements of nums except nums[i].

This method does not use division and runs in O(n) time complexity.

Value parameters

nums

An array of integers.

Attributes

Returns

An array where each element is the product of all the elements of nums except the element at the same index.

inline def productSIMD: Double
inline def sin: Array[Double]
inline def sin!: Unit
inline def sinh: Array[Double]
inline def sinh!: Unit
inline def spearmansRankCorrelation(thatVector: Array[Double])(using inline boundsCheck: BoundsCheck): Double
inline def sqrt: Array[Double]
inline def sqrt!: Unit
inline def stdDev: Double
inline def sum: Double
inline def sumSIMD: Double
inline def unary_-: Array[Double]
def variance: Double
extension (vec: Array[Array[Double]])
inline def horizontalSum: Array[Double]