diff options
author | Erik Schnetter <schnetter@cct.lsu.edu> | 2007-02-04 19:20:00 +0000 |
---|---|---|
committer | Erik Schnetter <schnetter@cct.lsu.edu> | 2007-02-04 19:20:00 +0000 |
commit | 06069c8ec6f31a3ff3dcd202f81668093b2d118e (patch) | |
tree | fb8b205fe1dba9899b04ba5d4171c542ed726c20 /Carpet/CarpetLib | |
parent | 954711d35af929870790714e8edff1edc0e35572 (diff) |
CarpetLib: Make ggf::cycle more efficient
darcs-hash:20070204192032-dae7b-10c06e6529291abe5a3dda8ae1d0022a23837ac3.gz
Diffstat (limited to 'Carpet/CarpetLib')
-rw-r--r-- | Carpet/CarpetLib/src/ggf.cc | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/Carpet/CarpetLib/src/ggf.cc b/Carpet/CarpetLib/src/ggf.cc index 759fb7a63..f3d215e44 100644 --- a/Carpet/CarpetLib/src/ggf.cc +++ b/Carpet/CarpetLib/src/ggf.cc @@ -281,11 +281,14 @@ void ggf::cycle (int const rl, int const c, int const ml) { assert (rl>=0 and rl<h.reflevels()); assert (c>=0 and c<h.components(rl)); assert (ml>=0 and ml<h.mglevels()); - gdata* tmpdata = storage.at(ml).at(rl).at(c).at(timelevels(ml,rl)-1); - for (int tl=timelevels(ml,rl)-1; tl>0; --tl) { - storage.at(ml).at(rl).at(c).at(tl) = storage.at(ml).at(rl).at(c).at(tl-1); + int const ntl = timelevels(ml,rl); + assert (ntl > 0); + fdata & fdatas = storage.AT(ml).AT(rl).AT(c); + gdata * const tmpdata = fdatas.AT(ntl-1); + for (int tl=ntl-1; tl>0; --tl) { + fdatas.AT(tl) = fdatas.AT(tl-1); } - storage.at(ml).at(rl).at(c).at(0) = tmpdata; + fdatas.AT(0) = tmpdata; } // Flip the time levels by exchanging the data sets |