SLIP
1.4
|
Provides some algorithms to computes arithmetical operations on ranges. More...
#include <iostream>
#include <iterator>
#include <algorithm>
#include <numeric>
#include <cassert>
#include <cmath>
#include <functional>
#include "stl_algo_ext.hpp"
#include "macros.hpp"
Go to the source code of this file.
Namespaces | |
slip | |
This namespace corresponds to the kernel of the Simple Library on Image Processing (SLIP). That is to say that it contains the data structures and the algorithms needed by these data strucutres. | |
Functions | |
Operations between two ranges | |
template<typename InputIterator1 , typename InputIterator2 , typename OutputIterator > | |
void | slip::plus (InputIterator1 __first1, InputIterator1 __last1, InputIterator2 __first2, OutputIterator __result) |
Computes the addition of two ranges. More... | |
template<typename _InputIterator1 , typename _InputIterator2 , typename _MaskIterator , typename _OutputIterator > | |
void | slip::plus_mask (_InputIterator1 __first1, _InputIterator1 __last1, _MaskIterator __mask_first, _InputIterator2 __first2, _OutputIterator __result, typename std::iterator_traits< _MaskIterator >::value_type value=typename std::iterator_traits< _MaskIterator >::value_type(1)) |
Computes the addition of two ranges according to a mask sequence. More... | |
template<typename _InputIterator1 , typename _InputIterator2 , typename _OutputIterator , typename _Predicate > | |
void | slip::plus_if (_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _OutputIterator __result, _Predicate __pred) |
Computes the addition of two ranges according to a Predicate. More... | |
template<typename InputIterator1 , typename InputIterator2 , typename OutputIterator > | |
void | slip::minus (InputIterator1 __first1, InputIterator1 __last1, InputIterator2 __first2, OutputIterator __result) |
Computes the difference of two ranges. More... | |
template<typename _InputIterator1 , typename _InputIterator2 , typename _MaskIterator , typename _OutputIterator > | |
void | slip::minus_mask (_InputIterator1 __first1, _InputIterator1 __last1, _MaskIterator __mask_first, _InputIterator2 __first2, _OutputIterator __result, typename std::iterator_traits< _MaskIterator >::value_type value=typename std::iterator_traits< _MaskIterator >::value_type(1)) |
Computes the difference of two ranges according to a mask sequence. More... | |
template<typename _InputIterator1 , typename _InputIterator2 , typename _OutputIterator , typename _Predicate > | |
void | slip::minus_if (_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _OutputIterator __result, _Predicate __pred) |
Computes the difference of two ranges according to a Predicate. More... | |
template<typename InputIterator1 , typename InputIterator2 , typename OutputIterator > | |
void | slip::multiplies (InputIterator1 __first1, InputIterator1 __last1, InputIterator2 __first2, OutputIterator __result) |
Computes the pointwise product of two ranges. More... | |
template<typename _InputIterator1 , typename _InputIterator2 , typename _MaskIterator , typename _OutputIterator > | |
void | slip::multiplies_mask (_InputIterator1 __first1, _InputIterator1 __last1, _MaskIterator __mask_first, _InputIterator2 __first2, _OutputIterator __result, typename std::iterator_traits< _MaskIterator >::value_type value=typename std::iterator_traits< _MaskIterator >::value_type(1)) |
Computes the pointwise product of two ranges according to a mask sequence. More... | |
template<typename _InputIterator1 , typename _InputIterator2 , typename _OutputIterator , typename _Predicate > | |
void | slip::multiplies_if (_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _OutputIterator __result, _Predicate __pred) |
Computes the pointwise product of two ranges according to a Predicate. More... | |
template<typename InputIterator1 , typename InputIterator2 , typename OutputIterator > | |
void | slip::divides (InputIterator1 __first1, InputIterator1 __last1, InputIterator2 __first2, OutputIterator __result) |
Computes the pointwise division of two ranges. More... | |
template<typename _InputIterator1 , typename _InputIterator2 , typename _MaskIterator , typename _OutputIterator > | |
void | slip::divides_mask (_InputIterator1 __first1, _InputIterator1 __last1, _MaskIterator __mask_first, _InputIterator2 __first2, _OutputIterator __result, typename std::iterator_traits< _MaskIterator >::value_type value=typename std::iterator_traits< _MaskIterator >::value_type(1)) |
Computes the pointwise division of two ranges according to a mask sequence. More... | |
template<typename _InputIterator1 , typename _InputIterator2 , typename _OutputIterator , typename _Predicate > | |
void | slip::divides_if (_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _OutputIterator __result, _Predicate __pred) |
Computes the pointwise division of two ranges. according to a Predicate. More... | |
template<typename InputIterator1 , typename InputIterator2 , typename OutputIterator > | |
void | slip::minimum (InputIterator1 __first1, InputIterator1 __last1, InputIterator2 __first2, OutputIterator __result) |
Computes the minimum of two ranges. More... | |
template<typename _InputIterator1 , typename _InputIterator2 , typename _MaskIterator , typename _OutputIterator > | |
void | slip::minimum_mask (_InputIterator1 __first1, _InputIterator1 __last1, _MaskIterator __mask_first, _InputIterator2 __first2, _OutputIterator __result, typename std::iterator_traits< _MaskIterator >::value_type value=typename std::iterator_traits< _MaskIterator >::value_type(1)) |
Computes the minimum of two ranges according to a mask sequence. More... | |
template<typename _InputIterator1 , typename _InputIterator2 , typename _OutputIterator , typename _Predicate > | |
void | slip::minimum_if (_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _OutputIterator __result, _Predicate __pred) |
Computes the minimum of two ranges according to a Predicate. More... | |
template<typename InputIterator1 , typename InputIterator2 , typename OutputIterator > | |
void | slip::maximum (InputIterator1 __first1, InputIterator1 __last1, InputIterator2 __first2, OutputIterator __result) |
Computes the maximum of two ranges. More... | |
template<typename _InputIterator1 , typename _InputIterator2 , typename _MaskIterator , typename _OutputIterator > | |
void | slip::maximum_mask (_InputIterator1 __first1, _InputIterator1 __last1, _MaskIterator __mask_first, _InputIterator2 __first2, _OutputIterator __result, typename std::iterator_traits< _MaskIterator >::value_type value=typename std::iterator_traits< _MaskIterator >::value_type(1)) |
Computes the maximum of two ranges according to a mask sequence. More... | |
template<typename _InputIterator1 , typename _InputIterator2 , typename _OutputIterator , typename _Predicate > | |
void | slip::maximum_if (_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _OutputIterator __result, _Predicate __pred) |
Computes the maximum of two ranges according to a Predicate. More... | |
Operations between a range and a scalar | |
template<typename InputIterator1 , typename OutputIterator > | |
void | slip::plus_scalar (InputIterator1 __first1, InputIterator1 __last1, const typename std::iterator_traits< InputIterator1 >::value_type &scalar, OutputIterator __result) |
Adds a scalar to a range. More... | |
template<typename _InputIterator1 , typename _MaskIterator , typename _OutputIterator > | |
void | slip::plus_scalar_mask (_InputIterator1 __first1, _InputIterator1 __last1, _MaskIterator __mask_first, const typename std::iterator_traits< _InputIterator1 >::value_type &scalar, _OutputIterator __result, typename std::iterator_traits< _MaskIterator >::value_type value=typename std::iterator_traits< _MaskIterator >::value_type(1)) |
Adds a scalar to a range according to a mask sequence. More... | |
template<typename _InputIterator1 , typename _OutputIterator , typename _Predicate > | |
void | slip::plus_scalar_if (_InputIterator1 __first1, _InputIterator1 __last1, const typename std::iterator_traits< _InputIterator1 >::value_type &scalar, _OutputIterator __result, _Predicate __pred) |
Adds a scalar to a range according to a Predicate. More... | |
template<typename InputIterator1 , typename OutputIterator > | |
void | slip::minus_scalar (InputIterator1 __first1, InputIterator1 __last1, const typename std::iterator_traits< InputIterator1 >::value_type &scalar, OutputIterator __result) |
Substracts a scalar to a range. More... | |
template<typename _InputIterator1 , typename _MaskIterator , typename _OutputIterator > | |
void | slip::minus_scalar_mask (_InputIterator1 __first1, _InputIterator1 __last1, _MaskIterator __mask_first, const typename std::iterator_traits< _InputIterator1 >::value_type &scalar, _OutputIterator __result, typename std::iterator_traits< _MaskIterator >::value_type value=typename std::iterator_traits< _MaskIterator >::value_type(1)) |
Substracts a scalar to a range according to a mask sequence. More... | |
template<typename _InputIterator1 , typename _OutputIterator , typename _Predicate > | |
void | slip::minus_scalar_if (_InputIterator1 __first1, _InputIterator1 __last1, const typename std::iterator_traits< _InputIterator1 >::value_type &scalar, _OutputIterator __result, _Predicate __pred) |
Substracts a scalar to a range according to a Predicate. More... | |
template<typename InputIterator1 , typename OutputIterator > | |
void | slip::multiplies_scalar (InputIterator1 __first1, InputIterator1 __last1, const typename std::iterator_traits< InputIterator1 >::value_type &scalar, OutputIterator __result) |
Multiplies a range by a scalar. More... | |
template<typename _InputIterator1 , typename _MaskIterator , typename _OutputIterator > | |
void | slip::multiplies_scalar_mask (_InputIterator1 __first1, _InputIterator1 __last1, _MaskIterator __mask_first, const typename std::iterator_traits< _InputIterator1 >::value_type &scalar, _OutputIterator __result, typename std::iterator_traits< _MaskIterator >::value_type value=typename std::iterator_traits< _MaskIterator >::value_type(1)) |
Multiplies a range by a scalar according to a mask sequence. More... | |
template<typename _InputIterator1 , typename _OutputIterator , typename _Predicate > | |
void | slip::multiplies_scalar_if (_InputIterator1 __first1, _InputIterator1 __last1, const typename std::iterator_traits< _InputIterator1 >::value_type &scalar, _OutputIterator __result, _Predicate __pred) |
Multiplies a range by a scalar according to a Predicate. More... | |
template<typename InputIterator1 , typename OutputIterator > | |
void | slip::divides_scalar (InputIterator1 __first1, InputIterator1 __last1, const typename std::iterator_traits< InputIterator1 >::value_type &scalar, OutputIterator __result) |
Divides a range by a scalar. More... | |
template<typename _InputIterator1 , typename _MaskIterator , typename _OutputIterator > | |
void | slip::divides_scalar_mask (_InputIterator1 __first1, _InputIterator1 __last1, _MaskIterator __mask_first, const typename std::iterator_traits< _InputIterator1 >::value_type &scalar, _OutputIterator __result, typename std::iterator_traits< _MaskIterator >::value_type value=typename std::iterator_traits< _MaskIterator >::value_type(1)) |
Divides a range by a scalar according to a mask sequence. More... | |
template<typename _InputIterator1 , typename _OutputIterator , typename _Predicate > | |
void | slip::divides_scalar_if (_InputIterator1 __first1, _InputIterator1 __last1, const typename std::iterator_traits< _InputIterator1 >::value_type &scalar, _OutputIterator __result, _Predicate __pred) |
Divides a range by a scalar according to a Predicate. More... | |
Operations on a range | |
template<typename InputIterator , typename OutputIterator > | |
void | slip::negate (InputIterator __first1, InputIterator __last1, OutputIterator __result) |
Computes the negation of a range. More... | |
template<typename InputIterator , typename MaskIterator , typename OutputIterator > | |
void | slip::negate_mask (InputIterator __first1, InputIterator __last1, MaskIterator __mask_first, OutputIterator __result, typename std::iterator_traits< MaskIterator >::value_type value=typename std::iterator_traits< MaskIterator >::value_type(1)) |
Computes the negation of a range according to a mask range. More... | |
template<typename _InputIterator1 , typename _OutputIterator , typename _Predicate > | |
void | slip::negate_if (_InputIterator1 __first1, _InputIterator1 __last1, _OutputIterator __result, _Predicate __pred) |
Computes the pointwise negate of a ranges according to a Predicate. More... | |
template<class ForwardIterator , class T > | |
void | slip::iota (ForwardIterator first, ForwardIterator last, T value, T step=T(1)) |
Iota assigns sequential increasing values based on a predefined step to a range. That is, it assigns value to *first, value + step to *(first + 1) and so on. In general, each iterator i in the range [first,last) is assigned value + step * (i - first). More... | |
template<class ForwardIterator , typename MaskIterator , class T > | |
void | slip::iota_mask (ForwardIterator first, ForwardIterator last, MaskIterator mask_first, T value, T step=T(1), typename std::iterator_traits< MaskIterator >::value_type value_mask=typename std::iterator_traits< MaskIterator >::value_type(1)) |
Iota_mask sequential increasing values based on a predefined step to a range according to a mask sequence. More... | |
Provides some algorithms to computes arithmetical operations on ranges.
Definition in file arithmetic_op.hpp.