<li> <p>
- Change: Sort the quadrature points of each <code
+ Changed: Sort the quadrature points of each <code
class="class">Quadrature<1></code> in ascending order. This
actually changed the order of the points of only <code
class="class">QGauss4</code> and <code
<h3>lac</h3>
<ol>
+ <li> <p>
+ New: The functions <code class="class">FullMatrix</code>::<code
+ class="member">mmult</code> and <code
+ class="member">Tmmult</code> now have an additional
+ <code>adding</code> argument. If this flag is
+ <code>true</code>, the matrix-matrix product is added to the
+ resulting matrix; if <code>false</code>, the resulting matrix
+ is set to (overwritten by) the matrix-matrix product. The
+ latter is the behaviour these functions had before. Hence the
+ default value is set to be <code>false</code> to ensure
+ backward compatibility.
+ <br>
+ (RH 2001/03/29)
+ </p>
+
<li> <p>
New: class <code class="class">SchurMatrix</code> implements
a Schur complement for block matrices. It provides matrix-vector
multiplication suitable for iterative methods as well as pre- and
post-processing of right hand side and slution, respectively.
<br>
- (GK 2001/02/13)
+ (GK 2001/03/22)
</p>
<li> <p>
<li> <p>
Changed: The syntax of the <code
class="class">FiniteElement<dim></code>::<code
- class="member">get_unit_support_points</code>
- function is changed; it returns a reference to the vector of
- points. These points are now computed by the constructor of the
- <code class="class">FiniteElement</code> and not on each <code
+ class="member">get_unit_support_points</code> function is
+ changed; it returns a reference to the vector of points in lieu
+ of taking this vector as argument. The unit support points are
+ now computed by the constructor of the <code
+ class="class">FiniteElement</code> and not on each <code
class="class">FiniteElement<dim></code>::<code
- class="member">get_unit_support_points</code>
- function call as before.
+ class="member">get_unit_support_points</code> function call as
+ before.
<br>
(WB 2001/03/14)
</p>
/**
* Matrix-matrix-multiplication.
- * $C=A*B$.
+ *
+ * The optional parameter
+ * @p{adding} determines, whether the
+ * result is stored in @p{C} or added
+ * to @p{C}.
+ *
+ * if (adding)
+ * $C += A*B$
+ *
+ * if (!adding)
+ * $C = A*B$
*
* Assumes that @p{A} and @p{B} have
- * compatible sizes and thet @p{C}
+ * compatible sizes and that @p{C}
* already has the right size.
*/
template<typename number2>
void mmult (FullMatrix<number2> &C,
- const FullMatrix<number2> &B) const;
+ const FullMatrix<number2> &B,
+ const bool adding=false) const;
/**
* Matrix-matrix-multiplication using
* transpose of @p{this}.
- * $C=A^T*B$.
+ *
+ * The optional parameter
+ * @p{adding} determines, whether the
+ * result is stored in @p{C} or added
+ * to @p{C}.
+ *
+ * if (adding)
+ * $C += A^T*B$
+ *
+ * if (!adding)
+ * $C = A^T*B$
*
* Assumes that @p{A} and @p{B} have
- * compatible sizes and thet @p{C}
+ * compatible sizes and that @p{C}
* already has the right size.
*/
template<typename number2>
void Tmmult (FullMatrix<number2> &C,
- const FullMatrix<number2> &B) const;
+ const FullMatrix<number2> &B,
+ const bool adding=false) const;
/**
* Matrix-vector-multiplication.
template <typename number>
template <typename number2>
void FullMatrix<number>::mmult (FullMatrix<number2> &dst,
- const FullMatrix<number2> &src) const
+ const FullMatrix<number2> &src,
+ const bool adding) const
{
Assert (val != 0, ExcEmptyMatrix());
Assert (n() == src.m(), ExcDimensionMismatch(n(), src.m()));
Assert (dst.n() == src.n(), ExcDimensionMismatch(dst.n(), src.n()));
Assert (dst.m() == m(), ExcDimensionMismatch(m(), dst.m()));
-
- for (unsigned int i=0; i<m(); i++)
- for (unsigned int j=0; j<src.n(); j++)
- {
- number2 s = 0.;
- for (unsigned k=0; k<n(); k++)
- s+= el(i,k) * src.el(k,j);
- dst.el(i,j) = s;
- }
+
+ if (!adding)
+ for (unsigned int i=0; i<m(); i++)
+ for (unsigned int j=0; j<src.n(); j++)
+ {
+ number2 s = 0.;
+ for (unsigned k=0; k<n(); k++)
+ s+= el(i,k) * src.el(k,j);
+ dst.el(i,j) = s;
+ }
+ else
+ for (unsigned int i=0; i<m(); i++)
+ for (unsigned int j=0; j<src.n(); j++)
+ {
+ number2 s = 0.;
+ for (unsigned k=0; k<n(); k++)
+ s+= el(i,k) * src.el(k,j);
+ dst.el(i,j) += s;
+ }
}
template <typename number>
template <typename number2>
void FullMatrix<number>::Tmmult (FullMatrix<number2> &dst,
- const FullMatrix<number2> &src) const
+ const FullMatrix<number2> &src,
+ const bool adding) const
{
Assert (val != 0, ExcEmptyMatrix());
Assert (m() == src.m(), ExcDimensionMismatch(m(), src.m()));
Assert (n() == dst.m(), ExcDimensionMismatch(n(), dst.m()));
Assert (src.n() == dst.n(), ExcDimensionMismatch(src.n(), dst.n()));
- for (unsigned int i=0; i<n(); i++)
- for (unsigned int j=0; j<src.n(); j++)
- {
- number2 s = 0;
- for (unsigned int k=0; k<m(); k++)
- s += el(k,i) * src.el(k,j);
- dst.el(i,j) = s;
- }
+ if (!adding)
+ for (unsigned int i=0; i<n(); i++)
+ for (unsigned int j=0; j<src.n(); j++)
+ {
+ number2 s = 0;
+ for (unsigned int k=0; k<m(); k++)
+ s += el(k,i) * src.el(k,j);
+ dst.el(i,j) = s;
+ }
+ else
+ for (unsigned int i=0; i<n(); i++)
+ for (unsigned int j=0; j<src.n(); j++)
+ {
+ number2 s = 0;
+ for (unsigned int k=0; k<m(); k++)
+ s += el(k,i) * src.el(k,j);
+ dst.el(i,j) += s;
+ }
}
template void FullMatrix<TYPEMAT>::reinit (const FullMatrix<TYPEMAT2>&);
template void FullMatrix<TYPEMAT>::add (const TYPEMAT, const FullMatrix<TYPEMAT2>&);
template void FullMatrix<TYPEMAT>::Tadd (const TYPEMAT, const FullMatrix<TYPEMAT2>&);
-template void FullMatrix<TYPEMAT>::mmult (FullMatrix<TYPEMAT2>&, const FullMatrix<TYPEMAT2>&) const;
-template void FullMatrix<TYPEMAT>::Tmmult (FullMatrix<TYPEMAT2>&, const FullMatrix<TYPEMAT2>&) const;
+template void FullMatrix<TYPEMAT>::mmult (FullMatrix<TYPEMAT2>&, const FullMatrix<TYPEMAT2>&, const bool) const;
+template void FullMatrix<TYPEMAT>::Tmmult (FullMatrix<TYPEMAT2>&, const FullMatrix<TYPEMAT2>&, const bool) const;
template void FullMatrix<TYPEMAT>::add_diag (const TYPEMAT, const FullMatrix<TYPEMAT2>&);
template void FullMatrix<TYPEMAT>::reinit (const FullMatrix<TYPEMAT2>&);
template void FullMatrix<TYPEMAT>::add (const TYPEMAT, const FullMatrix<TYPEMAT2>&);
template void FullMatrix<TYPEMAT>::Tadd (const TYPEMAT, const FullMatrix<TYPEMAT2>&);
-template void FullMatrix<TYPEMAT>::mmult (FullMatrix<TYPEMAT2>&, const FullMatrix<TYPEMAT2>&) const;
-template void FullMatrix<TYPEMAT>::Tmmult (FullMatrix<TYPEMAT2>&, const FullMatrix<TYPEMAT2>&) const;
+template void FullMatrix<TYPEMAT>::mmult (FullMatrix<TYPEMAT2>&, const FullMatrix<TYPEMAT2>&, const bool) const;
+template void FullMatrix<TYPEMAT>::Tmmult (FullMatrix<TYPEMAT2>&, const FullMatrix<TYPEMAT2>&, const bool) const;
template void FullMatrix<TYPEMAT>::add_diag (const TYPEMAT, const FullMatrix<TYPEMAT2>&);