diff --git a/src/Numerics/LinearAlgebra/Storage/DenseColumnMajorMatrixStorage.cs b/src/Numerics/LinearAlgebra/Storage/DenseColumnMajorMatrixStorage.cs
index 0ee45728..77c21efe 100644
--- a/src/Numerics/LinearAlgebra/Storage/DenseColumnMajorMatrixStorage.cs
+++ b/src/Numerics/LinearAlgebra/Storage/DenseColumnMajorMatrixStorage.cs
@@ -66,6 +66,32 @@ namespace MathNet.Numerics.LinearAlgebra.Storage
Data = data;
}
+ ///
+ /// True if the matrix storage format is dense.
+ ///
+ public override bool IsDense
+ {
+ get { return true; }
+ }
+
+ ///
+ /// True if all fields of this matrix can be set to any value.
+ /// False if some fields are fixed, like on a diagonal matrix.
+ ///
+ public override bool IsFullyMutable
+ {
+ get { return true; }
+ }
+
+ ///
+ /// True if the specified field can be set to any value.
+ /// False if the field is fixed, like an off-diagonal field on a diagonal matrix.
+ ///
+ public override bool IsMutableAt(int row, int column)
+ {
+ return true;
+ }
+
///
/// Retrieves the requested element without range checking.
///
diff --git a/src/Numerics/LinearAlgebra/Storage/DenseVectorStorage.cs b/src/Numerics/LinearAlgebra/Storage/DenseVectorStorage.cs
index 2cd00635..4532e12c 100644
--- a/src/Numerics/LinearAlgebra/Storage/DenseVectorStorage.cs
+++ b/src/Numerics/LinearAlgebra/Storage/DenseVectorStorage.cs
@@ -66,6 +66,14 @@ namespace MathNet.Numerics.LinearAlgebra.Storage
Data = data;
}
+ ///
+ /// True if the vector storage format is dense.
+ ///
+ public override bool IsDense
+ {
+ get { return true; }
+ }
+
///
/// Retrieves the requested element without range checking.
///
diff --git a/src/Numerics/LinearAlgebra/Storage/DiagonalMatrixStorage.cs b/src/Numerics/LinearAlgebra/Storage/DiagonalMatrixStorage.cs
index adedb7a0..f986ff2c 100644
--- a/src/Numerics/LinearAlgebra/Storage/DiagonalMatrixStorage.cs
+++ b/src/Numerics/LinearAlgebra/Storage/DiagonalMatrixStorage.cs
@@ -66,6 +66,32 @@ namespace MathNet.Numerics.LinearAlgebra.Storage
Data = data;
}
+ ///
+ /// True if the matrix storage format is dense.
+ ///
+ public override bool IsDense
+ {
+ get { return false; }
+ }
+
+ ///
+ /// True if all fields of this matrix can be set to any value.
+ /// False if some fields are fixed, like on a diagonal matrix.
+ ///
+ public override bool IsFullyMutable
+ {
+ get { return false; }
+ }
+
+ ///
+ /// True if the specified field can be set to any value.
+ /// False if the field is fixed, like an off-diagonal field on a diagonal matrix.
+ ///
+ public override bool IsMutableAt(int row, int column)
+ {
+ return row == column;
+ }
+
///
/// Retrieves the requested element without range checking.
///
@@ -89,16 +115,6 @@ namespace MathNet.Numerics.LinearAlgebra.Storage
}
}
- public override bool IsFullyMutable
- {
- get { return false; }
- }
-
- public override bool IsMutable(int row, int column)
- {
- return row == column;
- }
-
public override void Clear()
{
Array.Clear(Data, 0, Data.Length);
diff --git a/src/Numerics/LinearAlgebra/Storage/MatrixStorage.cs b/src/Numerics/LinearAlgebra/Storage/MatrixStorage.cs
index f8d09423..be87528f 100644
--- a/src/Numerics/LinearAlgebra/Storage/MatrixStorage.cs
+++ b/src/Numerics/LinearAlgebra/Storage/MatrixStorage.cs
@@ -60,6 +60,23 @@ namespace MathNet.Numerics.LinearAlgebra.Storage
ColumnCount = columnCount;
}
+ ///
+ /// True if the matrix storage format is dense.
+ ///
+ public abstract bool IsDense { get; }
+
+ ///
+ /// True if all fields of this matrix can be set to any value.
+ /// False if some fields are fixed, like on a diagonal matrix.
+ ///
+ public abstract bool IsFullyMutable { get; }
+
+ ///
+ /// True if the specified field can be set to any value.
+ /// False if the field is fixed, like an off-diagonal field on a diagonal matrix.
+ ///
+ public abstract bool IsMutableAt(int row, int column);
+
///
/// Gets or sets the value at the given row and column, with range checking.
///
@@ -111,24 +128,6 @@ namespace MathNet.Numerics.LinearAlgebra.Storage
/// WARNING: This method is not thread safe. Use "lock" with it and be sure to avoid deadlocks.
public abstract void At(int row, int column, T value);
- ///
- /// True if all fields of this matrix can be set to any value.
- /// False if some fields are fixed, like on a diagonal matrix.
- ///
- public virtual bool IsFullyMutable
- {
- get { return true; }
- }
-
- ///
- /// True if the specified field can be set to any value.
- /// False if the field is fixed, like an off-diagonal field on a diagonal matrix.
- ///
- public virtual bool IsMutable(int row, int column)
- {
- return true;
- }
-
public virtual void Clear()
{
for (var i = 0; i < RowCount; i++)
diff --git a/src/Numerics/LinearAlgebra/Storage/SparseCompressedRowMatrixStorage.cs b/src/Numerics/LinearAlgebra/Storage/SparseCompressedRowMatrixStorage.cs
index c24107bb..6e97cc20 100644
--- a/src/Numerics/LinearAlgebra/Storage/SparseCompressedRowMatrixStorage.cs
+++ b/src/Numerics/LinearAlgebra/Storage/SparseCompressedRowMatrixStorage.cs
@@ -74,6 +74,32 @@ namespace MathNet.Numerics.LinearAlgebra.Storage
ValueCount = 0;
}
+ ///
+ /// True if the matrix storage format is dense.
+ ///
+ public override bool IsDense
+ {
+ get { return false; }
+ }
+
+ ///
+ /// True if all fields of this matrix can be set to any value.
+ /// False if some fields are fixed, like on a diagonal matrix.
+ ///
+ public override bool IsFullyMutable
+ {
+ get { return true; }
+ }
+
+ ///
+ /// True if the specified field can be set to any value.
+ /// False if the field is fixed, like an off-diagonal field on a diagonal matrix.
+ ///
+ public override bool IsMutableAt(int row, int column)
+ {
+ return true;
+ }
+
///
/// Retrieves the requested element without range checking.
///
diff --git a/src/Numerics/LinearAlgebra/Storage/SparseVectorStorage.cs b/src/Numerics/LinearAlgebra/Storage/SparseVectorStorage.cs
index 62b0d6e5..281957fe 100644
--- a/src/Numerics/LinearAlgebra/Storage/SparseVectorStorage.cs
+++ b/src/Numerics/LinearAlgebra/Storage/SparseVectorStorage.cs
@@ -64,6 +64,14 @@ namespace MathNet.Numerics.LinearAlgebra.Storage
ValueCount = 0;
}
+ ///
+ /// True if the vector storage format is dense.
+ ///
+ public override bool IsDense
+ {
+ get { return false; }
+ }
+
///
/// Retrieves the requested element without range checking.
///
diff --git a/src/Numerics/LinearAlgebra/Storage/VectorStorage.cs b/src/Numerics/LinearAlgebra/Storage/VectorStorage.cs
index 925a67fb..25254c64 100644
--- a/src/Numerics/LinearAlgebra/Storage/VectorStorage.cs
+++ b/src/Numerics/LinearAlgebra/Storage/VectorStorage.cs
@@ -53,6 +53,11 @@ namespace MathNet.Numerics.LinearAlgebra.Storage
Length = length;
}
+ ///
+ /// True if the vector storage format is dense.
+ ///
+ public abstract bool IsDense { get; }
+
///
/// Gets or sets the value at the given index, with range checking.
///
@@ -93,24 +98,6 @@ namespace MathNet.Numerics.LinearAlgebra.Storage
/// WARNING: This method is not thread safe. Use "lock" with it and be sure to avoid deadlocks.
public abstract void At(int index, T value);
- ///
- /// True if all fields of this vector can be set to any value.
- /// False if some fields are fixed.
- ///
- public virtual bool IsFullyMutable
- {
- get { return true; }
- }
-
- ///
- /// True if the specified field can be set to any value.
- /// False if the field is fixed.
- ///
- public virtual bool IsMutable(int index)
- {
- return true;
- }
-
public virtual void Clear()
{
for (var i = 0; i < Length; i++)
diff --git a/src/UnitTests/LinearAlgebraTests/Complex/UserDefinedMatrix.cs b/src/UnitTests/LinearAlgebraTests/Complex/UserDefinedMatrix.cs
index 14c12708..9343b103 100644
--- a/src/UnitTests/LinearAlgebraTests/Complex/UserDefinedMatrix.cs
+++ b/src/UnitTests/LinearAlgebraTests/Complex/UserDefinedMatrix.cs
@@ -53,6 +53,21 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex
Data = data;
}
+ public override bool IsDense
+ {
+ get { return true; }
+ }
+
+ public override bool IsFullyMutable
+ {
+ get { return true; }
+ }
+
+ public override bool IsMutableAt(int row, int column)
+ {
+ return true;
+ }
+
public override Complex At(int row, int column)
{
return Data[row, column];
diff --git a/src/UnitTests/LinearAlgebraTests/Complex/UserDefinedVector.cs b/src/UnitTests/LinearAlgebraTests/Complex/UserDefinedVector.cs
index 23e88fe6..392b6cf9 100644
--- a/src/UnitTests/LinearAlgebraTests/Complex/UserDefinedVector.cs
+++ b/src/UnitTests/LinearAlgebraTests/Complex/UserDefinedVector.cs
@@ -53,6 +53,11 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex
Data = data;
}
+ public override bool IsDense
+ {
+ get { return true; }
+ }
+
public override Complex At(int index)
{
return Data[index];
diff --git a/src/UnitTests/LinearAlgebraTests/Complex32/UserDefinedMatrix.cs b/src/UnitTests/LinearAlgebraTests/Complex32/UserDefinedMatrix.cs
index a79deb1a..0810af7d 100644
--- a/src/UnitTests/LinearAlgebraTests/Complex32/UserDefinedMatrix.cs
+++ b/src/UnitTests/LinearAlgebraTests/Complex32/UserDefinedMatrix.cs
@@ -53,6 +53,21 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex32
Data = data;
}
+ public override bool IsDense
+ {
+ get { return true; }
+ }
+
+ public override bool IsFullyMutable
+ {
+ get { return true; }
+ }
+
+ public override bool IsMutableAt(int row, int column)
+ {
+ return true;
+ }
+
public override Complex32 At(int row, int column)
{
return Data[row, column];
diff --git a/src/UnitTests/LinearAlgebraTests/Complex32/UserDefinedVector.cs b/src/UnitTests/LinearAlgebraTests/Complex32/UserDefinedVector.cs
index 0d8e8e8c..83cd5ebb 100644
--- a/src/UnitTests/LinearAlgebraTests/Complex32/UserDefinedVector.cs
+++ b/src/UnitTests/LinearAlgebraTests/Complex32/UserDefinedVector.cs
@@ -53,6 +53,11 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Complex32
Data = data;
}
+ public override bool IsDense
+ {
+ get { return true; }
+ }
+
public override Complex32 At(int index)
{
return Data[index];
diff --git a/src/UnitTests/LinearAlgebraTests/Double/UserDefinedMatrix.cs b/src/UnitTests/LinearAlgebraTests/Double/UserDefinedMatrix.cs
index 8f976b88..9d2b9c8b 100644
--- a/src/UnitTests/LinearAlgebraTests/Double/UserDefinedMatrix.cs
+++ b/src/UnitTests/LinearAlgebraTests/Double/UserDefinedMatrix.cs
@@ -51,6 +51,21 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Double
Data = data;
}
+ public override bool IsDense
+ {
+ get { return true; }
+ }
+
+ public override bool IsFullyMutable
+ {
+ get { return true; }
+ }
+
+ public override bool IsMutableAt(int row, int column)
+ {
+ return true;
+ }
+
public override double At(int row, int column)
{
return Data[row, column];
diff --git a/src/UnitTests/LinearAlgebraTests/Double/UserDefinedVector.cs b/src/UnitTests/LinearAlgebraTests/Double/UserDefinedVector.cs
index 679d4fdb..438af13c 100644
--- a/src/UnitTests/LinearAlgebraTests/Double/UserDefinedVector.cs
+++ b/src/UnitTests/LinearAlgebraTests/Double/UserDefinedVector.cs
@@ -51,6 +51,11 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Double
Data = data;
}
+ public override bool IsDense
+ {
+ get { return true; }
+ }
+
public override double At(int index)
{
return Data[index];
diff --git a/src/UnitTests/LinearAlgebraTests/Single/UserDefinedMatrix.cs b/src/UnitTests/LinearAlgebraTests/Single/UserDefinedMatrix.cs
index f8d8ee14..2c11d72c 100644
--- a/src/UnitTests/LinearAlgebraTests/Single/UserDefinedMatrix.cs
+++ b/src/UnitTests/LinearAlgebraTests/Single/UserDefinedMatrix.cs
@@ -51,6 +51,21 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Single
Data = data;
}
+ public override bool IsDense
+ {
+ get { return true; }
+ }
+
+ public override bool IsFullyMutable
+ {
+ get { return true; }
+ }
+
+ public override bool IsMutableAt(int row, int column)
+ {
+ return true;
+ }
+
public override float At(int row, int column)
{
return Data[row, column];
diff --git a/src/UnitTests/LinearAlgebraTests/Single/UserDefinedVector.cs b/src/UnitTests/LinearAlgebraTests/Single/UserDefinedVector.cs
index a49c9b0b..142ea26c 100644
--- a/src/UnitTests/LinearAlgebraTests/Single/UserDefinedVector.cs
+++ b/src/UnitTests/LinearAlgebraTests/Single/UserDefinedVector.cs
@@ -51,6 +51,11 @@ namespace MathNet.Numerics.UnitTests.LinearAlgebraTests.Single
Data = data;
}
+ public override bool IsDense
+ {
+ get { return true; }
+ }
+
public override float At(int index)
{
return Data[index];