25 int main(
int argc,
char**argv)
30 const double xmin = -10.0;
31 const double xmax = +10.0;
33 typedef JLegendre<JQuaternion3D> JLegendre_t;
35 unsigned int numberOfEvents;
37 JLegendre_t f1(xmin, xmax);
42 JParser<> zap(
"Example program to test Legendre polynome.");
51 catch(
const exception &error) {
52 FATAL(error.what() << endl);
56 for (JLegendre_t::iterator i = f1.begin(); i != f1.end(); ++i) {
60 STATUS(
"function: " << *i << endl);
68 const double x = xmin + i * (xmax - xmin) / (
numberOfBins - 1);
76 <<
FIXED(7,3) << i->first <<
" "
78 << 360.0 * acos(i->second.getA()) /
PI << endl);
84 JLegendre<JQuaternion3D, N>
g1(data.begin(), data.end());
86 for (
size_t n = 0;
n !=
N + 1; ++
n) {
88 STATUS(
"Legendre: " << setw(2) <<
n <<
' ' <<
g1[
n]);
98 if (numberOfEvents > 0) {
102 for (
unsigned int i = 0; i != numberOfEvents; ++i) {
104 const double x = gRandom->Uniform(xmin, xmax);
105 const JQuaternion3D y = f1(x);
106 const JQuaternion3D z =
g1(x);
Utility class to parse command line options.
double getAngle(const JQuaternion3D &first, const JQuaternion3D &second)
Get space angle between quanternions.
Auxiliary methods for mathematics.
Auxiliary data structure for floating point format specification.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
static const double PI
Mathematical constants.
General purpose messaging.
Utility class to parse command line options.
alias put_queue eval echo n
then usage $script[input file[working directory[option]]] nWhere option can be N
int numberOfBins
number of bins for average CDF integral of optical module
#define DEBUG(A)
Message macros.
Double_t g1(const Double_t x)
Function.
int main(int argc, char *argv[])