]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Take over corrected fix from 1.15.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 30 May 2000 16:32:00 +0000 (16:32 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 30 May 2000 16:32:00 +0000 (16:32 +0000)
git-svn-id: https://svn.dealii.org/branches/Branch-3-0@2979 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/lac/source/sparsity_pattern.cc

index 024561dd679b0086685d77fac55755048e6b82ad..012a1d73d644b0ea68af00869d232ede6618ff37 100644 (file)
@@ -31,6 +31,7 @@ SparsityPattern::SparsityPattern () :
 };
 
 
+
 SparsityPattern::SparsityPattern (const SparsityPattern &s) :
                Subscriptor(),
                max_dim(0),
@@ -47,6 +48,7 @@ SparsityPattern::SparsityPattern (const SparsityPattern &s) :
 };
 
 
+
 SparsityPattern::SparsityPattern (const unsigned int m,
                                  const unsigned int n,
                                  const unsigned int max_per_row) 
@@ -59,6 +61,7 @@ SparsityPattern::SparsityPattern (const unsigned int m,
 };
 
 
+
 SparsityPattern::SparsityPattern (const unsigned int          m,
                                  const unsigned int          n,
                                  const vector<unsigned int> &row_lengths) 
@@ -71,6 +74,7 @@ SparsityPattern::SparsityPattern (const unsigned int          m,
 };
 
 
+
 SparsityPattern::SparsityPattern (const unsigned int n,
                                  const unsigned int max_per_row)
                : max_dim(0),
@@ -82,6 +86,7 @@ SparsityPattern::SparsityPattern (const unsigned int n,
 };
 
 
+
 SparsityPattern::SparsityPattern (const unsigned int          m,
                                  const vector<unsigned int> &row_lengths) 
                : max_dim(0),
@@ -93,6 +98,7 @@ SparsityPattern::SparsityPattern (const unsigned int          m,
 };
 
 
+
 SparsityPattern::SparsityPattern (const SparsityPattern &original,
                                  const unsigned int        max_per_row,
                                  const unsigned int        extra_off_diagonals)
@@ -193,6 +199,7 @@ SparsityPattern::operator = (const SparsityPattern &s)
 
   Assert (rowstart == 0, ExcInvalidConstructorCall());
   Assert (colnums == 0, ExcInvalidConstructorCall());
+
   Assert (rows == 0, ExcInvalidConstructorCall());
   Assert (cols == 0, ExcInvalidConstructorCall());
 
@@ -200,6 +207,7 @@ SparsityPattern::operator = (const SparsityPattern &s)
 };
 
 
+
 void
 SparsityPattern::reinit (const unsigned int m,
                         const unsigned int n,
@@ -217,6 +225,7 @@ SparsityPattern::reinit (const unsigned int m,
                         const unsigned int n,
                         const vector<unsigned int> &row_lengths)
 {
+
   Assert (((m==0) && (n==0)) || (*max_element(row_lengths.begin(), row_lengths.end()) > 0),
          ExcInvalidNumber(*max_element(row_lengths.begin(), row_lengths.end())));
   Assert (row_lengths.size() == m, ExcInvalidNumber (m));
@@ -229,6 +238,7 @@ SparsityPattern::reinit (const unsigned int m,
     {
       if (rowstart)  delete[] rowstart;
       if (colnums)   delete[] colnums;
+
       rowstart = 0;
       colnums = 0;
       max_vec_len = max_dim = rows = cols = 0;
@@ -316,6 +326,7 @@ SparsityPattern::compress ()
   unsigned int *new_colnums = new unsigned int[nonzero_elements];
 
 
+
 // reserve temporary storage to
                                   // store the entries of one row
   vector<unsigned int> tmp_entries (max_row_length);
@@ -399,7 +410,8 @@ SparsityPattern::compress ()
 
 
 bool
-SparsityPattern::empty () const {
+SparsityPattern::empty () const
+{
                                   // let's try to be on the safe side of
                                   // life by using multiple possibilities in
                                   // the check for emptiness... (sorry for
@@ -430,6 +442,7 @@ SparsityPattern::max_entries_per_row () const
                                   // called, we can get the maximum
                                   // number of elements per row using
                                   // the stored value
+
   if (!compressed)
     return max_row_length;
 
@@ -488,6 +501,7 @@ SparsityPattern::operator () (const unsigned int i,
 }
 
 
+
 void
 SparsityPattern::add (const unsigned int i,
                      const unsigned int j)
@@ -510,6 +524,7 @@ SparsityPattern::add (const unsigned int i,
        };
     };
 
+
                                   // if we came thus far, something went
                                   // wrong: there was not enough space
                                   // in this line
@@ -531,7 +546,7 @@ SparsityPattern::print_gnuplot (ostream &out) const
                                         // is x-y, that is we have to
                                         // exchange the order of
                                         // output
-       out << static_cast<signed int>(colnums[j]) << " " << -i << endl;
+       out << colnums[j] << " " << -static_cast<signed int>(i) << endl;
 
   AssertThrow (out, ExcIO());
 }
@@ -553,6 +568,54 @@ SparsityPattern::bandwidth () const
                                         // leave if at the end of
                                         // the entries of this line
        break;
+
   return b;
 };
 
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

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.