Ignore:
Timestamp:
Dec 16, 2005, 11:15:25 PM (17 years ago)
Author:
Peter
Message:

made median template

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/classifier/ConsensusInputRanker.cc

    r461 r464  
    3232    }
    3333    // Sorting with respect to median rank
    34     std::vector<std::pair<size_t,double> > median(data.rows());
     34    std::vector<std::pair<size_t,double> > medians(data.rows());
    3535    for (size_t i=0; i<data.rows(); i++){
    3636      std::vector<size_t> ranks(nof_rankers_);
     
    3838        ranks[j]=input_rankers_[j].rank(i);
    3939     
    40       median[i].first = i;
    41       median[i].second = statistics::median(ranks);
     40      medians[i].first = i;
     41      medians[i].second = statistics::median(ranks);
    4242    }
    4343   
    4444    //sort medians and assign id_ and rank_
    45     sort(median.begin(), median.end(),
     45    sort(medians.begin(), medians.end(),
    4646         utility::pair_value_compare<size_t, double>());
    4747    id_.resize(data.rows());
    4848    rank_.resize(data.rows());
    4949    for (size_t i=0; i<data.rows(); i++){
    50       id_[i]=median[i].first;
     50      id_[i]=medians[i].first;
    5151      rank_[id_[i]]=i;           
    5252    }
Note: See TracChangeset for help on using the changeset viewer.