kmath
kmath copied to clipboard
SVD support for matrices
implement commons-math implementation of http://commons.apache.org/proper/commons-math/apidocs/org/apache/commons/math4/linear/SingularValueDecomposition.html for java backend
Look into implementation for Koma backend
@Ixw123 you now can use DoubleTensorAlgebra
, also SVD is supported in kmath-ejml
:
import space.kscience.kmath.ejml.EjmlLinearSpaceDDRM
import space.kscience.kmath.linear.SingularValueDecompositionFeature
import space.kscience.kmath.linear.getFeature
import space.kscience.kmath.linear.invoke
import space.kscience.kmath.linear.one
EjmlLinearSpaceDDRM {
val svd = getFeature<Double, SingularValueDecompositionFeature<Double>>(one(1, 2))!!
println(svd.singularValues)
}