]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
preliminary version of new function
authorguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 10 Feb 2004 07:47:20 +0000 (07:47 +0000)
committerguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 10 Feb 2004 07:47:20 +0000 (07:47 +0000)
git-svn-id: https://svn.dealii.org/trunk@8449 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/lac/include/lac/sparsity_pattern.h
deal.II/lac/source/sparsity_pattern.cc

index 3211efb90a9d1ed4cdddfa23c5a11ffba2bcd24f..a70c8bc0f0e4b197ed5406fa9c2db739116cd32a 100644 (file)
@@ -643,32 +643,6 @@ class SparsityPattern : public Subscriptor
                                      */
     void symmetrize ();
     
-                                    /**
-                                     * Print the sparsity of the matrix
-                                     * in a format that <tt>gnuplot</tt> understands
-                                     * and which can be used to plot the
-                                     * sparsity pattern in a graphical
-                                     * way. The format consists of pairs
-                                     * <tt>i j</tt> of nonzero elements, each
-                                     * representing one entry of this
-                                     * matrix, one per line of the output
-                                     * file. Indices are counted from
-                                     * zero on, as usual. Since sparsity
-                                     * patterns are printed in the same
-                                     * way as matrices are displayed, we
-                                     * print the negative of the column
-                                     * index, which means that the
-                                     * <tt>(0,0)</tt> element is in the top left
-                                     * rather than in the bottom left
-                                     * corner.
-                                     *
-                                     * Print the sparsity pattern in
-                                     * gnuplot by setting the data style
-                                     * to dots or points and use the
-                                     * <tt>plot</tt> command.
-                                     */
-    void print_gnuplot (std::ostream &out) const;
-
                                     /**
                                      * Return number of rows of this
                                      * matrix, which equals the dimension
@@ -756,58 +730,6 @@ class SparsityPattern : public Subscriptor
                                      */
     bool optimize_diagonal () const;
     
-                                    /**
-                                     * This is kind of an expert mode. Get 
-                                     * access to the rowstart array, but
-                                     * read-only.
-                                     *
-                                     * Use of this function is highly
-                                     * deprecated. Use @p{row_length}
-                                     * and @p{column_number} instead.
-                                     *
-                                     * Though the return value is declared
-                                     * <tt>const</tt>, you should be aware that it
-                                     * may change if you call any nonconstant
-                                     * function of objects which operate on
-                                     * it.
-                                     *
-                                     * You should use this interface very
-                                     * carefully and only if you are absolutely
-                                     * sure to know what you do. You should
-                                     * also note that the structure of these
-                                     * arrays may change over time.
-                                     * If you change the layout yourself, you
-                                     * should also rename this function to
-                                     * avoid programs relying on outdated
-                                     * information!  */
-    const unsigned int * get_rowstart_indices () const;
-
-                                    /**
-                                     * @deprecated. Use @p{row_length}
-                                     * and @p{column_number} instead.
-                                     *
-                                     * This is kind of an expert mode: get
-                                     * access to the colnums array, but
-                                     * readonly.
-                                     *
-                                     * Though the return value is declared
-                                     * <tt>const</tt>, you should be aware that it
-                                     * may change if you call any nonconstant
-                                     * function of objects which operate on
-                                     * it.
-                                     *
-                                     * You should use this interface very
-                                     * carefully and only if you are absolutely
-                                     * sure to know what you do. You should
-                                     * also note that the structure of these
-                                     * arrays may change over time.
-                                     * If you change the layout yourself, you
-                                     * should also rename this function to
-                                     * avoid programs relying on outdated
-                                     * information!
-                                     */
-    const unsigned int * get_column_numbers () const;
-
                                     /**
                                      * Write the data of this object
                                      * en bloc to a file. This is
@@ -855,6 +777,41 @@ class SparsityPattern : public Subscriptor
                                      */
     void block_read (std::istream &in);
     
+                                    /**
+                                     * Print the sparsity of the
+                                     * matrix. The output consists of
+                                     * terms <tt>[i,j]</tt> for each
+                                     * allocated entry. No linefeeds
+                                     * are added.
+                                     */
+    void print (std::ostream &out) const;
+
+                                    /**
+                                     * Print the sparsity of the matrix
+                                     * in a format that <tt>gnuplot</tt> understands
+                                     * and which can be used to plot the
+                                     * sparsity pattern in a graphical
+                                     * way. The format consists of pairs
+                                     * <tt>i j</tt> of nonzero elements, each
+                                     * representing one entry of this
+                                     * matrix, one per line of the output
+                                     * file. Indices are counted from
+                                     * zero on, as usual. Since sparsity
+                                     * patterns are printed in the same
+                                     * way as matrices are displayed, we
+                                     * print the negative of the column
+                                     * index, which means that the
+                                     * <tt>(0,0)</tt> element is in the top left
+                                     * rather than in the bottom left
+                                     * corner.
+                                     *
+                                     * Print the sparsity pattern in
+                                     * gnuplot by setting the data style
+                                     * to dots or points and use the
+                                     * <tt>plot</tt> command.
+                                     */
+    void print_gnuplot (std::ostream &out) const;
+
                                     /**
                                      * Determine an estimate for the
                                      * memory consumption (in bytes)
@@ -863,6 +820,58 @@ class SparsityPattern : public Subscriptor
                                      */
     unsigned int memory_consumption () const;
 
+                                    /**
+                                     * This is kind of an expert mode. Get 
+                                     * access to the rowstart array, but
+                                     * read-only.
+                                     *
+                                     * Use of this function is highly
+                                     * deprecated. Use @p{row_length}
+                                     * and @p{column_number} instead.
+                                     *
+                                     * Though the return value is declared
+                                     * <tt>const</tt>, you should be aware that it
+                                     * may change if you call any nonconstant
+                                     * function of objects which operate on
+                                     * it.
+                                     *
+                                     * You should use this interface very
+                                     * carefully and only if you are absolutely
+                                     * sure to know what you do. You should
+                                     * also note that the structure of these
+                                     * arrays may change over time.
+                                     * If you change the layout yourself, you
+                                     * should also rename this function to
+                                     * avoid programs relying on outdated
+                                     * information!  */
+    const unsigned int * get_rowstart_indices () const;
+
+                                    /**
+                                     * @deprecated. Use @p{row_length}
+                                     * and @p{column_number} instead.
+                                     *
+                                     * This is kind of an expert mode: get
+                                     * access to the colnums array, but
+                                     * readonly.
+                                     *
+                                     * Though the return value is declared
+                                     * <tt>const</tt>, you should be aware that it
+                                     * may change if you call any nonconstant
+                                     * function of objects which operate on
+                                     * it.
+                                     *
+                                     * You should use this interface very
+                                     * carefully and only if you are absolutely
+                                     * sure to know what you do. You should
+                                     * also note that the structure of these
+                                     * arrays may change over time.
+                                     * If you change the layout yourself, you
+                                     * should also rename this function to
+                                     * avoid programs relying on outdated
+                                     * information!
+                                     */
+    const unsigned int * get_column_numbers () const;
+
                                     /**
                                      * Exception
                                      */
index dc0992e62344df4b1f7bcf76edb4eb33bcca04ce..aa3aa9007f11dc092a1dc4a03271fd51dbbcbdcd 100644 (file)
@@ -2,7 +2,7 @@
 //    $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
@@ -754,6 +754,17 @@ SparsityPattern::symmetrize ()
 
 
 
+void
+SparsityPattern::print (std::ostream &out) const
+{
+  Assert ((rowstart!=0) && (colnums!=0), ExcEmptyObject());  
+  const_iterator e = begin();
+  
+  AssertThrow (out, ExcIO());
+}
+
+
+
 void
 SparsityPattern::print_gnuplot (std::ostream &out) const
 {

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.