- Timestamp:
- Jan 1, 2017, 5:56:44 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/concepts.doxygen
r3322 r3548 293 293 294 294 \ref concept_distance is a concept for classes implementing different 295 alternatives to calculate the distance between two points. 295 alternatives to calculate the distance between two ranges. For details 296 on requirements needed for a class modelling the concept \ref 297 concept_distance refer to section below, but a convenient way to 298 implement a class is to use class theplu::yat::statistics::Distance as 299 base class. 296 300 297 301 \section concept_distance_requirments Requirements … … 307 311 308 312 \verbatim 309 template<typename Iter 1, typename Iter2>310 double operator() (Iter 1 beg1, Iter1 end1, Iter2 beg2) const313 template<typename Iterator1, typename Iterator2> 314 double operator() (Iterator1 beg1, Iterator1 end1, Iterator2 beg2) const 311 315 \endverbatim 312 316 … … 314 318 elements of two ranges. The first range is given by [\a beg1, \a end1) 315 319 and 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 320 the first range. The function should support iterators that model \ref 321 concept_data_iterator and \forward_traversal_iterator, in other words, 322 the function should not assume any functionality not guaranteed by 323 concepts \forward_traversal_iterator and \readable_iterator. 324 325 As \ref concept_data_iterator should be supported implies that class 326 should support \ref concept_weighted_iterator. Typically a \ref 327 concept_distance class has a fast calculation for the case when 328 neither of the two input ranges is weighted, and a separate function 329 taking care of weights. A convenient way to select between unweighted and 330 weighted implementations is to utilize tag structs 322 331 theplu::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. 332 theplu::yat::utility::weighted_iterator_tag as returned from meta-function 333 theplu::yat::utility::weighted_if_any2. 334 335 The class theplu::yat::utility::DistanceConcept an be used to test 336 that a class fulfills these requirements. 327 337 328 338 \section concept_distance_implementations Implementations
Note: See TracChangeset
for help on using the changeset viewer.