wo80 / CSparse.NET

A concise library for solving sparse linear systems with direct methods.
GNU Lesser General Public License v2.1
58 stars 25 forks source link

this[i,j] indexing for DenseMatrix #34

Closed epsi1on closed 3 years ago

epsi1on commented 3 years ago

Currently method for get or set member at i,j of a Double.DenseMatrix is the SparseMatrix.At method, Also possible to have indexing access for the instance:

/// <summary>
/// Gets or sets the member at i,j
/// </summary>
/// <param name="i">the row</param>
/// <param name="j">the column</param>
/// <returns>member at location i,j</returns>
public double this[int i, int j]
{
    get
    {
        return this.At(i, j);
    }
    set
    {
        this.At(i, j, value);
    }
}

Final result is member at i,j can be accessed in C# like this:

metrix[i,j] = value

epsi1on commented 3 years ago

my mistake, There already is indexing in DenseColumnMajorStorage<T>