Hi there. My environment is Linux Ubuntu 14.04. I am trying to adjust a C++ Gauss-Legendre Quadrature (one of hundreds of implementations) to my project. The code can be had at this link:
http://www.holoborodko.com/pavel/num...l-integration/
There are a couple of variants there, to get the code I use, one has to click on this link (download):
Gauss-Legendre Quadrature.zip in the section Gauss-Legendre Quadrature for C/C++
I tried to include one of the files:
gauss_legendre.c into my project file and it did not compile with a bunch of compilation errors. I look at some statements there and hardly understand how they work.
(1) Statement on line 455:
Code:
x0 = cos(PI*(double)((i<<2)-1)*t1)*t0;
The error:
invalid type argument of unary * (have double)
Is this statement a bitwise shift to the left?
(2) I also need to understand this code (lines 63-65):
Code:
#ifndef FABS
#define FABS(a) ((a)>=0?(a):-(a))
#endif
I will appreciate any comment.
Thanks, - Alex