From fa9f6faeab1946cb6f52334dd56477a45e702cf4 Mon Sep 17 00:00:00 2001 From: wolf Date: Thu, 22 Nov 2001 16:20:34 +0000 Subject: [PATCH] reinit allocated tmp vectors fast. git-svn-id: https://svn.dealii.org/trunk@5246 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/doc/news/2001/c-3-2.html | 9 +++++++++ deal.II/lac/include/lac/filtered_matrix.h | 6 +++++- deal.II/lac/include/lac/filtered_matrix.templates.h | 8 ++++---- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/deal.II/doc/news/2001/c-3-2.html b/deal.II/doc/news/2001/c-3-2.html index 625ebc1cea..68debc745f 100644 --- a/deal.II/doc/news/2001/c-3-2.html +++ b/deal.II/doc/news/2001/c-3-2.html @@ -94,6 +94,15 @@ documentation, etc.

lac

    +
  1. + Fixed: Allocation of temporary vectors in FilteredMatrix::allocate_tmp_vector + is now faster since it does no more copy the value of the + template vector. +
    + (WB 2001/11/22) +

    +
  2. Fixed: The FilteredMatrix::allocate_tmp_vector diff --git a/deal.II/lac/include/lac/filtered_matrix.h b/deal.II/lac/include/lac/filtered_matrix.h index 82a77c9843..31bd21758b 100644 --- a/deal.II/lac/include/lac/filtered_matrix.h +++ b/deal.II/lac/include/lac/filtered_matrix.h @@ -539,7 +539,11 @@ class FilteredMatrix : public Subscriptor * temporary vector. This * function has to be overloaded * for the various template - * parameter choices. + * parameter choices. Since the + * allocated vector will be + * filled by the site that calls + * this function, no + * initialization is necessary. */ void allocate_tmp_vector (); diff --git a/deal.II/lac/include/lac/filtered_matrix.templates.h b/deal.II/lac/include/lac/filtered_matrix.templates.h index 15344f1305..7b59c9c662 100644 --- a/deal.II/lac/include/lac/filtered_matrix.templates.h +++ b/deal.II/lac/include/lac/filtered_matrix.templates.h @@ -381,7 +381,7 @@ FilteredMatrix,Vector >:: allocate_tmp_vector () { tmp_mutex.acquire (); - tmp_vector.reinit (matrix->n()); + tmp_vector.reinit (matrix->n(), true); tmp_mutex.release (); }; @@ -393,7 +393,7 @@ FilteredMatrix,Vector >:: allocate_tmp_vector () { tmp_mutex.acquire (); - tmp_vector.reinit (matrix->n()); + tmp_vector.reinit (matrix->n(), true); tmp_mutex.release (); }; @@ -409,7 +409,7 @@ allocate_tmp_vector () block_sizes[i] = matrix->block(i,i).n(); tmp_mutex.acquire (); - tmp_vector.reinit (block_sizes); + tmp_vector.reinit (block_sizes, true); tmp_mutex.release (); }; @@ -425,7 +425,7 @@ allocate_tmp_vector () block_sizes[i] = matrix->block(i,i).n(); tmp_mutex.acquire (); - tmp_vector.reinit (block_sizes); + tmp_vector.reinit (block_sizes, true); tmp_mutex.release (); }; -- 2.39.5