Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ibasin opened this issue Aug 5, 2024 · 0 comments

Comments

@ibasin
Copy link

ibasin commented Aug 5, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant