33 static double get(
const double R)
35 return 2*JTOOLS::PI*R*R * JVolume<N-2>::get(R) / N;
51 static double get(
const double R)
53 return JTOOLS::PI*R*R;
69 static double get(
const double R)
82 template<
class JKey_t>
85 return key.first*
key.first;
95 template<
unsigned int N,
class JKey_t>
98 return key.first*
key.first + getLengthSquared(
key.second);
120 JParser<> zap(
"Example program to test integration of sphere in any number of dimensions.");
128 catch(
const exception &error) {
129 FATAL(error.what() << endl);
134 const double R = 1.0;
145 gs.configure(make_multigrid<N-2>(grid));
147 for (JMultiFunction_t::super_iterator i = gs.super_begin(); i != gs.super_end(); ++i) {
149 const double x = sqrt(getLengthSquared(i.getKey()));
151 for (
int __i = 0; __i != grid.
getSize(); ++__i) {
153 const double y = grid.
getX(__i);
154 const double z = R*R - x*x - y*y;
157 i.getValue()[y] = 2.0 * sqrt(z);
159 i.getValue()[y] = 0.0;
165 const double U = JVolume<N>::get(R);
167 JTimer timer(
"integrator");
171 const double W = getIntegral(gs);
175 NOTICE(
"Sphere " << N <<
"D" << endl);
181 ASSERT(fabs(U - W) < precision * U);
Various implementations of functional maps.
General purpose messaging.
#define ASSERT(A,...)
Assert macro.
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
I/O formatting auxiliaries.
int numberOfBins
number of bins for average CDF integral of optical module
int main(int argc, char **argv)
Auxiliary class for CPU timing and usage.
Utility class to parse command line options.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary data structure for floating point format specification.