# \[ANN\] SimplicialCubature.jl

**URL:** <https://discourse.julialang.org/t/ann-simplicialcubature-jl/91255>\
**Category:** Package Announcements\
**Tags:** package, announcement, integral\
**Created:** [December 5, 2022, 11:00am UTC](https://discourse.julialang.org/t/ann-simplicialcubature-jl/91255 "2022-12-05T11:00:58Z")\
**Posts on this page:** 8\
**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:** [December 5, 2022, 11:00am UTC](https://discourse.julialang.org/t/ann-simplicialcubature-jl/91255/1 "2022-12-05T11:00:58Z")

</div>

Hello,

I made a package for the numerical integration of a multivariate function on a simplex: [SimplicialCubature.jl](https://github.com/stla/SimplicialCubature.jl).

This is a port of the R package **SimplicialCubature**. The integration is adaptive.

There’s also a function for the computation of the exact value of the integral in the case when the function is polynomial.

Related blog post: [Integral over a polyhedron](https://laustep.github.io/stlahblog/posts/integralOnPolyhedronJulia.html).

---

<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:** [December 5, 2022, 12:38pm UTC](https://discourse.julialang.org/t/ann-simplicialcubature-jl/91255/2 "2022-12-05T12:38:28Z")

</div>

@_stla can you add references to the methods used? Also, the appearance of the code reminds Fortran/C… Be careful if you are copying/pasting code from other software projects with specific software license terms.

---

<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:** [December 5, 2022, 1:26pm UTC](https://discourse.julialang.org/t/ann-simplicialcubature-jl/91255/3 "2022-12-05T13:26:56Z")

</div>

Hello,

Ok, I will add the references.

The original code is written in Matlab and Fortran, written by Alan Genz. The R package has been written by someone else, John P. Nolan. He mentions Alan Genz in the description file of the package.

When I do a R package whose code is a translation from another language, I add the original author name in the authors list, and I specify he/she is copyright holder. Maybe I should do that for my Julia package. Where can I add a sentence like “Code adapted from …”?

The license of the R package **SimplicialCubature** is GPL \>= 2.

How do you recognize Fortran ?

---

<div class="post-metadata">

**Author:** ![lrnv](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lrnv/32/19373_2.png) [@lrnv](https://discourse.julialang.org/u/lrnv)\
**Post date:** [December 5, 2022, 1:41pm UTC](https://discourse.julialang.org/t/ann-simplicialcubature-jl/91255/4 "2022-12-05T13:41:57Z")

</div>

> [@\_stla](#):
>
> When I do a R package whose code is a translation from another language, I add the original author name in the authors list, and I specify he/she is copyright holder. Maybe I should do that for my Julia package. Where can I add a sentence like “Code adapted from …”?

Take a look at the license text, it usually tells you what to do. In any case, you can always contact the person to ask them how they want to be credited, i’m sure they will be pleased their code is ported to another language. 🙂

---

<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:** [December 5, 2022, 1:46pm UTC](https://discourse.julialang.org/t/ann-simplicialcubature-jl/91255/5 "2022-12-05T13:46:13Z")

</div>

As far as I understand your code must also be GPL as code derived from GPL. That is a very important information as many Julia devs (myself included) cannot afford the terms of GPL.

---

<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:** [December 5, 2022, 1:51pm UTC](https://discourse.julialang.org/t/ann-simplicialcubature-jl/91255/6 "2022-12-05T13:51:21Z")

</div>

Ok. I wrote an email to the author of the R package and I changed the license. Thanks.

---

<div class="post-metadata">

**Author:** ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)\
**Post date:** [December 5, 2022, 2:36pm UTC](https://discourse.julialang.org/t/ann-simplicialcubature-jl/91255/7 "2022-12-05T14:36:07Z")

</div>

> [@\_stla](#):
>
> The original code is written in Matlab and Fortran, written by Alan Genz.

Might also be good to provide an _exact_ reference, typically people don’t write a single piece of code ever. BTW, is that the same algorithm already provided by several different packages

- [`HCubature.jl`](https://github.com/JuliaMath/HCubature.jl)
- [`Cubature.jl`](https://github.com/JuliaMath/Cubature.jl)
- [`Cuba.jl`](https://github.com/giordano/Cuba.jl)
- [`NIntegration.jl`](https://github.com/pabloferz/NIntegration.jl)

?

_ **Edit** _: ok, [reference](https://stla.github.io/SimplicialCubature.jl/dev/#References) is in the documentation, I looked only at the README in the repository. Looks like a different algorithm.

---

<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:** [December 5, 2022, 2:37pm UTC](https://discourse.julialang.org/t/ann-simplicialcubature-jl/91255/8 "2022-12-05T14:37:53Z")

</div>

I think the packages you mention allow integration on rectangular domains only, not on simplices.
