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);
}
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.