From: wolf Date: Tue, 4 May 1999 11:46:45 +0000 (+0000) Subject: Implement a way to get the actual maximum number of elements per row from the sparsit... X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c8bfed8dd0bd5840cec27465169e3add9bf6787d;p=dealii-svn.git Implement a way to get the actual maximum number of elements per row from the sparsity pattern. git-svn-id: https://svn.dealii.org/trunk@1261 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/lac/include/lac/sparse_matrix.h b/deal.II/lac/include/lac/sparse_matrix.h index 3c215ec5c0..23507bc94c 100644 --- a/deal.II/lac/include/lac/sparse_matrix.h +++ b/deal.II/lac/include/lac/sparse_matrix.h @@ -174,7 +174,16 @@ class SparseMatrixStruct : public Subscriptor * dimensions are zero. */ bool empty () const; - + + /** + * Return the maximum number of entries per + * row. Before compression, this equals the + * number given to the constructor, while + * after compression, it equals the maximum + * number of entries actually allocated by + * the user. + */ + unsigned int max_entries_per_row () const; /** * Return the index of the matrix diff --git a/deal.II/lac/source/sparse_matrix.cc b/deal.II/lac/source/sparse_matrix.cc index ca35ddb28f..4df57c18c7 100644 --- a/deal.II/lac/source/sparse_matrix.cc +++ b/deal.II/lac/source/sparse_matrix.cc @@ -321,6 +321,18 @@ SparseMatrixStruct::empty () const { +unsigned int +SparseMatrixStruct::max_entries_per_row () const +{ + unsigned int m = 0; + for (unsigned int i=1; i