Hi,
I have the following static arrays of different size in a class:
in header:
static double w2[2], x2[2];
static double w3[3], x3[3];
static double w4[4], x4[4];
in GaussLegendre.c pp:
double GaussLegendre:: w2[2] = {1.0, 1.0};
double GaussLegendre:: x2[2] = {-0.5773502691896 25, 0.5773502691896 25};
double GaussLegendre:: w3[3] = {0.555555555555 556, 0.8888888888888 889,
0.5555555555555 56};
double GaussLegendre:: x3[3] = {-0.7745966692414 83, 0.0, 0.7745966692414 83};
double GaussLegendre:: w4[4] = {0.347854845137 453, 0.6521451548625 46,
0.6521451548625 46, 0.3478548451374 53};
double GaussLegendre:: x4[4] = {-0.8611363115940 53, -0.3399810435848 56,
0.3399810435848 56, 0.8611363115940 53};
Now I want to create a static array of pointers of x2, x3, x4 and w2,w2,w4.
I thought I could do that with just
declaring statis double* x[3] in my header and the following in .cpp:
double* GaussLegendre:: x[3] = {&GaussLegendre ::x2, &GaussLegendre: :x3,
&GaussLegendre: :x4};
but I get the following error: cannot convert from 'double (*)[2]' to
'double *
Why is that and how can it be done?
Thanks in advance,
Edward
I have the following static arrays of different size in a class:
in header:
static double w2[2], x2[2];
static double w3[3], x3[3];
static double w4[4], x4[4];
in GaussLegendre.c pp:
double GaussLegendre:: w2[2] = {1.0, 1.0};
double GaussLegendre:: x2[2] = {-0.5773502691896 25, 0.5773502691896 25};
double GaussLegendre:: w3[3] = {0.555555555555 556, 0.8888888888888 889,
0.5555555555555 56};
double GaussLegendre:: x3[3] = {-0.7745966692414 83, 0.0, 0.7745966692414 83};
double GaussLegendre:: w4[4] = {0.347854845137 453, 0.6521451548625 46,
0.6521451548625 46, 0.3478548451374 53};
double GaussLegendre:: x4[4] = {-0.8611363115940 53, -0.3399810435848 56,
0.3399810435848 56, 0.8611363115940 53};
Now I want to create a static array of pointers of x2, x3, x4 and w2,w2,w4.
I thought I could do that with just
declaring statis double* x[3] in my header and the following in .cpp:
double* GaussLegendre:: x[3] = {&GaussLegendre ::x2, &GaussLegendre: :x3,
&GaussLegendre: :x4};
but I get the following error: cannot convert from 'double (*)[2]' to
'double *
Why is that and how can it be done?
Thanks in advance,
Edward
Comment