Browse Source

Add new abstract class: StaticStorageIndexer

Signed-off-by: Alexander Karatarakis <alex@karatarakis.com>
pull/59/head
Alexander Karatarakis 14 years ago
parent
commit
d1e4fd9a5a
  1. 56
      src/Numerics/LinearAlgebra/Storage/Indexers/Static/StaticStorageIndexer.cs
  2. 5
      src/Numerics/Numerics.csproj

56
src/Numerics/LinearAlgebra/Storage/Indexers/Static/StaticStorageIndexer.cs

@ -0,0 +1,56 @@
namespace MathNet.Numerics.LinearAlgebra.Storage.Indexers.Static
{
/// <summary>
/// Classes that contain indexing information of a static storage scheme.
/// </summary>
/// <remarks>
/// A static storage scheme is always the same and only depends on the size of the matrix.
/// </remarks>
public abstract class StaticStorageIndexer : IStorageIndexer
{
/// <summary>
/// Gets the index of the given element.
/// </summary>
/// <param name = "row">
/// The row of the element.
/// </param>
/// <param name = "column">
/// The column of the element.
/// </param>
/// <remarks>
/// This method is parameter checked. <see cref = "IStorageIndexer.IndexOf(int,int)" /> and <see cref = "IStorageIndexer.IndexOfDiagonal(int)" /> to get values without parameter checking.
/// </remarks>
public abstract int this[int row, int column]
{
get;
}
/// <summary>
/// Gets the length of the stored data.
/// </summary>
public abstract int DataLength
{
get;
}
/// <summary>
/// Retrieves the index of the requested element without parameter checking.
/// </summary><param name="row">
/// The row of the element.
/// </param><param name="column">
/// The column of the element.
/// </param><returns>
/// The requested index.
/// </returns>
public abstract int IndexOf(int row, int column);
/// <summary>
/// Retrieves the index of the requested diagonal element without parameter checking.
/// </summary><param name="row">
/// The row=column of the diagonal element.
/// </param><returns>
/// The requested index.
/// </returns>
public abstract int IndexOfDiagonal(int row);
}
}

5
src/Numerics/Numerics.csproj

@ -142,6 +142,7 @@
<Compile Include="Distributions\Multivariate\Wishart.cs" /> <Compile Include="Distributions\Multivariate\Wishart.cs" />
<Compile Include="LinearAlgebra\Storage\DenseVectorStorage.cs" /> <Compile Include="LinearAlgebra\Storage\DenseVectorStorage.cs" />
<Compile Include="LinearAlgebra\Storage\Indexers\IStorageIndexer.cs" /> <Compile Include="LinearAlgebra\Storage\Indexers\IStorageIndexer.cs" />
<Compile Include="LinearAlgebra\Storage\Indexers\Static\StaticStorageIndexer.cs" />
<Compile Include="LinearAlgebra\Storage\MatrixStorage.Validation.cs" /> <Compile Include="LinearAlgebra\Storage\MatrixStorage.Validation.cs" />
<Compile Include="LinearAlgebra\Complex32\ExtensionMethods.cs" /> <Compile Include="LinearAlgebra\Complex32\ExtensionMethods.cs" />
<Compile Include="LinearAlgebra\Complex32\Factorization\Cholesky.cs" /> <Compile Include="LinearAlgebra\Complex32\Factorization\Cholesky.cs" />
@ -481,9 +482,7 @@
<ItemGroup> <ItemGroup>
<None Include="MathNet.Numerics.snk" /> <None Include="MathNet.Numerics.snk" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup />
<Folder Include="LinearAlgebra\Storage\Indexers\Static\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup> <PropertyGroup>
<PreBuildEvent> <PreBuildEvent>

Loading…
Cancel
Save