Changeset 3547


Ignore:
Timestamp:
Dec 30, 2016, 12:47:33 PM (7 years ago)
Author:
Peter
Message:

refs #803; use boost iterator concepts in qQuantileNormalizer.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/normalization.cc

    r3544 r3547  
    220220         boost::random_access_iterator_archetype<DataWeight>(),
    221221         boost::mutable_random_access_iterator_archetype<double>());
     222
     223    // test against boost iterator concepts
     224    typedef test::DataIterator<boost::forward_traversal_tag> trait1;
     225    trait1::unweighted_const_iterator input;
     226    trait1::weighted_const_iterator weighted_input;
     227    qQuantileNormalizer qqn5(input, input, 100);
     228    qQuantileNormalizer qqn6(weighted_input, weighted_input, 100);
     229
     230    typedef test::DataIterator<boost::random_access_traversal_tag> trait2;
     231    trait2::unweighted_const_iterator const_iterator;
     232    trait2::unweighted_iterator iterator;
     233    trait2::weighted_const_iterator const_weighted_iterator;
     234    trait2::weighted_iterator weighted_iterator;
     235    qqn5(const_iterator, const_iterator, iterator);
     236    qqn5(const_iterator, const_iterator, weighted_iterator);
     237    qqn5(const_weighted_iterator, const_weighted_iterator, iterator);
     238    qqn5(const_iterator, const_iterator, weighted_iterator);
    222239  }
    223240}
  • trunk/yat/normalizer/qQuantileNormalizer.h

    r3546 r3547  
    112112
    113113       \b Type \b Requirements:
    114        - \c ForwardIterator is a model of \forward_iterator.
     114       - \c ForwardIterator is a model of \forward_traversal_iterator
    115115       - \c ForwardIterator is a \ref concept_data_iterator
    116116    */
     
    134134
    135135       \b Type Requirements:
    136        - \c RandomAccessIterator1 is a model of \random_access_iterator
    137136       - \c RandomAccessIterator1 is a \ref concept_data_iterator
    138        - \c RandomAccessIterator1's value type is convertible to
    139          \c RandomAccessIterator2's value type
    140        - \c RandomAccessIterator2 is a model of \random_access_iterator
    141        - \c RandomAccessIterator2 is mutable.
     137       - \c RandomAccessIterator1 is a \random_access_traversal_iterator
     138       - \c RandomAccessIterator2 is a \ref concept_data_iterator
     139       - \c RandomAccessIterator2 is a \random_access_traversal_iterator
     140       - \c RandomAccessIterator2 is a \writable_iterator
    142141
    143142     */
     
    243242                                       RandomAccessIterator2 result) const
    244243  {
     244    BOOST_CONCEPT_ASSERT((utility::DataIterator<RandomAccessIterator1>));
     245    using boost_concepts::RandomAccessTraversal;
     246    BOOST_CONCEPT_ASSERT((RandomAccessTraversal<RandomAccessIterator1>));
     247    BOOST_CONCEPT_ASSERT((utility::DataIterator<RandomAccessIterator2>));
     248    BOOST_CONCEPT_ASSERT((RandomAccessTraversal<RandomAccessIterator2>));
     249    using boost_concepts::WritableIterator;
     250    BOOST_CONCEPT_ASSERT((WritableIterator<RandomAccessIterator2>));
     251
    245252    Partitioner source(first, last, target_.size());
    246253    typename utility::weighted_if_any2<RandomAccessIterator1, RandomAccessIterator2>::type tag;
     
    257264                                 utility::unweighted_iterator_tag tag) const
    258265  {
    259     BOOST_CONCEPT_ASSERT((boost::RandomAccessIterator<RandomAccessIterator1>));
    260     BOOST_CONCEPT_ASSERT((boost::Mutable_RandomAccessIterator<RandomAccessIterator2>));
    261     BOOST_CONCEPT_ASSERT((utility::DataIteratorConcept<RandomAccessIterator1>));
    262     BOOST_CONCEPT_ASSERT((utility::DataIteratorConcept<RandomAccessIterator2>));
    263266    utility::check_iterator_is_unweighted(first);
    264267    utility::check_iterator_is_unweighted(result);
     
    318321                                      utility::weighted_iterator_tag tag) const
    319322  {
    320     BOOST_CONCEPT_ASSERT((boost::RandomAccessIterator<RandomAccessIterator1>));
    321     BOOST_CONCEPT_ASSERT((boost::Mutable_RandomAccessIterator<RandomAccessIterator2>));
    322     BOOST_CONCEPT_ASSERT((utility::DataIterator<RandomAccessIterator1>));
    323     BOOST_CONCEPT_ASSERT((utility::DataIterator<RandomAccessIterator2>));
    324323    // copy the weights
    325324    detail::copy_weight_if_weighted(first, last, result);
     
    385384    : average_(utility::Vector(N)), quantiles_(utility::Vector(N))
    386385  {
    387     BOOST_CONCEPT_ASSERT((boost::ForwardIterator<ForwardIterator>));
     386    BOOST_CONCEPT_ASSERT((boost_concepts::ForwardTraversal<ForwardIterator>));
    388387    BOOST_CONCEPT_ASSERT((utility::DataIterator<ForwardIterator>));
    389388    build(first, last, N,
Note: See TracChangeset for help on using the changeset viewer.