本文整理汇总了C++中Polyhedron::getNoOfInequalities方法的典型用法代码示例。如果您正苦于以下问题:C++ Polyhedron::getNoOfInequalities方法的具体用法?C++ Polyhedron::getNoOfInequalities怎么用?C++ Polyhedron::getNoOfInequalities使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Polyhedron
的用法示例。
在下文中一共展示了Polyhedron::getNoOfInequalities方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc) {
bool chat = argc>1;
TvpiVar ident[] = {0,1,2 };
DenseTvpi<true> dom;
DomVar x = dom.createVariable();
DomVar y = dom.createVariable();
DomVar z = dom.createVariable();
Point xzA = Point(8,-2);
Point xzB = Point(8,1);
Point xzC = Point(7,5);
Point xzD = Point(6,7);
Point xzE = Point(5,7);
Point xzF = Point(2,8);
Point xzG = Point(0,8);
Point yzA = Point(0,-7);
Point yzB = Point(2,-7);
Point yzC = Point(4,-7);
Point yzD = Point(6,-6);
Point yzE = Point(7,-5);
Point yzF = Point(8,-2);
Point yzG = Point(8,2);
Inequality* eqsXZ[] = {
//new Inequality(xzA, xzB),
new Inequality(xzB, xzD),
new Inequality(xzC, xzF),
new Inequality(xzE, xzG),
0
};
Inequality* eqsYZ[] = {
new Inequality(yzA, yzD),
new Inequality(yzB, yzE),
new Inequality(yzC, yzF),
0,//new Inequality(yzF, yzG),
};
dom.addInequalities(x,z, 3, eqsXZ);
if (chat) cout << "Before:" << endl << dom;
dom.addInequalities(y,z, 3, eqsYZ);
if (chat) cout << "After:" << endl << dom;
if (chat) cout << "Intersection points:" << endl;
Polyhedron<true> xyP = dom.getProjection(x,y);
if (chat) for(size_t i=0; i+1<xyP.getNoOfInequalities(); i++)
cout << Point(*xyP[i], *xyP[i+1]) << endl;
// The point <8,10,-> is not entailed in the closure.
DenseTvpi<true> dom2;
dom2.createVariable(8);
dom2.createVariable(10);
dom2.createVariable();
if (chat) cout << "Testing:" << endl << dom2;
bool correct=!dom.includes(dom2, ident) && xyP.getNoOfInequalities()==8;
return !correct;
};
示例2: main
int main() {
Polyhedron<true> p;
vector<Inequality*> eqs;
eqs.push_back(new Inequality(-34,55,1));
Interval<true> xBound;
xBound.updateUpper(0);
Interval<true> yBound;
p.addInequalitySet(xBound, yBound, eqs);
//cout << "before:\n" << p
// << "x in " << xBound << ", y in " << yBound << endl;
bool correct=p.getNoOfInequalities()==2;
// Return 1 on error.
return !correct;
};