]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Rename local variables and types.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Thu, 15 Oct 2009 20:09:37 +0000 (20:09 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Thu, 15 Oct 2009 20:09:37 +0000 (20:09 +0000)
git-svn-id: https://svn.dealii.org/trunk@19887 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/base/include/base/index_set.h
deal.II/base/source/index_set.cc

index 20bc14ae4c107314de8c9aabad1a4676bc15540d..180fe7cf3e2e076fad21b8e61ae6faa85768ed6b 100644 (file)
@@ -143,7 +143,7 @@ class IndexSet
                                      * A type that denotes an index
                                      * range.
                                      */
-    typedef std::pair<unsigned int, unsigned int> ContiguousRange;
+    typedef std::pair<unsigned int, unsigned int> Range;
 
                                     /**
                                      * A structure that provides an
@@ -151,8 +151,8 @@ class IndexSet
                                      */
     struct RangeComparison
     {
-       bool operator() (const ContiguousRange &range_1,
-                        const ContiguousRange &range_2) const;
+       bool operator() (const Range &range_1,
+                        const Range &range_2) const;
     };
 
                                     /**
@@ -168,7 +168,7 @@ class IndexSet
                                      * representation of this index
                                      * set.
                                      */
-    mutable std::set<ContiguousRange, RangeComparison> contiguous_ranges;
+    mutable std::set<Range, RangeComparison> ranges;
 
                                     /**
                                      * The overall size of the index
@@ -184,8 +184,8 @@ class IndexSet
 
 inline
 bool
-IndexSet::RangeComparison::operator() (const ContiguousRange &range_1,
-                                      const ContiguousRange &range_2) const
+IndexSet::RangeComparison::operator() (const Range &range_1,
+                                      const Range &range_2) const
 {
   return ((range_1.first < range_2.first)
          ||
@@ -216,7 +216,7 @@ inline
 void
 IndexSet::set_size (const unsigned int sz)
 {
-  Assert (contiguous_ranges.size() == 0,
+  Assert (ranges.size() == 0,
          ExcMessage ("This function can only be called if the current "
                      "object does not yet contain any elements."));
   index_space_size = sz;
@@ -252,7 +252,7 @@ IndexSet::add_range (const unsigned int begin,
       if (end == begin+1)
        add_index (begin);
       else
-       contiguous_ranges.insert (ContiguousRange(begin,end));
+       ranges.insert (Range(begin,end));
     }
 }
 
@@ -265,7 +265,7 @@ IndexSet::add_index (const unsigned int index)
   Assert (index < index_space_size,
          ExcIndexRange (index, 0, index_space_size));
 
-  contiguous_ranges.insert (ContiguousRange(index, index+1));
+  ranges.insert (Range(index, index+1));
 }
 
 
@@ -277,10 +277,10 @@ IndexSet::is_element (const unsigned int index) const
 //TODO: since the list of ranges is sorted, we be faster here by doing a binary search
                                   // if not, we need to walk the list
                                   // of contiguous ranges:
-  if (contiguous_ranges.size() > 0)
-    for (std::set<ContiguousRange, RangeComparison>::const_iterator
-          i = contiguous_ranges.begin();
-        i != contiguous_ranges.end();
+  if (ranges.size() > 0)
+    for (std::set<Range, RangeComparison>::const_iterator
+          i = ranges.begin();
+        i != ranges.end();
         ++i)
       if ((index >= i->first) && (index < i->second))
        return true;
@@ -297,7 +297,7 @@ bool
 IndexSet::is_contiguous () const
 {
   compress ();
-  return (contiguous_ranges.size() <= 1);
+  return (ranges.size() <= 1);
 }
 
 
@@ -312,9 +312,9 @@ IndexSet::n_elements () const
   compress ();
 
   unsigned int s = 0;
-  for (std::set<ContiguousRange, RangeComparison>::iterator
-        range = contiguous_ranges.begin();
-       range != contiguous_ranges.end();
+  for (std::set<Range, RangeComparison>::iterator
+        range = ranges.begin();
+       range != ranges.end();
        ++range)
     s += (range->second - range->first);
 
@@ -330,7 +330,7 @@ IndexSet::nth_index_in_set (const unsigned int n) const
   Assert (n < n_elements(), ExcIndexRange (n, 0, n_elements()));
 
   Assert (is_contiguous(), ExcNotImplemented());
-  return (n+contiguous_ranges.begin()->first);
+  return (n+ranges.begin()->first);
 }
 
 
@@ -344,7 +344,7 @@ IndexSet::index_within_set (const unsigned int n) const
   Assert (n < size(), ExcIndexRange (n, 0, size()));
 
   Assert (is_contiguous(), ExcNotImplemented());
-  return (n-contiguous_ranges.begin()->first);
+  return (n-ranges.begin()->first);
 }
 
 
index ba48629d1e9a1993ad0267d2510f0148c38584e2..8838800216a7939368d40c6a895b0b2ecaebd069 100644 (file)
@@ -23,12 +23,12 @@ IndexSet::compress () const
                                   // merged. since they are sorted by
                                   // their first index, determining
                                   // overlap isn't all that hard
-  for (std::set<ContiguousRange, RangeComparison>::iterator
-        i = contiguous_ranges.begin();
-       i != contiguous_ranges.end();
+  for (std::set<Range, RangeComparison>::iterator
+        i = ranges.begin();
+       i != ranges.end();
        ++i)
     {
-      std::set<ContiguousRange, RangeComparison>::const_iterator
+      std::set<Range, RangeComparison>::const_iterator
        next = i;
       ++next;
 
@@ -38,7 +38,7 @@ IndexSet::compress () const
                                       // see if we can merge any of
                                       // the following ranges
       bool can_merge = false;
-      while (next != contiguous_ranges.end() &&
+      while (next != ranges.end() &&
             (next->first <= last_index))
        {
          last_index = next->second;
@@ -51,9 +51,9 @@ IndexSet::compress () const
                                           // delete the old
                                           // ranges and insert the
                                           // new range
-         contiguous_ranges.erase (i, next);
-         contiguous_ranges.insert (ContiguousRange(first_index,
-                                                   last_index));
+         ranges.erase (i, next);
+         ranges.insert (Range(first_index,
+                              last_index));
 
                                           // then set iterator to
                                           // the same position as
@@ -69,8 +69,8 @@ IndexSet::compress () const
                                           // sure we gobble up as
                                           // many of the following
                                           // ranges as possible
-         i = contiguous_ranges.lower_bound (ContiguousRange(first_index,
-                                                            last_index));
+         i = ranges.lower_bound (Range(first_index,
+                                       last_index));
        }
     }
 }

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.