From 8969df0b7244e915a0b099d372d37ad1f1f6de35 Mon Sep 17 00:00:00 2001 From: Marcus Cuda Date: Mon, 13 Dec 2010 15:18:00 +0200 Subject: [PATCH] bug: added fix to other data types --- src/Numerics/LinearAlgebra/Complex/SparseMatrix.cs | 2 +- src/Numerics/LinearAlgebra/Complex32/SparseMatrix.cs | 2 +- src/Numerics/LinearAlgebra/Single/SparseMatrix.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Numerics/LinearAlgebra/Complex/SparseMatrix.cs b/src/Numerics/LinearAlgebra/Complex/SparseMatrix.cs index 556dcce9..0f163b37 100644 --- a/src/Numerics/LinearAlgebra/Complex/SparseMatrix.cs +++ b/src/Numerics/LinearAlgebra/Complex/SparseMatrix.cs @@ -1225,7 +1225,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex return; } - if (scalar == 0.0) + if (scalar == 0.0 || NonZerosCount == 0) { result.Clear(); return; diff --git a/src/Numerics/LinearAlgebra/Complex32/SparseMatrix.cs b/src/Numerics/LinearAlgebra/Complex32/SparseMatrix.cs index 2b828690..10130dc7 100644 --- a/src/Numerics/LinearAlgebra/Complex32/SparseMatrix.cs +++ b/src/Numerics/LinearAlgebra/Complex32/SparseMatrix.cs @@ -1225,7 +1225,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32 return; } - if (scalar == 0.0f) + if (scalar == 0.0f || NonZerosCount == 0) { result.Clear(); return; diff --git a/src/Numerics/LinearAlgebra/Single/SparseMatrix.cs b/src/Numerics/LinearAlgebra/Single/SparseMatrix.cs index 958ac02c..35076359 100644 --- a/src/Numerics/LinearAlgebra/Single/SparseMatrix.cs +++ b/src/Numerics/LinearAlgebra/Single/SparseMatrix.cs @@ -1224,7 +1224,7 @@ namespace MathNet.Numerics.LinearAlgebra.Single return; } - if (scalar == 0.0) + if (scalar == 0.0 || NonZerosCount == 0) { result.Clear(); return;