From 11b9820d482f91bf9cf8bd22248441eac9a53c11 Mon Sep 17 00:00:00 2001 From: kronbichler Date: Wed, 9 Dec 2009 10:29:32 +0000 Subject: [PATCH] Fix stupid bug in operator=(double). git-svn-id: https://svn.dealii.org/trunk@20218 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/lac/include/lac/sparse_matrix.templates.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/deal.II/lac/include/lac/sparse_matrix.templates.h b/deal.II/lac/include/lac/sparse_matrix.templates.h index 1226e4e420..bccdf982ed 100644 --- a/deal.II/lac/include/lac/sparse_matrix.templates.h +++ b/deal.II/lac/include/lac/sparse_matrix.templates.h @@ -135,8 +135,8 @@ SparseMatrix::operator = (const double d) Assert (cols != 0, ExcNotInitialized()); Assert (cols->compressed || cols->empty(), SparsityPattern::ExcNotCompressed()); - if (val) - memset (&val[0], cols->n_nonzero_elements()*sizeof(number), 0); + if (val != 0) + memset (&val[0], 0, cols->n_nonzero_elements()*sizeof(number)); return *this; } @@ -185,8 +185,7 @@ SparseMatrix::reinit (const SparsityPattern &sparsity) max_len = N; } - if (val != 0) - std::fill_n (&val[0], N, 0); + *this = 0.; } -- 2.39.5