* be square for this operation.
*/
template <typename somenumber>
- somenumber matrix_norm_square (const BlockVector<rows,somenumber> &v) const;
+ somenumber
+ matrix_norm_square (const BlockVector<rows,somenumber> &v) const;
+
+ /**
+ * Compute the matrix scalar
+ * product $\left(u,Mv\right)$.
+ */
+ template <typename somenumber>
+ somenumber
+ matrix_scalar_product (const BlockVector<rows,somenumber> &u,
+ const BlockVector<columns,somenumber> &v) const;
/**
* Return a (constant) reference
+template <typename number, int rows, int columns>
+template <typename somenumber>
+somenumber
+BlockSparseMatrix<number,rows,columns>::
+matrix_scalar_product (const BlockVector<rows,somenumber> &u,
+ const BlockVector<columns,somenumber> &v) const
+{
+ somenumber result = 0;
+ for (unsigned int row=0; row<rows; ++row)
+ for (unsigned int col=0; col<columns; ++col)
+ result += block(row,col).matrix_scalar_product (u.block(row),
+ v.block(col));
+ return result;
+};
+
+
+
template <typename number, int rows, int columns>
const BlockSparsityPattern<rows,columns> &
BlockSparseMatrix<number,rows,columns>::get_sparsity_pattern () const
* can do, plus the access to a single #Vector# inside the
* #BlockVector# by #block(i)#.
*
- * @author Guido Kanschat, 1999
+ * @author Guido Kanschat, 1999; Wolfgang Bangerth, 2000
*/
template <int n_blocks, typename Number>
class BlockVector
*/
bool all_zero () const;
-// See above.
-// /**
-// * Make the #Vector# class a bit like the
-// * #vector<># class of the C++ standard
-// * library by returning iterators to
-// * the start and end of the elements of this
-// * vector.
-// */
-// iterator begin ();
-
-// /**
-// * Return constant iterator to the start of
-// * the vectors.
-// */
-// const_iterator begin () const;
-
-// /**
-// * Return an iterator pointing to the
-// * element past the end of the array.
-// */
-// iterator end ();
-
-// /**
-// * Return a constant iterator pointing to
-// * the element past the end of the array.
-// */
-// const_iterator end () const;
-
-
/**
* @name 2: Data-Access
*/
}
-// template <int n_blocks, typename Number>
-// inline
-// BlockVector<n_blocks,Number>::iterator BlockVector<n_blocks,Number>::begin () {
-// return &val[0];
-// };
-
-
-// template <int n_blocks, typename Number>
-// inline
-// BlockVector<n_blocks,Number>::const_iterator BlockVector<n_blocks,Number>::begin () const {
-// return &val[0];
-// };
-
-
-// template <int n_blocks, typename Number>
-// inline
-// BlockVector<n_blocks,Number>::iterator BlockVector<n_blocks,Number>::end () {
-// return &val[dim];
-// };
-
-
-// template <typename Number>
-// inline
-// BlockVector<n_blocks,Number>::const_iterator BlockVector<n_blocks,Number>::end () const {
-// return &val[dim];
-// };
-
-
template <int n_blocks, typename Number>
inline
Number BlockVector<n_blocks,Number>::operator() (const unsigned int i) const
--- /dev/null
+//---------------------------- block_vector.cc ---------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2000 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------- block_vector.cc ---------------------------
+
+#include <lac/block_vector.templates.h>
+
+// explicit instantiations
+template class BlockVector<2,double>;
+template class BlockVector<3,double>;
+
+template class BlockVector<2,float>;
+template class BlockVector<3,float>;