Go to Overview over all GrAL packages.
Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

Algorithms on Sequences


Modules

Set Algorithms

Functions

template<class InputIt, class OutputIt, class Filter> OutputIt copy_filter (InputIt b, InputIt e, OutputIt dest, Filter f)
 copy [b,e) to [dest, ...), mapping values with f. More...

template<class FwdIt, class P1, class P2> FwdIt find_if_preference (FwdIt b, FwdIt e, const P1 &must_be, const P2 &should_be)
 find_if_preference tries to find an element that satisfies both predicates. More...

template<class M1, class M2> void mapping_assign (M1 &dest, M2 const &src)
 Copy a mapping by iterating through its domain. More...


Detailed Description

This module contains algorithms on sequences, mostly slight variations on STL algorithms for convenience.

Function Documentation

template<class InputIt, class OutputIt, class Filter>
OutputIt copy_filter InputIt    b,
InputIt    e,
OutputIt    dest,
Filter    f
[inline]
 

copy [b,e) to [dest, ...), mapping values with f.

The output is the sequence f(*b), ... f(*(e-1)).

This algorithm could also be expressed using std::copy and an iterator-adaptor of InputIt using Filter. However, as a filter rather operates on the corresponding value_type, this version seems to be more natural.

Definition at line 41 of file some-algorithms.h.

template<class FwdIt, class P1, class P2>
FwdIt find_if_preference FwdIt    b,
FwdIt    e,
const P1 &    must_be,
const P2 &    should_be
[inline]
 

find_if_preference tries to find an element that satisfies both predicates.

Return value:

  1. i, where i is the first in [b,e) that satisfies must_be && should_be
  2. i, where i is the first in [b,e) that satisfies must_be, and no element in [b,e) satisfies should_be
  3. e, if no element in [b,e) satisfies must_be.

Definition at line 61 of file some-algorithms.h.

template<class M1, class M2>
void mapping_assign M1 &    dest,
M2 const &    src
 

Copy a mapping by iterating through its domain.

Template parameters

  • M1: operator[]
  • M2:
    • operator[]
    • typedef domain_type
    • domain_type domain()

Definition at line 87 of file some-algorithms.h.


Copyright (c) Guntram Berti 1997-2002. See the GrAL Homepage for up-to-date information.

Generated at Tue Feb 26 15:57:17 2002 for Sequence by doxygen 1.2.11-20011104 written by Dimitri van Heesch, © 1997-2000