20 namespace PhysicsTools {
37 d += coeffs[1]; tmp =
x;
38 d += coeffs[2] * tmp * 2.0; tmp *=
x;
39 d += coeffs[3] * tmp * 3.0;
47 area += coeffs[0] *
tmp; tmp *=
x;
48 area += coeffs[1] * tmp * (1.0 / 2.0); tmp *=
x;
49 area += coeffs[2] * tmp * (1.0 / 3.0); tmp *=
x;
50 area += coeffs[3] * tmp * (1.0 / 4.0);
64 n(0), segments(0), area(0.0)
78 seg->
coeffs[1] = vals[1] - vals[0];
88 m0 = 0.0, m1 = 0.5 * (vals[2] - vals[0]);
90 seg->
coeffs[1] = -2.0 * vals[0] + 2.0 * vals[1] - m1;
91 seg->
coeffs[2] = vals[0] - vals[1] + m1;
98 for(
unsigned int i = 1;
i <
n - 1;
i++, seg++, vals++) {
99 m1 = 0.5 * (vals[2] - vals[0]);
102 seg->coeffs[2] = -3.0 * vals[0] - 2.0 * m0 + 3.0 * vals[1] - m1;
103 seg->coeffs[3] = 2.0 * vals[0] + m0 - 2.0 * vals[1] + m1;
105 area = seg->integral(1.0);
109 seg->coeffs[0] = vals[0];
111 seg->coeffs[2] = - vals[0] - m0 + vals[1];
112 seg->coeffs[3] = 0.0;
114 area = seg->integral(1.0);
140 double rest = std::modf(x *
n, &total);
147 if (x < 0.0 || x > 1.0)
155 double rest = std::modf(x *
n, &total);
171 double rest = std::modf(x *
n, &total);
std::vector< std::vector< double > > tmp