Skip to content

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

Open
@ibasin

Description

@ibasin

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions