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

replaced u_int with unsigned int or size_t

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/utility/NNI.cc

    r1121 r1271  
    3939  // documentation.
    4040  NNI::NNI(const utility::Matrix& matrix,const utility::Matrix& weight,
    41            const u_int neighbours)
     41           const unsigned int neighbours)
    4242    : data_(matrix), imputed_data_(matrix), neighbours_(neighbours),
    4343      weight_(weight)
     
    4949  //                {\sum_{k=l,C} w_{ik} w_{jk} }
    5050  // where C is the number of columns
    51   std::vector<std::pair<u_int,double> >
    52   NNI::calculate_distances(const u_int row) const
     51  std::vector<std::pair<size_t,double> >
     52  NNI::calculate_distances(const size_t row) const
    5353  {
    54     std::vector<std::pair<u_int,double> > distance;
     54    std::vector<std::pair<size_t,double> > distance;
    5555    for (size_t i=0; i<data_.rows(); i++)
    5656      if (i!=row) {
    5757        double contribs=0;
    58         std::pair<u_int,double> this_distance(i,0.0);
     58        std::pair<size_t,double> this_distance(i,0.0);
    5959        for (size_t j=0; j<data_.columns(); j++)
    6060          // 0 contribution for missing values
     
    9090  // number, and neighbours are disqualified if their element (column)
    9191  // weight is zero
    92   std::vector<u_int>
    93   NNI::nearest_neighbours(const u_int column,
    94                           const std::vector<std::pair<u_int,double> >& d) const
     92  std::vector<size_t>
     93  NNI::nearest_neighbours(const size_t column,
     94                          const std::vector<std::pair<size_t,double> >& d) const
    9595  {
    96     std::vector<u_int> index;
     96    std::vector<size_t> index;
    9797    double contribs=0;
    98     for (u_int i=0; ((i<d.size()) &&
     98    for (size_t i=0; ((i<d.size()) &&
    9999                     (contribs+=weight_(d[i].first,column))<=neighbours_); i++)
    100100      if (weight_(d[i].first,column))
Note: See TracChangeset for help on using the changeset viewer.