The compiler complained about this code:
double a[] = { 2.0L, 3.0L, 2.0L, 10.0L, 3.0L, 4.0L, 3.0L, 6.0L, 1.0L };
gsl_matrix_view A = gsl_matrix_view_array(a, 3, 3);
Apparently, gsl_matrix_view_array() is expecting doubles, not long doubles.
Not believing my ears and whiskers, I looked at gsl_matrix.h. Using bash's
"tab completion", I found that there's a number of gsl_matrix.h's. One for
each data type.
Fair enough. I guess it's possible someone might need to do work in both
long double, and say, short int.
But the tgmath.h header makes it possible to use the correct function based
on the argument type. I don't really know how tgmath does its magic, but:
float a = 1.0F, ansA;
double b = 1.0, ansB;
long double c = 1.0L, ansC;
ansA = sqrt(a); // calls sqrtf()
ansB = sqrt(b); // calls sqrt()
ansC = sqrt(c); // calls sqrtl();
Why doesn't the GSL do the same thing?
Thanks!
Pete
_______________________________________________
Help-gsl mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-gsl