From d1e4fd9a5a8f9b2a0a3d63f2ce47f2da61a5c2d4 Mon Sep 17 00:00:00 2001 From: Alexander Karatarakis Date: Wed, 21 Nov 2012 16:09:17 +0200 Subject: [PATCH] Add new abstract class: StaticStorageIndexer Signed-off-by: Alexander Karatarakis --- .../Indexers/Static/StaticStorageIndexer.cs | 56 +++++++++++++++++++ src/Numerics/Numerics.csproj | 5 +- 2 files changed, 58 insertions(+), 3 deletions(-) create mode 100644 src/Numerics/LinearAlgebra/Storage/Indexers/Static/StaticStorageIndexer.cs diff --git a/src/Numerics/LinearAlgebra/Storage/Indexers/Static/StaticStorageIndexer.cs b/src/Numerics/LinearAlgebra/Storage/Indexers/Static/StaticStorageIndexer.cs new file mode 100644 index 00000000..5237ab96 --- /dev/null +++ b/src/Numerics/LinearAlgebra/Storage/Indexers/Static/StaticStorageIndexer.cs @@ -0,0 +1,56 @@ +namespace MathNet.Numerics.LinearAlgebra.Storage.Indexers.Static +{ + /// + /// Classes that contain indexing information of a static storage scheme. + /// + /// + /// A static storage scheme is always the same and only depends on the size of the matrix. + /// + public abstract class StaticStorageIndexer : IStorageIndexer + { + /// + /// Gets the index of the given element. + /// + /// + /// The row of the element. + /// + /// + /// The column of the element. + /// + /// + /// This method is parameter checked. and to get values without parameter checking. + /// + public abstract int this[int row, int column] + { + get; + } + + /// + /// Gets the length of the stored data. + /// + public abstract int DataLength + { + get; + } + + /// + /// Retrieves the index of the requested element without parameter checking. + /// + /// The row of the element. + /// + /// The column of the element. + /// + /// The requested index. + /// + public abstract int IndexOf(int row, int column); + + /// + /// Retrieves the index of the requested diagonal element without parameter checking. + /// + /// The row=column of the diagonal element. + /// + /// The requested index. + /// + public abstract int IndexOfDiagonal(int row); + } +} diff --git a/src/Numerics/Numerics.csproj b/src/Numerics/Numerics.csproj index 36973819..4e1d798f 100644 --- a/src/Numerics/Numerics.csproj +++ b/src/Numerics/Numerics.csproj @@ -142,6 +142,7 @@ + @@ -481,9 +482,7 @@ - - - +