From 125412d8b6b565ac2ed673206110a2391ed6a80a Mon Sep 17 00:00:00 2001 From: kanschat Date: Wed, 27 Sep 2006 20:27:57 +0000 Subject: [PATCH] group member functions git-svn-id: https://svn.dealii.org/trunk@13970 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/lac/include/lac/full_matrix.h | 2 +- deal.II/lac/include/lac/sparse_matrix.h | 133 ++++++++++++++++-------- 2 files changed, 89 insertions(+), 46 deletions(-) diff --git a/deal.II/lac/include/lac/full_matrix.h b/deal.II/lac/include/lac/full_matrix.h index 7176c52f9f..ba811f9015 100644 --- a/deal.II/lac/include/lac/full_matrix.h +++ b/deal.II/lac/include/lac/full_matrix.h @@ -187,7 +187,7 @@ class FullMatrix : public Table<2,number> Accessor accessor; }; /** - * @name Constructors Constructors and initalization. + * @name Constructors and initalization. * See also the base class Table. */ //@{ diff --git a/deal.II/lac/include/lac/sparse_matrix.h b/deal.II/lac/include/lac/sparse_matrix.h index a81102c08f..3beeca1bc8 100644 --- a/deal.II/lac/include/lac/sparse_matrix.h +++ b/deal.II/lac/include/lac/sparse_matrix.h @@ -501,6 +501,10 @@ class SparseMatrix : public virtual Subscriptor static const bool zero_addition_can_be_elided = true; }; +/** + * @name Constructors and initalization. + */ +//@{ /** * Constructor; initializes the matrix to * be empty, without any structure, i.e. @@ -671,7 +675,11 @@ class SparseMatrix : public virtual Subscriptor * previously tied to. */ virtual void clear (); - +//@} +/** + * @name Information on the matrix + */ +//@{ /** * Return whether the object is * empty. It is empty if either @@ -722,6 +730,33 @@ class SparseMatrix : public virtual Subscriptor */ unsigned int n_actually_nonzero_elements () const; + /** + * Return a (constant) reference + * to the underlying sparsity + * pattern of this matrix. + * + * Though the return value is + * declared const, you + * should be aware that it may + * change if you call any + * nonconstant function of + * objects which operate on it. + */ + const SparsityPattern & get_sparsity_pattern () const; + + /** + * Determine an estimate for the + * memory consumption (in bytes) + * of this object. See + * MemoryConsumption. + */ + unsigned int memory_consumption () const; + +//@} +/** + * @name Modifying entries + */ +//@{ /** * Set the element (i,j) * to value. Throws an @@ -907,6 +942,11 @@ class SparseMatrix : public virtual Subscriptor template void add_scaled (const number factor, const SparseMatrix &matrix); +//@} +/** + * @name Entry Access + */ +//@{ /** * Return the value of the entry @@ -1040,6 +1080,11 @@ class SparseMatrix : public virtual Subscriptor */ number & global_entry (const unsigned int i); +//@} +/** + * @name Matrix vector multiplications + */ +//@{ /** * Matrix-vector multiplication: * let dst = M*src with @@ -1178,6 +1223,31 @@ class SparseMatrix : public virtual Subscriptor template somenumber matrix_scalar_product (const Vector &u, const Vector &v) const; + /** + * Compute the residual of an + * equation Mx=b, where + * the residual is defined to be + * r=b-Mx. Write the + * residual into + * dst. The + * l2 norm of + * the residual vector is + * returned. + * + * Source x and destination + * dst must not be the same + * vector. + */ + template + somenumber residual (Vector &dst, + const Vector &x, + const Vector &b) const; + +//@} +/** + * @name Matrix norms + */ +//@{ /** * Return the l1-norm of the matrix, that is @@ -1213,26 +1283,11 @@ class SparseMatrix : public virtual Subscriptor * matrix. */ number frobenius_norm () const; - - /** - * Compute the residual of an - * equation Mx=b, where - * the residual is defined to be - * r=b-Mx. Write the - * residual into - * dst. The - * l2 norm of - * the residual vector is - * returned. - * - * Source x and destination - * dst must not be the same - * vector. - */ - template - somenumber residual (Vector &dst, - const Vector &x, - const Vector &b) const; +//@} +/** + * @name Preconditioning methods + */ +//@{ /** * Apply the Jacobi @@ -1390,20 +1445,11 @@ class SparseMatrix : public virtual Subscriptor void SSOR_step (Vector &v, const Vector &b, const number om = 1.) const; - - /** - * Return a (constant) reference - * to the underlying sparsity - * pattern of this matrix. - * - * Though the return value is - * declared const, you - * should be aware that it may - * change if you call any - * nonconstant function of - * objects which operate on it. - */ - const SparsityPattern & get_sparsity_pattern () const; +//@} +/** + * @name Iterators + */ +//@{ /** * STL-like iterator with the first entry @@ -1488,7 +1534,12 @@ class SparseMatrix : public virtual Subscriptor * iterator for the last row of a matrix. */ iterator end (const unsigned int r); - +//@} +/** + * @name Input/Output + */ +//@{ + /** * Print the matrix to the given * stream, using the format @@ -1600,15 +1651,7 @@ class SparseMatrix : public virtual Subscriptor * not more. */ void block_read (std::istream &in); - - /** - * Determine an estimate for the - * memory consumption (in bytes) - * of this object. See - * MemoryConsumption. - */ - unsigned int memory_consumption () const; - +//@} /** @addtogroup Exceptions * @{ */ -- 2.39.5