Skip to content
This repository was archived by the owner on Nov 19, 2020. It is now read-only.
This repository was archived by the owner on Nov 19, 2020. It is now read-only.

"Index out of bounds" error in SingularValueDecomposition.Solve #614

@ChristerModin

Description

@ChristerModin

Hi

First thanks a lot for all your work with this, at it seems, amazing library :)

I've run into trouble though when fitting an overdetermined system with a two-dimensional B-matrix.
Seems as the VLU isn't dimensioned properly with respect to the number of rows in U
Also, the inner loop should have the number of columns in U as upper bound instead of urows.

I suggest from line 934 in SingularValueDecomposition.cs :

        int ucols = u.Columns();
        var VLU = new Double[vrows, urows];
        for (int i = 0; i < vrows; i++)
        {
            for (int j = 0; j < urows; j++)
            {
                Double sum = 0;
                for (int k = 0; k < ucols; k++)
                    sum += VL[i, k] * u[j, k];
                VLU[i, j] = sum;
            }
        }         

BR

Christer Modin

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