mathnet / mathnet-numerics

Math.NET Numerics
http://numerics.mathdotnet.com
MIT License
3.51k stars 898 forks source link

Likely a bug #1086

Closed ibasin closed 3 months ago

ibasin commented 3 months ago

In the method MathNet.Numerics.Providers.LinearAlgebra.SingularValueDecomposition.ManagedLinearAlgebraProvider:

// Place the transformation in v for subsequent back multiplication. for (i = lp1; i < columnsA; i++) { v[(l*columnsA) + i] = e[i]; }

v is a vector here, and l is always 0, so the code should be changed to:

// Place the transformation in v for subsequent back multiplication. for (i = lp1; i < columnsA; i++) { v[i] = e[i]; }

ibasin commented 3 months ago

I think I may have been wrong on this one.