forked from tsai/mathnet-numerics
6 changed files with 220 additions and 3 deletions
@ -0,0 +1,51 @@ |
|||||
|
using System; |
||||
|
|
||||
|
namespace MathNet.Numerics.LinearAlgebra.Storage |
||||
|
{ |
||||
|
public interface IMatrixStorage<T> where T : struct, IEquatable<T>, IFormattable |
||||
|
{ |
||||
|
int RowCount { get; } |
||||
|
int ColumnCount { get; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Gets or sets the value at the given row and column, with range checking.
|
||||
|
/// </summary>
|
||||
|
/// <param name="row">
|
||||
|
/// The row of the element.
|
||||
|
/// </param>
|
||||
|
/// <param name="column">
|
||||
|
/// The column of the element.
|
||||
|
/// </param>
|
||||
|
/// <value>The value to get or set.</value>
|
||||
|
/// <remarks>This method is ranged checked. <see cref="At(int,int)"/> and <see cref="At(int,int,T)"/>
|
||||
|
/// to get and set values without range checking.</remarks>
|
||||
|
T this[int row, int column] { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Retrieves the requested element without range checking.
|
||||
|
/// </summary>
|
||||
|
/// <param name="row">
|
||||
|
/// The row of the element.
|
||||
|
/// </param>
|
||||
|
/// <param name="column">
|
||||
|
/// The column of the element.
|
||||
|
/// </param>
|
||||
|
/// <returns>
|
||||
|
/// The requested element.
|
||||
|
/// </returns>
|
||||
|
/// <remarks>Not range-checked.</remarks>
|
||||
|
T At(int row, int column); |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// Sets the element without range checking.
|
||||
|
/// </summary>
|
||||
|
/// <param name="row"> The row of the element. </param>
|
||||
|
/// <param name="column"> The column of the element. </param>
|
||||
|
/// <param name="value"> The value to set the element to. </param>
|
||||
|
/// <remarks>WARNING: This method is not thread safe. Use "lock" with it and be sure to avoid deadlocks.</remarks>
|
||||
|
void At(int row, int column, T value); |
||||
|
|
||||
|
void Clear(); |
||||
|
void CopyTo(IMatrixStorage<T> target, bool skipClearing = false); |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue