mathnet-numerics icon indicating copy to clipboard operation
mathnet-numerics copied to clipboard

Bug in MathNet.Numerics.Providers.LinearAlgebra.ManagedLinearAlgebraProvider line 758

Open ibasin opened this issue 1 year ago • 0 comments

In the method "public void LUFactor(float[] data, int order, int[] ipiv)", you have in your code:

// Compute multipliers. if (j < order & data[indexjj] != 0.0) { ... }

You are missing the second & in your AND operation - otherwise you are doing a bitwise AND instead of the logical AND which is what you want. In your case it might actually work but it is misleading and error prone. It should be:

// Compute multipliers. if (j < order && data[indexjj] != 0.0) { ... }

Cheers!

Ilya

ibasin avatar Aug 05 '24 18:08 ibasin