<h3>lac</h3>
<ol>
+ <li> <p> Improved: <code class="class">FullMatrix</code>::<code
+ class="member">fill</code> now copies the largest possible block,
+ whether the destination or source matrix is bigger. Additionally, an
+ offset inside the source matrix may be specified.
+ <br>
+ (GK 2003/03/31)
+ </p>
+
<li> <p>
New/Changed: The <code class="class">SparseILU</code>, <code
class="class">SparseMIC</code> and <code
/**
* Fill rectangular block.
*
- * 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}.
- *
- * 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}.
+ * A rectangular block of the
+ * matrix @p{src} is copied into
+ * @p{this}. The upper left
+ * corner of the block being
+ * copied is
+ * @p{(src_offset_i,src_offset_j)}.
+ * The upper left corner of the
+ * copied block is
+ * @p{(dst_offset_i,dst_offset_j)}.
+ * The size of the rectangular
+ * block being copied is the
+ * maximum size possible,
+ * determined either by the size
+ * of @p{this} or @p{src}.
*/
template<typename number2>
void fill (const FullMatrix<number2> &src,
- const unsigned int i=0,
- const unsigned int j=0);
+ const unsigned int dst_offset_i = 0,
+ const unsigned int dst_offset_j = 0,
+ const unsigned int src_offset_i = 0,
+ const unsigned int src_offset_j = 0);
/**
/**
* Least-Squares-Approximation by
- * QR-factorization.
+ * QR-factorization. The return
+ * value is the Euclidean norm of
+ * the approximation error.
*/
template<typename number2>
double least_squares (Vector<number2> &dst,
template <typename number>
template <typename number2>
void FullMatrix<number>::fill (const FullMatrix<number2> &src,
- const unsigned int i,
- const unsigned int j)
+ const unsigned int dst_offset_i,
+ const unsigned int dst_offset_j,
+ const unsigned int src_offset_i,
+ const unsigned int src_offset_j)
{
- Assert (n() >= src.n() + j, ExcInvalidDestination(n(), src.n(), j));
- Assert (m() >= src.m() + i, ExcInvalidDestination(m(), src.m(), i));
-
- for (unsigned int ii=0; ii<src.m() ; ++ii)
- for (unsigned int jj=0; jj<src.n() ; ++jj)
- this->el(ii+i,jj+j) = src.el(ii,jj);
+ // Compute maximal size of copied block
+ const unsigned int rows = (m() - dst_offset_i >= src.m() - src_offset_i)
+ ? src.m()
+ : m();
+ const unsigned int cols = (n() - dst_offset_j >= src.n() - src_offset_j)
+ ? src.n()
+ : n();
+
+ for (unsigned int i=0; i<rows ; ++i)
+ for (unsigned int j=0; j<cols ; ++j)
+ this->el(dst_offset_i+i,dst_offset_j+j)
+ = src.el(src_offset_i+i,src_offset_j+j);
}
#define TYPEMAT2 double
//template FullMatrix<TYPEMAT>& FullMatrix<TYPEMAT>::operator =(const FullMatrix<TYPEMAT2>&);
-template void FullMatrix<TYPEMAT>::fill<TYPEMAT2> (const FullMatrix<TYPEMAT2>&, const unsigned, const unsigned);
+template void FullMatrix<TYPEMAT>::fill<TYPEMAT2> (
+ const FullMatrix<TYPEMAT2>&, const unsigned, const unsigned, const unsigned, const unsigned);
template void FullMatrix<TYPEMAT>::add<TYPEMAT2> (const TYPEMAT, const FullMatrix<TYPEMAT2>&);
template void FullMatrix<TYPEMAT>::Tadd<TYPEMAT2> (const TYPEMAT, const FullMatrix<TYPEMAT2>&);
template void FullMatrix<TYPEMAT>::mmult<TYPEMAT2> (FullMatrix<TYPEMAT2>&, const FullMatrix<TYPEMAT2>&, const bool) const;
#define TYPEMAT2 float
//template FullMatrix<TYPEMAT>& FullMatrix<TYPEMAT>::operator =<>(const FullMatrix<TYPEMAT2>&);
-template void FullMatrix<TYPEMAT>::fill<TYPEMAT2> (const FullMatrix<TYPEMAT2>&, const unsigned, const unsigned);
+template void FullMatrix<TYPEMAT>::fill<TYPEMAT2> (
+ const FullMatrix<TYPEMAT2>&, const unsigned, const unsigned, const unsigned, const unsigned);
template void FullMatrix<TYPEMAT>::add<TYPEMAT2> (const TYPEMAT, const FullMatrix<TYPEMAT2>&);
template void FullMatrix<TYPEMAT>::Tadd<TYPEMAT2> (const TYPEMAT, const FullMatrix<TYPEMAT2>&);
template void FullMatrix<TYPEMAT>::mmult<TYPEMAT2> (FullMatrix<TYPEMAT2>&, const FullMatrix<TYPEMAT2>&, const bool) const;