Is there a multidimensional integrate-function?

Code is protected by copyright. Algorithms are protected by patents.

Alas, it’s up to the courts to decide the difference between copying code and reimplementing algorithms.