Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/17/09 17:05:22 (15 years ago)
Author:
gkronber
Message:

Updated ALGLIB to latest version. #751 (Plugin for for data-modeling with ANN (integrated into CEDMA))

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/ALGLIB/igammaf.cs

    r2445 r2563  
    7373
    7474            igammaepsilon = 0.000000000000001;
    75             if( x<=0 | a<=0 )
     75            if( (double)(x)<=(double)(0) | (double)(a)<=(double)(0) )
    7676            {
    7777                result = 0;
    7878                return result;
    7979            }
    80             if( x>1 & x>a )
     80            if( (double)(x)>(double)(1) & (double)(x)>(double)(a) )
    8181            {
    8282                result = 1-incompletegammac(a, x);
    8383                return result;
    8484            }
    85             ax = a*Math.Log(x)-x-gammaf.lngamma(a, ref tmp);
    86             if( ax<-709.78271289338399 )
     85            ax = a*Math.Log(x)-x-gammafunc.lngamma(a, ref tmp);
     86            if( (double)(ax)<(double)(-709.78271289338399) )
    8787            {
    8888                result = 0;
     
    9999                ans = ans+c;
    100100            }
    101             while( c/ans>igammaepsilon );
     101            while( (double)(c/ans)>(double)(igammaepsilon) );
    102102            result = ans*ax/a;
    103103            return result;
     
    164164            igammabignumber = 4503599627370496.0;
    165165            igammabignumberinv = 2.22044604925031308085*0.0000000000000001;
    166             if( x<=0 | a<=0 )
     166            if( (double)(x)<=(double)(0) | (double)(a)<=(double)(0) )
    167167            {
    168168                result = 1;
    169169                return result;
    170170            }
    171             if( x<1 | x<a )
     171            if( (double)(x)<(double)(1) | (double)(x)<(double)(a) )
    172172            {
    173173                result = 1-incompletegamma(a, x);
    174174                return result;
    175175            }
    176             ax = a*Math.Log(x)-x-gammaf.lngamma(a, ref tmp);
    177             if( ax<-709.78271289338399 )
     176            ax = a*Math.Log(x)-x-gammafunc.lngamma(a, ref tmp);
     177            if( (double)(ax)<(double)(-709.78271289338399) )
    178178            {
    179179                result = 0;
     
    197197                pk = pkm1*z-pkm2*yc;
    198198                qk = qkm1*z-qkm2*yc;
    199                 if( qk!=0 )
     199                if( (double)(qk)!=(double)(0) )
    200200                {
    201201                    r = pk/qk;
     
    211211                qkm2 = qkm1;
    212212                qkm1 = qk;
    213                 if( Math.Abs(pk)>igammabignumber )
     213                if( (double)(Math.Abs(pk))>(double)(igammabignumber) )
    214214                {
    215215                    pkm2 = pkm2*igammabignumberinv;
     
    219219                }
    220220            }
    221             while( t>igammaepsilon );
     221            while( (double)(t)>(double)(igammaepsilon) );
    222222            result = ans*ax;
    223223            return result;
     
    290290            y = 1-d-normaldistr.invnormaldistribution(y0)*Math.Sqrt(d);
    291291            x = a*y*y*y;
    292             lgm = gammaf.lngamma(a, ref tmp);
     292            lgm = gammafunc.lngamma(a, ref tmp);
    293293            i = 0;
    294294            while( i<10 )
    295295            {
    296                 if( x>x0 | x<x1 )
     296                if( (double)(x)>(double)(x0) | (double)(x)<(double)(x1) )
    297297                {
    298298                    d = 0.0625;
     
    300300                }
    301301                y = incompletegammac(a, x);
    302                 if( y<yl | y>yh )
     302                if( (double)(y)<(double)(yl) | (double)(y)>(double)(yh) )
    303303                {
    304304                    d = 0.0625;
    305305                    break;
    306306                }
    307                 if( y<y0 )
     307                if( (double)(y)<(double)(y0) )
    308308                {
    309309                    x0 = x;
     
    316316                }
    317317                d = (a-1)*Math.Log(x)-x-lgm;
    318                 if( d<-709.78271289338399 )
     318                if( (double)(d)<(double)(-709.78271289338399) )
    319319                {
    320320                    d = 0.0625;
     
    323323                d = -Math.Exp(d);
    324324                d = (y-y0)/d;
    325                 if( Math.Abs(d/x)<igammaepsilon )
     325                if( (double)(Math.Abs(d/x))<(double)(igammaepsilon) )
    326326                {
    327327                    result = x;
     
    331331                i = i+1;
    332332            }
    333             if( x0==iinvgammabignumber )
    334             {
    335                 if( x<=0 )
     333            if( (double)(x0)==(double)(iinvgammabignumber) )
     334            {
     335                if( (double)(x)<=(double)(0) )
    336336                {
    337337                    x = 1;
    338338                }
    339                 while( x0==iinvgammabignumber )
     339                while( (double)(x0)==(double)(iinvgammabignumber) )
    340340                {
    341341                    x = (1+d)*x;
    342342                    y = incompletegammac(a, x);
    343                     if( y<y0 )
     343                    if( (double)(y)<(double)(y0) )
    344344                    {
    345345                        x0 = x;
     
    358358                y = incompletegammac(a, x);
    359359                lgm = (x0-x1)/(x1+x0);
    360                 if( Math.Abs(lgm)<dithresh )
     360                if( (double)(Math.Abs(lgm))<(double)(dithresh) )
    361361                {
    362362                    break;
    363363                }
    364364                lgm = (y-y0)/y0;
    365                 if( Math.Abs(lgm)<dithresh )
    366                 {
    367                     break;
    368                 }
    369                 if( x<=0.0 )
    370                 {
    371                     break;
    372                 }
    373                 if( y>=y0 )
     365                if( (double)(Math.Abs(lgm))<(double)(dithresh) )
     366                {
     367                    break;
     368                }
     369                if( (double)(x)<=(double)(0.0) )
     370                {
     371                    break;
     372                }
     373                if( (double)(y)>=(double)(y0) )
    374374                {
    375375                    x1 = x;
Note: See TracChangeset for help on using the changeset viewer.