From 0a2ac13f1e61edf3c93e65faaa28dfab0faa9e4d Mon Sep 17 00:00:00 2001 From: wolf Date: Thu, 22 Nov 2001 16:25:00 +0000 Subject: [PATCH] Move fully specialized templates to the .cc file. git-svn-id: https://svn.dealii.org/trunk@5247 0785d39b-7218-0410-832d-ea1e28bc413d --- .../include/lac/filtered_matrix.templates.h | 127 ----------------- deal.II/lac/source/filtered_matrix.cc | 128 ++++++++++++++++++ 2 files changed, 128 insertions(+), 127 deletions(-) diff --git a/deal.II/lac/include/lac/filtered_matrix.templates.h b/deal.II/lac/include/lac/filtered_matrix.templates.h index 7b59c9c662..166c88dd4d 100644 --- a/deal.II/lac/include/lac/filtered_matrix.templates.h +++ b/deal.II/lac/include/lac/filtered_matrix.templates.h @@ -141,78 +141,6 @@ apply_constraints (Vector &v, -template <> -void -FilteredMatrix,Vector >:: -get_column_entries (const unsigned int index, - std::vector &column_entries, - const bool matrix_is_symmetric) const -{ - // depending on whether the matrix - // can be assumed symmetric or not, - // either use a fast or a slow - // algorithm - if (matrix_is_symmetric == true) - // ok, matrix is symmetric. we - // may determine the matrix - // entries in this column by - // looking at the matrix entries - // in this row which is - // significantly faster since we - // can traverse them linearly and - // do not have to check each row - // for the possible existence of - // a matrix entry - { - const unsigned int * - col_nums = &(matrix->get_sparsity_pattern().get_column_numbers() - [matrix->get_sparsity_pattern().get_rowstart_indices()[index]]); - const unsigned int - row_length = matrix->get_sparsity_pattern().row_length(index); - - for (unsigned int i=0; iget_sparsity_pattern()(row,index); - if (global_index != SparsityPattern::invalid_entry) - column_entries.push_back (std::make_pair(row, - (*matrix)(row,index))); - }; - }; -}; - - - -template <> -void -FilteredMatrix,BlockVector >:: -get_column_entries (const unsigned int /*index*/, - std::vector &/*column_entries*/, - const bool /*matrix_is_symmetric*/) const -{ - // presently not implemented, but - // should be fairly simple to do - Assert (false, ExcNotImplemented()); -}; - - - template void FilteredMatrix::pre_filter (Vector &v) const @@ -375,59 +303,4 @@ FilteredMatrix::memory_consumption () const -template <> -void -FilteredMatrix,Vector >:: -allocate_tmp_vector () -{ - tmp_mutex.acquire (); - tmp_vector.reinit (matrix->n(), true); - tmp_mutex.release (); -}; - - - -template <> -void -FilteredMatrix,Vector >:: -allocate_tmp_vector () -{ - tmp_mutex.acquire (); - tmp_vector.reinit (matrix->n(), true); - tmp_mutex.release (); -}; - - - -template <> -void -FilteredMatrix,BlockVector >:: -allocate_tmp_vector () -{ - std::vector block_sizes (matrix->n_block_rows()); - for (unsigned int i=0; iblock(i,i).n(); - - tmp_mutex.acquire (); - tmp_vector.reinit (block_sizes, true); - tmp_mutex.release (); -}; - - - -template <> -void -FilteredMatrix,BlockVector >:: -allocate_tmp_vector () -{ - std::vector block_sizes (matrix->n_block_rows()); - for (unsigned int i=0; iblock(i,i).n(); - - tmp_mutex.acquire (); - tmp_vector.reinit (block_sizes, true); - tmp_mutex.release (); -}; - - #endif diff --git a/deal.II/lac/source/filtered_matrix.cc b/deal.II/lac/source/filtered_matrix.cc index 40dc8c4242..87949890c5 100644 --- a/deal.II/lac/source/filtered_matrix.cc +++ b/deal.II/lac/source/filtered_matrix.cc @@ -15,5 +15,133 @@ #include +template <> +void +FilteredMatrix,Vector >:: +get_column_entries (const unsigned int index, + std::vector &column_entries, + const bool matrix_is_symmetric) const +{ + // depending on whether the matrix + // can be assumed symmetric or not, + // either use a fast or a slow + // algorithm + if (matrix_is_symmetric == true) + // ok, matrix is symmetric. we + // may determine the matrix + // entries in this column by + // looking at the matrix entries + // in this row which is + // significantly faster since we + // can traverse them linearly and + // do not have to check each row + // for the possible existence of + // a matrix entry + { + const unsigned int * + col_nums = &(matrix->get_sparsity_pattern().get_column_numbers() + [matrix->get_sparsity_pattern().get_rowstart_indices()[index]]); + const unsigned int + row_length = matrix->get_sparsity_pattern().row_length(index); + + for (unsigned int i=0; iget_sparsity_pattern()(row,index); + if (global_index != SparsityPattern::invalid_entry) + column_entries.push_back (std::make_pair(row, + (*matrix)(row,index))); + }; + }; +}; + + + +template <> +void +FilteredMatrix,BlockVector >:: +get_column_entries (const unsigned int /*index*/, + std::vector &/*column_entries*/, + const bool /*matrix_is_symmetric*/) const +{ + // presently not implemented, but + // should be fairly simple to do + Assert (false, ExcNotImplemented()); +}; + + + + +template <> +void +FilteredMatrix,Vector >:: +allocate_tmp_vector () +{ + tmp_mutex.acquire (); + tmp_vector.reinit (matrix->n(), true); + tmp_mutex.release (); +}; + + + +template <> +void +FilteredMatrix,Vector >:: +allocate_tmp_vector () +{ + tmp_mutex.acquire (); + tmp_vector.reinit (matrix->n(), true); + tmp_mutex.release (); +}; + + + +template <> +void +FilteredMatrix,BlockVector >:: +allocate_tmp_vector () +{ + std::vector block_sizes (matrix->n_block_rows()); + for (unsigned int i=0; iblock(i,i).n(); + + tmp_mutex.acquire (); + tmp_vector.reinit (block_sizes, true); + tmp_mutex.release (); +}; + + + +template <> +void +FilteredMatrix,BlockVector >:: +allocate_tmp_vector () +{ + std::vector block_sizes (matrix->n_block_rows()); + for (unsigned int i=0; iblock(i,i).n(); + + tmp_mutex.acquire (); + tmp_vector.reinit (block_sizes, true); + tmp_mutex.release (); +}; + + template class FilteredMatrix,Vector >; template class FilteredMatrix,BlockVector >; -- 2.39.5