]> www.ginac.de Git - ginac.git/commitdiff
Explicit function disambiguation.
authorRichard Kreckel <kreckel@ginac.de>
Thu, 13 May 2010 16:30:40 +0000 (18:30 +0200)
committerRichard Kreckel <kreckel@ginac.de>
Thu, 13 May 2010 16:30:40 +0000 (18:30 +0200)
This is necessary for compilers where the hyperbolic and the tgamma function
templates are pulled in from <cmath> and compete with GiNaC's function
templates. GCC 4.4 and 4.5 need this, when compiling with -std=cxx0x.

check/exam_inifcns.cpp
check/exam_inifcns_nstdsums.cpp
check/exam_pseries.cpp
check/time_antipode.cpp
check/time_gammaseries.cpp
ginsh/ginsh_parser.yy

index 37dd05d2fd638fd8070295eabde01bd784daf968..454a826374061bc51e321e8c60b928be8a85b0ce 100644 (file)
@@ -31,6 +31,7 @@ using namespace std;
 static unsigned inifcns_consist_trans()
 {
        using GiNaC::asin; using GiNaC::acos;
+       using GiNaC::asinh; using GiNaC::acosh; using GiNaC::atanh;
 
        unsigned result = 0;
        symbol x("x");
@@ -124,6 +125,7 @@ static unsigned inifcns_consist_trans()
  * exists in closed form and check if it's ok. */
 static unsigned inifcns_consist_gamma()
 {
+       using GiNaC::tgamma;
        unsigned result = 0;
        ex e;
        
@@ -170,6 +172,7 @@ static unsigned inifcns_consist_gamma()
 static unsigned inifcns_consist_psi()
 {
        using GiNaC::log;
+       using GiNaC::tgamma;
 
        unsigned result = 0;
        symbol x;
index 4d81233bc62404e066e3946340512b92ae9c04a3..b836ee4f307d69024448509fa9f28bb42570314a 100644 (file)
@@ -80,7 +80,7 @@ static unsigned inifcns_test_S()
        int digitsbuf = Digits;
        // precision of data
        Digits = 22;
-       ex prec = 5 * pow(10, -(int)Digits);
+       ex prec = 5 * pow(10, -(ex)Digits);
        
        unsigned result = 0;
        
@@ -125,9 +125,10 @@ static unsigned inifcns_test_S()
 
 static unsigned inifcns_test_HLi()
 {
+       using GiNaC::log;
        int digitsbuf = Digits;
        Digits = 17;
-       ex prec = 5 * pow(10, -(int)Digits);
+       ex prec = 5 * pow(10, -(ex)Digits);
        numeric almostone("0.999999999999999999");
        unsigned result = 0;
 
@@ -198,7 +199,7 @@ static unsigned inifcns_test_zeta()
        
        for (lst::const_iterator it = res.begin(); it != res.end(); it++) {
                Digits = 17;
-               ex prec = 5 * pow(10, -(int)Digits);
+               ex prec = 5 * pow(10, -(ex)Digits);
                ex diff = abs((*it).evalf());
                if (diff > prec) {
                        clog << *it << " seems to be wrong: " << diff << endl;
@@ -207,7 +208,7 @@ static unsigned inifcns_test_zeta()
                }
                cout << "." << flush;
                Digits = 40;
-               prec = 5 * pow(10, -(int)Digits);
+               prec = 5 * pow(10, -(ex)Digits);
                diff = abs((*it).evalf());
                if (diff > prec) {
                        clog << *it << " seems to be wrong: " << diff << endl;
@@ -234,7 +235,7 @@ static unsigned inifcns_test_LiG()
 {
        int digitsbuf = Digits;
        Digits = 17;
-       ex prec = 5 * pow(10, -(int)Digits);
+       ex prec = 5 * pow(10, -(ex)Digits);
        numeric almostone("0.99999999999999999999");
        unsigned result = 0;
 
@@ -300,7 +301,7 @@ static unsigned inifcns_test_LiG()
 static unsigned inifcns_test_legacy()
 {
        Digits = 17;
-       ex prec = 5 * pow(10, -(int)Digits);
+       ex prec = 5 * pow(10, -(ex)Digits);
 
        unsigned result = 0;
 
@@ -327,7 +328,7 @@ static unsigned inifcns_test_legacy()
        }
 
        Digits = 100;
-       prec = 5 * pow(10, -(int)Digits);
+       prec = 5 * pow(10, -(ex)Digits);
        ex x0 = 1.;
           x1 = exp(Pi*I/3).evalf();
           x2 = exp(2*Pi*I/3).evalf();
index 4b6143339461d877b6c652b73c6b7bcf45889469..42650cc031413c546f48b8f2739f3067cd5c6108 100644 (file)
@@ -173,6 +173,7 @@ static unsigned exam_series3()
 // Series exponentiation
 static unsigned exam_series4()
 {
+       using GiNaC::tgamma;
        unsigned result = 0;
        ex e, d;
        
@@ -211,6 +212,7 @@ static unsigned exam_series5()
 // Series expansion of tgamma(-1)
 static unsigned exam_series6()
 {
+       using GiNaC::tgamma;
        ex e = tgamma(2*x);
        ex d = pow(x+1,-1)*numeric(1,4) +
               pow(x+1,0)*(numeric(3,4) -
@@ -328,6 +330,7 @@ static unsigned exam_series11()
 static unsigned exam_series12()
 {
        using GiNaC::log;
+       using GiNaC::atanh;
 
        unsigned result = 0;
        ex e, d;
index 448270cb361603578e5bc3de404416ef8f4b6516..4f678382dbb77abacb2581d44fd3f3f998536259 100644 (file)
@@ -72,6 +72,7 @@ static ex div_part(const ex &exarg, const symbol &x, unsigned grad)
 /* F_ab(a, i, b, j, "x") is a common pattern in all vertex evaluators. */
 static ex F_ab(int a, int i, int b, int j, const symbol &x)
 {
+       using GiNaC::tgamma;
        if ((i==0 && a<=0) || (j==0 && b<=0))
                return 0;
        else
index 3f07f64617a109ab9f781274c15615d709fdc0f1..cd09eacc7c17e1a732615258ecb6c63d00f3df43 100644 (file)
@@ -33,13 +33,13 @@ unsigned tgammaseries(unsigned order)
        unsigned result = 0;
        symbol x;
 
-       ex myseries = series(tgamma(x),x==0,order);
+       ex myseries = series(GiNaC::tgamma(x),x==0,order);
        // compute the last coefficient numerically:
        ex last_coeff = myseries.coeff(x,order-1).evalf();
        // compute a bound for that coefficient using a variation of the leading
        // term in Stirling's formula:
        ex bound = exp(-.57721566490153286*(order-1))/(order-1);
-       if (abs((last_coeff-pow(-1,order))/bound) > 1) {
+       if (abs((last_coeff-pow(-1,ex(order)))/bound) > 1) {
                clog << "The " << order-1
                     << "th order coefficient in the power series expansion of tgamma(0) was erroneously found to be "
                     << last_coeff << ", violating a simple estimate." << endl;
index 359e22b3d147e268a5cd8512f15b05181bbcd758..9783bf8cdb129711cf7b17c86925e025701ca292 100644 (file)
@@ -727,7 +727,7 @@ static void insert_fcns(const fcn_init *p)
 
 static ex f_ginac_function(const exprseq &es, int serial)
 {
-       return function(serial, es).eval(1);
+       return GiNaC::function(serial, es).eval(1);
 }
 
 // All registered GiNaC functions