diff options
author | Erik Schnetter <schnetter@cct.lsu.edu> | 2010-03-18 15:29:56 -0700 |
---|---|---|
committer | Barry Wardell <barry.wardell@gmail.com> | 2011-12-14 16:45:35 +0000 |
commit | ece361c5e3f8027eda95ff4ce4bdf969aac4913b (patch) | |
tree | 49bdfe4e3587bdfd0a1abd827583ea4a15598b9a | |
parent | b1ca9bb147872979ec3b14a9f5a4b9f23986be4d (diff) |
CarpetLib: Improve comments and debug facilities in fulltree data structure
-rw-r--r-- | Carpet/CarpetLib/src/fulltree.cc | 22 | ||||
-rw-r--r-- | Carpet/CarpetLib/src/fulltree.hh | 4 |
2 files changed, 13 insertions, 13 deletions
diff --git a/Carpet/CarpetLib/src/fulltree.cc b/Carpet/CarpetLib/src/fulltree.cc index 3234a73dc..d482691cf 100644 --- a/Carpet/CarpetLib/src/fulltree.cc +++ b/Carpet/CarpetLib/src/fulltree.cc @@ -23,7 +23,7 @@ fulltree<T,D,P>::fulltree () // Create a tree branch from a list of bounds and subtrees template <typename T, int D, typename P> -fulltree<T,D,P>::fulltree (int dir_, vector <T> const & bounds_, +fulltree<T,D,P>::fulltree (int const dir_, vector <T> const & bounds_, vector <fulltree *> const & subtrees_) : type (type_branch), dir (dir_), bounds (bounds_), subtrees (subtrees_) { @@ -194,14 +194,14 @@ fulltree<T,D,P>::const_iterator::const_iterator (fulltree const & f_) { if (f.is_branch()) { assert (f.subtrees.size() > 0); - it = new const_iterator (* f.subtrees.at(i)); + it = new const_iterator (* f.subtrees.AT(i)); while ((*it).done()) { delete it; it = 0; ++ i; if (done()) break; // to do: use a new function "reset iterator" instead - it = new const_iterator (* f.subtrees.at(i)); + it = new const_iterator (* f.subtrees.AT(i)); } assert (done() or not (*it).done()); } @@ -271,7 +271,7 @@ fulltree<T,D,P>::const_iterator::operator++ () ++ i; if (not done()) { // to do: use a new function "reset iterator" instead - it = new const_iterator (* f.subtrees.at(i)); + it = new const_iterator (* f.subtrees.AT(i)); assert (not (*it).done()); } } @@ -282,7 +282,7 @@ fulltree<T,D,P>::const_iterator::operator++ () ++ i; if (done()) break; // to do: use a new function "reset iterator" instead - it = new const_iterator (* f.subtrees.at(i)); + it = new const_iterator (* f.subtrees.AT(i)); } assert (done() or not (*it).done()); } @@ -311,14 +311,14 @@ fulltree<T,D,P>::iterator::iterator (fulltree & f_) { if (f.is_branch()) { assert (f.subtrees.size() > 0); - it = new iterator (* f.subtrees.at(i)); + it = new iterator (* f.subtrees.AT(i)); while ((*it).done()) { delete it; it = 0; ++ i; if (done()) break; // to do: use a new function "reset iterator" instead - it = new iterator (* f.subtrees.at(i)); + it = new iterator (* f.subtrees.AT(i)); } assert (done() or not (*it).done()); } @@ -388,7 +388,7 @@ fulltree<T,D,P>::iterator::operator++ () ++ i; if (not done()) { // to do: use a new function "reset iterator" instead - it = new iterator (* f.subtrees.at(i)); + it = new iterator (* f.subtrees.AT(i)); assert (not (*it).done()); } } @@ -399,7 +399,7 @@ fulltree<T,D,P>::iterator::operator++ () ++ i; if (done()) break; // to do: use a new function "reset iterator" instead - it = new iterator (* f.subtrees.at(i)); + it = new iterator (* f.subtrees.AT(i)); } assert (done() or not (*it).done()); } @@ -453,9 +453,9 @@ fulltree<T,D,P>::output (ostream & os) const << "dir=" << dir << "," << "subtrees=["; for (size_t i=0; i<subtrees.size(); ++i) { - os << bounds.at(i) << ":[" << i << "]=" << *subtrees.at(i) << ":"; + os << bounds.AT(i) << ":[" << i << "]=" << *subtrees.AT(i) << ":"; } - os << bounds.at(subtrees.size()) << "]"; + os << bounds.AT(subtrees.size()) << "]"; } else { os << "leaf:" << "payload=" << p; diff --git a/Carpet/CarpetLib/src/fulltree.hh b/Carpet/CarpetLib/src/fulltree.hh index 82d09be02..dacbe82f1 100644 --- a/Carpet/CarpetLib/src/fulltree.hh +++ b/Carpet/CarpetLib/src/fulltree.hh @@ -13,9 +13,9 @@ using namespace std; -// This is a "full tree" data structure, i.e., a tree data structure +// This is a "full tree" data structure, i.e. a tree data structure // which decomposes a cuboid domain into a set of non-overlapping -// cuboid subdomains. It is an n-ary tree, i.e., each tree node can +// cuboid subdomains. It is an n-ary tree, i.e. each tree node can // have arbitrarily many subtrees. Each node splits a domain in // exactly one direction. Subdomains cannot be empty. |