I have a lot of datapoints and I want to compute the area under the curve for sliding windows. But It should be quite fast. I googled a bit and found a NewtonCotes implementation in Java, but I don´t know if there are faster methods.
Any Ideas?
I have a lot of datapoints and I want to compute the area under the curve for sliding windows. But It should be quite fast. I googled a bit and found a NewtonCotes implementation in Java, but I don´t know if there are faster methods.
Any Ideas?
The answer depends on the function you're trying to integrate. Gauss quadrature can be very efficient indeed if applied to the right function. 5th order adaptive Runga-Kutta can do very well, too.
An adaptive method that automatically increases refinement to meet a given accuracy requirement is quite doable.
The fastest code to write is a library:
http://commons.apache.org/math/
I'd recommend a book like Numerical Recipes or another by Forman Acton.