From: wolf Date: Mon, 25 Nov 2002 17:31:46 +0000 (+0000) Subject: Fix one TODO for good. Use same approach as before. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4d3f90931372052052888bc4c06f1dcf20bfb825;p=dealii-svn.git Fix one TODO for good. Use same approach as before. git-svn-id: https://svn.dealii.org/trunk@6783 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/base/source/polynomial.cc b/deal.II/base/source/polynomial.cc index 7755f40ca4..2423e4438f 100644 --- a/deal.II/base/source/polynomial.cc +++ b/deal.II/base/source/polynomial.cc @@ -522,17 +522,21 @@ namespace Polynomials -//TODO[WB]: Treat the same way as above -#if ((__GNUC__ == 3) && (__GNUC_MINOR__ == 1)) -#define SHIFT_TYPE double -#else -#define SHIFT_TYPE long double -#endif - template void Legendre::compute_coefficients (const unsigned int k_) { + // make sure we call the + // Polynomial::shift function + // only with an argument with + // which it will not crash the + // compiler +#ifdef DEAL_II_LONG_DOUBLE_LOOP_BUG + typedef double SHIFT_TYPE; +#else + typedef long double SHIFT_TYPE; +#endif + unsigned int k = k_; // first make sure that no other @@ -579,9 +583,9 @@ namespace Polynomials c0 = new std::vector(*c0); c1 = new std::vector(*c1); - Polynomial::shift(*c0, (SHIFT_TYPE) -1.); + Polynomial::template shift (*c0, -1.); Polynomial::scale(*c0, 2.); - Polynomial::shift(*c1, (SHIFT_TYPE) -1.); + Polynomial::template shift (*c1, -1.); Polynomial::scale(*c1, 2.); Polynomial::multiply(*c1, std::sqrt(3.)); shifted_coefficients[0]=c0; @@ -623,7 +627,7 @@ namespace Polynomials // and compute the // coefficients for [0,1] ck = new std::vector(*ck); - shift(*ck,(SHIFT_TYPE) -1.); + Polynomial::template shift (*ck, -1.); Polynomial::scale(*ck, 2.); Polynomial::multiply(*ck, std::sqrt(2.*k+1.)); shifted_coefficients[k] = ck;