From: Wolfgang Bangerth Date: Mon, 25 May 1998 22:30:33 +0000 (+0000) Subject: Doc update and move some functions from the class declaration to the inline section... X-Git-Tag: v8.0.0~22892 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3057b5d5bea4a3de133b94495cb1f31f14e2f4a7;p=dealii.git Doc update and move some functions from the class declaration to the inline section or the .cc-file. git-svn-id: https://svn.dealii.org/trunk@362 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/lac/include/lac/dfmatrix.h b/deal.II/lac/include/lac/dfmatrix.h index 4a579bc3d6..134be26e30 100644 --- a/deal.II/lac/include/lac/dfmatrix.h +++ b/deal.II/lac/include/lac/dfmatrix.h @@ -50,34 +50,35 @@ class dFMatrix void init (const unsigned int m, const unsigned int n); /** - * Access Elements. returns A(i,j) + * Return a read-write reference to the + * element #(i,j)#. + * + * This function does no bounds checking. */ - double& el (const unsigned int i, const unsigned int j) { - return val[i*dim_range+j]; - }; + double& el (const unsigned int i, const unsigned int j); /** - * Access Elements. returns A(i,j) + * Return the value of the element #(i,j)#. + * + * This function does no bounds checking. */ - double el (const unsigned int i, const unsigned int j) const { - return val[i*dim_range+j]; - }; + double el (const unsigned int i, const unsigned int j) const; public: /**@name 1: Basic Object-handling */ //@{ /** - * Constructor. Dimension = (n,n)

- * -> quadratic matrix (n rows , n columns) + * Constructor. Initialize the matrix as + * a square matrix with dimension #n#. */ - dFMatrix (const unsigned int n = 1) { init(n,n); } + dFMatrix (const unsigned int n = 1); /** - * Constructor. Dimension = (m,n)

- * -> rectangular matrix (m rows , n columns) + * Constructor. Initialize the matrix as + * a rectangular #m# times #n# matrix. */ - dFMatrix (const unsigned int m,unsigned int n) { init(m,n); } + dFMatrix (const unsigned int m, const unsigned int n); /** * Copy constructor. Be very careful with @@ -88,14 +89,16 @@ class dFMatrix dFMatrix (const dFMatrix&); /** - * Destructor. Clears memory + * Destructor. Release all memory. */ ~dFMatrix(); - /** + /** * Comparison operator. Be careful with * this thing, it may eat up huge amounts - * of computing time! + * of computing time! It is most commonly + * used for internal consistency checks + * of programs. */ bool operator == (const dFMatrix &) const; @@ -123,24 +126,28 @@ class dFMatrix * Set dimension to (n,n)

* ( reinit quadratic matrix ) */ - void reinit (const unsigned int n) { reinit(n,n); } + void reinit (const unsigned int n); /** * Adjust Dimension. * Set dimension to ( m(B),n(B) )

* ( adjust to dimensions of another matrix B ) */ - void reinit (const dFMatrix& B) { reinit(B.m(), B.n()); } + void reinit (const dFMatrix &B); /** - * Inquire Dimension (Row) . returns Number of Rows + * Return number of rows of this matrix. + * To remember: this matrix is an + * $m \times n$-matrix. */ - unsigned int m() const { return dim_image; } + unsigned int m () const; /** - * Inquire Dimension (Col) . returns Number of Columns + * Return number of columns of this matrix. + * To remember: this matrix is an + * $m \times n$-matrix. */ - unsigned int n () const { return dim_range; } + unsigned int n () const; /** * Return whether the matrix contains only @@ -162,28 +169,23 @@ class dFMatrix * Access Elements. returns element at relative 'address' i

* ( -> access to A(i/n , i mod n) ) */ - double el (const unsigned int i) const { return val[i]; } + double el (const unsigned int i) const; /** - * Access Elements. returns A(i,j) + * Return the value of the element #(i,j)#. + * Does the same as the #el(i,j)# function + * but does bounds checking. */ - double operator() (const unsigned int i, const unsigned int j) const - { - Assert (i * ( application of this to a vector v ) - * flag adding=true : w=+A*v + * flag adding=true : w+=A*v */ void vmult (dVector& w, const dVector& v, const bool adding=false) const; @@ -437,6 +439,64 @@ class dFMatrix + +/*-------------------------Inline functions -------------------------------*/ + + +inline +double & dFMatrix::el (const unsigned int i, const unsigned int j) { + return val[i*dim_range+j]; +}; + + + +inline +double dFMatrix::el (const unsigned int i, const unsigned int j) const { + return val[i*dim_range+j]; +}; + + + +inline +unsigned int dFMatrix::m() const { + return dim_image; +}; + + + +inline +unsigned int dFMatrix::n() const { + return dim_range; +}; + + + +inline +double dFMatrix::el (const unsigned int i) const { + return val[i]; +}; + + + +inline +double dFMatrix::operator() (const unsigned int i, const unsigned int j) const { + Assert (i