Changeset 3548 for trunk/doc

Jan 1, 2017, 5:56:44 AM (6 years ago)

The concept 'Distance' now requires that operator() works on iterator
that are readable and forward traversal, i.e., the previously implicit
requirement that iterator's reference type is lvalue is
dropped. closes #873

1 edited


  • trunk/doc/concepts.doxygen

    r3322 r3548  
    294294\ref concept_distance is a concept for classes implementing different
    295 alternatives to calculate the distance between two points.
     295alternatives to calculate the distance between two ranges. For details
     296on requirements needed for a class modelling the concept \ref
     297concept_distance refer to section below, but a convenient way to
     298implement a class is to use class theplu::yat::statistics::Distance as
     299base class.
    297301\section concept_distance_requirments Requirements
    309 template<typename Iter1, typename Iter2>
    310 double  operator() (Iter1 beg1, Iter1 end1, Iter2 beg2) const
     313template<typename Iterator1, typename Iterator2>
     314double  operator() (Iterator1 beg1, Iterator1 end1, Iterator2 beg2) const
    314318elements of two ranges. The first range is given by [\a beg1, \a end1)
    315319and the second range starts with \a beg2 and has the same length as
    316 the first range. The function should support iterators of the category
    317 std::forward_iterator. The function should provide both a fast
    318 calculation for unweighted iterators and a calculation for weighted
    319 iterators. The latter correspond to the case where elements in a range
    320 have both a value and a weight. The selection between unweighted and
    321 weighted implementations should utilize
     320the first range. The function should support iterators that model \ref
     321concept_data_iterator and \forward_traversal_iterator, in other words,
     322the function should not assume any functionality not guaranteed by
     323concepts \forward_traversal_iterator and \readable_iterator.
     325As \ref concept_data_iterator should be supported implies that class
     326should support \ref concept_weighted_iterator. Typically a \ref
     327concept_distance class has a fast calculation for the case when
     328neither of the two input ranges is weighted, and a separate function
     329taking care of weights. A convenient way to select between unweighted and
     330weighted implementations is to utilize tag structs
    322331theplu::yat::utility::unweighted_iterator_tag and
    323 theplu::yat::utility::weighted_iterator_tag. Moreover
    324 theplu::yat::utility::weighted_if_any2 should be utilized to provide a
    325 weighted implementation if any of the two ranges is weighted, and an
    326 unweighted implementation when both ranges are unweighted.
     332theplu::yat::utility::weighted_iterator_tag as returned from meta-function
     335The class theplu::yat::utility::DistanceConcept an be used to test
     336that a class fulfills these requirements.
    328338\section concept_distance_implementations Implementations
Note: See TracChangeset for help on using the changeset viewer.