From 628578a9f976dcdfb42a9a12c8c44b416bb8f57e Mon Sep 17 00:00:00 2001 From: kronbichler Date: Mon, 21 Jan 2013 14:43:28 +0000 Subject: [PATCH] Use std::memset. Fix typo in in-code comment. git-svn-id: https://svn.dealii.org/trunk@28147 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/include/deal.II/lac/full_matrix.h | 2 +- .../deal.II/lac/sparse_matrix.templates.h | 21 +++++++------------ 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/deal.II/include/deal.II/lac/full_matrix.h b/deal.II/include/deal.II/lac/full_matrix.h index 3ce6ea26c3..6a2854ef91 100644 --- a/deal.II/include/deal.II/lac/full_matrix.h +++ b/deal.II/include/deal.II/lac/full_matrix.h @@ -1497,7 +1497,7 @@ FullMatrix::operator = (const number d) (void)d; // removes -Wunused-parameter warning in optimized mode if (this->n_elements() != 0) - memset (&this->values[0], 0, this->n_elements()*sizeof(number)); + std::memset (&this->values[0], 0, this->n_elements()*sizeof(number)); return *this; } diff --git a/deal.II/include/deal.II/lac/sparse_matrix.templates.h b/deal.II/include/deal.II/lac/sparse_matrix.templates.h index f032403de4..d9d982f3ee 100644 --- a/deal.II/include/deal.II/lac/sparse_matrix.templates.h +++ b/deal.II/include/deal.II/lac/sparse_matrix.templates.h @@ -144,18 +144,13 @@ SparseMatrix::operator = (const double d) Assert (cols != 0, ExcNotInitialized()); Assert (cols->compressed || cols->empty(), SparsityPattern::ExcNotCompressed()); - // do initial zeroing of elements in - // parallel. Try to achieve a similar layout - // as when doing matrix-vector products, as on - // some NUMA systems, a memory block is - // assigned to memory banks where the first - // access is generated. For sparse matrices, - // the first operations is usually the - // operator=. The grain size is chosen to - // reflect the number of rows in - // minimum_parallel_grain_size, weighted by - // the number of nonzero entries per row on - // average. + // do initial zeroing of elements in parallel. Try to achieve a similar + // layout as when doing matrix-vector products, as on some NUMA systems, a + // memory block is assigned to memory banks where the first access is + // generated. For sparse matrices, the first operations is usually the + // operator=. The grain size is chosen to reflect the number of rows in + // minimum_parallel_grain_size, weighted by the number of nonzero entries + // per row on average. const unsigned int matrix_size = cols->n_nonzero_elements(); const unsigned int grain_size = internal::SparseMatrix::minimum_parallel_grain_size * @@ -168,7 +163,7 @@ SparseMatrix::operator = (const double d) val), grain_size); else if (matrix_size > 0) - memset (&val[0], 0, matrix_size*sizeof(number)); + std::memset (&val[0], 0, matrix_size*sizeof(number)); return *this; } -- 2.39.5