SLIP  1.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
arithmetic_op.hpp
Go to the documentation of this file.
1 /*
2  * Copyright(c):
3  * Signal Image and Communications (SIC) Department
4  * http://www.sic.sp2mi.univ-poitiers.fr/
5  * - University of Poitiers, France http://www.univ-poitiers.fr
6  * - XLIM Institute UMR CNRS 7252 http://www.xlim.fr/
7  *
8  * and
9  *
10  * D2 Fluid, Thermic and Combustion
11  * - University of Poitiers, France http://www.univ-poitiers.fr
12  * - PPRIME Institute - UPR CNRS 3346 http://www.pprime.fr
13  * - ISAE-ENSMA http://www.ensma.fr
14  *
15  * Contributor(s):
16  * The SLIP team,
17  * Benoit Tremblais <tremblais_AT_sic.univ-poitiers.fr>,
18  * Laurent David <laurent.david_AT_lea.univ-poitiers.fr>,
19  * Ludovic Chatellier <ludovic.chatellier_AT_univ-poitiers.fr>,
20  * Lionel Thomas <lionel.thomas_AT_univ-poitiers.fr>,
21  * Denis Arrivault <arrivault_AT_sic.univ-poitiers.fr>,
22  * Julien Dombre <julien.dombre_AT_univ-poitiers.fr>.
23  *
24  * Description:
25  * The Simple Library of Image Processing (SLIP) is a new image processing
26  * library. It is written in the C++ language following as much as possible
27  * the ISO/ANSI C++ standard. It is consequently compatible with any system
28  * satisfying the ANSI C++ complience. It works on different Unix , Linux ,
29  * Mircrosoft Windows and Mac OS X plateforms. SLIP is a research library that
30  * was created by the Signal, Image and Communications (SIC) departement of
31  * the XLIM, UMR 7252 CNRS Institute in collaboration with the Fluids, Thermic
32  * and Combustion departement of the P', UPR 3346 CNRS Institute of the
33  * University of Poitiers.
34  *
35  * The SLIP Library source code has been registered to the APP (French Agency
36  * for the Protection of Programs) by the University of Poitiers and CNRS,
37  * under registration number IDDN.FR.001.300034.000.S.P.2010.000.21000.
38 
39  * http://www.sic.sp2mi.univ-poitiers.fr/slip/
40  *
41  * This software is governed by the CeCILL-C license under French law and
42  * abiding by the rules of distribution of free software. You can use,
43  * modify and/ or redistribute the software under the terms of the CeCILL-C
44  * license as circulated by CEA, CNRS and INRIA at the following URL
45  * http://www.cecill.info.
46  * As a counterpart to the access to the source code and rights to copy,
47  * modify and redistribute granted by the license, users are provided only
48  * with a limited warranty and the software's author, the holder of the
49  * economic rights, and the successive licensors have only limited
50  * liability.
51  *
52  * In this respect, the user's attention is drawn to the risks associated
53  * with loading, using, modifying and/or developing or reproducing the
54  * software by the user in light of its specific status of free software,
55  * that may mean that it is complicated to manipulate, and that also
56  * therefore means that it is reserved for developers and experienced
57  * professionals having in-depth computer knowledge. Users are therefore
58  * encouraged to load and test the software's suitability as regards their
59  * requirements in conditions enabling the security of their systems and/or
60  * data to be ensured and, more generally, to use and operate it in the
61  * same conditions as regards security.
62  *
63  * The fact that you are presently reading this means that you have had
64  * knowledge of the CeCILL-C license and that you accept its terms.
65  */
66 
67 
74 #ifndef SLIP_ARITHMETIC_OP_HPP
75 #define SLIP_ARITHMETIC_OP_HPP
76 
77 #include <iostream>
78 #include <iterator>
79 #include <algorithm>
80 #include <numeric>
81 #include <cassert>
82 #include <cmath>
83 #include <functional>
84 #include "stl_algo_ext.hpp"
85 #include "macros.hpp"
86 namespace slip
87 {
88 
89 
90 
92  /* @{ */
93 
121  template<typename InputIterator1,
122  typename InputIterator2,
123  typename OutputIterator>
124  inline
125  void plus(InputIterator1 __first1,
126  InputIterator1 __last1,
127  InputIterator2 __first2,
128  OutputIterator __result)
129  {
130  std::transform(__first1,__last1,
131  __first2,
132  __result,
133  std::plus<typename std::iterator_traits<OutputIterator>::value_type>());
134  }
135 
136 
197  template<typename _InputIterator1,
198  typename _InputIterator2,
199  typename _MaskIterator,
200  typename _OutputIterator>
201  inline
202  void plus_mask(_InputIterator1 __first1, _InputIterator1 __last1,
203  _MaskIterator __mask_first,
204  _InputIterator2 __first2,
205  _OutputIterator __result,
206  typename std::iterator_traits<_MaskIterator>::value_type value=typename std::iterator_traits<_MaskIterator>::value_type(1))
207  {
209  __first1,
210  __last1,
211  __mask_first,
212  __first2,
213  __result,
214  std::plus<typename std::iterator_traits<_InputIterator1>::value_type>(),
215  value);
216 
217 
218  }
219 
262  template<typename _InputIterator1,
263  typename _InputIterator2,
264  typename _OutputIterator,
265  typename _Predicate>
266  inline
267  void plus_if(_InputIterator1 __first1, _InputIterator1 __last1,
268  _InputIterator2 __first2,
269  _OutputIterator __result,
270  _Predicate __pred)
271  {
273  __first1,
274  __last1,
275  __first2,
276  __result,
277  std::plus<typename std::iterator_traits<_InputIterator1>::value_type>(),
278  __pred);
279 
280 
281  }
282 
283 
311  template<typename InputIterator1,
312  typename InputIterator2,
313  typename OutputIterator>
314  inline
315  void minus(InputIterator1 __first1,
316  InputIterator1 __last1,
317  InputIterator2 __first2,
318  OutputIterator __result)
319  {
320  std::transform(__first1,__last1,
321  __first2,
322  __result,
323  std::minus<typename std::iterator_traits<OutputIterator>::value_type>());
324  }
325 
387  template<typename _InputIterator1,
388  typename _InputIterator2,
389  typename _MaskIterator,
390  typename _OutputIterator>
391  inline
392  void minus_mask(_InputIterator1 __first1, _InputIterator1 __last1,
393  _MaskIterator __mask_first,
394  _InputIterator2 __first2,
395  _OutputIterator __result,
396  typename std::iterator_traits<_MaskIterator>::value_type value=typename std::iterator_traits<_MaskIterator>::value_type(1))
397  {
399  __first1,
400  __last1,
401  __mask_first,
402  __first2,
403  __result,
404  std::minus<typename std::iterator_traits<_InputIterator1>::value_type>(),
405  value);
406 
407 
408  }
409 
453  template<typename _InputIterator1,
454  typename _InputIterator2,
455  typename _OutputIterator,
456  typename _Predicate>
457  inline
458  void minus_if(_InputIterator1 __first1, _InputIterator1 __last1,
459  _InputIterator2 __first2,
460  _OutputIterator __result,
461  _Predicate __pred)
462  {
464  __first1,
465  __last1,
466  __first2,
467  __result,
468  std::minus<typename std::iterator_traits<_InputIterator1>::value_type>(),
469  __pred);
470 
471 
472  }
473 
504  template<typename InputIterator1,
505  typename InputIterator2,
506  typename OutputIterator>
507  inline
508  void multiplies(InputIterator1 __first1,
509  InputIterator1 __last1,
510  InputIterator2 __first2,
511  OutputIterator __result)
512  {
513  std::transform(__first1,__last1,
514  __first2,
515  __result,
516  std::multiplies<typename std::iterator_traits<OutputIterator>::value_type>());
517  }
518 
519 
580  template<typename _InputIterator1,
581  typename _InputIterator2,
582  typename _MaskIterator,
583  typename _OutputIterator>
584  inline
585  void multiplies_mask(_InputIterator1 __first1, _InputIterator1 __last1,
586  _MaskIterator __mask_first,
587  _InputIterator2 __first2,
588  _OutputIterator __result,
589  typename std::iterator_traits<_MaskIterator>::value_type value=typename std::iterator_traits<_MaskIterator>::value_type(1))
590  {
592  __first1,
593  __last1,
594  __mask_first,
595  __first2,
596  __result,
597  std::multiplies<typename std::iterator_traits<_InputIterator1>::value_type>(),
598  value);
599 
600 
601  }
602 
603 
604 
605 
647  template<typename _InputIterator1,
648  typename _InputIterator2,
649  typename _OutputIterator,
650  typename _Predicate>
651  inline
652  void multiplies_if(_InputIterator1 __first1, _InputIterator1 __last1,
653  _InputIterator2 __first2,
654  _OutputIterator __result,
655  _Predicate __pred)
656  {
658  __first1,
659  __last1,
660  __first2,
661  __result,
662  std::multiplies<typename std::iterator_traits<_InputIterator1>::value_type>(),
663  __pred);
664 
665 
666  }
667 
668 
697  template<typename InputIterator1,
698  typename InputIterator2,
699  typename OutputIterator>
700  inline
701  void divides(InputIterator1 __first1,
702  InputIterator1 __last1,
703  InputIterator2 __first2,
704  OutputIterator __result)
705  {
706  std::transform(__first1,__last1,
707  __first2,
708  __result,
709  std::divides<typename std::iterator_traits<OutputIterator>::value_type>());
710  }
711 
772  template<typename _InputIterator1,
773  typename _InputIterator2,
774  typename _MaskIterator,
775  typename _OutputIterator>
776  inline
777  void divides_mask(_InputIterator1 __first1, _InputIterator1 __last1,
778  _MaskIterator __mask_first,
779  _InputIterator2 __first2,
780  _OutputIterator __result,
781  typename std::iterator_traits<_MaskIterator>::value_type value=typename std::iterator_traits<_MaskIterator>::value_type(1))
782  {
784  __first1,
785  __last1,
786  __mask_first,
787  __first2,
788  __result,
789  std::divides<typename std::iterator_traits<_InputIterator1>::value_type>(),
790  value);
791 
792 
793  }
794 
795 
796 
838  template<typename _InputIterator1,
839  typename _InputIterator2,
840  typename _OutputIterator,
841  typename _Predicate>
842  inline
843  void divides_if(_InputIterator1 __first1, _InputIterator1 __last1,
844  _InputIterator2 __first2,
845  _OutputIterator __result,
846  _Predicate __pred)
847  {
849  __first1,
850  __last1,
851  __first2,
852  __result,
853  std::divides<typename std::iterator_traits<_InputIterator1>::value_type>(),
854  __pred);
855 
856 
857  }
858 
887  template<typename InputIterator1,
888  typename InputIterator2,
889  typename OutputIterator>
890  inline
891  void minimum(InputIterator1 __first1,
892  InputIterator1 __last1,
893  InputIterator2 __first2,
894  OutputIterator __result)
895  {
896  std::transform(__first1,__last1,
897  __first2,
898  __result,
899  slip::mini<typename std::iterator_traits<OutputIterator>::value_type>());
900  }
901 
962  template<typename _InputIterator1,
963  typename _InputIterator2,
964  typename _MaskIterator,
965  typename _OutputIterator>
966  inline
967  void minimum_mask(_InputIterator1 __first1, _InputIterator1 __last1,
968  _MaskIterator __mask_first,
969  _InputIterator2 __first2,
970  _OutputIterator __result,
971  typename std::iterator_traits<_MaskIterator>::value_type value=typename std::iterator_traits<_MaskIterator>::value_type(1))
972  {
974  __first1,
975  __last1,
976  __mask_first,
977  __first2,
978  __result,
979  slip::mini<typename std::iterator_traits<_InputIterator1>::value_type>(),
980  value);
981 
982 
983  }
984 
1027  template<typename _InputIterator1,
1028  typename _InputIterator2,
1029  typename _OutputIterator,
1030  typename _Predicate>
1031  inline
1032  void minimum_if(_InputIterator1 __first1, _InputIterator1 __last1,
1033  _InputIterator2 __first2,
1034  _OutputIterator __result,
1035  _Predicate __pred)
1036  {
1038  __first1,
1039  __last1,
1040  __first2,
1041  __result,
1042  slip::mini<typename std::iterator_traits<_InputIterator1>::value_type>(),
1043  __pred);
1044 
1045 
1046  }
1047 
1048 
1077  template<typename InputIterator1,
1078  typename InputIterator2,
1079  typename OutputIterator>
1080  inline
1081  void maximum(InputIterator1 __first1,
1082  InputIterator1 __last1,
1083  InputIterator2 __first2,
1084  OutputIterator __result)
1085  {
1086  std::transform(__first1,__last1,
1087  __first2,
1088  __result,
1089  slip::maxi<typename std::iterator_traits<OutputIterator>::value_type>());
1090  }
1091 
1152  template<typename _InputIterator1,
1153  typename _InputIterator2,
1154  typename _MaskIterator,
1155  typename _OutputIterator>
1156  inline
1157  void maximum_mask(_InputIterator1 __first1, _InputIterator1 __last1,
1158  _MaskIterator __mask_first,
1159  _InputIterator2 __first2,
1160  _OutputIterator __result,
1161  typename std::iterator_traits<_MaskIterator>::value_type value=typename std::iterator_traits<_MaskIterator>::value_type(1))
1162  {
1164  __first1,
1165  __last1,
1166  __mask_first,
1167  __first2,
1168  __result,
1169  slip::maxi<typename std::iterator_traits<_InputIterator1>::value_type>(),
1170  value);
1171 
1172 
1173  }
1174 
1217  template<typename _InputIterator1,
1218  typename _InputIterator2,
1219  typename _OutputIterator,
1220  typename _Predicate>
1221  inline
1222  void maximum_if(_InputIterator1 __first1, _InputIterator1 __last1,
1223  _InputIterator2 __first2,
1224  _OutputIterator __result,
1225  _Predicate __pred)
1226  {
1228  __first1,
1229  __last1,
1230  __first2,
1231  __result,
1232  slip::maxi<typename std::iterator_traits<_InputIterator1>::value_type>(),
1233  __pred);
1234 
1235 
1236  }
1237 
1238 
1239  /* @} */
1240 
1241 
1243  /* @{ */
1266  template<typename InputIterator1,
1267  typename OutputIterator>
1268  inline
1269  void plus_scalar(InputIterator1 __first1,
1270  InputIterator1 __last1,
1271  const typename std::iterator_traits<InputIterator1>::value_type& scalar,
1272  OutputIterator __result)
1273  {
1274  std::transform(__first1,__last1,
1275  __result,
1276  std::bind2nd(std::plus<typename std::iterator_traits<InputIterator1>::value_type>(),scalar));
1277  }
1278 
1279 
1331  template<typename _InputIterator1,
1332  typename _MaskIterator,
1333  typename _OutputIterator>
1334  inline
1335  void plus_scalar_mask(_InputIterator1 __first1, _InputIterator1 __last1,
1336  _MaskIterator __mask_first,
1337  const typename std::iterator_traits<_InputIterator1>::value_type& scalar,
1338  _OutputIterator __result,
1339  typename std::iterator_traits<_MaskIterator>::value_type value=typename std::iterator_traits<_MaskIterator>::value_type(1))
1340  {
1342  __first1,
1343  __last1,
1344  __mask_first,
1345  __result,
1346  std::bind2nd(std::plus<typename std::iterator_traits<_InputIterator1>::value_type>(),scalar),
1347  value);
1348 
1349 
1350  }
1351 
1352 
1389  template<typename _InputIterator1,
1390  typename _OutputIterator,
1391  typename _Predicate>
1392  inline
1393  void plus_scalar_if(_InputIterator1 __first1, _InputIterator1 __last1,
1394  const typename std::iterator_traits<_InputIterator1>::value_type& scalar,
1395  _OutputIterator __result,
1396  _Predicate __pred)
1397  {
1399  __first1,
1400  __last1,
1401  __result,
1402  std::bind2nd(std::plus<typename std::iterator_traits<_InputIterator1>::value_type>(),scalar),
1403  __pred);
1404 
1405 
1406  }
1407 
1430  template<typename InputIterator1,
1431  typename OutputIterator>
1432  inline
1433  void minus_scalar(InputIterator1 __first1,
1434  InputIterator1 __last1,
1435  const typename std::iterator_traits<InputIterator1>::value_type& scalar,
1436  OutputIterator __result)
1437  {
1438  std::transform(__first1,__last1,
1439  __result,
1440  std::bind2nd(std::minus<typename std::iterator_traits<InputIterator1>::value_type>(),scalar));
1441  }
1442 
1443 
1495  template<typename _InputIterator1,
1496  typename _MaskIterator,
1497  typename _OutputIterator>
1498  inline
1499  void minus_scalar_mask(_InputIterator1 __first1, _InputIterator1 __last1,
1500  _MaskIterator __mask_first,
1501  const typename std::iterator_traits<_InputIterator1>::value_type& scalar,
1502  _OutputIterator __result,
1503  typename std::iterator_traits<_MaskIterator>::value_type value=typename std::iterator_traits<_MaskIterator>::value_type(1))
1504  {
1506  __first1,
1507  __last1,
1508  __mask_first,
1509  __result,
1510  std::bind2nd(std::minus<typename std::iterator_traits<_InputIterator1>::value_type>(),scalar),
1511  value);
1512 
1513 
1514  }
1515 
1552  template<typename _InputIterator1,
1553  typename _OutputIterator,
1554  typename _Predicate>
1555  inline
1556  void minus_scalar_if(_InputIterator1 __first1, _InputIterator1 __last1,
1557  const typename std::iterator_traits<_InputIterator1>::value_type& scalar,
1558  _OutputIterator __result,
1559  _Predicate __pred)
1560  {
1562  __first1,
1563  __last1,
1564  __result,
1565  std::bind2nd(std::minus<typename std::iterator_traits<_InputIterator1>::value_type>(),scalar),
1566  __pred);
1567 
1568 
1569  }
1570 
1571 
1594  template<typename InputIterator1,
1595  typename OutputIterator>
1596  inline
1597  void multiplies_scalar(InputIterator1 __first1,
1598  InputIterator1 __last1,
1599  const typename std::iterator_traits<InputIterator1>::value_type& scalar,
1600  OutputIterator __result)
1601  {
1602  std::transform(__first1,__last1,
1603  __result,
1604  std::bind2nd(std::multiplies<typename std::iterator_traits<InputIterator1>::value_type>(),scalar));
1605  }
1606 
1607 
1659  template<typename _InputIterator1,
1660  typename _MaskIterator,
1661  typename _OutputIterator>
1662  inline
1663  void multiplies_scalar_mask(_InputIterator1 __first1, _InputIterator1 __last1,
1664  _MaskIterator __mask_first,
1665  const typename std::iterator_traits<_InputIterator1>::value_type& scalar,
1666  _OutputIterator __result,
1667  typename std::iterator_traits<_MaskIterator>::value_type value=typename std::iterator_traits<_MaskIterator>::value_type(1))
1668  {
1670  __first1,
1671  __last1,
1672  __mask_first,
1673  __result,
1674  std::bind2nd(std::multiplies<typename std::iterator_traits<_InputIterator1>::value_type>(),scalar),
1675  value);
1676 
1677 
1678  }
1679 
1680 
1717  template<typename _InputIterator1,
1718  typename _OutputIterator,
1719  typename _Predicate>
1720  inline
1721  void multiplies_scalar_if(_InputIterator1 __first1, _InputIterator1 __last1,
1722  const typename std::iterator_traits<_InputIterator1>::value_type& scalar,
1723  _OutputIterator __result,
1724  _Predicate __pred)
1725  {
1727  __first1,
1728  __last1,
1729  __result,
1730  std::bind2nd(std::multiplies<typename std::iterator_traits<_InputIterator1>::value_type>(),scalar),
1731  __pred);
1732 
1733 
1734  }
1735 
1736 
1759  template<typename InputIterator1,
1760  typename OutputIterator>
1761  inline
1762  void divides_scalar(InputIterator1 __first1,
1763  InputIterator1 __last1,
1764  const typename std::iterator_traits<InputIterator1>::value_type& scalar,
1765  OutputIterator __result)
1766  {
1767  std::transform(__first1,__last1,
1768  __result,
1769  std::bind2nd(std::divides<typename std::iterator_traits<InputIterator1>::value_type>(),scalar));
1770  }
1771 
1823  template<typename _InputIterator1,
1824  typename _MaskIterator,
1825  typename _OutputIterator>
1826  inline
1827  void divides_scalar_mask(_InputIterator1 __first1, _InputIterator1 __last1,
1828  _MaskIterator __mask_first,
1829  const typename std::iterator_traits<_InputIterator1>::value_type& scalar,
1830  _OutputIterator __result,
1831  typename std::iterator_traits<_MaskIterator>::value_type value=typename std::iterator_traits<_MaskIterator>::value_type(1))
1832  {
1834  __first1,
1835  __last1,
1836  __mask_first,
1837  __result,
1838  std::bind2nd(std::divides<typename std::iterator_traits<_InputIterator1>::value_type>(),scalar),
1839  value);
1840 
1841 
1842  }
1843 
1844 
1881  template<typename _InputIterator1,
1882  typename _OutputIterator,
1883  typename _Predicate>
1884  inline
1885  void divides_scalar_if(_InputIterator1 __first1, _InputIterator1 __last1,
1886  const typename std::iterator_traits<_InputIterator1>::value_type& scalar,
1887  _OutputIterator __result,
1888  _Predicate __pred)
1889  {
1891  __first1,
1892  __last1,
1893  __result,
1894  std::bind2nd(std::divides<typename std::iterator_traits<_InputIterator1>::value_type>(),scalar),
1895  __pred);
1896 
1897 
1898  }
1899 
1900  /* @} */
1901 
1902 
1904  /* @{ */
1905 
1928  template<typename InputIterator, typename OutputIterator>
1929  inline
1930  void negate(InputIterator __first1,
1931  InputIterator __last1,
1932  OutputIterator __result)
1933 
1934  {
1935  std::transform(__first1,__last1,
1936  __result,
1937  std::negate<typename std::iterator_traits<InputIterator>::value_type>());
1938  }
1939 
1988  template<typename InputIterator,
1989  typename MaskIterator,
1990  typename OutputIterator>
1991  inline
1992  void negate_mask(InputIterator __first1,
1993  InputIterator __last1,
1994  MaskIterator __mask_first,
1995  OutputIterator __result,
1996  typename std::iterator_traits<MaskIterator>::value_type value=typename std::iterator_traits<MaskIterator>::value_type(1))
1997 
1998  {
1999  slip::transform_mask_un(__first1,__last1,
2000  __mask_first,
2001  __result,
2002  std::negate<typename std::iterator_traits<InputIterator>::value_type>(),value);
2003  }
2039  template<typename _InputIterator1,
2040  typename _OutputIterator,
2041  typename _Predicate>
2042  inline
2043  void negate_if(_InputIterator1 __first1, _InputIterator1 __last1,
2044 
2045  _OutputIterator __result,
2046  _Predicate __pred)
2047  {
2049  __first1,
2050  __last1,
2051  __result,
2052  std::negate<typename std::iterator_traits<_InputIterator1>::value_type>(),
2053  __pred);
2054 
2055 
2056  }
2057 
2085  template <class ForwardIterator, class T>
2086  inline
2087  void iota(ForwardIterator first, ForwardIterator last, T value, T step = T(1))
2088  {
2089  for (;first != last; ++first)
2090  {
2091  *first = value;
2092  value = value + step;
2093  }
2094 
2095  }
2096 
2129  template <class ForwardIterator, typename MaskIterator, class T>
2130  inline
2131  void iota_mask(ForwardIterator first,
2132  ForwardIterator last,
2133  MaskIterator mask_first,
2134  T value, T step = T(1),
2135  typename std::iterator_traits<MaskIterator>::value_type value_mask=typename std::iterator_traits<MaskIterator>::value_type(1))
2136  {
2137  for (;first != last; ++first,++mask_first)
2138  {
2139  if(*mask_first == value_mask)
2140  {
2141  *first = value;
2142  value = value + step;
2143  }
2144 
2145  }
2146  }
2147 
2148 
2149  /* @} */
2150 
2151 }//slip::
2152 
2153 
2154 #endif //SLIP_ARITHMETIC_OP_HPP
void minus(InputIterator1 __first1, InputIterator1 __last1, InputIterator2 __first2, OutputIterator __result)
Computes the difference of two ranges.
void 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.
void negate(InputIterator __first1, InputIterator __last1, OutputIterator __result)
Computes the negation of a range.
Computes the maximum value between two values.
Definition: macros.hpp:214
void minimum_if(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _OutputIterator __result, _Predicate __pred)
Computes the minimum of two ranges according to a Predicate.
void minus_if(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _OutputIterator __result, _Predicate __pred)
Computes the difference of two ranges according to a Predicate.
void 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.
void 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.
_OutputIterator transform_if(_InputIterator first, _InputIterator last, _OutputIterator result, _UnaryOperation unary_op, _Predicate pred)
Perform an operation on a sequence according to a Predicate.
void 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.
void 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.
void divides_scalar(InputIterator1 __first1, InputIterator1 __last1, const typename std::iterator_traits< InputIterator1 >::value_type &scalar, OutputIterator __result)
Divides a range by a scalar.
void negate_if(_InputIterator1 __first1, _InputIterator1 __last1, _OutputIterator __result, _Predicate __pred)
Computes the pointwise negate of a ranges according to a Predicate.
void divides(InputIterator1 __first1, InputIterator1 __last1, InputIterator2 __first2, OutputIterator __result)
Computes the pointwise division of two ranges.
_OutputIterator transform_mask_bin(_InputIterator1 first1, _InputIterator1 last1, _MaskIterator mask_first, _InputIterator2 first2, _OutputIterator result, _BinaryOperation binary_op, typename std::iterator_traits< _MaskIterator >::value_type value=typename std::iterator_traits< _MaskIterator >::value_type(1))
Perform an operation on corresponding elements of two sequences according to a mask sequence...
void multiplies_scalar(InputIterator1 __first1, InputIterator1 __last1, const typename std::iterator_traits< InputIterator1 >::value_type &scalar, OutputIterator __result)
Multiplies a range by a scalar.
void plus_if(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _OutputIterator __result, _Predicate __pred)
Computes the addition of two ranges according to a Predicate.
void minimum(InputIterator1 __first1, InputIterator1 __last1, InputIterator2 __first2, OutputIterator __result)
Computes the minimum of two ranges.
void 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 sequ...
void 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...
Computes the minimum value between two values.
Definition: macros.hpp:194
void maximum(InputIterator1 __first1, InputIterator1 __last1, InputIterator2 __first2, OutputIterator __result)
Computes the maximum of two ranges.
void plus_scalar(InputIterator1 __first1, InputIterator1 __last1, const typename std::iterator_traits< InputIterator1 >::value_type &scalar, OutputIterator __result)
Adds a scalar to a range.
void 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.
void maximum_if(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _OutputIterator __result, _Predicate __pred)
Computes the maximum of two ranges according to a Predicate.
void 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.
void divides_if(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _OutputIterator __result, _Predicate __pred)
Computes the pointwise division of two ranges. according to a Predicate.
void plus(InputIterator1 __first1, InputIterator1 __last1, InputIterator2 __first2, OutputIterator __result)
Computes the addition of two ranges.
void multiplies(InputIterator1 __first1, InputIterator1 __last1, InputIterator2 __first2, OutputIterator __result)
Computes the pointwise product of two ranges.
_OutputIterator transform_mask_un(_InputIterator first, _InputIterator last, _MaskIterator mask_first, _OutputIterator result, _UnaryOperation unary_op, typename std::iterator_traits< _MaskIterator >::value_type value=typename std::iterator_traits< _MaskIterator >::value_type(1))
Perform an operation on a sequence according to a mask sequence.
void multiplies_if(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _OutputIterator __result, _Predicate __pred)
Computes the pointwise product of two ranges according to a Predicate.
Provides some mathematical functors and constants.
Provides some extension to STL algorithms.
void minus_scalar(InputIterator1 __first1, InputIterator1 __last1, const typename std::iterator_traits< InputIterator1 >::value_type &scalar, OutputIterator __result)
Substracts a scalar to a range.
void 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.
void 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.
void 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.
void 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.
void 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.
void 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.
void 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.
void 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.