// $Id$
// Version: $Name$
//
-// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 by the deal.II authors
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
*/
unsigned int n_nonzero_elements () const;
+ /**
+ * Print the sparsity of the
+ * matrix. The output consists of
+ * one line per row of the format
+ * <tt>[i,j1,j2,j3,...]</tt>. <i>i</i>
+ * is the row number and
+ * <i>jn</n> are the allocated
+ * columns in this row.
+ */
+ void print (std::ostream &out) const;
+
+
/**
* Exception
*/
// $Id$
// Version: $Name$
//
-// Copyright (C) 2000, 2001, 2002, 2003 by the deal authors
+// Copyright (C) 2000, 2001, 2002, 2003, 2004 by the deal authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
+template <class SparsityPatternBase>
+void
+BlockSparsityPatternBase<SparsityPatternBase>::print(std::ostream& out) const
+{
+ unsigned int k=0;
+ for (unsigned int ib=0;ib<n_block_rows();++ib)
+ {
+ for (unsigned int i=0;i<block(ib,ib).n_rows();++i)
+ {
+ out << '[' << i+k;
+ unsigned int l=0;
+ for (unsigned int jb=0;jb<n_block_cols();++jb)
+ {
+ const SparsityPatternBase& b = block(ib,jb);
+ for (unsigned int j=0;j<b.n_cols();++j)
+ if (b.exists(i,j))
+ out << ',' << l+j;
+ l += b.n_cols();
+ }
+ out << ']' << std::endl;
+ }
+ k += block(ib,ib).n_rows();
+ }
+}
+
+
BlockSparsityPattern::BlockSparsityPattern ()
{}
}
-
unsigned int
BlockSparsityPattern::memory_consumption () const
{