Changeset 1709
 Timestamp:
 Jan 13, 2009, 11:48:07 AM (15 years ago)
 Location:
 trunk/yat/normalizer
 Files:

 2 edited
Legend:
 Unmodified
 Added
 Removed

trunk/yat/normalizer/qQuantileNormalizer.cc
r1708 r1709 37 37 Partitioner::Partitioner(const utility::VectorConstView& vec, 38 38 unsigned int N) 39 : average_(utility::Vector(N +1)), index_(utility::Vector(N+1))39 : average_(utility::Vector(N)), index_(utility::Vector(N)) 40 40 { 41 41 assert(N>1); … … 46 46 utility::Vector sortedvec(vec); 47 47 std::sort(sortedvec.begin(),sortedvec.end()); 48 for (unsigned int i=0; i<=N; ++i) {49 unsigned int first = ( i ? (i0.5)*range : 0 );50 unsigned int end = ( i !=N ? (i+0.5)*range : sortedvec.size());48 unsigned int first=0; 49 for (unsigned int i=0; i<N; ++i) { 50 unsigned int end = ( i==(N1) ? sortedvec.size() : first+range ); 51 51 statistics::Averager av; 52 52 for (unsigned int r=first; r<end; ++r) 53 53 av.add(sortedvec(r)); 54 54 average_(i)=av.mean(); 55 index_(i)=end; 55 index_(i)= (i+0.5)*range; 56 first=end; 56 57 } 57 58 } … … 72 73 size_t Partitioner::size(void) const 73 74 { 74 return average_.size() 1;75 return average_.size(); 75 76 } 76 77 
trunk/yat/normalizer/qQuantileNormalizer.h
r1708 r1709 53 53 54 54 /** 55 \brief The number of equal sized partitions, i.e., number of 56 internal parts minus 1. 57 58 \note The end partitions are paired together to make part since 59 they are only half size as compared to the other parts. 55 \brief The number of parts. 60 56 */ 61 57 size_t size(void) const;
Note: See TracChangeset
for help on using the changeset viewer.