From: Wolfgang Bangerth Date: Thu, 3 Mar 2005 20:09:46 +0000 (+0000) Subject: Inherit the value_type of the matrix over which we build the X-Git-Tag: v8.0.0~14542 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=108e349aa2302db24f2f1e783233deb4b4af103d;p=dealii.git Inherit the value_type of the matrix over which we build the array. General clean-ups. git-svn-id: https://svn.dealii.org/trunk@9979 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/doc/news/changes.html b/deal.II/doc/news/changes.html index a45bc52b74..d47d7cfdf4 100644 --- a/deal.II/doc/news/changes.html +++ b/deal.II/doc/news/changes.html @@ -85,6 +85,15 @@ contributor's names are abbreviated by WB (Wolfgang Bangerth), GK

lac

    +
  1. + Fixed: The BlockSparseMatrix class had no local + typedef value_type like all other classes, which + made it a little awkward to use in some places. This has now + been fixed. +
    + (WB, 2005/03/03) +

    +
  2. Fixed: The PETScWrappers::MatrixBase class documented that adding or setting a value that hasn't been in diff --git a/deal.II/lac/include/lac/block_matrix_array.h b/deal.II/lac/include/lac/block_matrix_array.h index d24c6dc12b..f802ba0d99 100644 --- a/deal.II/lac/include/lac/block_matrix_array.h +++ b/deal.II/lac/include/lac/block_matrix_array.h @@ -64,6 +64,13 @@ template class BlockMatrixArray : public Subscriptor { public: + /** + * Inherit the value_type from + * the class over which we build + * the array. + */ + typedef typename MATRIX::value_type value_type; + /** * Constructor fixing the * dimensions. @@ -74,11 +81,11 @@ class BlockMatrixArray : public Subscriptor /** * Add a block matrix entry. */ - void enter (const MATRIX& matrix, - unsigned row, - unsigned int col, - double prefix = 1., - bool transpose = false); + void enter (const MATRIX &matrix, + const unsigned int row, + const unsigned int col, + const double prefix = 1., + const bool transpose = false); /** * Delete all entries, i.e. reset diff --git a/tests/bits/block_matrix_array_01.cc b/tests/bits/block_matrix_array_01.cc new file mode 100644 index 0000000000..aa4c51b08f --- /dev/null +++ b/tests/bits/block_matrix_array_01.cc @@ -0,0 +1,41 @@ +//---------------------------- block_matrix_array_01.cc --------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2005 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_matrix_array_01.cc --------------------------- + + +// the class BlockMatrixArray had no local type value_type that is +// needed in some places. in particular, this is needed for +// PreconditionBlockSSOR + +#include +#include +#include +#include +#include +#include + + +int main () +{ + std::ofstream logfile("block_matrix_array_01.output"); + deallog.attach(logfile); + deallog.depth_console(0); + + BlockMatrixArray >::value_type i = 1.0; + deallog << i << std::endl; + + // the following did not compile + // right away + PreconditionBlockSSOR > > p; + + return 0; +}