# \[ANN\] PolyhedralCubature.jl

**URL:** <https://discourse.julialang.org/t/ann-polyhedralcubature-jl/106225>\
**Category:** Package Announcements\
**Tags:** announcement, numerics, math\
**Created:** [November 14, 2023, 3:32pm UTC](https://discourse.julialang.org/t/ann-polyhedralcubature-jl/106225 "2023-11-14T15:32:00Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![\_stla](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/_stla/32/35613_2.png) [@\_stla](https://discourse.julialang.org/u/_stla)\
**Post date:** [November 14, 2023, 3:32pm UTC](https://discourse.julialang.org/t/ann-polyhedralcubature-jl/106225/1 "2023-11-14T15:32:00Z")

</div>

I’ve just finished [PolyhedralCubature.jl](https://github.com/stla/PolyhedralCubature.jl), a package allowing to evaluate the multiple integral of a function over a convex polytope, given by linear inequalities such as:

![zzzz1](https://global.discourse-cdn.com/julialang/original/3X/1/4/14cd6621c6f8a7d56b606bfa8d28d159e1644b81.png)

It remains to improve the doc. I also implemented this method in R and Python.

---

<div class="post-metadata">

**Author:** ![juliohm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliohm/32/215266_2.png) [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Post date:** [November 14, 2023, 5:18pm UTC](https://discourse.julialang.org/t/ann-polyhedralcubature-jl/106225/2 "2023-11-14T17:18:49Z")

</div>

The latex in the docs is rendering incorrect integrations:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/c/2/c216bf16b59806616fe42b976342eae20121548d.png)

---

<div class="post-metadata">

**Author:** ![\_stla](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/_stla/32/35613_2.png) [@\_stla](https://discourse.julialang.org/u/_stla)\
**Post date:** [November 14, 2023, 5:20pm UTC](https://discourse.julialang.org/t/ann-polyhedralcubature-jl/106225/3 "2023-11-14T17:20:03Z")

</div>

Thanks. I didn’t look at the output yet ^^

---

<div class="post-metadata">

**Author:** ![juliohm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliohm/32/215266_2.png) [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Post date:** [November 14, 2023, 5:24pm UTC](https://discourse.julialang.org/t/ann-polyhedralcubature-jl/106225/4 "2023-11-14T17:24:09Z")

</div>

It would be nice to remove the dependency on Polyhedra.jl. Perhaps you could obtain the v-representation yourself? Or is it too much work?

---

<div class="post-metadata">

**Author:** ![\_stla](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/_stla/32/35613_2.png) [@\_stla](https://discourse.julialang.org/u/_stla)\
**Post date:** [November 14, 2023, 5:25pm UTC](https://discourse.julialang.org/t/ann-polyhedralcubature-jl/106225/5 "2023-11-14T17:25:46Z")

</div>

It’s a hard problem of computational geometry I think. Why would it be nice to remove this package?

---

<div class="post-metadata">

**Author:** ![\_stla](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/_stla/32/35613_2.png) [@\_stla](https://discourse.julialang.org/u/_stla)\
**Post date:** [November 14, 2023, 5:32pm UTC](https://discourse.julialang.org/t/ann-polyhedralcubature-jl/106225/6 "2023-11-14T17:32:23Z")

</div>

[This](https://discourse.julialang.org/t/matrix-vector-representation-of-a-system-of-linear-inequalities/106188/1) would be a nice to have.

I have such a feature in R and Python, but not in Julia yet.

---

<div class="post-metadata">

**Author:** ![juliohm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliohm/32/215266_2.png) [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Post date:** [November 14, 2023, 5:34pm UTC](https://discourse.julialang.org/t/ann-polyhedralcubature-jl/106225/7 "2023-11-14T17:34:16Z")

</div>

It would be nice for users who cannot afford a heavy dependency. For example, we have similar integration features in our GeoStats.jl stack and would benefit from a well-tested package for integration over polytopes.

---

<div class="post-metadata">

**Author:** ![\_stla](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/_stla/32/35613_2.png) [@\_stla](https://discourse.julialang.org/u/_stla)\
**Post date:** [November 14, 2023, 5:45pm UTC](https://discourse.julialang.org/t/ann-polyhedralcubature-jl/106225/8 "2023-11-14T17:45:33Z")

</div>

In Python and R, I get the V-representation with the help of the C library **cddlib**. I think it is also used by **Polyhedra** , via **CDDLib.jl**. I’m not aware of another available implementation.

---

<div class="post-metadata">

**Author:** ![juliohm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliohm/32/215266_2.png) [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Post date:** [November 14, 2023, 5:52pm UTC](https://discourse.julialang.org/t/ann-polyhedralcubature-jl/106225/9 "2023-11-14T17:52:08Z")

</div>

Got it. I wish I had the time to read the original papers describing the methods. I am assuming that it is an optimization problem that can be formulated and solved with native Julia packages.

---

<div class="post-metadata">

**Author:** ![\_stla](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/_stla/32/35613_2.png) [@\_stla](https://discourse.julialang.org/u/_stla)\
**Post date:** [November 14, 2023, 5:54pm UTC](https://discourse.julialang.org/t/ann-polyhedralcubature-jl/106225/10 "2023-11-14T17:54:53Z")

</div>

Perhaps. And I don’t need the sense `V -> H`. Moreover I need `H -> V` in the polytope case only, without rays and lines. So maybe that’s not so difiicult.
