From: guido Date: Thu, 3 Oct 2002 07:18:41 +0000 (+0000) Subject: missing Tvmult implemented X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e4e3394161d509925e5de80448cf5f7079008e61;p=dealii-svn.git missing Tvmult implemented git-svn-id: https://svn.dealii.org/trunk@6595 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/lac/include/lac/block_sparse_matrix.h b/deal.II/lac/include/lac/block_sparse_matrix.h index 25cb8d0784..c76366bcad 100644 --- a/deal.II/lac/include/lac/block_sparse_matrix.h +++ b/deal.II/lac/include/lac/block_sparse_matrix.h @@ -555,6 +555,25 @@ class BlockSparseMatrix : public Subscriptor /* ------------------------- Template functions ---------------------- */ +template +inline +unsigned int +BlockSparseMatrix::n_block_cols () const +{ + return columns; +}; + + + +template +inline +unsigned int +BlockSparseMatrix::n_block_rows () const +{ + return rows; +}; + + template inline SparseMatrix & @@ -748,14 +767,22 @@ BlockSparseMatrix::vmult_add (BlockVector &dst, template template void -BlockSparseMatrix::Tvmult (BlockVector &/*dst*/, - const BlockVector &/*src*/) const +BlockSparseMatrix::Tvmult (BlockVector& dst, + const BlockVector& src) const { - // presently not - // implemented. should be simple, - // but don't have the time right - // now. - Assert (false, ExcNotImplemented()); + Assert (dst.n_blocks() == n_block_cols(), + ExcDimensionMismatch(dst.n_blocks(), n_block_cols())); + Assert (src.n_blocks() == n_block_rows(), + ExcDimensionMismatch(src.n_blocks(), n_block_rows())); + + dst = 0.; + + for (unsigned int row=0; row::Tvmult (BlockVector &/*dst*/, template template void -BlockSparseMatrix::Tvmult_add (BlockVector &/*dst*/, - const BlockVector &/*src*/) const +BlockSparseMatrix::Tvmult_add (BlockVector& dst, + const BlockVector& src) const { - // presently not - // implemented. should be simple, - // but don't have the time right - // now. - Assert (false, ExcNotImplemented()); + Assert (dst.n_blocks() == n_block_cols(), + ExcDimensionMismatch(dst.n_blocks(), n_block_cols())); + Assert (src.n_blocks() == n_block_rows(), + ExcDimensionMismatch(src.n_blocks(), n_block_rows())); + + for (unsigned int row=0; row &dst, }; -template -inline -unsigned int -BlockSparseMatrix::n_block_cols () const -{ - return columns; -}; - - - -template -inline -unsigned int -BlockSparseMatrix::n_block_rows () const -{ - return rows; -}; - - #endif // __deal2__block_sparse_matrix_h