Simple Application Framework
1
|
Mathematical algorithms and functions that execute on a range of elements. More...
Functions | |
template<class FwdIter , class Val , class Comp > | |
FwdIter | LowerBound (FwdIter begin, FwdIter end, const Val &val, Comp comp) |
Finds the furthermost iterator lb in the range [begin, end] such that for any iterator it in the range [begin, lb) it holds that comp(*it, val) == true . | |
template<class FwdIter , class Val > | |
FwdIter | LowerBound (FwdIter begin, FwdIter end, const Val &val) |
Finds the furthermost iterator lb in the range [begin, end] such that for any iterator it in the range [begin, lb) it holds that *it < val . | |
template<class FwdIter > | |
Type::IteratorTraits< FwdIter > ::ValType | Product (FwdIter begin, FwdIter end) |
Compute the product of elements in the range [begin, end) . | |
template<class FwdIter > | |
Type::IteratorTraits< FwdIter > ::ValType | Sum (FwdIter begin, FwdIter end) |
Compute the sum of elements in the range [begin, end) . | |
template<class FwdIter , class Val , class Comp > | |
FwdIter | UpperBound (FwdIter begin, FwdIter end, const Val &val, Comp comp) |
Finds the furthermost iterator ub in the range [begin, end] such that for any iterator it in the range [begin, ub) it holds that comp(val, *it) == false . | |
template<class FwdIter , class Val > | |
FwdIter | UpperBound (FwdIter begin, FwdIter end, const Val &val) |
Finds the furthermost iterator ub in the range [begin, end] such that for any iterator it in the range [begin, ub) it holds that !(val < *it) . |
Mathematical algorithms and functions that execute on a range of elements.
FwdIter Saf::Math::Range::LowerBound | ( | FwdIter | begin, |
FwdIter | end, | ||
const Val & | val, | ||
Comp | comp | ||
) | [inline] |
Finds the furthermost iterator lb
in the range [begin, end]
such that for any iterator it
in the range [begin, lb)
it holds that comp(*it, val) == true
.
The input range is assumed to be sorted according to the comp
predicate.
Properties:
[in] | begin | Iterator to the beginning of the sequence. |
[in] | end | Iterator to the end of the sequence. |
[in] | val | The value. |
[in] | comp | Comparison predicate (accepting Val as the first parameter). |
FwdIter Saf::Math::Range::LowerBound | ( | FwdIter | begin, |
FwdIter | end, | ||
const Val & | val | ||
) | [inline] |
Finds the furthermost iterator lb
in the range [begin, end]
such that for any iterator it
in the range [begin, lb)
it holds that *it < val
.
The input range is assumed to be sorted according to the Algo::Predicate::Less predicate.
Properties:
[in] | begin | Iterator to the beginning of the sequence. |
[in] | end | Iterator to the end of the sequence. |
[in] | val | The value. |
LowerBound(begin, end, Algo::Predicate::Less<Val>())
. Type::IteratorTraits<FwdIter>::ValType Saf::Math::Range::Product | ( | FwdIter | begin, |
FwdIter | end | ||
) | [inline] |
Compute the product of elements in the range [begin, end)
.
Properties:
Type::IteratorTraits<FwdIter>::ValType Saf::Math::Range::Sum | ( | FwdIter | begin, |
FwdIter | end | ||
) | [inline] |
Compute the sum of elements in the range [begin, end)
.
Properties:
FwdIter Saf::Math::Range::UpperBound | ( | FwdIter | begin, |
FwdIter | end, | ||
const Val & | val, | ||
Comp | comp | ||
) | [inline] |
Finds the furthermost iterator ub
in the range [begin, end]
such that for any iterator it
in the range [begin, ub)
it holds that comp(val, *it) == false
.
The input range is assumed to be sorted according to the comp
predicate.
Properties:
[in] | begin | Iterator to the beginning of the sequence. |
[in] | end | Iterator to the end of the sequence. |
[in] | val | The value. |
[in] | comp | Comparison predicate (accepting Val as the first parameter). |
FwdIter Saf::Math::Range::UpperBound | ( | FwdIter | begin, |
FwdIter | end, | ||
const Val & | val | ||
) | [inline] |
Finds the furthermost iterator ub
in the range [begin, end]
such that for any iterator it
in the range [begin, ub)
it holds that !(val < *it)
.
The input range is assumed to be sorted according to the Algo::Predicate::Less predicate.
Properties:
[in] | begin | Iterator to the beginning of the sequence. |
[in] | end | Iterator to the end of the sequence. |
[in] | val | The value. |
UpperBound(begin, end, Algo::Predicate::Less<Val>())
.