42 std::vector<long> ref_values,
43 std::vector<bool> ref_valid)
45 for (std::size_t i=0; i<ref_values.size(); ++i)
47 if (ref_values[i] != *iter)
49 std::cerr <<
"Error after " << i <<
"increments: Expected value " << ref_values[i] <<
", but got " << *iter << std::endl;
52 if (ref_valid[i] != iter.
valid())
54 std::cerr <<
"Error after " << i <<
"increments: Expected valid status " << ref_valid[i] <<
", but got " << iter.
valid() << std::endl;
70 std::cout <<
"--- Iteration over all harmonics: ---" << std::endl;
71 std::vector<bool> ref_all_valid(17,
true);
72 ref_all_valid[16] =
false;
73 std::vector<long> ref_all_values(17);
74 for (std::size_t i=0; i<17; ++i)
75 ref_all_values[i] =
long(i);
77 ok = test_iterator(iter_all, ref_all_values, ref_all_valid);
78 if (ok ==
false)
return (EXIT_FAILURE);
80 std::cout <<
"--- Iteration over even harmonics: ---" << std::endl;
81 std::vector<bool> ref_even_valid(7,
true);
82 ref_even_valid[6] =
false;
83 std::vector<long> ref_even_values(7);
84 ref_even_values[1] = 4;
85 ref_even_values[2] = 5;
86 ref_even_values[3] = 6;
87 ref_even_values[4] = 7;
88 ref_even_values[5] = 8;
89 ref_even_values[6] = 16;
90 ok = test_iterator(iter_even, ref_even_values, ref_even_valid);
91 if (ok ==
false)
return (EXIT_FAILURE);
93 std::cout <<
"--- Iteration over odd harmonics: ---" << std::endl;
94 std::vector<bool> ref_odd_valid(11,
true);
95 ref_odd_valid[10] =
false;
96 std::vector<long> ref_odd_values(11);
97 ref_odd_values[0] = 1;
98 ref_odd_values[1] = 2;
99 ref_odd_values[2] = 3;
100 ref_odd_values[3] = 9;
101 ref_odd_values[4] = 10;
102 ref_odd_values[5] = 11;
103 ref_odd_values[6] = 12;
104 ref_odd_values[7] = 13;
105 ref_odd_values[8] = 14;
106 ref_odd_values[9] = 15;
107 ref_odd_values[10] = 25;
108 ok = test_iterator(iter_odd, ref_odd_values, ref_odd_valid);
109 if (ok ==
false)
return (EXIT_FAILURE);
111 std::cout <<
"*******************************" << std::endl;
112 std::cout <<
"* Test finished successfully! *" << std::endl;
113 std::cout <<
"*******************************" << std::endl;
115 return (EXIT_SUCCESS);
Iteration over all spherical harmonics indices up to order L, with increasing indices l and m.
Provides the SHE coupling matrices and computes higher-order coupling matrices if required....
Implementation of numerical integration routines.
@ ALL_HARMONICS_ITERATION_ID
@ EVEN_HARMONICS_ITERATION_ID
@ ODD_HARMONICS_ITERATION_ID
Implementation of spherical harmonics plus helper functions.