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

Sparse MapIndexedInplace starts with incorrect indices #1045

Open
jellezult opened this issue Nov 3, 2023 · 0 comments
Open

Sparse MapIndexedInplace starts with incorrect indices #1045

jellezult opened this issue Nov 3, 2023 · 0 comments

Comments

@jellezult
Copy link

The following test fails when using MapIndexedInplace on a sparse matrix with the Zeros.AllowSkip option. Somehow the iteration starts of with i=0, j=1 as indices.

[Test]
public void Sparse_MapIndexedInplace_AllowSkipZeros_Bug()
{

    int nRows = 3;
    int nCols = 1;
    Matrix<float> data = Matrix<float>.Build.Sparse(nRows, nCols, 42);

    data.MapIndexedInplace((i, j, v) =>
    {
        j.Should().Be(0);
        return Math.Abs(v);
    }, Zeros.AllowSkip);
}
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