Gauss.h 961 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #ifndef MY_GAUSS_H
  2. #define MY_GAUSS_H
  3. const long int mu = 25;
  4. const long int np = 49;
  5. /* index standard interval [-1,1] */
  6. #define STDI(X) ((X)+mu)
  7. struct Gauss
  8. {
  9. private:
  10. static float angmu[10];
  11. static float angphi[13];
  12. public:
  13. /* [a,b] = [0,2*Pi] */
  14. float rp[np]; /* gaussian angles */
  15. float gp[np]; /* gaussian weights */
  16. // [a,b] = [-1,1]
  17. float rm[2*mu+1]; /* shifted gaussian angles */
  18. float gb[2*mu+1]; /* shifted gaussian weights */
  19. /* with the ends zeroed as well as the center */
  20. /* [0 ? ? ? ? 0 ? ? ? ? 0] */
  21. /* preliminary computations for gauss integration */
  22. void init();
  23. /* Compute for a given n, the gaussian quadrature (the n gaussian angles and the
  24. their respective weights). The gaussian quadrature is used in numerical integration involving the
  25. cosine of emergent or incident direction zenith angle. */
  26. static void gauss (float a, float b, float *x, float *w, long int n);
  27. };
  28. #endif /* MY_GAUSS_H */