本文整理汇总了C++中Polyhedron::addInequalitySet方法的典型用法代码示例。如果您正苦于以下问题:C++ Polyhedron::addInequalitySet方法的具体用法?C++ Polyhedron::addInequalitySet怎么用?C++ Polyhedron::addInequalitySet使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Polyhedron
的用法示例。
在下文中一共展示了Polyhedron::addInequalitySet方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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;
};
示例2: main
int main(int argc) {
bool chat = argc>1;
Polyhedron<true> p;
vector<Inequality*> eqs;
eqs.push_back(new Inequality(-4079,4080,4080));
eqs.push_back(new Inequality(4079,-4080,-4080));
Interval<true> xBound;
Interval<true> yBound;
xBound.updateLower(2041);
xBound.updateUpper(4080);
yBound.updateLower(2041);
yBound.updateUpper(4080);
p.addInequalitySet(xBound, yBound, eqs);
if (chat) cout << "result:\n" << p
<< "x in " << xBound << ", y in " << yBound << endl;
// The inequalities only have a single integral point as solution.
bool correct=!xBound.updateLower(4080) && !xBound.updateUpper(4080);
// Return 1 on error.
return !correct;
};