Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
07/22/10 00:44:01 (14 years ago)
Author:
swagner
Message:

Sorted usings and removed unused usings in entire solution (#1094)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.ALGLIB/2.5.0/ALGLIB-2.5.0/poissondistr.cs

    r3839 r4068  
    2626*************************************************************************/
    2727
    28 using System;
    2928
    30 namespace alglib
    31 {
    32     public class poissondistr
    33     {
    34         /*************************************************************************
    35         Poisson distribution
     29namespace alglib {
     30  public class poissondistr {
     31    /*************************************************************************
     32    Poisson distribution
    3633
    37         Returns the sum of the first k+1 terms of the Poisson
    38         distribution:
     34    Returns the sum of the first k+1 terms of the Poisson
     35    distribution:
    3936
    40           k         j
    41           --   -m  m
    42           >   e    --
    43           --       j!
    44          j=0
     37      k         j
     38      --   -m  m
     39      >   e    --
     40      --       j!
     41     j=0
    4542
    46         The terms are not summed directly; instead the incomplete
    47         gamma integral is employed, according to the relation
     43    The terms are not summed directly; instead the incomplete
     44    gamma integral is employed, according to the relation
    4845
    49         y = pdtr( k, m ) = igamc( k+1, m ).
     46    y = pdtr( k, m ) = igamc( k+1, m ).
    5047
    51         The arguments must both be positive.
    52         ACCURACY:
     48    The arguments must both be positive.
     49    ACCURACY:
    5350
    54         See incomplete gamma function
     51    See incomplete gamma function
    5552
    56         Cephes Math Library Release 2.8:  June, 2000
    57         Copyright 1984, 1987, 1995, 2000 by Stephen L. Moshier
    58         *************************************************************************/
    59         public static double poissondistribution(int k,
    60             double m)
    61         {
    62             double result = 0;
     53    Cephes Math Library Release 2.8:  June, 2000
     54    Copyright 1984, 1987, 1995, 2000 by Stephen L. Moshier
     55    *************************************************************************/
     56    public static double poissondistribution(int k,
     57        double m) {
     58      double result = 0;
    6359
    64             System.Diagnostics.Debug.Assert(k>=0 & (double)(m)>(double)(0), "Domain error in PoissonDistribution");
    65             result = igammaf.incompletegammac(k+1, m);
    66             return result;
    67         }
     60      System.Diagnostics.Debug.Assert(k >= 0 & (double)(m) > (double)(0), "Domain error in PoissonDistribution");
     61      result = igammaf.incompletegammac(k + 1, m);
     62      return result;
     63    }
    6864
    6965
    70         /*************************************************************************
    71         Complemented Poisson distribution
     66    /*************************************************************************
     67    Complemented Poisson distribution
    7268
    73         Returns the sum of the terms k+1 to infinity of the Poisson
    74         distribution:
     69    Returns the sum of the terms k+1 to infinity of the Poisson
     70    distribution:
    7571
    76          inf.       j
    77           --   -m  m
    78           >   e    --
    79           --       j!
    80          j=k+1
     72     inf.       j
     73      --   -m  m
     74      >   e    --
     75      --       j!
     76     j=k+1
    8177
    82         The terms are not summed directly; instead the incomplete
    83         gamma integral is employed, according to the formula
     78    The terms are not summed directly; instead the incomplete
     79    gamma integral is employed, according to the formula
    8480
    85         y = pdtrc( k, m ) = igam( k+1, m ).
     81    y = pdtrc( k, m ) = igam( k+1, m ).
    8682
    87         The arguments must both be positive.
     83    The arguments must both be positive.
    8884
    89         ACCURACY:
     85    ACCURACY:
    9086
    91         See incomplete gamma function
     87    See incomplete gamma function
    9288
    93         Cephes Math Library Release 2.8:  June, 2000
    94         Copyright 1984, 1987, 1995, 2000 by Stephen L. Moshier
    95         *************************************************************************/
    96         public static double poissoncdistribution(int k,
    97             double m)
    98         {
    99             double result = 0;
     89    Cephes Math Library Release 2.8:  June, 2000
     90    Copyright 1984, 1987, 1995, 2000 by Stephen L. Moshier
     91    *************************************************************************/
     92    public static double poissoncdistribution(int k,
     93        double m) {
     94      double result = 0;
    10095
    101             System.Diagnostics.Debug.Assert(k>=0 & (double)(m)>(double)(0), "Domain error in PoissonDistributionC");
    102             result = igammaf.incompletegamma(k+1, m);
    103             return result;
    104         }
     96      System.Diagnostics.Debug.Assert(k >= 0 & (double)(m) > (double)(0), "Domain error in PoissonDistributionC");
     97      result = igammaf.incompletegamma(k + 1, m);
     98      return result;
     99    }
    105100
    106101
    107         /*************************************************************************
    108         Inverse Poisson distribution
     102    /*************************************************************************
     103    Inverse Poisson distribution
    109104
    110         Finds the Poisson variable x such that the integral
    111         from 0 to x of the Poisson density is equal to the
    112         given probability y.
     105    Finds the Poisson variable x such that the integral
     106    from 0 to x of the Poisson density is equal to the
     107    given probability y.
    113108
    114         This is accomplished using the inverse gamma integral
    115         function and the relation
     109    This is accomplished using the inverse gamma integral
     110    function and the relation
    116111
    117            m = igami( k+1, y ).
     112       m = igami( k+1, y ).
    118113
    119         ACCURACY:
     114    ACCURACY:
    120115
    121         See inverse incomplete gamma function
     116    See inverse incomplete gamma function
    122117
    123         Cephes Math Library Release 2.8:  June, 2000
    124         Copyright 1984, 1987, 1995, 2000 by Stephen L. Moshier
    125         *************************************************************************/
    126         public static double invpoissondistribution(int k,
    127             double y)
    128         {
    129             double result = 0;
     118    Cephes Math Library Release 2.8:  June, 2000
     119    Copyright 1984, 1987, 1995, 2000 by Stephen L. Moshier
     120    *************************************************************************/
     121    public static double invpoissondistribution(int k,
     122        double y) {
     123      double result = 0;
    130124
    131             System.Diagnostics.Debug.Assert(k>=0 & (double)(y)>=(double)(0) & (double)(y)<(double)(1), "Domain error in InvPoissonDistribution");
    132             result = igammaf.invincompletegammac(k+1, y);
    133             return result;
    134         }
     125      System.Diagnostics.Debug.Assert(k >= 0 & (double)(y) >= (double)(0) & (double)(y) < (double)(1), "Domain error in InvPoissonDistribution");
     126      result = igammaf.invincompletegammac(k + 1, y);
     127      return result;
    135128    }
     129  }
    136130}
Note: See TracChangeset for help on using the changeset viewer.