trsl logo

trsl::ppfilter_iterator< Predicate, ElementIterator > Class Template Reference

Random permutation, persistent filter iterator. More...

#include <ppfilter_iterator.hpp>

List of all members.

Public Types

typedef base_t::element_iterator element_iterator

Public Member Functions

 ppfilter_iterator (Predicate f, ElementIterator first, ElementIterator last)
 Constructor.
template<class OtherElementIterator >
 ppfilter_iterator (ppfilter_iterator< Predicate, OtherElementIterator > const &r, typename boost::enable_if_convertible< OtherElementIterator, ElementIterator >::type *=0)
 Allows conversion from a ppfilter_iterator to a const ppfilter_iterator, won't allow conversion from a const ppfilter_iterator to a ppfilter_iterator.
ppfilter_iterator< Predicate,
ElementIterator > 
begin () const
 Returns a ppfilter_iterator pointing to the begining of the range.
ppfilter_iterator< Predicate,
ElementIterator > 
end () const
 Returns a ppfilter_iterator pointing to the end of the range.
upstream_iterator::index_t index () const
 Returns the index of the element that the iterator is currently pointing to.
Predicate predicate () const
 Returns the persistent_filter_iterator predicate.

Friends

class boost::iterator_core_access
class ppfilter_iterator

Detailed Description

template<class Predicate, class ElementIterator>
class trsl::ppfilter_iterator< Predicate, ElementIterator >

Random permutation, persistent filter iterator.

This class pipes a random_permutation_iterator() (upstream) with a persistent_filter_iterator (downstream). It is intended to be used with is_picked_systematic. Systematic sampling of a random permutation achieves probability sampling.

ElementIterator should model Random Access Iterator.

Examples:

ParticleCollection.hpp, trsl_example1.cpp, and trsl_example2.cpp.

Definition at line 58 of file ppfilter_iterator.hpp.


Constructor & Destructor Documentation

template<class Predicate, class ElementIterator>
template<class OtherElementIterator >
trsl::ppfilter_iterator< Predicate, ElementIterator >::ppfilter_iterator ( ppfilter_iterator< Predicate, OtherElementIterator > const &  r,
typename boost::enable_if_convertible< OtherElementIterator, ElementIterator >::type *  = 0 
) [inline]

Allows conversion from a ppfilter_iterator to a const ppfilter_iterator, won't allow conversion from a const ppfilter_iterator to a ppfilter_iterator.

By “const ppfilter_iterator”, we mean that the ElementIterator is const, e.g. std::vector<Particle>::const_iterator.

Definition at line 99 of file ppfilter_iterator.hpp.


The documentation for this class was generated from the following file:
© Copyright 2007-2011 Renaud Detry.
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at www.boost.org/LICENSE_1_0.txt.)
Revised Wed Apr 6 16:30:07 2011.
SourceForge.net Logo