@@ -19,22 +19,22 @@ std::tuple<std::vector<double>, std::vector<double>, std::vector<double>>
19
19
generate_data () {
20
20
using namespace matplot ;
21
21
int n = 16 ;
22
- auto r = iota (-n , 2 ., n );
22
+ auto r = iota (static_cast < double >(-n) , 2 ., static_cast < double >(n) );
23
23
auto theta = transform (r, [n](double x) { return x / n * pi ; });
24
24
auto phi = transform (r, [n](double x) { return x / n * pi / 2 .; });
25
25
auto sinphi = transform (phi, [](double x) { return sin (x); });
26
26
auto cosphi = transform (phi, [](double x) { return cos (x); });
27
27
cosphi.front () = 0 ;
28
28
cosphi.back () = 0 ;
29
- auto sintheta = transform (theta, [n ](double x) { return sin (x); });
29
+ auto sintheta = transform (theta, [](double x) { return sin (x); });
30
30
sintheta.front () = 0 ;
31
31
sintheta.back () = 0 ;
32
- auto costheta = transform (theta, [n ](double x) { return cos (x); });
32
+ auto costheta = transform (theta, [](double x) { return cos (x); });
33
33
std::vector<std::vector<double >> X (17 , std::vector<double >(17 , 0 .));
34
34
std::vector<std::vector<double >> Y (17 , std::vector<double >(17 , 0 .));
35
35
std::vector<std::vector<double >> Z (17 , std::vector<double >(17 , 0 .));
36
- for (size_t i = 0 ; i < n + 1 ; ++i) {
37
- for (size_t j = 0 ; j < n + 1 ; ++j) {
36
+ for (int i = 0 ; i < n + 1 ; ++i) {
37
+ for (int j = 0 ; j < n + 1 ; ++j) {
38
38
X[i][j] = cosphi[i] * costheta[j];
39
39
Y[i][j] = cosphi[i] * sintheta[j];
40
40
Z[i][j] = sinphi[i];
0 commit comments