本文整理汇总了C++中Pos::IsBorder方法的典型用法代码示例。如果您正苦于以下问题:C++ Pos::IsBorder方法的具体用法?C++ Pos::IsBorder怎么用?C++ Pos::IsBorder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pos
的用法示例。
在下文中一共展示了Pos::IsBorder方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: rotateUntilBorder
void ModButterfly::rotateUntilBorder(RgbVertexC& v, Pos& pos)
{
assert(v.vp() == pos.v);
do
{
pos.FlipE();
pos.FlipF();
} while (!pos.IsBorder());
assert(v.vp() == pos.v);
}
示例2: computeExtraordinary
ModButterfly::Point ModButterfly::computeExtraordinary(RgbVertexC& v, Pos& pos)
{
int rank;
if (v.getLevel() == 0)
rank = baseArity(v);
else
rank = 4;
vector<Point> points;
vector<double> coeff;
computeExtraordinaryPattern(coeff,rank);
points.reserve(rank+1);
points.push_back(v.getCoord());
if (!v.getIsBorder())
{
int angle = rank * 2;
do
{
pos.FlipV();
points.push_back(pos.v->P());
assert(pos.v != v.vp());
pos.FlipV();
rotate(v,pos,2);
angle -= 2;
assert (angle >= 0);
}
while (angle != 0);
}
else
{
Pos pos2 = pos;
// Border
int angle = (rank-1) * 2;
do
{
pos.FlipV();
points.push_back(pos.v->P());
assert(pos.v != v.vp());
pos.FlipV();
assert(pos.v == v.vp());
rotate(v,pos,2);
angle -= 2;
assert (angle >= 0);
}
while ((!pos.IsBorder()) && (angle != 0));
pos.FlipV();
points.push_back(pos.v->P());
assert(pos.v != v.vp());
pos.FlipV();
assert(angle >= 0);
vector<Point> pointsreverse;
pos2.FlipF();
rotate(v,pos2,2);
angle -= 2;
if ((!pos2.IsBorder()) && (angle != 0))
{
do
{
pos2.FlipV();
pointsreverse.push_back(pos2.v->P());
assert(pos2.v != v.vp());
pos2.FlipV();
assert(pos2.v == v.vp());
rotate(v,pos2,2);
angle -= 2;
assert (angle >= 0);
}
while ((!pos2.IsBorder()) && (angle != 0));
}
assert(angle == 0);
pos.FlipV();
points.push_back(pos.v->P());
assert(pos.v != v.vp());
pos.FlipV();
for(int i=pointsreverse.size()-1;i>= 0; i--)
points.push_back(pointsreverse[i]);
}
assert(points.size() == (unsigned int)(rank + 1));
assert(points.size() == coeff.size());
Point acc = Point(0.0,0.0,0.0);
for (int i=0; i<rank+1; i++)
{
Point tmp = points[i] * coeff[i];
acc += tmp;
}
return acc;
}