本文整理汇总了C++中Stack::IteratorReset方法的典型用法代码示例。如果您正苦于以下问题:C++ Stack::IteratorReset方法的具体用法?C++ Stack::IteratorReset怎么用?C++ Stack::IteratorReset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Stack
的用法示例。
在下文中一共展示了Stack::IteratorReset方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: rv
void
CircleAdaptive::Process(Stack<AtomicRegion>& Offspring)
{
Circle& C = Geometry();
static unsigned int mxgen=2;
//if (mxgen == 0)
//{
//std::cerr<<"How many times may I apply the circle rule? ";
//cin>>mxgen;
//};
TimesCalled++;
if(TimesCalled ==1)
{
if (GenerationNumber < mxgen)
{
TheRule->Apply(LocalIntegrand(),C,Integral(),AbsoluteError());
}
else
{
Point rv (C.Radius(),0);
Point bp = C.Center()+rv;
AtomicRegion* A ;
A= (AtomicRegion*) POLAR_RECTANGLE(C.Center(),bp,bp);
A->LocalIntegrand(&(LocalIntegrand()));
Offspring.Push(A);
};
}
else
{
const real CircleRatio = 0.44721359549995793928;
Point m1(C.Radius()*CircleRatio ,0.);
Point m2(C.Radius() , 0.);
Point m3(0.,C.Radius());
Point m4(0.,C.Radius()*CircleRatio);
Point origin=C.Center();
AtomicRegion*
t1=(AtomicRegion*) POLAR_RECTANGLE(origin+m1,origin+m2,origin+m3);
AtomicRegion*
t2=(AtomicRegion*) POLAR_RECTANGLE(origin+m4,origin+m3,origin-m2);
AtomicRegion*
t3=(AtomicRegion*) POLAR_RECTANGLE(origin-m1,origin-m2,origin-m3);
AtomicRegion*
t4=(AtomicRegion*) POLAR_RECTANGLE(origin-m4,origin-m3,origin+m2);
Offspring.Push(t1);
Offspring.Push(t2);
Offspring.Push(t3);
Offspring.Push(t4);
Offspring.IteratorReset();
while (!Offspring.IteratorAtEnd())
{
Offspring.IteratorNext()->LocalIntegrand(&LocalIntegrand());
};
if (CircleRatio != 0.0)
{
Circle* tmp = new Circle(origin,C.Radius()*CircleRatio);
Atomic<Circle>* a =new Atomic<Circle>(tmp,Descendant());
a->LocalIntegrand(&LocalIntegrand());
Offspring.Push(a);
};
};
}