Changeset 1271 for trunk/yat/statistics


Ignore:
Timestamp:
Apr 9, 2008, 6:11:07 PM (13 years ago)
Author:
Peter
Message:

replaced u_int with unsigned int or size_t

Location:
trunk/yat/statistics
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/statistics/Averager.cc

    r1122 r1271  
    3737  }
    3838
    39   Averager::Averager(double x, double xx, u_long n)
     39  Averager::Averager(double x, double xx, unsigned long n)
    4040    : n_(n), x_(x), xx_(xx)
    4141  {
     
    4747  }
    4848
    49   void Averager::add(double d, u_long n)
     49  void Averager::add(double d, unsigned long n)
    5050  {
    5151    assert(!std::isnan(d));
     
    6565  }
    6666
    67   u_long Averager::n(void) const
     67  unsigned long Averager::n(void) const
    6868  {
    6969    return n_;
  • trunk/yat/statistics/Averager.h

    r1186 r1271  
    3030
    3131#include <cmath>
    32 #include <sys/types.h>
    3332
    3433namespace theplu{
     
    5655    /// number of samples \a n.
    5756    ///
    58     Averager(double x, double xx, u_long n);
     57    Averager(double x, double xx, unsigned long n);
    5958
    6059    ///
     
    6665    /// Adding \a n (default=1) number of data point(s) with value \a d.
    6766    ///
    68     void add(double d, u_long n=1);
     67    void add(double d, unsigned long n=1);
    6968
    7069    /**
     
    8685    /// @return Number of data points
    8786    ///
    88     u_long n(void) const;
     87    unsigned long n(void) const;
    8988
    9089    ///
     
    179178
    180179  private:
    181     u_long  n_;
     180    unsigned long n_;
    182181    double  x_, xx_;
    183182  };
  • trunk/yat/statistics/Fisher.cc

    r1000 r1271  
    7272
    7373
    74   u_int& Fisher::minimum_size(void)
     74  unsigned int& Fisher::minimum_size(void)
    7575  {
    7676    return minimum_size_;
     
    7878
    7979
    80   const u_int& Fisher::minimum_size(void) const
     80  const unsigned int& Fisher::minimum_size(void) const
    8181  {
    8282    return minimum_size_;
     
    8484
    8585
    86   double Fisher::oddsratio(const u_int a,
    87                            const u_int b,
    88                            const u_int c,
    89                            const u_int d)
     86  double Fisher::oddsratio(const unsigned int a,
     87                           const unsigned int b,
     88                           const unsigned int c,
     89                           const unsigned int d)
    9090  {
    9191    // If a column sum or a row sum is zero, the table is nonsense
  • trunk/yat/statistics/Fisher.h

    r1000 r1271  
    2828
    2929#include "Score.h"
    30 
    31 #include <sys/types.h>
    3230
    3331#include <cmath>
     
    106104    /// @return reference to minimum_size
    107105    ///
    108     u_int& minimum_size(void);
     106    unsigned int& minimum_size(void);
    109107
    110108    ///
     
    114112    /// @return const reference to minimum_size
    115113    ///
    116     const u_int& minimum_size(void) const;
     114    const unsigned int& minimum_size(void) const;
    117115
    118116    ///
     
    150148       is invalid if a row or column sum is zero.
    151149    */
    152     double oddsratio(const u_int a, const u_int b,
    153                      const u_int c, const u_int d);
     150    double oddsratio(const unsigned a, const unsigned int b,
     151                     const unsigned int c, const unsigned int d);
    154152
    155153  private:
     
    161159    double p_value_exact(void) const;
    162160
    163     u_int a_;
    164     u_int b_;
    165     u_int c_;
    166     u_int d_;
    167     u_int minimum_size_;
     161    unsigned int a_;
     162    unsigned int b_;
     163    unsigned int c_;
     164    unsigned int d_;
     165    unsigned int minimum_size_;
    168166    double oddsratio_;
    169167  };
  • trunk/yat/statistics/Histogram.cc

    r1203 r1271  
    118118  void Histogram::reset(void)
    119119  {
    120     for (u_int i=0; i<histogram_.size(); i++)
     120    for (size_t i=0; i<histogram_.size(); i++)
    121121      histogram_[i]=0;
    122122    sum_all_.reset();
     
    174174      << "# column 2: frequency\n";
    175175
    176     for (u_int i=0; i<histogram.nof_bins(); i++) {
     176    for (size_t i=0; i<histogram.nof_bins(); i++) {
    177177      s.width(12);
    178178      s << histogram.observation_value(i);
  • trunk/yat/statistics/PearsonCorrelation.cc

    r1145 r1271  
    4242  {
    4343    return pearson_p_value(ap_.correlation(),
    44                            static_cast<u_int>(ap_.n()));
     44                           static_cast<unsigned int>(ap_.n()));
    4545  }
    4646
  • trunk/yat/statistics/PearsonCorrelation.h

    r1145 r1271  
    7070       
    7171       P-value is calculated using function pearson_p_value(double,
    72        u_int) where degrees of freedom is calculated using n(void) in
     72       unsigned int) where degrees of freedom is calculated using n(void) in
    7373       AveragerPairWeighted.
    7474
  • trunk/yat/statistics/ROC.cc

    r1120 r1271  
    103103  }
    104104
    105   u_int& ROC::minimum_size(void)
     105  unsigned int& ROC::minimum_size(void)
    106106  {
    107107    return minimum_size_;
     
    109109
    110110
    111   const u_int& ROC::minimum_size(void) const
     111  const unsigned int& ROC::minimum_size(void) const
    112112  {
    113113    return minimum_size_;
  • trunk/yat/statistics/ROC.h

    r1260 r1271  
    3232#include <map>
    3333#include <utility>
    34 
    35 #include <sys/types.h>
    3634
    3735namespace theplu {
     
    8078    /// @return reference to minimum_size
    8179    ///
    82     u_int& minimum_size(void);
     80    unsigned int& minimum_size(void);
    8381
    8482    /**
     
    8886       @return const reference to minimum_size
    8987    */
    90     const u_int& minimum_size(void) const;
     88    const unsigned int& minimum_size(void) const;
    9189
    9290    ///
     
    144142
    145143    double area_;
    146     u_int minimum_size_;
     144    unsigned int minimum_size_;
    147145    double w_neg_;
    148146    double w_pos_;
  • trunk/yat/statistics/utility.cc

    r1145 r1271  
    3737namespace statistics { 
    3838
    39   double cdf_hypergeometric_P(u_int k, u_int n1, u_int n2, u_int t)
     39  double cdf_hypergeometric_P(unsigned int k, unsigned int n1,
     40                              unsigned int n2, unsigned int t)
    4041  {
    4142    double p=0;
    42     for (u_int i=0; i<=k; i++)
     43    for (size_t i=0; i<=k; i++)
    4344      p+= gsl_ran_hypergeometric_pdf(i, n1, n2, t);
    4445    return p;
     
    4647
    4748
    48   double pearson_p_value(double r, u_int n)
     49  double pearson_p_value(double r, unsigned int n)
    4950  {
    5051    assert(n>=2);
    51     if (n<2)
     52    if (n<=2)
    5253      return std::numeric_limits<double>::quiet_NaN();
    5354    return gsl_cdf_tdist_Q(r*sqrt((n-2)/(1-r*r)), n-2);
  • trunk/yat/statistics/utility.h

    r1145 r1271  
    7777  /// @return cumulative hypergeomtric distribution functions P(k).
    7878  ///
    79   double cdf_hypergeometric_P(u_int k, u_int n1, u_int n2, u_int t);
     79  double cdf_hypergeometric_P(unsigned int k, unsigned int n1,
     80                              unsigned int n2, unsigned int t);
    8081
    8182
     
    9394     chance when having \a n samples.
    9495   */
    95   double pearson_p_value(double r, u_int n);
     96  double pearson_p_value(double r, unsigned int n);
    9697
    9798  ///
Note: See TracChangeset for help on using the changeset viewer.