My Project
Loading...
Searching...
No Matches
stxxl::generate
Author
Roman Dementiev (2006)

The semantics of the algorithm are equivalent to the STL std::generate.

Prototype

template < typename ExtIterator, typename Generator >
void generate ( ExtIterator first,
ExtIterator last,
Generator generator,
int_type nbuffers
)

Description

Requirements on types

  • ExtIterator is a model of External Random Access Iterator.
  • ExtIterator is mutable.
  • Generator is a model of a STL Generator.
  • Generator's result type is convertible to ExtIterator's value type.

Preconditions

[first, last) is a valid range.

Complexity

  • Internal work is linear.
  • External work: close to $ N/DB $ I/Os (write-only).

Example

// Fill a vector with random numbers, using the
// standard C library function rand.
typedef stxxl::VECTOR_GENERATOR<int>::result vector_type;
vector_type V(some_size);
// use 20 buffer blocks
stxxl::generate(V.begin(), V.end(), rand, 20);