Frage

When using a DenseMatrix from Math .NET, and I want to access the second column, third row, do I write matrix[1,2] or matrix[2,1] in other words, does the first index determine the row or the column?

War es hilfreich?

Lösung

A quick search yields this documentation:

http://api.mathdotnet.com/Numerics/MathNet.Numerics.LinearAlgebra.Double/DenseMatrix.htm

While it's lacking in what you're asking, it does have a RowCount property you can interrogate to find your answer.

Running a test now


It's [row, column].

public virtual T this[int row, int column]
{
    get
    {
        RangeCheck(row, column);
        return At(row, column);
    }

    set
    {
        RangeCheck(row, column);
        At(row, column, value);
    }
}
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top