From d8180fa541ad07b04c8a940af01e3040f51e5014 Mon Sep 17 00:00:00 2001 From: wolf Date: Mon, 24 Sep 2001 08:16:00 +0000 Subject: [PATCH] Fix spelling. Doc updates. git-svn-id: https://svn.dealii.org/trunk@5032 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/lac/include/lac/block_sparse_matrix.h | 2 +- deal.II/lac/include/lac/filtered_matrix.h | 2 +- deal.II/lac/include/lac/full_matrix.h | 151 ++++++++++++------ deal.II/lac/include/lac/sparse_matrix.h | 4 +- .../lac/include/lac/sparse_vanka.templates.h | 2 +- deal.II/lac/include/lac/vector.templates.h | 9 ++ 6 files changed, 116 insertions(+), 54 deletions(-) diff --git a/deal.II/lac/include/lac/block_sparse_matrix.h b/deal.II/lac/include/lac/block_sparse_matrix.h index 786bf61faf..bc43eb0b1b 100644 --- a/deal.II/lac/include/lac/block_sparse_matrix.h +++ b/deal.II/lac/include/lac/block_sparse_matrix.h @@ -37,7 +37,7 @@ template class BlockVector; * preconditioners, where each block belongs to a specific component * of the equation you are presently discretizing. * - * Note that the number of blocks and rows are implicitely determined + * Note that the number of blocks and rows are implicitly determined * by the sparsity pattern objects used. * * diff --git a/deal.II/lac/include/lac/filtered_matrix.h b/deal.II/lac/include/lac/filtered_matrix.h index 621b3c2d80..95ade6b7fb 100644 --- a/deal.II/lac/include/lac/filtered_matrix.h +++ b/deal.II/lac/include/lac/filtered_matrix.h @@ -77,7 +77,7 @@ template class Vector; * unconstrained nodes, the latter on the constrained ones). * * In iterative solvers, it is not actually necessary to compute $A_X$ - * explicitely, since only matrix-vector operations need to be + * explicitly, since only matrix-vector operations need to be * performed. This can be done in a three-step procedure that first * clears all elements in the incoming vector that belong to * constrained nodes, then performs the product with the matrix $A$, diff --git a/deal.II/lac/include/lac/full_matrix.h b/deal.II/lac/include/lac/full_matrix.h index de5ac4995b..f1b0b0627b 100644 --- a/deal.II/lac/include/lac/full_matrix.h +++ b/deal.II/lac/include/lac/full_matrix.h @@ -64,28 +64,46 @@ class FullMatrix : public vector2d { public: /** - * Constructor. Initialize the matrix as - * a square matrix with dimension @p{n}. + * Constructor. Initialize the + * matrix as a square matrix with + * dimension @p{n}. * * In order to avoid the implicit - * conversion of integers and other types - * to a matrix, this constructor is - * declared @p{explicit}. + * conversion of integers and + * other types to a matrix, this + * constructor is declared + * @p{explicit}. * - * By default, no memory is allocated. + * By default, no memory is + * allocated. */ explicit FullMatrix (const unsigned int n = 0); /** - * Constructor. Initialize the matrix as - * a rectangular matrix. + * Constructor. Initialize the + * matrix as a rectangular + * matrix. */ FullMatrix (const unsigned int rows, const unsigned int cols); /** - * Copy constructor. This constructor does - * a deep copy of the matrix. Therefore, - * it poses an efficiency problem. + * Copy constructor. This + * constructor does a deep copy + * of the matrix. Therefore, it + * poses a possible efficiency + * problem, if for example, + * function arguments are passed + * by value rather than by + * reference. Unfortunately, we + * can't mark this copy + * constructor @p{explicit}, + * since that prevents the use of + * this class in containers, such + * as @p{std::vector}. The + * responsibility to check + * performance of programs must + * therefore remains with the + * user of this class. */ FullMatrix (const FullMatrix&); @@ -101,11 +119,13 @@ class FullMatrix : public vector2d /** - * Comparison operator. Be careful with - * this thing, it may eat up huge amounts - * of computing time! It is most commonly - * used for internal consistency checks - * of programs. + * Comparison operator. Be + * careful with this thing, it + * may eat up huge amounts of + * computing time! It is most + * commonly used for internal + * consistency checks of + * programs. */ bool operator == (const FullMatrix &) const; @@ -114,14 +134,16 @@ class FullMatrix : public vector2d * * The matrix @p{src} is copied * into the target. The optional - * values @p{i} and @p{j} determine the - * upper left corner of the image - * of @p{src}. + * values @p{i} and @p{j} + * determine the upper left + * corner of the image of + * @p{src}. * * This function requires that * @p{i+src.m()<=m()} and - * @p{j+src.n()<=n()}, that is, the - * image fits into the space of @p{this}. + * @p{j+src.n()<=n()}, that is, + * the image fits into the space + * of @p{this}. */ template void fill (const FullMatrix &src, @@ -130,7 +152,8 @@ class FullMatrix : public vector2d /** - * Make function of base class available. + * Make function of base class + * available. */ template void fill (const number2*); @@ -278,7 +301,8 @@ class FullMatrix : public vector2d const bool adding=false) const; /** - * Transpose matrix-vector-multiplication. + * Transpose + * matrix-vector-multiplication. * See @p{vmult} above. */ template @@ -476,43 +500,87 @@ class FullMatrix : public vector2d * Swap A(i,1-n) <-> A(j,1-n). * Swap rows i and j of this */ - void swap_row (const unsigned int i, const unsigned int j); + void swap_row (const unsigned int i, + const unsigned int j); /** * Swap A(1-n,i) <-> A(1-n,j). * Swap columns i and j of this */ - void swap_col (const unsigned int i, const unsigned int j); + void swap_col (const unsigned int i, + const unsigned int j); + + /** + * A(i,i)+=B(i,1-n). Addition of complete + * rows of B to diagonal-elements of this ;

+ * ( i = 1 ... m ) + */ + template + void add_diag (const number s, + const FullMatrix &B); + + /** + * Add constant to diagonal + * elements of this, i.e. add a + * multiple of the identity + * matrix. + */ + void diagadd (const number s); /** * $w=b-A*v$. * Residual calculation , returns - * the $l_2$-norm $|w|$ + * the $l_2$-norm $|w|$. */ template - double residual (Vector & w, - const Vector& v, - const Vector& b) const; + double residual (Vector &w, + const Vector &v, + const Vector &b) const; /** * Forward elimination of lower * triangle. Inverts the lower - * triangle of a quadratic - * matrix. + * triangle of a quadratic matrix + * for a given right hand side. * * If the matrix has more columns * than rows, this function only * operates on the left square * submatrix. If there are more * rows, the upper square part of - * the matrix is considered + * the matrix is considered. + * + * Note that this function does + * not fit into this class at + * all, since it assumes that the + * elements of this object do not + * represent a matrix, but rather + * a decomposition into two + * factors. Therefore, if this + * assumption holds, all + * functions like multiplication + * by matrices or vectors, norms, + * etc, have no meaning any + * more. Conversely, if these + * functions have a meaning on + * this object, then the + * @p{forward} function has no + * meaning. This bifacial + * property of this class is + * probably a design mistake and + * may once go away by separating + * the @p{forward} and + * @p{backward} functions into a + * class of their own. */ template void forward (Vector &dst, const Vector &src) const; /** - * Backward elimination of upper triangle. + * Backward elimination of upper + * triangle. + * * @see forward */ template @@ -543,21 +611,6 @@ class FullMatrix : public vector2d double least_squares (Vector &dst, Vector &src); - /** - * A(i,i)+=B(i,1-n). Addition of complete - * rows of B to diagonal-elements of this ;

- * ( i = 1 ... m ) - */ - template - void add_diag (const number s, - const FullMatrix &B); - - /** - * A(i,i)+=s i=1-m. - * Add constant to diagonal elements of this - */ - void diagadd (const number s); - /** * Output of the matrix in * user-defined format. @@ -574,7 +627,7 @@ class FullMatrix : public vector2d * readability, elements not in * the matrix are displayed as * empty space, while matrix - * elements which are explicitely + * elements which are explicitly * set to zero are displayed as * such. * diff --git a/deal.II/lac/include/lac/sparse_matrix.h b/deal.II/lac/include/lac/sparse_matrix.h index 6133d3602f..09d903db84 100644 --- a/deal.II/lac/include/lac/sparse_matrix.h +++ b/deal.II/lac/include/lac/sparse_matrix.h @@ -266,7 +266,7 @@ class SparseMatrix : public Subscriptor * case, then the result of this * operation will not be a * symmetric matrix, since it - * only explicitely symmetrizes + * only explicitly symmetrizes * by looping over the lower left * triangular part for efficiency * reasons; if there are entries @@ -724,7 +724,7 @@ class SparseMatrix : public Subscriptor * readability, elements not in * the matrix are displayed as * empty space, while matrix - * elements which are explicitely + * elements which are explicitly * set to zero are displayed as * such. * diff --git a/deal.II/lac/include/lac/sparse_vanka.templates.h b/deal.II/lac/include/lac/sparse_vanka.templates.h index b90cf41902..410a8856c4 100644 --- a/deal.II/lac/include/lac/sparse_vanka.templates.h +++ b/deal.II/lac/include/lac/sparse_vanka.templates.h @@ -278,7 +278,7 @@ SparseVanka::apply_preconditioner (Vector &dst, // row (as stored in the // SparsityPattern object // - // since we do not explicitely + // since we do not explicitly // consider nonsysmmetric sparsity // patterns, the first element // of each entry simply denotes diff --git a/deal.II/lac/include/lac/vector.templates.h b/deal.II/lac/include/lac/vector.templates.h index 644bc76402..3ce808a5ba 100644 --- a/deal.II/lac/include/lac/vector.templates.h +++ b/deal.II/lac/include/lac/vector.templates.h @@ -19,6 +19,15 @@ #include +/* + Note that in this file, we use std::fabs, std::sqrt, etc + everywhere. The reason is that we want to use those version of these + functions that take a variable of the template type "Number", rather + than the C standard function which accepts and returns a double. The + C++ standard library therefore offers overloaded versions of these + functions taking floats, or long doubles, with the importance on the + additional accuracy when using long doubles. + */ template static inline Number sqr (const Number x) -- 2.39.5