Vecxt
Making cross plaform vector problem less... vexing
Scala cli
//> using dep io.github.quafadas::vecxt::0.0.34
// If you're on the JVM
//> using javaOpt "--add-modules=jdk.incubator.vector"
Mill
ivy"io.github.quafadas::vecxt::0.0.34"
import vecxt.all.*
import vecxt.BoundsCheck.DoBoundsCheck.yes
val v1 = Array[Double](1, 2, 3)
// v1: Array[Double] = Array(1.0, 2.0, 3.0)
val v2 = Array[Double](4, 5, 6)
// v2: Array[Double] = Array(4.0, 5.0, 6.0)
v1 + v2
// res0: Array[Double] = Array(5.0, 7.0, 9.0)
val v3 = Array.fill(3)(0.0)
// v3: Array[Double] = Array(-4.0, -5.0, -6.0)
v3 -= v2
v3
// res2: Array[Double] = Array(-4.0, -5.0, -6.0)
Goals
- Where possible inline calls to platform-native-BLAS implementations for maximum performance\
- Zero copy semantics / views on contiguous unbroken arrays of data for performance
- Reasonable, consistent cross platform ergonomics
- Very little / no data-structures - the vector part of the library is an extension method on
Array[Double]
for example - A single cross platform test suite
- Simplicity, speed
Non-Goals
- General mathematics - lets' try to keep a focus on linear algebra. See slash or breeze for more general libraries
- Visualisation - see dedav4s