]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Work around a problem with the gcc debug libstdc++ that would not allow to generate...
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 18 May 2004 21:08:36 +0000 (21:08 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 18 May 2004 21:08:36 +0000 (21:08 +0000)
git-svn-id: https://svn.dealii.org/trunk@9259 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/source/dofs/dof_constraints.cc

index 36d9bf85e9e6099387567257e40ed701745db486..26370850e93bf0ea03d505abcca44b122ad1558b 100644 (file)
@@ -367,9 +367,10 @@ void ConstraintMatrix::merge (const ConstraintMatrix &other_constraints)
                                       // resolve entries, since if
                                       // not there is no need to copy
                                       // the line one-to-one
-      tmp.resize (0);
-      tmp_other_lines.resize (0);
-      tmp_other_lines.resize (line->entries.size());
+      tmp.clear ();
+      tmp_other_lines.clear ();
+      tmp_other_lines.reserve (line->entries.size());
+
       
       bool entries_to_resolve = false;
       
@@ -393,31 +394,39 @@ void ConstraintMatrix::merge (const ConstraintMatrix &other_constraints)
                                               // end iterator
              ConstraintLine index_comparison;
              index_comparison.line = line->entries[i].first;
-             tmp_other_lines[i] =
-               std::lower_bound (other_constraints.lines.begin (),
-                                 other_constraints.lines.end (),
-                                 index_comparison);
-             if ((tmp_other_lines[i] != other_constraints.lines.end ()) &&
-                 (tmp_other_lines[i]->line != index_comparison.line))
-               tmp_other_lines[i] = other_constraints.lines.end ();
+
+             std::vector<ConstraintLine>::const_iterator
+               it = std::lower_bound (other_constraints.lines.begin (),
+                                      other_constraints.lines.end (),
+                                      index_comparison);
+             if ((it != other_constraints.lines.end ()) &&
+                 (it->line != index_comparison.line))
+               it = other_constraints.lines.end ();
+
+             tmp_other_lines.push_back (it);
            }
          else
            {
-             tmp_other_lines[i] = other_constraints.lines.end ();
+             std::vector<ConstraintLine>::const_iterator
+               it = other_constraints.lines.end ();
+             
              for (std::vector<ConstraintLine>::const_iterator
                     p=other_constraints.lines.begin();
                   p!=other_constraints.lines.end(); ++p)
                if (p->line == line->entries[i].first)
                  {
-                   tmp_other_lines[i] = p;
+                   it = p;
                    break;
-                 };          
+                 }
+
+             tmp_other_lines.push_back (it);
            };
          
-         if (tmp_other_lines[i] != other_constraints.lines.end ())
+         if (tmp_other_lines.back() != other_constraints.lines.end ())
            entries_to_resolve = true;
        };
-  
+      Assert (tmp_other_lines.size() == line->entries.size(),
+             ExcInternalError());
 
                                       // now we have for each entry
                                       // in the present line whether

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.