8 |
|
|
9 |
|
/** |
10 |
|
* Adapted from FJTask version. |
11 |
< |
* Sample program using Guassian Quadrature for numerical integration. |
11 |
> |
* Sample program using Gaussian Quadrature for numerical integration. |
12 |
|
* Inspired by a |
13 |
|
* <A href="http://www.cs.uga.edu/~dkl/filaments/dist.html"> Filaments</A> |
14 |
|
* demo program. |
15 |
|
*/ |
16 |
– |
|
16 |
|
public class IntegrateGamma { |
17 |
|
/** for time conversion */ |
18 |
|
static final long NPS = (1000L * 1000 * 1000); |
91 |
|
} |
92 |
|
} |
93 |
|
|
95 |
– |
|
94 |
|
static class Integrator { |
95 |
|
final Function f; // The function to integrate |
96 |
|
final double errorTolerance; |
113 |
|
return q.area; |
114 |
|
} |
115 |
|
|
118 |
– |
|
116 |
|
/** |
117 |
|
* FJTask to recursively perform the quadrature. |
118 |
|
* Algorithm: |