Skip to content

Commit

Permalink
refs #3868. Change to prefix operators.
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartcampbell committed Dec 21, 2011
1 parent 2a93457 commit 2d6fec6
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 47 deletions.
74 changes: 37 additions & 37 deletions Code/Mantid/Framework/Geometry/src/Math/Acomp.cpp
Expand Up @@ -74,7 +74,7 @@ namespace Mantid
*/
{
std::vector<Acomp>::const_iterator vc;
for(vc=A.Comp.begin();vc!=A.Comp.end();vc++)
for(vc=A.Comp.begin();vc!=A.Comp.end();++vc)
Comp.push_back(*vc);
}

Expand Down Expand Up @@ -141,7 +141,7 @@ namespace Mantid
{
std::vector<int>::const_iterator vc,xc;
xc=A.Units.begin();
for(vc=Units.begin();vc!=Units.end();xc++,vc++)
for(vc=Units.begin();vc!=Units.end();++xc,++vc)
if (*vc != *xc)
return false;
}
Expand All @@ -154,7 +154,7 @@ namespace Mantid
std::vector<Acomp>::const_iterator acv,xcv;
acv=A.Comp.begin();
for(xcv=Comp.begin();xcv!=Comp.end() &&
*xcv==*acv ;xcv++,acv++);
*xcv==*acv ;++xcv,++acv);
return (xcv==Comp.end()) ? true : false;
}

Expand Down Expand Up @@ -197,7 +197,7 @@ namespace Mantid
std::vector<int>::const_iterator uc,ac;
ac=A.Units.begin();
uc=Units.begin();
for(;ac!=A.Units.end() && uc!=Units.end();uc++,ac++)
for(;ac!=A.Units.end() && uc!=Units.end();++uc,++ac)
if (*uc!=*ac)
return (*uc < *ac);

Expand All @@ -210,7 +210,7 @@ namespace Mantid
std::vector<Acomp>::const_iterator ux,ax;
ux=Comp.begin();
ax=A.Comp.begin();
for(;ux!=Comp.end() && ax!=A.Comp.end();ux++,ax++)
for(;ux!=Comp.end() && ax!=A.Comp.end();++ux,++ax)
{
if (*ax!=*ux)
return (*ux < *ax);
Expand Down Expand Up @@ -283,7 +283,7 @@ namespace Mantid
//Process Components:
std::vector<Acomp>::const_iterator fc,gc;
gc=Gparts.begin();
for(fc=Fparts.begin();gc!=Gparts.end() && fc!=Fparts.end();fc++)
for(fc=Fparts.begin();gc!=Gparts.end() && fc!=Fparts.end();++fc)
{
while(gc!=Gparts.end() && (*gc < *fc))
{
Expand Down Expand Up @@ -390,15 +390,15 @@ namespace Mantid
if (AX.isSingle() || AX.Intersect==Intersect) //single unit component/Conjoint
{
std::vector<int>::const_iterator aup;
for(aup=AX.Units.begin();aup!=AX.Units.end();aup++)
for(aup=AX.Units.begin();aup!=AX.Units.end();++aup)
{
std::vector<int>::iterator ipt;
ipt=std::lower_bound(Units.begin(),Units.end(),*aup);
if (ipt==Units.end() || *ipt!=*aup) // Only insert if new
Units.insert(ipt,*aup);
}
std::vector<Acomp>::const_iterator acp;
for(acp=AX.Comp.begin();acp!=AX.Comp.end();acp++)
for(acp=AX.Comp.begin();acp!=AX.Comp.end();++acp)
{
std::vector<Acomp>::iterator cpt;
cpt=std::lower_bound(Comp.begin(),Comp.end(),*acp);
Expand Down Expand Up @@ -608,7 +608,7 @@ namespace Mantid

// Add components
std::vector<Acomp>::const_iterator vc;
for(vc=A.Comp.begin();vc!=A.Comp.end();vc++)
for(vc=A.Comp.begin();vc!=A.Comp.end();++vc)
addComp(*vc);
return 0;
}
Expand Down Expand Up @@ -662,7 +662,7 @@ namespace Mantid

Intersect=0; // union of intersection
std::vector<BnId>::const_iterator vc;
for(vc=A.begin();vc!=A.end();vc++)
for(vc=A.begin();vc!=A.end();++vc)
{
Acomp Px(1); // Intersection
Px.addUnit(Index,*vc);
Expand Down Expand Up @@ -694,7 +694,7 @@ namespace Mantid

Intersect=1; // intersection of union
std::vector<BnId>::const_iterator vc;
for(vc=A.begin();vc!=A.end();vc++)
for(vc=A.begin();vc!=A.end();++vc)
{
Acomp Px(0); // Union
//std::cout<<"Item == "<<*vc<<std::endl;
Expand Down Expand Up @@ -768,7 +768,7 @@ namespace Mantid


std::map<int,int>::const_iterator mc;
for(mc=litMap.begin();mc!=litMap.end();mc++)
for(mc=litMap.begin();mc!=litMap.end();++mc)
{
Base[mc->first]=1; // Insert and Set to true
keyNumbers.push_back(mc->first);
Expand Down Expand Up @@ -830,7 +830,7 @@ namespace Mantid
return (Comp.empty()) ? 1 : 0;
// Else needs to be intersection of unions
std::vector<Acomp>::const_iterator cc;
for(cc=Comp.begin();cc!=Comp.end();cc++)
for(cc=Comp.begin();cc!=Comp.end();++cc)
if (cc->Intersect==1 || !cc->isSimple())
return 0;

Expand All @@ -850,7 +850,7 @@ namespace Mantid
std::vector<int>::const_iterator uc;
std::map<int,int>::iterator mc;
int S,V;
for(uc=Units.begin();uc!=Units.end();uc++)
for(uc=Units.begin();uc!=Units.end();++uc)
{
split(*uc,S,V);
mc=literalMap.find(V);
Expand All @@ -877,7 +877,7 @@ namespace Mantid
{
std::vector<int>::const_iterator uc;
std::map<int,int>::iterator mc;
for(uc=Units.begin();uc!=Units.end();uc++)
for(uc=Units.begin();uc!=Units.end();++uc)
{
mc=literalMap.find(*uc);
if (mc!=literalMap.end())
Expand All @@ -886,7 +886,7 @@ namespace Mantid
literalMap.insert(std::pair<int,int>(*uc,1));
}
std::vector<Acomp>::const_iterator cc;
for(cc=Comp.begin();cc!=Comp.end();cc++)
for(cc=Comp.begin();cc!=Comp.end();++cc)
{
cc->getLiterals(literalMap);
}
Expand Down Expand Up @@ -985,11 +985,11 @@ namespace Mantid
// object
// Can sort this realive to
std::vector<BnId>::iterator vc;
for(vc=Work.begin();vc!=Work.end();vc++)
for(vc=Work.begin();vc!=Work.end();++vc)
{
const int GrpIndex(vc->TrueCount()+1);
std::vector<BnId>::iterator oc=vc+1;
for(oc=vc+1;oc!=Work.end();oc++)
for(oc=vc+1;oc!=Work.end();++oc)
{
const int OCnt=oc->TrueCount();
if (OCnt>GrpIndex)
Expand All @@ -1008,7 +1008,7 @@ namespace Mantid
}
}

for(vc=Work.begin();vc!=Work.end();vc++)
for(vc=Work.begin();vc!=Work.end();++vc)
if (vc->PIstatus()==1)
PIComp.push_back(*vc);
Work=Tmod;
Expand Down Expand Up @@ -1085,16 +1085,16 @@ namespace Mantid
//
// First remove singlets:
//
for(dx=DNFactive.begin();dx!=DNFactive.end();dx++)
for(dx=DNFactive.begin();dx!=DNFactive.end();++dx)
{
if (*dx>=0 && DNFscore[*dx]==1) // EPI (definately)
{
for(px=PIactive.begin();
px!=PIactive.end() && !Grid[*px][*dx];px++);
px!=PIactive.end() && !Grid[*px][*dx];++px);

EPI.push_back(PIform[*px]);
// remove all minterm that the EPI covered
for(ddx=DNFactive.begin();ddx!=DNFactive.end();ddx++)
for(ddx=DNFactive.begin();ddx!=DNFactive.end();++ddx)
if (*ddx>=0 && Grid[*px][*ddx])
*ddx= -1; //mark for deletion (later)
// Can remove PIactive now.
Expand All @@ -1114,7 +1114,7 @@ namespace Mantid
for(px=PIactive.begin();px!=PIactive.end();px++)
{
std::cerr<<PIform[*px]<<":";
for(ddx=DNFactive.begin();ddx!=DNFactive.end();ddx++)
for(ddx=DNFactive.begin();ddx!=DNFactive.end();++ddx)
std::cerr<<((Grid[*px][*ddx]) ? " 1" : " 0");
std::cerr<<std::endl;
}
Expand All @@ -1128,10 +1128,10 @@ namespace Mantid
// First Make a new matrix for speed. Useful ???
Kernel::Matrix<int> Cmat(PIactive.size(),DNFactive.size()); // corrolation matrix
int cm(0);
for(px=PIactive.begin();px!=PIactive.end();px++)
for(px=PIactive.begin();px!=PIactive.end();++px)
{
int dm(0);
for(ddx=DNFactive.begin();ddx!=DNFactive.end();ddx++)
for(ddx=DNFactive.begin();ddx!=DNFactive.end();++ddx)
{
if (Grid[*px][*ddx])
Cmat[cm][dm]=1;
Expand Down Expand Up @@ -1172,7 +1172,7 @@ namespace Mantid
}

//OH well that means every PIactive is a EPI :-(
for(px=PIactive.begin();px!=PIactive.end();px++)
for(px=PIactive.begin();px!=PIactive.end();++px)
EPI.push_back(PIform[*px]);
DNFobj=EPI;
return 1;
Expand Down Expand Up @@ -1299,13 +1299,13 @@ namespace Mantid
std::vector<Acomp>::const_iterator xc;

Parts.clear();
for(vc=Units.begin();vc!=Units.end();vc++)
for(vc=Units.begin();vc!=Units.end();++vc)
{
Acomp Aitem(1); // Intersection (doesn't matter since 1 object)
Aitem.addUnitItem(*vc);
Parts.push_back(Aitem);
}
for(xc=Comp.begin();xc!=Comp.end();xc++)
for(xc=Comp.begin();xc!=Comp.end();++xc)
Parts.push_back(*xc);
return static_cast<int>(Parts.size());
}
Expand All @@ -1317,7 +1317,7 @@ namespace Mantid
if (makePI(DNFobj))
{
std::vector<BnId>::const_iterator vc;
for(vc=DNFobj.begin();vc!=DNFobj.end();vc++)
for(vc=DNFobj.begin();vc!=DNFobj.end();++vc)
{
Acomp Aitem(1); // make an intersection and add components
Aitem.addUnit(keyNumbers,*vc);
Expand Down Expand Up @@ -1356,7 +1356,7 @@ namespace Mantid
int cnt(0);


for(mc=litMap.begin();mc!=litMap.end();mc++)
for(mc=litMap.begin();mc!=litMap.end();++mc)
{
mc->second=cnt++;
Base[mc->first]=1; // Set to true
Expand Down Expand Up @@ -1410,7 +1410,7 @@ namespace Mantid
}

std::vector<Acomp>::const_iterator cc;
for(cc=Comp.begin();cc!=Comp.end();cc++)
for(cc=Comp.begin();cc!=Comp.end();++cc)
if (cc->isTrue(Base)==retJoin)
return retJoin;

Expand Down Expand Up @@ -1517,10 +1517,10 @@ namespace Mantid
{
std::vector<int>::const_iterator vc,tc;
tc=Units.begin();
for(vc=A.Units.begin();vc!=A.Units.end();vc++)
for(vc=A.Units.begin();vc!=A.Units.end();++vc)
{
while(tc!=Units.end() && *tc<*vc)
tc++;
++tc;
if (tc==Units.end() || *tc!=*vc)
return 0;
}
Expand Down Expand Up @@ -1754,7 +1754,7 @@ namespace Mantid
OXF<<" ";
OXF<<display()<<std::endl;
std::vector<Acomp>::const_iterator vc;
for(vc=Comp.begin();vc!=Comp.end();vc++)
for(vc=Comp.begin();vc!=Comp.end();++vc)
{
vc->writeFull(OXF,Indent+2);
}
Expand All @@ -1772,7 +1772,7 @@ namespace Mantid
std::stringstream cx;
std::vector<int>::const_iterator ic;
int sign,val; // sign and value of unit
for(ic=Units.begin();ic!=Units.end();ic++)
for(ic=Units.begin();ic!=Units.end();++ic)
{
if (!Intersect && ic!=Units.begin())
cx<<'+';
Expand Down Expand Up @@ -1815,7 +1815,7 @@ namespace Mantid
std::stringstream cx;
std::vector<int>::const_iterator ic;
int sign,val; // sign and value of unit
for(ic=Units.begin();ic!=Units.end();ic++)
for(ic=Units.begin();ic!=Units.end();++ic)
{
if (!Intersect && ic!=Units.begin())
cx<<'+';
Expand All @@ -1831,7 +1831,7 @@ namespace Mantid
}
// Now do composites
std::vector<Acomp>::const_iterator vc;
for(vc=Comp.begin();vc!=Comp.end();vc++)
for(vc=Comp.begin();vc!=Comp.end();++vc)
{
if (!Intersect && (vc!=Comp.begin() || !Units.empty()))
cx<<'+';
Expand Down
18 changes: 9 additions & 9 deletions Code/Mantid/Framework/Geometry/src/Objects/Object.cpp
Expand Up @@ -71,7 +71,7 @@ namespace Mantid

// Need to deep-copy the vector of pointers to surfaces
std::vector<const Surface*>::const_iterator vc;
for (vc = A.SurList.begin(); vc != A.SurList.end(); vc++)
for (vc = A.SurList.begin(); vc != A.SurList.end(); ++vc)
{
SurList.push_back((*vc)->clone());
}
Expand Down Expand Up @@ -105,7 +105,7 @@ namespace Mantid
// Need to deep-copy the vector of pointers to surfaces
SurList.clear();
std::vector<const Surface*>::const_iterator vc;
for (vc = A.SurList.begin(); vc != A.SurList.end(); vc++)
for (vc = A.SurList.begin(); vc != A.SurList.end(); ++vc)
{
SurList.push_back((*vc)->clone());
}
Expand Down Expand Up @@ -431,7 +431,7 @@ namespace Mantid
std::list<Kernel::V3D> Snorms; // Normals from the constact surface.

std::vector<const Surface*>::const_iterator vc;
for (vc = SurList.begin(); vc != SurList.end(); vc++)
for (vc = SurList.begin(); vc != SurList.end(); ++vc)
{
if ((*vc)->onSurface(Pt))
{
Expand All @@ -444,8 +444,8 @@ namespace Mantid
}
std::list<Kernel::V3D>::const_iterator xs, ys;
Kernel::V3D NormPair;
for (xs = Snorms.begin(); xs != Snorms.end(); xs++)
for (ys = xs, ys++; ys != Snorms.end(); ys++)
for (xs = Snorms.begin(); xs != Snorms.end(); ++xs)
for (ys = xs, ys++; ys != Snorms.end(); ++ys)
{
NormPair = (*ys) + (*xs);
NormPair.normalize();
Expand Down Expand Up @@ -537,7 +537,7 @@ namespace Mantid
{

std::vector<const Surface*>::const_iterator vc;
for (vc = SurList.begin(); vc != SurList.end(); vc++)
for (vc = SurList.begin(); vc != SurList.end(); ++vc)
{
std::cerr << "Point == " << reinterpret_cast<long int> (*vc) << std::endl;
std::cerr << (*vc)->getName() << std::endl;
Expand Down Expand Up @@ -629,7 +629,7 @@ namespace Mantid
std::cout << "Rules == " << Rcount << std::endl;
std::vector<int>::const_iterator mc;
std::cout << "Surface included == ";
for (mc = Cells.begin(); mc < Cells.end(); mc++)
for (mc = Cells.begin(); mc < Cells.end(); ++mc)
{
std::cout << (*mc) << " ";
}
Expand Down Expand Up @@ -806,7 +806,7 @@ namespace Mantid
// Loop over all the surfaces.
LineIntersectVisit LI(UT.startPoint(), UT.direction());
std::vector<const Surface*>::const_iterator vc;
for (vc = SurList.begin(); vc != SurList.end(); vc++)
for (vc = SurList.begin(); vc != SurList.end(); ++vc)
{
(*vc)->acceptVisitor(LI);
}
Expand Down Expand Up @@ -1688,7 +1688,7 @@ namespace Mantid
axes.push_back(Kernel::V3D(0, 0, 1));
axes.push_back(Kernel::V3D(0, 0, -1));
std::vector<Kernel::V3D>::const_iterator dir;
for (dir = axes.begin(); dir != axes.end(); dir++)
for (dir = axes.begin(); dir != axes.end(); ++dir)
{
Geometry::Track tr(point, (*dir));
if (this->interceptSurface(tr) > 0)
Expand Down
2 changes: 1 addition & 1 deletion Code/Mantid/Framework/Geometry/src/Surfaces/Quadratic.cpp
Expand Up @@ -260,7 +260,7 @@ Quadratic::distance(const Kernel::V3D& Pt) const
double Out= -1;
Kernel::V3D xvec;
std::vector<double>::const_iterator vc;
for(vc=TRange.begin();vc!=TRange.end();vc++)
for(vc=TRange.begin();vc!=TRange.end();++vc)
{
const double daI=1.0+2* (*vc) *da;
const double dbI=1.0+2* (*vc) *db;
Expand Down

0 comments on commit 2d6fec6

Please sign in to comment.