From 6543b9951e1c0cd7597e91ebdcbcb464cc0a0c82 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Thu, 22 Jan 2015 08:53:54 -0600 Subject: [PATCH] Remove some of the deprecated functions in SparsityPattern. --- doc/news/changes.h | 4 +- include/deal.II/lac/sparsity_pattern.h | 238 ------------------------- source/lac/sparsity_pattern.cc | 106 ----------- tests/bits/sparse_matrix_01a.cc | 4 +- tests/umfpack/umfpack_08.cc | 5 +- tests/umfpack/umfpack_09.cc | 5 +- tests/umfpack/umfpack_11.cc | 5 +- 7 files changed, 10 insertions(+), 357 deletions(-) diff --git a/doc/news/changes.h b/doc/news/changes.h index d8e1bff1ec..af1f2c4ba4 100644 --- a/doc/news/changes.h +++ b/doc/news/changes.h @@ -150,7 +150,7 @@ inconvenience this causes. - Vector::scale. - TrilinosWrappers::*Vector*::compress with an Epetra_CombineMode argument - - ChunkSparsityPattern functions that take an + - SparsityPattern and ChunkSparsityPattern functions that take an optimize_diagonal argument.
This release also removes the deprecated class MGDoFHandler. The @@ -176,7 +176,7 @@ inconvenience this causes. same function with the level argument for each of the levels of the triangulation individually.
- (Wolfgang Bangerth, 2014/12/29-2015/01/11) + (Wolfgang Bangerth, 2014/12/29-2015/01/22)
  • Removed: The config.h file no longer exports HAVE_* definitions. diff --git a/include/deal.II/lac/sparsity_pattern.h b/include/deal.II/lac/sparsity_pattern.h index c5dd1aa0fd..a528322d6b 100644 --- a/include/deal.II/lac/sparsity_pattern.h +++ b/include/deal.II/lac/sparsity_pattern.h @@ -980,214 +980,6 @@ public: */ // @{ - /** - * Initialize a rectangular matrix. - * - * @arg m number of rows @arg n number of columns @arg max_per_row maximum - * number of nonzero entries per row @arg optimize_diagonal This parameter - * is ignored. - * - * @deprecated Use the constructor without the last argument since it is - * ignored. - */ - SparsityPattern (const size_type m, - const size_type n, - const unsigned int max_per_row, - const bool optimize_diagonal) DEAL_II_DEPRECATED; - - /** - * Initialize a rectangular matrix. - * - * @arg m number of rows @arg n number of columns @arg row_lengths possible - * number of nonzero entries for each row. This vector must have one entry - * for each row. @arg optimize_diagonal This argument is ignored. - * - * @deprecated Use the constructor without the last argument since it is - * ignored. - */ - SparsityPattern (const size_type m, - const size_type n, - const std::vector &row_lengths, - const bool optimize_diagonal) DEAL_II_DEPRECATED; - - /** - * Initialize a quadratic matrix. - * - * @arg m number of rows and columns @arg row_lengths possible number of - * nonzero entries for each row. This vector must have one entry for each - * row. @arg optimize_diagonal This argument is ignored. - * - * @deprecated Use the constructor without the last argument since it is - * ignored. - */ - SparsityPattern (const size_type m, - const std::vector &row_lengths, - const bool optimize_diagonal) DEAL_II_DEPRECATED; - - - /** - * Reallocate memory for a matrix of size m x n. The number of - * entries for each row is taken from the array row_lengths which - * has to give this number of each row i=1...m. - * - * If m*n==0 all memory is freed, resulting in a total - * reinitialization of the object. If it is nonzero, new memory is only - * allocated if the new size extends the old one. This is done to save time - * and to avoid fragmentation of the heap. - * - * If the number of rows equals the number of columns and the last parameter - * is true, diagonal elements are stored first in each row to allow - * optimized access in relaxation methods of SparseMatrix. - * - * @deprecated The last argument of this function is ignored. Use the - * version of this function without the last argument. - */ - void reinit (const size_type m, - const size_type n, - const std::vector &row_lengths, - const bool optimize_diagonal) DEAL_II_DEPRECATED; - - - /** - * Same as above, but with a VectorSlice argument instead. - * - * @deprecated The last argument of this function is ignored. Use the - * version of this function without the last argument. - */ - void reinit (const size_type m, - const size_type n, - const VectorSlice > &row_lengths, - const bool optimize_diagonal) DEAL_II_DEPRECATED; - - /** - * Reallocate memory and set up data structures for a new matrix with m - * rows and n columns, with at most max_per_row - * nonzero entries per row. - * - * This function simply maps its operations to the other reinit - * function. - * - * @deprecated The last argument of this function is ignored. Use the - * version of this function without the last argument. - */ - void reinit (const size_type m, - const size_type n, - const unsigned int max_per_row, - const bool optimize_diagonal) DEAL_II_DEPRECATED; - - /** - * This function can be used as a replacement for reinit(), subsequent calls - * to add() and a final call to close() if you know exactly in advance the - * entries that will form the matrix sparsity pattern. - * - * The first two parameters determine the size of the matrix. For the two - * last ones, note that a sparse matrix can be described by a sequence of - * rows, each of which is represented by a sequence of pairs of column - * indices and values. In the present context, the begin() and end() - * parameters designate iterators (of forward iterator type) into a - * container, one representing one row. The distance between begin() and - * end() should therefore be equal to n_rows(). These iterators may be - * iterators of std::vector, std::list, pointers into a - * C-style array, or any other iterator satisfying the requirements of a - * forward iterator. The objects pointed to by these iterators (i.e. what we - * get after applying operator* or operator-> to one of - * these iterators) must be a container itself that provides functions - * begin and end designating a range of iterators that - * describe the contents of one line. Dereferencing these inner iterators - * must either yield a pair of an unsigned integer as column index and a - * value of arbitrary type (such a type would be used if we wanted to - * describe a sparse matrix with one such object), or simply an unsigned - * integer (of we only wanted to describe a sparsity pattern). The function - * is able to determine itself whether an unsigned integer or a pair is what - * we get after dereferencing the inner iterators, through some template - * magic. - * - * While the order of the outer iterators denotes the different rows of the - * matrix, the order of the inner iterator denoting the columns does not - * matter, as they are sorted internal to this function anyway. - * - * Since that all sounds very complicated, consider the following example - * code, which may be used to fill a sparsity pattern: - * @code - * std::vector > column_indices (n_rows); - * for (unsigned int row=0; rowbegin and end (namely - * std::vectors), and the inner iterators dereferenced yield - * unsigned integers as column indices. Note that we could have replaced - * each of the two std::vector occurrences by std::list, - * and the inner one by std::set as well. - * - * Another example would be as follows, where we initialize a whole matrix, - * not only a sparsity pattern: - * @code - * std::vector > entries (n_rows); - * for (unsigned int row=0; rowstd::vector could - * be replaced by std::list, and the inner std::map could be replaced by std::vector >, or a list or set of such pairs, as they all return - * iterators that point to such pairs. - * - * @deprecated The last argument of this function is ignored. Use the - * version of this function without the last argument. - */ - template - void copy_from (const size_type n_rows, - const size_type n_cols, - const ForwardIterator begin, - const ForwardIterator end, - const bool optimize_diagonal) DEAL_II_DEPRECATED; - - /** - * Copy data from an object of type CompressedSparsityPattern, - * CompressedSetSparsityPattern or CompressedSimpleSparsityPattern. Previous - * content of this object is lost, and the sparsity pattern is in compressed - * mode afterwards. - * - * @deprecated The last argument of this function is ignored. Use the - * version of this function without the last argument. - */ - template - void copy_from (const CompressedSparsityType &csp, - const bool optimize_diagonal) DEAL_II_DEPRECATED; - - - /** - * Take a full matrix and use its nonzero entries to generate a sparse - * matrix entry pattern for this object. - * - * Previous content of this object is lost, and the sparsity pattern is in - * compressed mode afterwards. - * - * @deprecated The last argument of this function is ignored. Use the - * version of this function without the last argument. - */ - template - void copy_from (const FullMatrix &matrix, - const bool optimize_diagonal) DEAL_II_DEPRECATED; /** * STL-like iterator with the first entry of row r. @@ -1215,15 +1007,6 @@ public: */ row_iterator row_end (const size_type r) const DEAL_II_DEPRECATED; - /** - * Determine whether the matrix uses the special convention for quadratic - * matrices that the diagonal entries are stored first in each row. - * - * @deprecated The function always returns true if the matrix is square and - * false if it is not. - */ - bool optimize_diagonal () const DEAL_II_DEPRECATED; - /** * @deprecated This function is deprecated. Use SparsityTools::partition * instead. @@ -1752,14 +1535,6 @@ SparsityPattern::is_compressed () const } -inline -bool -SparsityPattern::optimize_diagonal () const -{ - return store_diagonal_first_in_row; -} - - inline bool SparsityPattern::stores_only_added_elements () const @@ -1920,19 +1695,6 @@ namespace internal -template -void -SparsityPattern::copy_from (const size_type n_rows, - const size_type n_cols, - const ForwardIterator begin, - const ForwardIterator end, - const bool) -{ - copy_from (n_rows, n_cols, begin, end); -} - - - template void SparsityPattern::copy_from (const size_type n_rows, diff --git a/source/lac/sparsity_pattern.cc b/source/lac/sparsity_pattern.cc index 05331c748a..3c8282a582 100644 --- a/source/lac/sparsity_pattern.cc +++ b/source/lac/sparsity_pattern.cc @@ -73,23 +73,6 @@ SparsityPattern::SparsityPattern (const SparsityPattern &s) -SparsityPattern::SparsityPattern (const size_type m, - const size_type n, - const unsigned int max_per_row, - const bool) - : - max_dim(0), - max_vec_len(0), - rowstart(0), - colnums(0), - compressed(false), - store_diagonal_first_in_row(m == n) -{ - reinit (m,n,max_per_row); -} - - - SparsityPattern::SparsityPattern (const size_type m, const size_type n, const unsigned int max_per_row) @@ -106,21 +89,6 @@ SparsityPattern::SparsityPattern (const size_type m, -SparsityPattern::SparsityPattern (const size_type m, - const size_type n, - const std::vector &row_lengths, - const bool) - : - max_dim(0), - max_vec_len(0), - rowstart(0), - colnums(0), - store_diagonal_first_in_row(m == n) -{ - reinit (m, n, row_lengths); -} - - SparsityPattern::SparsityPattern (const size_type m, const size_type n, const std::vector &row_lengths) @@ -149,19 +117,6 @@ SparsityPattern::SparsityPattern (const size_type n, -SparsityPattern::SparsityPattern (const size_type m, - const std::vector &row_lengths, - const bool) - : - max_dim(0), - max_vec_len(0), - rowstart(0), - colnums(0) -{ - reinit (m, m, row_lengths); -} - - SparsityPattern::SparsityPattern (const size_type m, const std::vector &row_lengths) : @@ -286,19 +241,6 @@ SparsityPattern::operator = (const SparsityPattern &s) -void -SparsityPattern::reinit (const size_type m, - const size_type n, - const unsigned int max_per_row, - const bool) -{ - // simply map this function to the other @p{reinit} function - const std::vector row_lengths (m, max_per_row); - reinit (m, n, row_lengths); -} - - - void SparsityPattern::reinit (const size_type m, const size_type n, @@ -311,17 +253,6 @@ SparsityPattern::reinit (const size_type m, -void -SparsityPattern::reinit (const size_type m, - const size_type n, - const VectorSlice > &row_lengths, - const bool) -{ - reinit (m, n, row_lengths); -} - - - void SparsityPattern::reinit (const size_type m, const size_type n, @@ -549,16 +480,6 @@ SparsityPattern::compress () -template -void -SparsityPattern::copy_from (const CSP &csp, - const bool) -{ - copy_from (csp); -} - - - template void SparsityPattern::copy_from (const CSP &csp) @@ -602,15 +523,6 @@ SparsityPattern::copy_from (const CSP &csp) -template -void SparsityPattern::copy_from (const FullMatrix &matrix, - const bool) -{ - copy_from (matrix); -} - - - template void SparsityPattern::copy_from (const FullMatrix &matrix) { @@ -644,17 +556,6 @@ void SparsityPattern::copy_from (const FullMatrix &matrix) } -void -SparsityPattern::reinit (const size_type m, - const size_type n, - const std::vector &row_lengths, - const bool) -{ - reinit(m, n, make_slice(row_lengths)); -} - - - void SparsityPattern::reinit (const size_type m, const size_type n, @@ -1073,13 +974,6 @@ partition (const unsigned int n_partitions, // explicit instantiations -template void SparsityPattern::copy_from (const SparsityPattern &, bool); -template void SparsityPattern::copy_from (const CompressedSparsityPattern &, bool); -template void SparsityPattern::copy_from (const CompressedSetSparsityPattern &, bool); -template void SparsityPattern::copy_from (const CompressedSimpleSparsityPattern &, bool); -template void SparsityPattern::copy_from (const FullMatrix &, bool); -template void SparsityPattern::copy_from (const FullMatrix &, bool); - template void SparsityPattern::copy_from (const SparsityPattern &); template void SparsityPattern::copy_from (const CompressedSparsityPattern &); template void SparsityPattern::copy_from (const CompressedSetSparsityPattern &); diff --git a/tests/bits/sparse_matrix_01a.cc b/tests/bits/sparse_matrix_01a.cc index 9412478a35..009ea05bd5 100644 --- a/tests/bits/sparse_matrix_01a.cc +++ b/tests/bits/sparse_matrix_01a.cc @@ -1,6 +1,6 @@ // --------------------------------------------------------------------- // -// Copyright (C) 2004 - 2014 by the deal.II authors +// Copyright (C) 2004 - 2015 by the deal.II authors // // This file is part of the deal.II library. // @@ -28,7 +28,7 @@ void test () { - SparsityPattern sp (5,5,3,false); + SparsityPattern sp (5,5,3); for (unsigned int i=0; i<5; ++i) for (unsigned int j=0; j<5; ++j) if ((i+2*j+1) % 3 == 0) diff --git a/tests/umfpack/umfpack_08.cc b/tests/umfpack/umfpack_08.cc index b402b10637..db2e855c98 100644 --- a/tests/umfpack/umfpack_08.cc +++ b/tests/umfpack/umfpack_08.cc @@ -1,6 +1,6 @@ // --------------------------------------------------------------------- // -// Copyright (C) 2002 - 2014 by the deal.II authors +// Copyright (C) 2002 - 2015 by the deal.II authors // // This file is part of the deal.II library. // @@ -74,8 +74,7 @@ void test () j!=2 ? dof_handler.n_dofs()/3 : dof_handler.n_dofs()-2*(dof_handler.n_dofs()/3), - dof_handler.max_couplings_between_dofs(), - false); + dof_handler.max_couplings_between_dofs()); sparsity_pattern.collect_sizes(); DoFTools::make_sparsity_pattern (dof_handler, sparsity_pattern); sparsity_pattern.compress (); diff --git a/tests/umfpack/umfpack_09.cc b/tests/umfpack/umfpack_09.cc index 5afcc612a1..016f4d85eb 100644 --- a/tests/umfpack/umfpack_09.cc +++ b/tests/umfpack/umfpack_09.cc @@ -1,6 +1,6 @@ // --------------------------------------------------------------------- // -// Copyright (C) 2002 - 2014 by the deal.II authors +// Copyright (C) 2002 - 2015 by the deal.II authors // // This file is part of the deal.II library. // @@ -74,8 +74,7 @@ void test () j!=2 ? dof_handler.n_dofs()/3 : dof_handler.n_dofs()-2*(dof_handler.n_dofs()/3), - dof_handler.max_couplings_between_dofs(), - false); + dof_handler.max_couplings_between_dofs()); sparsity_pattern.collect_sizes(); DoFTools::make_sparsity_pattern (dof_handler, sparsity_pattern); sparsity_pattern.compress (); diff --git a/tests/umfpack/umfpack_11.cc b/tests/umfpack/umfpack_11.cc index dcf917c282..26a6e76b8a 100644 --- a/tests/umfpack/umfpack_11.cc +++ b/tests/umfpack/umfpack_11.cc @@ -1,6 +1,6 @@ // --------------------------------------------------------------------- // -// Copyright (C) 2002 - 2014 by the deal.II authors +// Copyright (C) 2002 - 2015 by the deal.II authors // // This file is part of the deal.II library. // @@ -75,8 +75,7 @@ void test () j!=2 ? dof_handler.n_dofs()/3 : dof_handler.n_dofs()-2*(dof_handler.n_dofs()/3), - dof_handler.max_couplings_between_dofs(), - false); + dof_handler.max_couplings_between_dofs()); sparsity_pattern.collect_sizes(); DoFTools::make_sparsity_pattern (dof_handler, sparsity_pattern); sparsity_pattern.compress (); -- 2.39.5