c++ - 帕尔马多面体库 : Vertex Enumeration

标签 c++ discrete-mathematics polyhedra

我正在尝试使用 Parma Polyhedra 库 [1]枚举(凸)多面体的顶点,例如,我有一个由四个约束指定的矩形:

Constraint_System cs;
cs.insert(x >= 0);
cs.insert(x <= 3);
cs.insert(y >= 0);
cs.insert(y <= 3);
C_Polyhedron ph(cs);

我如何生成顶点?

最佳答案

PPL 中的每个形状都有双重表示:1) Constraint_System,2) Generator_System。对于凸多面体,生成器系统将包含一组生成器,这些生成器可以是 1) 点、2) 线、3) 射线。对于凸多胞形,生成器集将是所有点。您可以获得生成器表示如下:

Generator_System gs = ph.generators(); // Use ph.minimized_generators() to minimal set of points for the polytope
for(Generator_System::const_iterator it = gs.begin(); it != gs.end(); it++) {
  const Generator& g = *it;
  assert(g.is_point()); // Assertions will fail for unbounded polyhedra
  std::cout << g;
}

关于c++ - 帕尔马多面体库 : Vertex Enumeration,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30018766/

相关文章:

java - 算法的复杂性(嵌套循环)

c++ - 捕获 Visual Studio 响应文件?

c++ - 在 arm neon 中高效地重新洗牌和组合 16 个 3 位数字

python - Combinatorics Counting Puzzle : Roll 20, 8面骰子,得到至少5个相同值的骰子的概率是多少

c++ - CGAL 段错误

MATLAB:根据一组分散的 3D 点计算凹多面体的体积

c# - 如何判断多面体是否凸?

c++ - 如何创建一个新值并分配给类构造函数中的私有(private) unique_ptr?

c++ - 将一串十六进制存储到一个字符中?

haskell - 在 Haskell 中寻找自由幂等幺半群的元素的最小形式