CLASS
dSMatrix
- @author Original version by Roland Becker, Guido Kanschat,
- Franz-Theo Suttmeier; lots of enhancements, reorganisation
- and documentation by Wolfgang Bangerth
+ @author Original version by Roland Becker, Guido Kanschat, Franz-Theo Suttmeier; lots of enhancements, reorganisation and documentation by Wolfgang Bangerth 1998
*/
class dSMatrix
{
*/
dSMatrix ();
- //
+ /**
+ * Constructor. Takes the given matrix
+ * sparisty structure to represent the
+ * sparsity pattern of this matrix. You
+ * can change the sparsity pattern later
+ * on by calling the #reinit# function.
+ *
+ * You have to make sure that the lifetime
+ * of the sparsity structure is at least
+ * as long as that of this matrix or as
+ * long as #reinit# is not called with a
+ * new sparsity structure.
+ */
dSMatrix (dSMatrixStruct& c);
- //
+ /**
+ * Destructor. Free all memory, but do not
+ * release the memory of the sparsity
+ * structure.
+ */
~dSMatrix ();
* Release all memory and return to a state
* just like after having called the
* default constructor.
+ *
+ * You have to make sure that the lifetime
+ * of the sparsity structure is at least
+ * as long as that of this matrix or as
+ * long as #reinit# is not called with a
+ * new sparsity structure.
*/
void clear ();
- //
+ /**
+ * Return the dimension of the imga space.
+ * To remember: the matrix is of dimension
+ * $m \times n$.
+ */
unsigned int m () const;
- //
+
+ /**
+ * Return the dimension of the range space.
+ * To remember: the matrix is of dimension
+ * $m \times n$.
+ */
unsigned int n () const;
/**
*/
double & global_entry (const unsigned int i);
- //
- void vmult (dVector& dst,const dVector& src) const;
- //
- void Tvmult (dVector& dst,const dVector& src) const;
+ /**
+ * Matrix-vector multiplication: let
+ * #dst = M*src# with #M# being this matrix.
+ */
+ void vmult (dVector& dst, const dVector& src) const;
+
+ /**
+ * Matrix-vector multiplication: let
+ * #dst = M^T*src# with #M# being this
+ * matrix. This function does the same as
+ * #vmult# but takes the transposed matrix.
+ */
+ void Tvmult (dVector& dst, const dVector& src) const;
/**
void reinit (const unsigned int N, const bool fast=false);
/**
- * Adjust Dimension. <p>
- * Set dimension to n(V) <p>
- * ! reserved memory for This remains unchanged ! <p>
- * ! components of V are not copied in any case ! <p>
- * on fast==false vector is filled by 0.
+ * Change the dimension to that of the
+ * vector #V#. The same applies as for
+ * the other #reinit# function.
+ *
+ * The elements of #V# are not copied.
*/
void reinit (const dVector& V, const bool fast=false);
/**
- * Inquire Dimension. returns Dimension ,
- * INLINE
+ * Return dimension of the vector. This
+ * function was formerly called #n()#, but
+ * was renamed to get the #dVector# class
+ * closer to the C++ standard library's
+ * #vector# container.
*/
unsigned int size () const;
dVector & operator -= (const dVector &V);
/**
- * U(0-DIM)+=s . Addition of S to all components
+ * U(0-DIM)+=s.
+ * Addition of #s# to all components. Note
+ * that #s# is a scalar and not a vector.
*/
void add (const double s);
/**
- * U+=V . Simple addition
+ * U+=V.
+ * Simple vector addition, equal to the
+ * #operator +=#.
*/
void add (const dVector& V);
/**
- * U+=a*V . Simple addition
+ * U+=a*V.
+ * Simple addition of a scaled vector.
*/
void add (const double a, const dVector& V);
/**
- * U+=a*V+b*W . Multiple addition
+ * U+=a*V+b*W.
+ * Multiple addition of scaled vectors.
*/
void add (const double a, const dVector& V,
const double b, const dVector& W);
/**
- * U=s*U+V . Scaling + simple addition
+ * U=s*U+V.
+ * Scaling and simple vector addition.
*/
void sadd (const double s, const dVector& V);
/**
- * U=s*U+a*V . Scaling + simple addition
+ * U=s*U+a*V.
+ * Scaling and simple addition.
*/
void sadd (const double s, const double a, const dVector& V);
/**
- * U=s*U+a*V+b*W . Scaling + multiple addition
+ * U=s*U+a*V+b*W.
+ * Scaling and multiple addition.
*/
void sadd (const double s, const double a,
const dVector& V, const double b, const dVector& W);
/**
- * U=s*U+a*V+b*W+c*X. Scaling + multiple addition
+ * U=s*U+a*V+b*W+c*X.
+ * Scaling and multiple addition.
*/
void sadd (const double s, const double a,
const dVector& V, const double b, const dVector& W,
void scale (const double factor);
/**
- * U=a*V . Replacing
+ * U=a*V. Replacing
*/
void equ (const double a, const dVector& V);
/**
- * U=a*V+b*W . Replacing by sum
+ * U=a*V+b*W.
+ * Replacing by sum.
*/
void equ (const double a, const dVector& V,
const double b, const dVector& W);
const double b, const unsigned int k);
/**
- * U(i)=a*V(j)+b*V(k)+c*V(l)+d*V(m) . Replacing by sum
+ * U(i)=a*V(j)+b*V(k)+c*V(l)+d*V(m).
+ * Replacing by sum
*/
void cequ (const unsigned int i, const VectorBase& V,
const double a, const unsigned int j,
const double b, const unsigned int k);
/**
- * U(i)+=a*V(j)+b*V(k)+c*V(l)+d*V(m) . Multiple addition
+ * U(i)+=a*V(j)+b*V(k)+c*V(l)+d*V(m).
+ * Multiple addition
*/
void cadd (const unsigned int i, const VectorBase& V,
const double a, const unsigned int j,
+
+/*----------------------- Inline functions ----------------------------------*/
+
+
inline unsigned int dVector::size () const
{
return dim;