Browse Source

Fixed Add and Subtract methods in DiagonalMatrix to use the correct type of matrix.

la-knuth
Alexander Karatarakis 16 years ago
committed by Marcus Cuda
parent
commit
6892b7c768
  1. 4
      src/Numerics/LinearAlgebra/Complex/DiagonalMatrix.cs
  2. 8
      src/Numerics/LinearAlgebra/Complex32/DiagonalMatrix.cs
  3. 8
      src/Numerics/LinearAlgebra/Double/DiagonalMatrix.cs
  4. 8
      src/Numerics/LinearAlgebra/Single/DiagonalMatrix.cs

4
src/Numerics/LinearAlgebra/Complex/DiagonalMatrix.cs

@ -301,11 +301,11 @@ namespace MathNet.Numerics.LinearAlgebra.Complex
Matrix<Complex> result;
if (other is DiagonalMatrix)
{
result = new DenseMatrix(RowCount, ColumnCount);
result = new DiagonalMatrix(RowCount, ColumnCount);
}
else
{
result = new DiagonalMatrix(RowCount, ColumnCount);
result = new DenseMatrix(RowCount, ColumnCount);
}
Add(other, result);

8
src/Numerics/LinearAlgebra/Complex32/DiagonalMatrix.cs

@ -306,11 +306,11 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32
Matrix<Complex32> result;
if (other is DiagonalMatrix)
{
result = new DenseMatrix(RowCount, ColumnCount);
result = new DiagonalMatrix(RowCount, ColumnCount);
}
else
{
result = new DiagonalMatrix(RowCount, ColumnCount);
result = new DenseMatrix(RowCount, ColumnCount);
}
Add(other, result);
@ -381,11 +381,11 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32
Matrix<Complex32> result;
if (other is DiagonalMatrix)
{
result = new DenseMatrix(RowCount, ColumnCount);
result = new DiagonalMatrix(RowCount, ColumnCount);
}
else
{
result = new DiagonalMatrix(RowCount, ColumnCount);
result = new DenseMatrix(RowCount, ColumnCount);
}
Subtract(other, result);

8
src/Numerics/LinearAlgebra/Double/DiagonalMatrix.cs

@ -300,11 +300,11 @@ namespace MathNet.Numerics.LinearAlgebra.Double
Matrix<double> result;
if (other is DiagonalMatrix)
{
result = new DenseMatrix(RowCount, ColumnCount);
result = new DiagonalMatrix(RowCount, ColumnCount);
}
else
{
result = new DiagonalMatrix(RowCount, ColumnCount);
result = new DenseMatrix(RowCount, ColumnCount);
}
Add(other, result);
@ -375,11 +375,11 @@ namespace MathNet.Numerics.LinearAlgebra.Double
Matrix<double> result;
if (other is DiagonalMatrix)
{
result = new DenseMatrix(RowCount, ColumnCount);
result = new DiagonalMatrix(RowCount, ColumnCount);
}
else
{
result = new DiagonalMatrix(RowCount, ColumnCount);
result = new DenseMatrix(RowCount, ColumnCount);
}
Subtract(other, result);

8
src/Numerics/LinearAlgebra/Single/DiagonalMatrix.cs

@ -300,11 +300,11 @@ namespace MathNet.Numerics.LinearAlgebra.Single
Matrix<float> result;
if (other is DiagonalMatrix)
{
result = new DenseMatrix(RowCount, ColumnCount);
result = new DiagonalMatrix(RowCount, ColumnCount);
}
else
{
result = new DiagonalMatrix(RowCount, ColumnCount);
result = new DenseMatrix(RowCount, ColumnCount);
}
Add(other, result);
@ -375,11 +375,11 @@ namespace MathNet.Numerics.LinearAlgebra.Single
Matrix<float> result;
if (other is DiagonalMatrix)
{
result = new DenseMatrix(RowCount, ColumnCount);
result = new DiagonalMatrix(RowCount, ColumnCount);
}
else
{
result = new DiagonalMatrix(RowCount, ColumnCount);
result = new DenseMatrix(RowCount, ColumnCount);
}
Subtract(other, result);

Loading…
Cancel
Save