48template<
typename CONTAINER>
50 std::function<
void(
typename CONTAINER::value_type)> func) {
63template<
typename CONTAINER>
65 std::function<
bool(
typename CONTAINER::value_type)> func) {
83template<
class LIST,
class COMPARER>
85 const int n =
L.size();
89 for (
const typename LIST::value_type& x :
L) {
96 for (
typename LIST::value_type& x :
L) {
108template<
typename CONTAINER,
typename TYPE,
typename ITERATOR>
142template<
typename CONTAINER,
typename TYPE,
typename ITERATOR>
157 for (
auto it :
other) {
185template<
typename CONTAINER,
typename TYPE,
typename ITERATOR>
195 for (
int i = 0; i < index; i++) {
218template<
typename CONTAINER,
typename TYPE>
221 std::function<
bool(
const TYPE&)>
includeElement = [](
const TYPE&) {
return true; },
223 return internal::chooseIteratorFrom<CONTAINER, TYPE, typename CONTAINER::iterator>(
container,
228template<
typename CONTAINER,
typename TYPE>
231 std::function<
bool(
const TYPE&)>
includeElement = [](
const TYPE&) {
return true; },
233 return internal::chooseIteratorFrom<const CONTAINER, TYPE, typename CONTAINER::const_iterator>(
Declaration and implementation of Array class and Array algorithms.
The parameterized class Array implements dynamic arrays of type E.
int randomNumber(int low, int high)
Returns random integer between low and high (including).
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()
ITERATOR chooseIteratorByFastTest(CONTAINER &container, std::function< bool(const TYPE &)> includeElement)
ITERATOR chooseIteratorFrom(CONTAINER &container, std::function< bool(const TYPE &)> includeElement, bool isFastTest)
Returns an iterator to a random element in the container.
ITERATOR chooseIteratorBySlowTest(CONTAINER &container, std::function< bool(const TYPE &)> includeElement, int size)
The namespace for all OGDF objects.
bool safeTestForEach(CONTAINER &container, std::function< bool(typename CONTAINER::value_type)> func)
Like ogdf::safeForEach() but aborts if func returns false.
void safeForEach(CONTAINER &container, std::function< void(typename CONTAINER::value_type)> func)
Calls (possibly destructive) func for each element of container.
CONTAINER::iterator chooseIteratorFrom(CONTAINER &container, std::function< bool(const TYPE &)> includeElement=[](const TYPE &) { return true;}, bool isFastTest=true)
Returns an iterator to a random element in the container.
void quicksortTemplate(LIST &L)