Changeset 1801


Ignore:
Timestamp:
Feb 17, 2009, 6:48:49 PM (12 years ago)
Author:
Peter
Message:

changed template arguments to better describe requirements on passed iterators - refs #478 and #425

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/normalizer/qQuantileNormalizer.h

    r1797 r1801  
    8989       normalization.
    9090    */
    91     template<typename BidirectionalIterator>
    92     qQuantileNormalizer(BidirectionalIterator first, BidirectionalIterator last,
     91    template<typename ForwardIterator>
     92    qQuantileNormalizer(ForwardIterator first, ForwardIterator last,
    9393                        unsigned int Q);
    9494
     
    118118       \brief Create the partition and perform required calculations.
    119119    */
    120     template<typename BidirectionalIterator>
    121     Partitioner(BidirectionalIterator first, BidirectionalIterator last,
     120    template<typename ForwardIterator>
     121    Partitioner(ForwardIterator first, ForwardIterator last,
    122122                unsigned int N);
    123123
     
    143143  private:
    144144    // unweighted "constructor"
    145     template<typename Iterator>
    146     void build(Iterator first, Iterator last, unsigned int N,
     145    template<typename ForwardIterator>
     146    void build(ForwardIterator first, ForwardIterator last, unsigned int N,
    147147               utility::unweighted_iterator_tag);
    148148    // weighted "constructor"
    149     template<typename Iterator>
    150     void build(Iterator first, Iterator last, unsigned int N,
     149    template<typename ForwardIterator>
     150    void build(ForwardIterator first, ForwardIterator last, unsigned int N,
    151151               utility::weighted_iterator_tag);
    152152    void init(const utility::VectorBase&, unsigned int N);
     
    176176  // template implementations
    177177
    178   template<typename BidirectionalIterator>
    179   qQuantileNormalizer::qQuantileNormalizer(BidirectionalIterator first,
    180                                            BidirectionalIterator last,
     178  template<typename ForwardIterator>
     179  qQuantileNormalizer::qQuantileNormalizer(ForwardIterator first,
     180                                           ForwardIterator last,
    181181                                           unsigned int Q)
    182182    : target_(Partitioner(first, last, Q))
     
    310310
    311311
    312   template<typename BidirectionalIterator>
    313   qQuantileNormalizer::Partitioner::Partitioner(BidirectionalIterator first,
    314                                                 BidirectionalIterator last,
     312  template<typename ForwardIterator>
     313  qQuantileNormalizer::Partitioner::Partitioner(ForwardIterator first,
     314                                                ForwardIterator last,
    315315                                                unsigned int N)
    316316    : average_(utility::Vector(N)), index_(utility::Vector(N))
    317317  {
    318     typedef typename
    319       utility::weighted_iterator_traits<BidirectionalIterator>::type tag;
    320     build(first, last, N, tag());
    321          
    322   }
    323 
    324 
    325   template<typename Iterator>
    326   void qQuantileNormalizer::Partitioner::build(Iterator first, Iterator last,
     318    build(first, last, N,
     319          typename utility::weighted_iterator_traits<ForwardIterator>::type());
     320  }
     321
     322
     323  template<typename ForwardIterator>
     324  void qQuantileNormalizer::Partitioner::build(ForwardIterator first,
     325                                               ForwardIterator last,
    327326                                               unsigned int N,
    328327                                               utility::unweighted_iterator_tag)
     
    335334
    336335
    337   template<typename Iterator>
    338   void qQuantileNormalizer::Partitioner::build(Iterator first,
    339                                                Iterator last, unsigned int N,
     336  template<typename ForwardIterator>
     337  void qQuantileNormalizer::Partitioner::build(ForwardIterator first,
     338                                               ForwardIterator last,
     339                                               unsigned int N,
    340340                                               utility::weighted_iterator_tag)
    341341  {
Note: See TracChangeset for help on using the changeset viewer.