From f754a121f70dbb12d399f644e1d8e9470c28e6f6 Mon Sep 17 00:00:00 2001 From: Christoph Ruegg Date: Tue, 11 Oct 2011 22:08:43 +0200 Subject: [PATCH] Sparse Linear Algebra: minor add/subtract optimization, gh-18. --- src/Numerics/LinearAlgebra/Complex/SparseVector.cs | 2 -- src/Numerics/LinearAlgebra/Complex32/SparseVector.cs | 2 -- src/Numerics/LinearAlgebra/Double/SparseVector.cs | 2 -- src/Numerics/LinearAlgebra/Single/SparseVector.cs | 2 -- 4 files changed, 8 deletions(-) diff --git a/src/Numerics/LinearAlgebra/Complex/SparseVector.cs b/src/Numerics/LinearAlgebra/Complex/SparseVector.cs index 4e33e2a0..a3d69ea2 100644 --- a/src/Numerics/LinearAlgebra/Complex/SparseVector.cs +++ b/src/Numerics/LinearAlgebra/Complex/SparseVector.cs @@ -430,7 +430,6 @@ namespace MathNet.Numerics.LinearAlgebra.Complex } else if (j >= otherSparse.NonZerosCount || i < NonZerosCount && _nonZeroIndices[i] < otherSparse._nonZeroIndices[j]) { - _nonZeroValues[i] += otherSparse.At(_nonZeroIndices[i]); i++; } else @@ -577,7 +576,6 @@ namespace MathNet.Numerics.LinearAlgebra.Complex } else if (j >= otherSparse.NonZerosCount || i < NonZerosCount && _nonZeroIndices[i] < otherSparse._nonZeroIndices[j]) { - _nonZeroValues[i] -= otherSparse.At(_nonZeroIndices[i]); i++; } else diff --git a/src/Numerics/LinearAlgebra/Complex32/SparseVector.cs b/src/Numerics/LinearAlgebra/Complex32/SparseVector.cs index a58040fe..a99010fe 100644 --- a/src/Numerics/LinearAlgebra/Complex32/SparseVector.cs +++ b/src/Numerics/LinearAlgebra/Complex32/SparseVector.cs @@ -460,7 +460,6 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32 } else if (j >= otherSparse.NonZerosCount || i < NonZerosCount && _nonZeroIndices[i] < otherSparse._nonZeroIndices[j]) { - _nonZeroValues[i] += otherSparse.At(_nonZeroIndices[i]); i++; } else @@ -607,7 +606,6 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32 } else if (j >= otherSparse.NonZerosCount || i < NonZerosCount && _nonZeroIndices[i] < otherSparse._nonZeroIndices[j]) { - _nonZeroValues[i] -= otherSparse.At(_nonZeroIndices[i]); i++; } else diff --git a/src/Numerics/LinearAlgebra/Double/SparseVector.cs b/src/Numerics/LinearAlgebra/Double/SparseVector.cs index cffed1c5..e051f388 100644 --- a/src/Numerics/LinearAlgebra/Double/SparseVector.cs +++ b/src/Numerics/LinearAlgebra/Double/SparseVector.cs @@ -378,7 +378,6 @@ namespace MathNet.Numerics.LinearAlgebra.Double } else if (j >= otherSparse.NonZerosCount || i < NonZerosCount && _nonZeroIndices[i] < otherSparse._nonZeroIndices[j]) { - _nonZeroValues[i] += otherSparse.At(_nonZeroIndices[i]); i++; } else @@ -525,7 +524,6 @@ namespace MathNet.Numerics.LinearAlgebra.Double } else if (j >= otherSparse.NonZerosCount || i < NonZerosCount && _nonZeroIndices[i] < otherSparse._nonZeroIndices[j]) { - _nonZeroValues[i] -= otherSparse.At(_nonZeroIndices[i]); i++; } else diff --git a/src/Numerics/LinearAlgebra/Single/SparseVector.cs b/src/Numerics/LinearAlgebra/Single/SparseVector.cs index b1c48feb..b428530c 100644 --- a/src/Numerics/LinearAlgebra/Single/SparseVector.cs +++ b/src/Numerics/LinearAlgebra/Single/SparseVector.cs @@ -408,7 +408,6 @@ namespace MathNet.Numerics.LinearAlgebra.Single } else if (j >= otherSparse.NonZerosCount || i < NonZerosCount && _nonZeroIndices[i] < otherSparse._nonZeroIndices[j]) { - _nonZeroValues[i] += otherSparse.At(_nonZeroIndices[i]); i++; } else @@ -555,7 +554,6 @@ namespace MathNet.Numerics.LinearAlgebra.Single } else if (j >= otherSparse.NonZerosCount || i < NonZerosCount && _nonZeroIndices[i] < otherSparse._nonZeroIndices[j]) { - _nonZeroValues[i] -= otherSparse.At(_nonZeroIndices[i]); i++; } else