SLIP  1.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Matrix3d.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_MATRIX3D_HPP
75 #define SLIP_MATRIX3D_HPP
76 
77 #include <iostream>
78 #include <iterator>
79 #include <cassert>
80 #include <numeric>
81 #include <algorithm>
82 #include <cmath>
83 #include <string>
84 #include <cstddef>
85 #include "Array3d.hpp"
86 #include "stride_iterator.hpp"
87 #include "apply.hpp"
88 #include "iterator3d_plane.hpp"
89 #include "iterator3d_box.hpp"
90 #include "iterator3d_range.hpp"
91 
92 #include <boost/serialization/access.hpp>
93 #include <boost/serialization/split_member.hpp>
94 #include <boost/serialization/string.hpp>
95 #include <boost/serialization/complex.hpp>
96 #include <boost/serialization/version.hpp>
97 
98 namespace slip
99 {
100 
101  template <typename T>
102  class Matrix3d;
103 
104  template <typename T>
105  class Array3d;
106 
107  template <typename T>
108  std::ostream& operator<<(std::ostream & out, const slip::Matrix3d<T>& a);
109 
110  template<typename T>
111  bool operator==(const slip::Matrix3d<T>& x,
112  const slip::Matrix3d<T>& y);
113 
114  template<typename T>
115  bool operator!=(const slip::Matrix3d<T>& x,
116  const slip::Matrix3d<T>& y);
117 
118  template<typename T>
119  bool operator<(const slip::Matrix3d<T>& x,
120  const slip::Matrix3d<T>& y);
121 
122  template<typename T>
123  bool operator>(const slip::Matrix3d<T>& x,
124  const slip::Matrix3d<T>& y);
125 
126  template<typename T>
127  bool operator<=(const slip::Matrix3d<T>& x,
128  const slip::Matrix3d<T>& y);
129 
130  template<typename T>
131  bool operator>=(const slip::Matrix3d<T>& x,
132  const slip::Matrix3d<T>& y);
133 
154  template <typename T>
155  class Matrix3d
156  {
157  public :
158 
159  typedef T value_type;
160  typedef Matrix3d<T> self;
161  typedef const Matrix3d<T> const_self;
162 
163  typedef value_type* pointer;
164  typedef value_type const* const_pointer;
166  typedef value_type const& const_reference;
167 
168  typedef ptrdiff_t difference_type;
169  typedef std::size_t size_type;
170 
171  typedef pointer iterator;
173 
174  typedef std::reverse_iterator<iterator> reverse_iterator;
175  typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
176 
177  //slice, row and col iterator
190 
191  typedef std::reverse_iterator<slice_iterator> reverse_slice_iterator;
192  typedef std::reverse_iterator<const_slice_iterator> const_reverse_slice_iterator;
193  typedef std::reverse_iterator<iterator> reverse_row_iterator;
194  typedef std::reverse_iterator<const_iterator> const_reverse_row_iterator;
195  typedef std::reverse_iterator<col_iterator> reverse_col_iterator;
196  typedef std::reverse_iterator<const_col_iterator> const_reverse_col_iterator;
197  typedef std::reverse_iterator<slice_range_iterator> reverse_slice_range_iterator;
198  typedef std::reverse_iterator<const_slice_range_iterator> const_reverse_slice_range_iterator;
199  typedef std::reverse_iterator<row_range_iterator> reverse_row_range_iterator;
200  typedef std::reverse_iterator<const_row_range_iterator> const_reverse_row_range_iterator;
201  typedef std::reverse_iterator<col_range_iterator> reverse_col_range_iterator;
202  typedef std::reverse_iterator<const_col_range_iterator> const_reverse_col_range_iterator;
203 
204 #ifdef ALL_PLANE_ITERATOR3D
205  //generic 1d iterator
206  typedef slip::stride_iterator<pointer> iterator1d;
207  typedef slip::stride_iterator<const_pointer> const_iterator1d;
208  typedef std::reverse_iterator<iterator1d> reverse_iterator1d;
209  typedef std::reverse_iterator<const_iterator1d> const_reverse_iterator1d;
210 #endif //ALL_PLANE_ITERATOR3D
211 
212  //iterator 2d
215  typedef std::reverse_iterator<iterator2d> reverse_iterator2d;
216  typedef std::reverse_iterator<const_iterator2d> const_reverse_iterator2d;
217 
218  //iterator 3d
223 
224  typedef std::reverse_iterator<iterator3d> reverse_iterator3d;
225  typedef std::reverse_iterator<const_iterator3d> const_reverse_iterator3d;
226  typedef std::reverse_iterator<iterator3d_range> reverse_iterator3d_range;
227  typedef std::reverse_iterator<const_iterator3d_range> const_reverse_iterator3d_range;
228 
229  //default iterator of the container
232 
233  static const std::size_t DIM = 3;
234 
235  public:
236 
242 
246  Matrix3d();
247 
256  Matrix3d(const std::size_t d1,
257  const std::size_t d2,
258  const std::size_t d3);
259 
267  Matrix3d(const std::size_t d1,
268  const std::size_t d2,
269  const std::size_t d3,
270  const T& val);
278  Matrix3d(const std::size_t d1,
279  const std::size_t d2,
280  const std::size_t d3,
281  const T* val);
282 
295  template<typename InputIterator>
296  Matrix3d(const size_type d1,
297  const size_type d2,
298  const size_type d3,
299  InputIterator first,
300  InputIterator last):
301  array_(new slip::Array3d<T>(d1,d2,d3,first,last))
302  {}
303 
307  Matrix3d(const Matrix3d<T>& rhs);
308 
309 
313  ~Matrix3d();
314 
315 
327  void resize(std::size_t d1,
328  std::size_t d2,
329  std::size_t d3,
330  const T& val = T());
331 
336 
337  //****************************************************************************
338  // One dimensionnal iterators
339  //****************************************************************************
340 
341 
342 
343  //----------------------Global iterators------------------------------
344 
364  const_iterator begin() const;
365 
385  iterator begin();
386 
406  iterator end();
407 
427  const_iterator end() const;
428 
449 
470 
491 
512 
518  //--------------------One dimensionnal slice iterators----------------------
519 
520 
542  slice_iterator slice_begin(const size_type row, const size_type col);
543 
565  const_slice_iterator slice_begin(const size_type row, const size_type col) const;
566 
588  slice_iterator slice_end(const size_type row, const size_type col);
589 
611  const_slice_iterator slice_end(const size_type row, const size_type col) const;
612 
613 
637 
660  const_reverse_slice_iterator slice_rbegin(const size_type row, const size_type col) const;
661 
685 
686 
709  const_reverse_slice_iterator slice_rend(const size_type row, const size_type col) const;
710 
717  //-------------------row iterators----------
718 
729  row_iterator row_begin(const size_type slice,
730  const size_type row);
731 
743  const size_type row) const;
744 
745 
756  row_iterator row_end(const size_type slice,
757  const size_type row);
758 
759 
771  const size_type row) const;
772 
773 
785  const size_type row);
786 
798  const size_type row) const;
799 
800 
812  const size_type row);
813 
814 
826  const size_type row) const;
827 
833  //-------------------col iterators----------
834 
845  col_iterator col_begin(const size_type slice,
846  const size_type col);
847 
848 
860  const size_type col) const;
861 
872  col_iterator col_end(const size_type slice,
873  const size_type col);
874 
875 
887  const size_type col) const;
888 
889 
901  const size_type col);
902 
903 
915  const size_type col) const;
916 
928  const size_type col);
929 
930 
942  const size_type col) const;
943 
951  //------------------------slice range iterators -----------------------
952 
980  const slip::Range<int>& range);
981 
982 
1009  slice_range_iterator slice_end(const size_type row,const size_type col,
1010  const slip::Range<int>& range);
1011 
1012 
1039  const slip::Range<int>& range) const;
1040 
1067  const slip::Range<int>& range) const;
1068 
1069 
1087  const slip::Range<int>& range);
1088 
1089 
1107  const slip::Range<int>& range);
1108 
1109 
1127  const slip::Range<int>& range) const;
1128 
1146  const slip::Range<int>& range) const;
1147 
1148 
1155  //------------------------row range iterators -----------------------
1156 
1182  row_range_iterator row_begin(const size_type slice,const size_type row,
1183  const slip::Range<int>& range);
1184 
1210  row_range_iterator row_end(const size_type slice,const size_type row,
1211  const slip::Range<int>& range);
1212 
1213 
1239  const_row_range_iterator row_begin(const size_type slice,const size_type row,
1240  const slip::Range<int>& range) const;
1241 
1242 
1267  const_row_range_iterator row_end(const size_type slice,const size_type row,
1268  const slip::Range<int>& range) const;
1269 
1285  const slip::Range<int>& range);
1286 
1287 
1305  const slip::Range<int>& range);
1306 
1307 
1308 
1323  const slip::Range<int>& range) const;
1324 
1325 
1342  const slip::Range<int>& range) const;
1343 
1349  //------------------------col range iterators -----------------------
1350 
1376  col_range_iterator col_begin(const size_type slice,const size_type col,
1377  const slip::Range<int>& range);
1378 
1405  col_range_iterator col_end(const size_type slice,const size_type col,
1406  const slip::Range<int>& range);
1407 
1408 
1434  const_col_range_iterator col_begin(const size_type slice,const size_type col,
1435  const slip::Range<int>& range) const;
1436 
1463  const_col_range_iterator col_end(const size_type slice,const size_type col,
1464  const slip::Range<int>& range) const;
1465 
1482  const slip::Range<int>& range);
1483 
1501  const slip::Range<int>& range);
1502 
1519  const slip::Range<int>& range) const;
1520 
1537  const slip::Range<int>& range) const;
1538 
1541  //****************************************************************************
1542  // One dimensionnal plane iterators
1543  //****************************************************************************
1544 
1549 
1550  //----------------------Global plane iterators------------------------------
1551 
1569  iterator plane_begin(const size_type slice);
1570 
1588  const_iterator plane_begin(const size_type slice) const;
1589 
1607  iterator plane_end(const size_type slice);
1608 
1626  const_iterator plane_end(const size_type slice) const;
1627 
1646 
1664  const_reverse_iterator plane_rbegin(const size_type slice) const;
1665 
1683  reverse_iterator plane_rend(const size_type slice);
1684 
1702  const_reverse_iterator plane_rend(const size_type slice) const;
1703 
1707 #ifdef ALL_PLANE_ITERATOR3D
1708 
1713  //-------------------row and col plane iterators----------
1714 
1715 
1727  const_iterator1d plane_row_begin(PLANE_ORIENTATION P, const size_type plane_coordinate,
1728  const size_type row) const;
1729 
1741  iterator1d plane_row_begin(PLANE_ORIENTATION P, const size_type plane_coordinate,
1742  const size_type row);
1743 
1756  iterator1d plane_row_end(PLANE_ORIENTATION P, const size_type plane_coordinate, const size_type row);
1757 
1769  const_iterator1d plane_row_end(PLANE_ORIENTATION P, const size_type plane_coordinate,const size_type row) const;
1770 
1771 
1783  reverse_iterator1d plane_row_rbegin(PLANE_ORIENTATION P, const size_type plane_coordinate,
1784  const size_type row);
1785 
1797  const_reverse_iterator1d plane_row_rbegin(PLANE_ORIENTATION P, const size_type plane_coordinate,
1798  const size_type row) const;
1799 
1811  reverse_iterator1d plane_row_rend(PLANE_ORIENTATION P, const size_type plane_coordinate, const size_type row);
1812 
1824  const_reverse_iterator1d plane_row_rend(PLANE_ORIENTATION P, const size_type plane_coordinate,const size_type row) const;
1825 
1837  iterator1d plane_col_begin(PLANE_ORIENTATION P, const size_type plane_coordinate,
1838  const size_type col);
1839 
1851  const_iterator1d plane_col_begin(PLANE_ORIENTATION P, const size_type plane_coordinate,
1852  const size_type col) const;
1853 
1865  iterator1d plane_col_end(PLANE_ORIENTATION P, const size_type plane_coordinate, const size_type col);
1866 
1878  const_iterator1d plane_col_end(PLANE_ORIENTATION P, const size_type plane_coordinate,const size_type col) const;
1879 
1880 
1892  reverse_iterator1d plane_col_rbegin(PLANE_ORIENTATION P, const size_type plane_coordinate,
1893  const size_type col);
1894 
1904  const_reverse_iterator1d plane_col_rbegin(PLANE_ORIENTATION P, const size_type plane_coordinate,
1905  const size_type col) const;
1906 
1918  reverse_iterator1d plane_col_rend(PLANE_ORIENTATION P, const size_type plane_coordinate, const size_type col);
1919 
1931  const_reverse_iterator1d plane_col_rend(PLANE_ORIENTATION P, const size_type plane_coordinate,const size_type col) const;
1932 
1939  //-------------------plane box iterators----------
1940 
1952  const_iterator1d plane_row_begin(PLANE_ORIENTATION P, const size_type plane_coordinate,
1953  const size_type row, const Box2d<int> & b) const;
1954 
1967  iterator1d plane_row_begin(PLANE_ORIENTATION P, const size_type plane_coordinate,
1968  const size_type row, const Box2d<int> & b);
1969 
1981  iterator1d plane_row_end(PLANE_ORIENTATION P, const size_type plane_coordinate,
1982  const size_type row, const Box2d<int> & b);
1983 
1996  const_iterator1d plane_row_end(PLANE_ORIENTATION P, const size_type plane_coordinate,
1997  const size_type row, const Box2d<int> & b) const;
1998 
1999 
2011  reverse_iterator1d plane_row_rbegin(PLANE_ORIENTATION P, const size_type plane_coordinate,
2012  const size_type row, const Box2d<int> & b);
2013 
2026  const_reverse_iterator1d plane_row_rbegin(PLANE_ORIENTATION P, const size_type plane_coordinate,
2027  const size_type row, const Box2d<int> & b) const;
2028 
2039  reverse_iterator1d plane_row_rend(PLANE_ORIENTATION P, const size_type plane_coordinate,
2040  const size_type row, const Box2d<int> & b);
2041 
2054  const_reverse_iterator1d plane_row_rend(PLANE_ORIENTATION P, const size_type plane_coordinate,
2055  const size_type row, const Box2d<int> & b) const;
2056 
2067  iterator1d plane_col_begin(PLANE_ORIENTATION P, const size_type plane_coordinate,
2068  const size_type col, const Box2d<int> & b);
2069 
2081  const_iterator1d plane_col_begin(PLANE_ORIENTATION P, const size_type plane_coordinate,
2082  const size_type col, const Box2d<int> & b) const;
2083 
2096  iterator1d plane_col_end(PLANE_ORIENTATION P, const size_type plane_coordinate,
2097  const size_type col, const Box2d<int> & b);
2098 
2111  const_iterator1d plane_col_end(PLANE_ORIENTATION P, const size_type plane_coordinate,
2112  const size_type col, const Box2d<int> & b) const;
2113 
2114 
2127  reverse_iterator1d plane_col_rbegin(PLANE_ORIENTATION P, const size_type plane_coordinate,
2128  const size_type col, const Box2d<int> & b);
2129 
2142  const_reverse_iterator1d plane_col_rbegin(PLANE_ORIENTATION P, const size_type plane_coordinate,
2143  const size_type col, const Box2d<int> & b) const;
2144 
2157  reverse_iterator1d plane_col_rend(PLANE_ORIENTATION P, const size_type plane_coordinate,
2158  const size_type col, const Box2d<int> & b);
2159 
2172  const_reverse_iterator1d plane_col_rend(PLANE_ORIENTATION P, const size_type plane_coordinate,
2173  const size_type col, const Box2d<int> & b) const;
2174 
2175 
2178 #endif //ALL_PLANE_ITERATOR3D
2179 
2180  //****************************************************************************
2181  // Two dimensionnal plane iterators
2182  //****************************************************************************
2183 
2188 
2208  iterator2d plane_upper_left(PLANE_ORIENTATION P, const size_type plane_coordinate);
2209 
2231  iterator2d plane_bottom_right(PLANE_ORIENTATION P, const size_type plane_coordinate);
2232 
2254  const_iterator2d plane_upper_left(PLANE_ORIENTATION P, const size_type plane_coordinate) const;
2255 
2275  const_iterator2d plane_bottom_right(PLANE_ORIENTATION P, const size_type plane_coordinate) const;
2276 
2296 
2316 
2335  const_reverse_iterator2d plane_rupper_left(PLANE_ORIENTATION P, const size_type plane_coordinate) const;
2336 
2356 
2357 
2364 
2387  iterator2d plane_upper_left(PLANE_ORIENTATION P, const size_type plane_coordinate
2388  , const Box2d<int> & b);
2389 
2412  iterator2d plane_bottom_right(PLANE_ORIENTATION P, const size_type plane_coordinate
2413  , const Box2d<int> & b);
2414 
2438  , const Box2d<int> & b) const;
2439 
2463  , const Box2d<int> & b) const;
2464 
2488  , const Box2d<int> & b);
2489 
2513  , const Box2d<int> & b);
2514 
2538  , const Box2d<int> & b) const;
2539 
2563  , const Box2d<int> & b) const;
2564 
2565 
2568  //****************************************************************************
2569  // Three dimensionnal iterators
2570  //****************************************************************************
2571 
2576 
2577  //------------------------ Global iterators------------------------------------
2578 
2596 
2597 
2615 
2616 
2634 
2635 
2653 
2671 
2689 
2707 
2708 
2726 
2733 
2734  //------------------------ Box iterators------------------------------------
2735 
2757 
2758 
2781 
2782 
2804  const_iterator3d front_upper_left(const Box3d<int>& box) const;
2805 
2806 
2829  const_iterator3d back_bottom_right(const Box3d<int>& box) const;
2830 
2831 
2832 
2848 
2864 
2880 
2881 
2897 
2898 
2906 
2907  //------------------------ Range iterators------------------------------------
2908 
2935  iterator3d_range front_upper_left(const Range<int>& slice_range, const Range<int>& row_range,
2936  const Range<int>& col_range);
2937 
2964  iterator3d_range back_bottom_right(const Range<int>& slice_range, const Range<int>& row_range,
2965  const Range<int>& col_range);
2966 
2967 
2994  const_iterator3d_range front_upper_left(const Range<int>& slice_range, const Range<int>& row_range,
2995  const Range<int>& col_range) const;
2996 
2997 
3024  const_iterator3d_range back_bottom_right(const Range<int>& slice_range, const Range<int>& row_range,
3025  const Range<int>& col_range) const;
3026 
3054  reverse_iterator3d_range rfront_upper_left(const Range<int>& slice_range, const Range<int>& row_range,
3055  const Range<int>& col_range);
3056 
3084  reverse_iterator3d_range rback_bottom_right(const Range<int>& slice_range, const Range<int>& row_range,
3085  const Range<int>& col_range);
3086 
3114  const_reverse_iterator3d_range rfront_upper_left(const Range<int>& slice_range, const Range<int>& row_range,
3115  const Range<int>& col_range) const;
3116 
3144  const_reverse_iterator3d_range rback_bottom_right(const Range<int>& slice_range, const Range<int>& row_range,
3145  const Range<int>& col_range) const;
3146 
3150  //********************************************************************
3151 
3161  friend std::ostream& operator<< <>(std::ostream & out,
3162  const self& a);
3163 
3178  self& operator=(const Matrix3d<T> & rhs);
3179 
3180 
3181 
3189  self& operator=(const T& value);
3190 
3191 
3197  void fill(const T& value)
3198  {
3199  std::fill_n(this->begin(),this->size(),value);
3200  }
3201 
3208  void fill(const T* value)
3209  {
3210  std::copy(value,value + this->size(), this->begin());
3211  }
3212 
3221  template<typename InputIterator>
3222  void fill(InputIterator first,
3223  InputIterator last)
3224  {
3225  std::copy(first,last, this->begin());
3226  }
3241  friend bool operator== <>(const Matrix3d<T>& x,
3242  const Matrix3d<T>& y);
3243 
3250  friend bool operator!= <>(const Matrix3d<T>& x,
3251  const Matrix3d<T>& y);
3252 
3259  friend bool operator< <>(const Matrix3d<T>& x,
3260  const Matrix3d<T>& y);
3261 
3268  friend bool operator> <>(const Matrix3d<T>& x,
3269  const Matrix3d<T>& y);
3270 
3277  friend bool operator<= <>(const Matrix3d<T>& x,
3278  const Matrix3d<T>& y);
3279 
3286  friend bool operator>= <>(const Matrix3d<T>& x,
3287  const Matrix3d<T>& y);
3288 
3289 
3299 
3310  T** operator[](const size_type k);
3311 
3322  const T* const* operator[](const size_type k) const;
3323 
3324 
3338  reference operator()(const size_type k,
3339  const size_type i,
3340  const size_type j);
3341 
3356  const size_type i,
3357  const size_type j) const;
3358 
3366  std::string name() const;
3367 
3368 
3369 
3374  size_type dim1() const;
3375 
3380  size_type slices() const;
3381 
3386  size_type dim2() const;
3387 
3392  size_type rows() const;
3393 
3398  size_type dim3() const;
3399 
3404  size_type cols() const;
3405 
3410  size_type columns() const;
3411 
3412 
3413 
3417  size_type size() const;
3418 
3419 
3423  size_type max_size() const;
3424 
3428  size_type slice_size() const;
3429 
3430 
3434  bool empty()const;
3435 
3444  void swap(Matrix3d& M);
3445 
3455  self& operator+=(const T& val);
3456  self& operator-=(const T& val);
3457  self& operator*=(const T& val);
3458  self& operator/=(const T& val);
3459  // self& operator%=(const T& val);
3460  // self& operator^=(const T& val);
3461  // self& operator&=(const T& val);
3462  // self& operator|=(const T& val);
3463  // self& operator<<=(const T& val);
3464  // self& operator>>=(const T& val);
3465 
3466 
3467  self operator-() const;
3468  //self operator!() const;
3469 
3470 
3471 
3472  self& operator+=(const self& rhs);
3473  self& operator-=(const self& rhs);
3474  self& operator*=(const self& rhs);
3475  self& operator/=(const self& rhs);
3476 
3477 
3489  T& min() const;
3490 
3491 
3497  T& max() const;
3498 
3503  T sum() const;
3504 
3505 
3512  Matrix3d<T>& apply(T (*fun)(T));
3513 
3520  Matrix3d<T>& apply(T (*fun)(const T&));
3521 
3524  private:
3525  Array3d<T>* array_;
3526  private:
3527  friend class boost::serialization::access;
3528  template<class Archive>
3529  void save(Archive & ar, const unsigned int version) const
3530  {
3531  ar & this->array_;
3532  }
3533  template<class Archive>
3534  void load(Archive & ar, const unsigned int version)
3535  {
3536  ar & this->array_;
3537  }
3538  BOOST_SERIALIZATION_SPLIT_MEMBER();
3539  };
3540 
3561 
3562 
3563 }//slip::
3564 
3565 
3566 namespace slip{
3575  template<typename T>
3576  Matrix3d<T> operator+(const Matrix3d<T>& M1,
3577  const Matrix3d<T>& M2);
3578 
3585  template<typename T>
3586  Matrix3d<T> operator+(const Matrix3d<T>& M1,
3587  const T& val);
3588 
3595  template<typename T>
3596  Matrix3d<T> operator+(const T& val,
3597  const Matrix3d<T>& M1);
3598 
3607  template<typename T>
3608  Matrix3d<T> operator-(const Matrix3d<T>& M1,
3609  const Matrix3d<T>& M2);
3610 
3617  template<typename T>
3618  Matrix3d<T> operator-(const Matrix3d<T>& M1,
3619  const T& val);
3620 
3627  template<typename T>
3628  Matrix3d<T> operator-(const T& val,
3629  const Matrix3d<T>& M1);
3630 
3639  template<typename T>
3640  Matrix3d<T> operator*(const Matrix3d<T>& M1,
3641  const Matrix3d<T>& M2);
3642 
3649  template<typename T>
3650  Matrix3d<T> operator*(const Matrix3d<T>& M1,
3651  const T& val);
3652 
3659  template<typename T>
3660  Matrix3d<T> operator*(const T& val,
3661  const Matrix3d<T>& M1);
3662 
3671  template<typename T>
3672  Matrix3d<T> operator/(const Matrix3d<T>& M1,
3673  const Matrix3d<T>& M2);
3674 
3681  template<typename T>
3682  Matrix3d<T> operator/(const Matrix3d<T>& M1,
3683  const T& val);
3684 
3685 
3686 
3693  template<typename T>
3694  T& min(const Matrix3d<T>& M1);
3695 
3702  template<typename T>
3703  T& max(const Matrix3d<T>& M1);
3704 
3711  template<typename T>
3712  Matrix3d<T> abs(const Matrix3d<T>& V);
3713 
3720  template<typename T>
3721  Matrix3d<T> sqrt(const Matrix3d<T>& V);
3722 
3729  template<typename T>
3730  Matrix3d<T> cos(const Matrix3d<T>& V);
3731 
3738  template<typename T>
3739  Matrix3d<T> acos(const Matrix3d<T>& V);
3740 
3747  template<typename T>
3748  Matrix3d<T> sin(const Matrix3d<T>& V);
3749 
3756  template<typename T>
3757  Matrix3d<T> asin(const Matrix3d<T>& V);
3758 
3759 
3766  template<typename T>
3767  Matrix3d<T> tan(const Matrix3d<T>& V);
3768 
3775  template<typename T>
3776  Matrix3d<T> atan(const Matrix3d<T>& V);
3777 
3784  template<typename T>
3785  Matrix3d<T> exp(const Matrix3d<T>& V);
3786 
3793  template<typename T>
3794  Matrix3d<T> log(const Matrix3d<T>& V);
3795 
3802  template<typename T>
3803  Matrix3d<T> cosh(const Matrix3d<T>& V);
3804 
3811  template<typename T>
3812  Matrix3d<T> sinh(const Matrix3d<T>& V);
3813 
3820  template<typename T>
3821  Matrix3d<T> tanh(const Matrix3d<T>& V);
3822 
3829  template<typename T>
3830  Matrix3d<T> log10(const Matrix3d<T>& V);
3831 
3832 
3833 }//slip::
3834 
3835 
3836 
3837 namespace slip
3838 {
3840  // Constructors
3842  template<typename T>
3843  inline
3845  array_(new slip::Array3d<T>())
3846  {}
3847 
3848  template<typename T>
3849  inline
3851  const typename Matrix3d<T>::size_type d2,
3852  const typename Matrix3d<T>::size_type d3):
3853  array_(new slip::Array3d<T>(d1,d2,d3))
3854  {}
3855 
3856  template<typename T>
3857  inline
3859  const typename Matrix3d<T>::size_type d2,
3860  const typename Matrix3d<T>::size_type d3,
3861  const T& val):
3862  array_(new slip::Array3d<T>(d1,d2,d3,val))
3863  {}
3864 
3865  template<typename T>
3866  inline
3868  const typename Matrix3d<T>::size_type d2,
3869  const typename Matrix3d<T>::size_type d3,
3870  const T* val):
3871  array_(new slip::Array3d<T>(d1,d2,d3,val))
3872  {}
3873 
3874 
3875  template<typename T>
3876  inline
3878  array_(new slip::Array3d<T>((*rhs.array_)))
3879  {}
3880 
3881  template<typename T>
3882  inline
3884  {
3885  delete array_;
3886  }
3887 
3889 
3890 
3892  // Assignment operators
3894  template<typename T>
3895  inline
3897  {
3898  if(this != &rhs)
3899  {
3900  *array_ = *(rhs.array_);
3901  }
3902  return *this;
3903  }
3904 
3905  template<typename T>
3906  inline
3908  {
3909  std::fill_n((*array_)[0][0],array_->size(),value);
3910  return *this;
3911  }
3912 
3913  template<typename T>
3914  inline
3916  const typename Matrix3d<T>::size_type d2,
3917  const typename Matrix3d<T>::size_type d3,
3918  const T& val)
3919  {
3920  array_->resize(d1,d2,d3,val);
3921  }
3923 
3924 
3926  // Iterators
3928 
3929  //****************************************************************************
3930  // One dimensionnal iterators
3931  //****************************************************************************
3932 
3933 
3934 
3935  //----------------------Global iterators------------------------------
3936 
3937  template<typename T>
3938  inline
3940  {
3941  return array_->begin();
3942  }
3943 
3944  template<typename T>
3945  inline
3947  {
3948  return array_->end();
3949  }
3950 
3951  template<typename T>
3952  inline
3954  {
3955  Array3d<T> const * tp(array_);
3956  return tp->begin();
3957  }
3958 
3959  template<typename T>
3960  inline
3962  {
3963  Array3d<T> const * tp(array_);
3964  return tp->end();
3965  }
3966 
3967 
3968  template<typename T>
3969  inline
3971  {
3972  return typename Matrix3d<T>::reverse_iterator(this->end());
3973  }
3974 
3975  template<typename T>
3976  inline
3978  {
3979  return typename Matrix3d<T>::reverse_iterator(this->begin());
3980  }
3981 
3982  template<typename T>
3983  inline
3985  {
3986  return typename Matrix3d<T>::const_reverse_iterator(this->end());
3987  }
3988 
3989  template<typename T>
3990  inline
3992  {
3993  return typename Matrix3d<T>::const_reverse_iterator(this->begin());
3994  }
3995 
3996  //--------------------simple slice iterators----------------------
3997 
3998  template<typename T>
3999  inline
4000  typename Matrix3d<T>::slice_iterator
4002  const typename Matrix3d<T>::size_type col)
4003  {
4004  return array_->slice_begin(row,col);
4005  }
4006 
4007  template<typename T>
4008  inline
4011  const typename Matrix3d<T>::size_type col) const
4012  {
4013  Array3d<T> const * tp(array_);
4014  return tp->slice_begin(row,col);
4015  }
4016 
4017  template<typename T>
4018  inline
4019  typename Matrix3d<T>::slice_iterator
4020  Matrix3d<T>::slice_end(const typename Matrix3d<T>::size_type row,
4021  const typename Matrix3d<T>::size_type col)
4022  {
4023  return array_->slice_end(row,col);
4024  }
4025 
4026  template<typename T>
4027  inline
4029  Matrix3d<T>::slice_end(const typename Matrix3d<T>::size_type row,
4030  const typename Matrix3d<T>::size_type col) const
4031  {
4032  Array3d<T> const * tp(array_);
4033  return tp->slice_end(row,col);
4034  }
4035 
4036 
4037  template<typename T>
4038  inline
4041  const typename Matrix3d<T>::size_type col)
4042  {
4043  return array_->slice_rbegin(row,col);
4044  }
4045 
4046  template<typename T>
4047  inline
4050  const typename Matrix3d<T>::size_type col) const
4051  {
4052  Array3d<T> const * tp(array_);
4053  return tp->slice_rbegin(row,col);
4054  }
4055 
4056  template<typename T>
4057  inline
4059  Matrix3d<T>::slice_rend(const typename Matrix3d<T>::size_type row,
4060  const typename Matrix3d<T>::size_type col)
4061  {
4062  return array_->slice_rend(row,col);
4063  }
4064 
4065 
4066  template<typename T>
4067  inline
4069  Matrix3d<T>::slice_rend(const typename Matrix3d<T>::size_type row,
4070  const typename Matrix3d<T>::size_type col) const
4071  {
4072  Array3d<T> const * tp(array_);
4073  return tp->slice_rend(row,col);
4074  }
4075 
4076  //--------------------simple row iterators----------------------
4077 
4078  template<typename T>
4079  inline
4080  typename Matrix3d<T>::row_iterator
4081  Matrix3d<T>::row_begin(const typename Matrix3d<T>::size_type slice,
4082  const typename Matrix3d<T>::size_type row)
4083  {
4084  return array_->row_begin(slice,row);
4085  }
4086 
4087  template<typename T>
4088  inline
4090  Matrix3d<T>::row_begin(const typename Matrix3d<T>::size_type slice,
4091  const typename Matrix3d<T>::size_type row) const
4092  {
4093  Array3d<T> const * tp(array_);
4094  return tp->row_begin(slice,row);
4095  }
4096 
4097  template<typename T>
4098  inline
4099  typename Matrix3d<T>::row_iterator
4100  Matrix3d<T>::row_end(const typename Matrix3d<T>::size_type slice,
4101  const typename Matrix3d<T>::size_type row)
4102  {
4103  return array_->row_end(slice,row);
4104  }
4105 
4106  template<typename T>
4107  inline
4109  Matrix3d<T>::row_end(const typename Matrix3d<T>::size_type slice,
4110  const typename Matrix3d<T>::size_type row) const
4111  {
4112  Array3d<T> const * tp(array_);
4113  return tp->row_end(slice,row);
4114  }
4115 
4116 
4117  template<typename T>
4118  inline
4120  Matrix3d<T>::row_rbegin(const typename Matrix3d<T>::size_type slice,
4121  const typename Matrix3d<T>::size_type row)
4122  {
4123  return array_->row_rbegin(slice,row);
4124  }
4125 
4126  template<typename T>
4127  inline
4129  Matrix3d<T>::row_rbegin(const typename Matrix3d<T>::size_type slice,
4130  const typename Matrix3d<T>::size_type row) const
4131  {
4132  Array3d<T> const * tp(array_);
4133  return tp->row_rbegin(slice,row);
4134  }
4135 
4136 
4137  template<typename T>
4138  inline
4140  Matrix3d<T>::row_rend(const typename Matrix3d<T>::size_type slice,
4141  const typename Matrix3d<T>::size_type row)
4142  {
4143  return array_->row_rend(slice,row);
4144  }
4145 
4146  template<typename T>
4147  inline
4149  Matrix3d<T>::row_rend(const typename Matrix3d<T>::size_type slice,
4150  const typename Matrix3d<T>::size_type row) const
4151  {
4152  Array3d<T> const * tp(array_);
4153  return tp->row_rend(slice,row);
4154  }
4155 
4156  //--------------------Simple col iterators----------------------
4157 
4158  template<typename T>
4159  inline
4160  typename Matrix3d<T>::col_iterator
4161  Matrix3d<T>::col_begin(const typename Matrix3d<T>::size_type slice,
4162  const typename Matrix3d<T>::size_type col)
4163  {
4164  return array_->col_begin(slice,col);
4165  }
4166 
4167  template<typename T>
4168  inline
4170  Matrix3d<T>::col_begin(const typename Matrix3d<T>::size_type slice,
4171  const typename Matrix3d<T>::size_type col) const
4172  {
4173  Array3d<T> const * tp(array_);
4174  return tp->col_begin(slice,col);
4175  }
4176 
4177 
4178  template<typename T>
4179  inline
4180  typename Matrix3d<T>::col_iterator
4181  Matrix3d<T>::col_end(const typename Matrix3d<T>::size_type slice,
4182  const typename Matrix3d<T>::size_type col)
4183  {
4184  return array_->col_end(slice,col);
4185  }
4186 
4187  template<typename T>
4188  inline
4190  Matrix3d<T>::col_end(const typename Matrix3d<T>::size_type slice,
4191  const typename Matrix3d<T>::size_type col) const
4192  {
4193  Array3d<T> const * tp(array_);
4194  return tp->col_end(slice,col);
4195  }
4196 
4197 
4198  template<typename T>
4199  inline
4201  Matrix3d<T>::col_rbegin(const typename Matrix3d<T>::size_type slice,
4202  const typename Matrix3d<T>::size_type col)
4203  {
4204  return array_->col_rbegin(slice,col);
4205  }
4206 
4207  template<typename T>
4208  inline
4210  Matrix3d<T>::col_rbegin(const typename Matrix3d<T>::size_type slice,
4211  const typename Matrix3d<T>::size_type col) const
4212  {
4213  Array3d<T> const * tp(array_);
4214  return tp->col_rbegin(slice,col);
4215  }
4216 
4217 
4218  template<typename T>
4219  inline
4221  Matrix3d<T>::col_rend(const typename Matrix3d<T>::size_type slice,
4222  const typename Matrix3d<T>::size_type col)
4223  {
4224  return array_->col_rend(slice,col);
4225  }
4226 
4227  template<typename T>
4228  inline
4230  Matrix3d<T>::col_rend(const typename Matrix3d<T>::size_type slice,
4231  const typename Matrix3d<T>::size_type col) const
4232  {
4233  Array3d<T> const * tp(array_);
4234  return tp->col_rend(slice,col);
4235  }
4236 
4237  //--------------------Constant slice range iterators----------------------
4238 
4239  template<typename T>
4240  inline
4243  const typename Matrix3d<T>::size_type col,
4244  const slip::Range<int>& range)
4245  {
4246  return array_->slice_begin(row,col,range);
4247  }
4248 
4249  template<typename T>
4250  inline
4253  const typename Matrix3d<T>::size_type col,
4254  const slip::Range<int>& range) const
4255  {
4256  Array3d<T> const * tp(array_);
4257  return tp->slice_begin(row,col,range);
4258  }
4259 
4260  template<typename T>
4261  inline
4263  Matrix3d<T>::slice_end(const typename Matrix3d<T>::size_type row,
4264  const typename Matrix3d<T>::size_type col,
4265  const slip::Range<int>& range)
4266  {
4267  return array_->slice_end(row,col,range);
4268  }
4269 
4270  template<typename T>
4271  inline
4274  const typename Matrix3d<T>::size_type col,
4275  const slip::Range<int>& range) const
4276  {
4277  Array3d<T> const * tp(array_);
4278  return tp->slice_end(row,col,range);
4279  }
4280 
4281  template<typename T>
4282  inline
4285  const typename Matrix3d<T>::size_type col,
4286  const slip::Range<int>& range)
4287  {
4288  return array_->slice_rbegin(row,col,range);
4289  }
4290 
4291  template<typename T>
4292  inline
4294  Matrix3d<T>::slice_rbegin(const typename Matrix3d<T>::size_type row, const typename Matrix3d<T>::size_type col,
4295  const slip::Range<int>& range) const
4296  {
4297  Array3d<T> const * tp(array_);
4298  return tp->slice_rbegin(row,col,range);
4299  }
4300 
4301  template<typename T>
4302  inline
4304  Matrix3d<T>::slice_rend(const typename Matrix3d<T>::size_type row, const typename Matrix3d<T>::size_type col,
4305  const slip::Range<int>& range)
4306  {
4307  return array_->slice_rend(row,col,range);
4308  }
4309 
4310  template<typename T>
4311  inline
4313  Matrix3d<T>::slice_rend(const typename Matrix3d<T>::size_type row, const typename Matrix3d<T>::size_type col,
4314  const slip::Range<int>& range) const
4315  {
4316  Array3d<T> const * tp(array_);
4317  return tp->slice_rend(row,col,range);
4318  }
4319 
4320 
4321  //--------------------Constant row range iterators----------------------
4322 
4323  template<typename T>
4324  inline
4326  Matrix3d<T>::row_begin(const typename Matrix3d<T>::size_type slice,
4327  const typename Matrix3d<T>::size_type row,
4328  const slip::Range<int>& range)
4329  {
4330  return array_->row_begin(slice,row,range);
4331  }
4332 
4333  template<typename T>
4334  inline
4336  Matrix3d<T>::row_begin(const typename Matrix3d<T>::size_type slice,
4337  const typename Matrix3d<T>::size_type row,
4338  const slip::Range<int>& range) const
4339  {
4340  Array3d<T> const * tp(array_);
4341  return tp->row_begin(slice,row,range);
4342  }
4343 
4344  template<typename T>
4345  inline
4347  Matrix3d<T>::row_end(const typename Matrix3d<T>::size_type slice,
4348  const typename Matrix3d<T>::size_type row,
4349  const slip::Range<int>& range)
4350  {
4351  return array_->row_end(slice,row,range);
4352  }
4353 
4354  template<typename T>
4355  inline
4357  Matrix3d<T>::row_end(const typename Matrix3d<T>::size_type slice,
4358  const typename Matrix3d<T>::size_type row,
4359  const slip::Range<int>& range) const
4360  {
4361  Array3d<T> const * tp(array_);
4362  return tp->row_end(slice,row,range);
4363  }
4364 
4365  template<typename T>
4366  inline
4368  Matrix3d<T>::row_rbegin(const typename Matrix3d<T>::size_type slice,
4369  const typename Matrix3d<T>::size_type row,
4370  const slip::Range<int>& range)
4371  {
4372  return array_->row_rbegin(slice,row,range);
4373  }
4374 
4375  template<typename T>
4376  inline
4378  Matrix3d<T>::row_rbegin(const typename Matrix3d<T>::size_type slice,
4379  const typename Matrix3d<T>::size_type row,
4380  const slip::Range<int>& range) const
4381  {
4382  Array3d<T> const * tp(array_);
4383  return tp->row_rbegin(slice,row,range);
4384  }
4385 
4386  template<typename T>
4387  inline
4389  Matrix3d<T>::row_rend(const typename Matrix3d<T>::size_type slice,
4390  const typename Matrix3d<T>::size_type row,
4391  const slip::Range<int>& range)
4392  {
4393  return array_->row_rend(slice,row,range);
4394  }
4395 
4396  template<typename T>
4397  inline
4399  Matrix3d<T>::row_rend(const typename Matrix3d<T>::size_type slice,
4400  const typename Matrix3d<T>::size_type row,
4401  const slip::Range<int>& range) const
4402  {
4403  Array3d<T> const * tp(array_);
4404  return tp->row_rend(slice,row,range);
4405  }
4406 
4407  //--------------------Constant col range iterators----------------------
4408 
4409  template<typename T>
4410  inline
4412  Matrix3d<T>::col_begin(const typename Matrix3d<T>::size_type slice,
4413  const typename Matrix3d<T>::size_type col,
4414  const slip::Range<int>& range)
4415  {
4416  return array_->col_begin(slice,col,range);
4417  }
4418 
4419  template<typename T>
4420  inline
4422  Matrix3d<T>::col_begin(const typename Matrix3d<T>::size_type slice,
4423  const typename Matrix3d<T>::size_type col,
4424  const slip::Range<int>& range) const
4425  {
4426  Array3d<T> const * tp(array_);
4427  return tp->col_begin(slice,col,range);
4428  }
4429 
4430  template<typename T>
4431  inline
4433  Matrix3d<T>::col_end(const typename Matrix3d<T>::size_type slice,
4434  const typename Matrix3d<T>::size_type col,
4435  const slip::Range<int>& range)
4436  {
4437  return array_->col_end(slice,col,range);
4438  }
4439 
4440  template<typename T>
4441  inline
4443  Matrix3d<T>::col_end(const typename Matrix3d<T>::size_type slice,
4444  const typename Matrix3d<T>::size_type col,
4445  const slip::Range<int>& range) const
4446  {
4447  Array3d<T> const * tp(array_);
4448  return tp->col_end(slice,col,range);
4449  }
4450 
4451  template<typename T>
4452  inline
4454  Matrix3d<T>::col_rbegin(const typename Matrix3d<T>::size_type slice,
4455  const typename Matrix3d<T>::size_type col,
4456  const slip::Range<int>& range)
4457  {
4458  return array_->col_rbegin(slice,col,range);
4459  }
4460 
4461  template<typename T>
4462  inline
4464  Matrix3d<T>::col_rbegin(const typename Matrix3d<T>::size_type slice,
4465  const typename Matrix3d<T>::size_type col,
4466  const slip::Range<int>& range) const
4467  {
4468  Array3d<T> const * tp(array_);
4469  return tp->col_rbegin(slice,col,range);
4470  }
4471 
4472  template<typename T>
4473  inline
4475  Matrix3d<T>::col_rend(const typename Matrix3d<T>::size_type slice,
4476  const typename Matrix3d<T>::size_type col,
4477  const slip::Range<int>& range)
4478  {
4479  return array_->col_rend(slice,col,range);
4480  }
4481 
4482  template<typename T>
4483  inline
4485  Matrix3d<T>::col_rend(const typename Matrix3d<T>::size_type slice,
4486  const typename Matrix3d<T>::size_type col,
4487  const slip::Range<int>& range) const
4488  {
4489  Array3d<T> const * tp(array_);
4490  return tp->col_rend(slice,col,range);
4491  }
4492 
4493 
4494  //-------------------plane global iterators----------
4495 
4496  template<typename T>
4497  inline
4498  typename Matrix3d<T>::iterator
4499  Matrix3d<T>::plane_begin(const typename Matrix3d<T>::size_type slice)
4500  {
4501  return array_->plane_begin(slice);
4502  }
4503 
4504  template<typename T>
4505  inline
4506  typename Matrix3d<T>::const_iterator
4507  Matrix3d<T>::plane_begin(const typename Matrix3d<T>::size_type slice) const
4508  {
4509  Array3d<T> const * tp(array_);
4510  return tp->plane_begin(slice);
4511  }
4512 
4513  template<typename T>
4514  inline
4515  typename Matrix3d<T>::iterator
4516  Matrix3d<T>::plane_end(const typename Matrix3d<T>::size_type slice)
4517  {
4518  return array_->plane_end(slice);
4519  }
4520 
4521  template<typename T>
4522  inline
4523  typename Matrix3d<T>::const_iterator
4524  Matrix3d<T>::plane_end(const typename Matrix3d<T>::size_type slice) const
4525  {
4526  Array3d<T> const * tp(array_);
4527  return tp->plane_end(slice);
4528  }
4529 
4530  template<typename T>
4531  inline
4534  {
4535  return array_->plane_rbegin(slice);
4536  }
4537 
4538  template<typename T>
4539  inline
4541  Matrix3d<T>::plane_rbegin(const typename Matrix3d<T>::size_type slice) const
4542  {
4543  Array3d<T> const * tp(array_);
4544  return tp->plane_rbegin(slice);
4545  }
4546 
4547  template<typename T>
4548  inline
4550  Matrix3d<T>::plane_rend(const typename Matrix3d<T>::size_type slice)
4551  {
4552  return array_->plane_rend(slice);
4553  }
4554 
4555  template<typename T>
4556  inline
4558  Matrix3d<T>::plane_rend(const typename Matrix3d<T>::size_type slice) const
4559  {
4560  Array3d<T> const * tp(array_);
4561  return tp->plane_rend(slice);
4562  }
4563 
4564 #ifdef ALL_PLANE_ITERATOR3D
4565 
4566  //-------------------plane row col iterators----------
4567 
4568 
4569  template<typename T>
4570  inline
4571  typename Matrix3d<T>::iterator1d
4572  Matrix3d<T>::plane_row_begin(PLANE_ORIENTATION P, const typename Matrix3d<T>::size_type plane_coordinate,
4573  const typename Matrix3d<T>::size_type row)
4574  {
4575  return array_->plane_row_begin(P,plane_coordinate,row);
4576  }
4577 
4578  template<typename T>
4579  inline
4580  typename Matrix3d<T>::const_iterator1d
4581  Matrix3d<T>::plane_row_begin(PLANE_ORIENTATION P, const typename Matrix3d<T>::size_type plane_coordinate,
4582  const typename Matrix3d<T>::size_type row) const
4583  {
4584  Array3d<T> const * tp(array_);
4585  return tp->plane_row_begin(P,plane_coordinate,row);
4586  }
4587 
4588  template<typename T>
4589  inline
4590  typename Matrix3d<T>::iterator1d
4591  Matrix3d<T>::plane_row_end(PLANE_ORIENTATION P, const typename Matrix3d<T>::size_type plane_coordinate,
4592  const typename Matrix3d<T>::size_type row)
4593  {
4594  return array_->plane_row_end(P,plane_coordinate,row);
4595  }
4596 
4597  template<typename T>
4598  inline
4599  typename Matrix3d<T>::const_iterator1d
4600  Matrix3d<T>::plane_row_end(PLANE_ORIENTATION P, const typename Matrix3d<T>::size_type plane_coordinate,
4601  const typename Matrix3d<T>::size_type row) const
4602  {
4603  Array3d<T> const * tp(array_);
4604  return tp->plane_row_end(P,plane_coordinate,row);
4605  }
4606 
4607  template<typename T>
4608  inline
4609  typename Matrix3d<T>::reverse_iterator1d
4610  Matrix3d<T>::plane_row_rbegin(PLANE_ORIENTATION P, const typename Matrix3d<T>::size_type plane_coordinate,
4611  const typename Matrix3d<T>::size_type row)
4612  {
4613  return array_->plane_row_rbegin(P,plane_coordinate,row);
4614  }
4615 
4616  template<typename T>
4617  inline
4618  typename Matrix3d<T>::const_reverse_iterator1d
4619  Matrix3d<T>::plane_row_rbegin(PLANE_ORIENTATION P, const typename Matrix3d<T>::size_type plane_coordinate,
4620  const typename Matrix3d<T>::size_type row) const
4621  {
4622  Array3d<T> const * tp(array_);
4623  return tp->plane_row_rbegin(P,plane_coordinate,row);
4624  }
4625 
4626  template<typename T>
4627  inline
4628  typename Matrix3d<T>::reverse_iterator1d
4629  Matrix3d<T>::plane_row_rend(PLANE_ORIENTATION P, const typename Matrix3d<T>::size_type plane_coordinate,
4630  const typename Matrix3d<T>::size_type row)
4631  {
4632  return array_->plane_row_rend(P,plane_coordinate,row);
4633  }
4634 
4635  template<typename T>
4636  inline
4637  typename Matrix3d<T>::const_reverse_iterator1d
4638  Matrix3d<T>::plane_row_rend(PLANE_ORIENTATION P, const typename Matrix3d<T>::size_type plane_coordinate,
4639  const typename Matrix3d<T>::size_type row) const
4640  {
4641  Array3d<T> const * tp(array_);
4642  return tp->plane_row_rend(P,plane_coordinate,row);
4643  }
4644 
4645  template<typename T>
4646  inline
4647  typename Matrix3d<T>::iterator1d
4648  Matrix3d<T>::plane_col_begin(PLANE_ORIENTATION P, const typename Matrix3d<T>::size_type plane_coordinate,
4649  const typename Matrix3d<T>::size_type col)
4650  {
4651  return array_->plane_col_begin(P,plane_coordinate,col);
4652  }
4653 
4654  template<typename T>
4655  inline
4656  typename Matrix3d<T>::const_iterator1d
4657  Matrix3d<T>::plane_col_begin(PLANE_ORIENTATION P, const typename Matrix3d<T>::size_type plane_coordinate,
4658  const typename Matrix3d<T>::size_type col) const
4659  {
4660  Array3d<T> const * tp(array_);
4661  return tp->plane_col_begin(P,plane_coordinate,col);
4662  }
4663 
4664  template<typename T>
4665  inline
4666  typename Matrix3d<T>::iterator1d
4667  Matrix3d<T>::plane_col_end(PLANE_ORIENTATION P, const typename Matrix3d<T>::size_type plane_coordinate,
4668  const typename Matrix3d<T>::size_type col)
4669  {
4670  return array_->plane_col_end(P,plane_coordinate,col);
4671  }
4672 
4673  template<typename T>
4674  inline
4675  typename Matrix3d<T>::const_iterator1d
4676  Matrix3d<T>::plane_col_end(PLANE_ORIENTATION P, const typename Matrix3d<T>::size_type plane_coordinate,
4677  const typename Matrix3d<T>::size_type col) const
4678  {
4679  Array3d<T> const * tp(array_);
4680  return tp->plane_col_end(P,plane_coordinate,col);
4681  }
4682 
4683  template<typename T>
4684  inline
4685  typename Matrix3d<T>::reverse_iterator1d
4686  Matrix3d<T>::plane_col_rbegin(PLANE_ORIENTATION P, const typename Matrix3d<T>::size_type plane_coordinate,
4687  const typename Matrix3d<T>::size_type col)
4688  {
4689  return array_->plane_col_rbegin(P,plane_coordinate,col);
4690  }
4691 
4692  template<typename T>
4693  inline
4694  typename Matrix3d<T>::const_reverse_iterator1d
4695  Matrix3d<T>::plane_col_rbegin(PLANE_ORIENTATION P, const typename Matrix3d<T>::size_type plane_coordinate,
4696  const typename Matrix3d<T>::size_type col) const
4697  {
4698  Array3d<T> const * tp(array_);
4699  return tp->plane_col_rbegin(P,plane_coordinate,col);
4700  }
4701 
4702  template<typename T>
4703  inline
4704  typename Matrix3d<T>::reverse_iterator1d
4705  Matrix3d<T>::plane_col_rend(PLANE_ORIENTATION P, const typename Matrix3d<T>::size_type plane_coordinate,
4706  const typename Matrix3d<T>::size_type col)
4707  {
4708  return array_->plane_col_rend(P,plane_coordinate,col);
4709  }
4710 
4711  template<typename T>
4712  inline
4713  typename Matrix3d<T>::const_reverse_iterator1d
4714  Matrix3d<T>::plane_col_rend(PLANE_ORIENTATION P, const typename Matrix3d<T>::size_type plane_coordinate,
4715  const typename Matrix3d<T>::size_type col) const
4716  {
4717  Array3d<T> const * tp(array_);
4718  return tp->plane_col_rend(P,plane_coordinate,col);
4719  }
4720 
4721  //-------------------plane box iterators----------
4722 
4723 
4724  template<typename T>
4725  inline
4726  typename Matrix3d<T>::const_iterator1d
4727  Matrix3d<T>::plane_row_begin(PLANE_ORIENTATION P, const typename Matrix3d<T>::size_type plane_coordinate,
4728  const size_type row, const Box2d<int> & b) const
4729  {
4730  Array3d<T> const * tp(array_);
4731  return tp->plane_row_begin(P,plane_coordinate,row,b);
4732  }
4733 
4734  template<typename T>
4735  inline
4736  typename Matrix3d<T>::iterator1d
4737  Matrix3d<T>::plane_row_begin(PLANE_ORIENTATION P, const typename Matrix3d<T>::size_type plane_coordinate,
4738  const size_type row, const Box2d<int> & b)
4739  {
4740  return array_->plane_row_begin(P,plane_coordinate,row,b);
4741  }
4742 
4743  template<typename T>
4744  inline
4745  typename Matrix3d<T>::iterator1d
4746  Matrix3d<T>:: plane_row_end(PLANE_ORIENTATION P, const typename Matrix3d<T>::size_type plane_coordinate,
4747  const size_type row, const Box2d<int> & b)
4748  {
4749  return array_->plane_row_end(P,plane_coordinate,row,b);
4750  }
4751 
4752  template<typename T>
4753  inline
4754  typename Matrix3d<T>::const_iterator1d
4755  Matrix3d<T>::plane_row_end(PLANE_ORIENTATION P, const typename Matrix3d<T>::size_type plane_coordinate,
4756  const size_type row, const Box2d<int> & b) const
4757  {
4758  Array3d<T> const * tp(array_);
4759  return tp->plane_row_end(P,plane_coordinate,row,b);
4760  }
4761 
4762  template<typename T>
4763  inline
4764  typename Matrix3d<T>::reverse_iterator1d
4765  Matrix3d<T>::plane_row_rbegin(PLANE_ORIENTATION P, const typename Matrix3d<T>::size_type plane_coordinate,
4766  const size_type row, const Box2d<int> & b)
4767  {
4768  return array_->plane_row_rbegin(P,plane_coordinate,row,b);
4769  }
4770 
4771  template<typename T>
4772  inline
4773  typename Matrix3d<T>::const_reverse_iterator1d
4774  Matrix3d<T>::plane_row_rbegin(PLANE_ORIENTATION P, const typename Matrix3d<T>::size_type plane_coordinate,
4775  const size_type row, const Box2d<int> & b) const
4776  {
4777  Array3d<T> const * tp(array_);
4778  return tp->plane_row_rbegin(P,plane_coordinate,row,b);
4779  }
4780 
4781  template<typename T>
4782  inline
4783  typename Matrix3d<T>::reverse_iterator1d
4784  Matrix3d<T>::plane_row_rend(PLANE_ORIENTATION P, const typename Matrix3d<T>::size_type plane_coordinate,
4785  const size_type row, const Box2d<int> & b)
4786  {
4787  return array_->plane_row_rend(P,plane_coordinate,row,b);
4788  }
4789 
4790  template<typename T>
4791  inline
4792  typename Matrix3d<T>::const_reverse_iterator1d
4793  Matrix3d<T>::plane_row_rend(PLANE_ORIENTATION P, const typename Matrix3d<T>::size_type plane_coordinate,
4794  const size_type row, const Box2d<int> & b) const
4795  {
4796  Array3d<T> const * tp(array_);
4797  return tp->plane_row_rend(P,plane_coordinate,row,b);
4798  }
4799 
4800  template<typename T>
4801  inline
4802  typename Matrix3d<T>::iterator1d
4803  Matrix3d<T>::plane_col_begin(PLANE_ORIENTATION P, const typename Matrix3d<T>::size_type plane_coordinate,
4804  const size_type col, const Box2d<int> & b)
4805  {
4806  return array_->plane_col_begin(P,plane_coordinate,col,b);
4807  }
4808 
4809  template<typename T>
4810  inline
4811  typename Matrix3d<T>::const_iterator1d
4812  Matrix3d<T>::plane_col_begin(PLANE_ORIENTATION P, const typename Matrix3d<T>::size_type plane_coordinate,
4813  const size_type col, const Box2d<int> & b) const
4814  {
4815  Array3d<T> const * tp(array_);
4816  return tp->plane_col_begin(P,plane_coordinate,col,b);
4817  }
4818 
4819  template<typename T>
4820  inline
4821  typename Matrix3d<T>::iterator1d
4822  Matrix3d<T>::plane_col_end(PLANE_ORIENTATION P, const typename Matrix3d<T>::size_type plane_coordinate,
4823  const size_type col, const Box2d<int> & b)
4824  {
4825  return array_->plane_col_end(P,plane_coordinate,col,b);
4826  }
4827 
4828  template<typename T>
4829  inline
4830  typename Matrix3d<T>::const_iterator1d
4831  Matrix3d<T>::plane_col_end(PLANE_ORIENTATION P, const typename Matrix3d<T>::size_type plane_coordinate,
4832  const size_type col, const Box2d<int> & b) const
4833  {
4834  Array3d<T> const * tp(array_);
4835  return tp->plane_col_end(P,plane_coordinate,col,b);
4836  }
4837 
4838  template<typename T>
4839  inline
4840  typename Matrix3d<T>::reverse_iterator1d
4841  Matrix3d<T>::plane_col_rbegin(PLANE_ORIENTATION P, const typename Matrix3d<T>::size_type plane_coordinate,
4842  const size_type col, const Box2d<int> & b)
4843  {
4844  return array_->plane_col_rbegin(P,plane_coordinate,col,b);
4845  }
4846 
4847  template<typename T>
4848  inline
4849  typename Matrix3d<T>::const_reverse_iterator1d
4850  Matrix3d<T>::plane_col_rbegin(PLANE_ORIENTATION P, const typename Matrix3d<T>::size_type plane_coordinate,
4851  const size_type col, const Box2d<int> & b) const
4852  {
4853  Array3d<T> const * tp(array_);
4854  return tp->plane_col_rbegin(P,plane_coordinate,col,b);
4855  }
4856 
4857  template<typename T>
4858  inline
4859  typename Matrix3d<T>::reverse_iterator1d
4860  Matrix3d<T>::plane_col_rend(PLANE_ORIENTATION P, const typename Matrix3d<T>::size_type plane_coordinate,
4861  const size_type col, const Box2d<int> & b)
4862  {
4863  return array_->plane_col_rend(P,plane_coordinate,col,b);
4864  }
4865 
4866  template<typename T>
4867  inline
4868  typename Matrix3d<T>::const_reverse_iterator1d
4869  Matrix3d<T>::plane_col_rend(PLANE_ORIENTATION P, const typename Matrix3d<T>::size_type plane_coordinate,
4870  const size_type col, const Box2d<int> & b) const
4871  {
4872  Array3d<T> const * tp(array_);
4873  return tp->plane_col_rend(P,plane_coordinate,col,b);
4874  }
4875 #endif //ALL_PLANE_ITERATOR3D
4876 
4877  //****************************************************************************
4878  // Two dimensionnal plane iterators
4879  //****************************************************************************
4880 
4881  //------------------------ Global iterators------------------------------------
4882 
4883  template<typename T>
4884  inline
4885  typename Matrix3d<T>::iterator2d
4886  Matrix3d<T>::plane_upper_left(PLANE_ORIENTATION P, const typename Matrix3d<T>::size_type plane_coordinate)
4887  {
4888  return array_->plane_upper_left(P,plane_coordinate);
4889  }
4890 
4891  template<typename T>
4892  inline
4893  typename Matrix3d<T>::iterator2d
4895  {
4896  return array_->plane_bottom_right(P,plane_coordinate);
4897  }
4898 
4899  template<typename T>
4900  inline
4902  Matrix3d<T>::plane_upper_left(PLANE_ORIENTATION P, const typename Matrix3d<T>::size_type plane_coordinate) const
4903  {
4904  Array3d<T> const * tp(array_);
4905  return tp->plane_upper_left(P,plane_coordinate);
4906  }
4907 
4908  template<typename T>
4909  inline
4911  Matrix3d<T>::plane_bottom_right(PLANE_ORIENTATION P, const typename Matrix3d<T>::size_type plane_coordinate) const
4912  {
4913  Array3d<T> const * tp(array_);
4914  return tp->plane_bottom_right(P,plane_coordinate);
4915  }
4916 
4917  template<typename T>
4918  inline
4920  Matrix3d<T>::plane_rupper_left(PLANE_ORIENTATION P, const typename Matrix3d<T>::size_type plane_coordinate)
4921  {
4922  return array_->plane_rupper_left(P,plane_coordinate);
4923  }
4924 
4925  template<typename T>
4926  inline
4929  {
4930  return array_->plane_rbottom_right(P,plane_coordinate);
4931  }
4932 
4933  template<typename T>
4934  inline
4936  Matrix3d<T>::plane_rupper_left(PLANE_ORIENTATION P, const typename Matrix3d<T>::size_type plane_coordinate) const
4937  {
4938  Array3d<T> const * tp(array_);
4939  return tp->plane_rupper_left(P,plane_coordinate);
4940  }
4941 
4942  template<typename T>
4943  inline
4945  Matrix3d<T>::plane_rbottom_right(PLANE_ORIENTATION P, const typename Matrix3d<T>::size_type plane_coordinate) const
4946  {
4947  Array3d<T> const * tp(array_);
4948  return tp->plane_rbottom_right(P,plane_coordinate);
4949  }
4950 
4951  //------------------------ box iterators------------------------------------
4952 
4953  template<typename T>
4954  inline
4955  typename Matrix3d<T>::iterator2d
4957  {
4958  return array_->plane_upper_left(P,plane_coordinate,b);
4959  }
4960 
4961  template<typename T>
4962  inline
4963  typename Matrix3d<T>::iterator2d
4965  {
4966  return array_->plane_bottom_right(P,plane_coordinate,b);
4967  }
4968 
4969  template<typename T>
4970  inline
4972  Matrix3d<T>::plane_upper_left(PLANE_ORIENTATION P, const typename Matrix3d::size_type plane_coordinate, const Box2d<int>& b) const
4973  {
4974  Array3d<T> const * tp(array_);
4975  return tp->plane_upper_left(P,plane_coordinate,b);
4976  }
4977 
4978  template<typename T>
4979  inline
4981  Matrix3d<T>::plane_bottom_right(PLANE_ORIENTATION P, const typename Matrix3d::size_type plane_coordinate, const Box2d<int>& b) const
4982  {
4983  Array3d<T> const * tp(array_);
4984  return tp->plane_bottom_right(P,plane_coordinate,b);
4985  }
4986 
4987  template<typename T>
4988  inline
4991  {
4992  return array_->plane_rupper_left(P,plane_coordinate,b);
4993  }
4994 
4995  template<typename T>
4996  inline
4999  {
5000  return array_->plane_rbottom_right(P,plane_coordinate,b);
5001  }
5002 
5003  template<typename T>
5004  inline
5006  Matrix3d<T>::plane_rupper_left(PLANE_ORIENTATION P, const typename Matrix3d::size_type plane_coordinate, const Box2d<int>& b) const
5007  {
5008  Array3d<T> const * tp(array_);
5009  return tp->plane_rupper_left(P,plane_coordinate,b);
5010  }
5011 
5012  template<typename T>
5013  inline
5016  const Box2d<int>& b) const
5017  {
5018  Array3d<T> const * tp(array_);
5019  return tp->plane_rbottom_right(P,plane_coordinate,b);
5020  }
5021 
5022  //****************************************************************************
5023  // Three dimensionnal iterators
5024  //****************************************************************************
5025 
5026  //------------------------ Global iterators------------------------------------
5027 
5028  template<typename T>
5029  inline
5031  {
5032  return array_->front_upper_left();
5033  }
5034 
5035  template<typename T>
5036  inline
5038  {
5039  Array3d<T> const * tp(array_);
5040  return tp->front_upper_left();
5041  }
5042 
5043  template<typename T>
5044  inline
5046  {
5047  return array_->back_bottom_right();
5048  }
5049 
5050  template<typename T>
5051  inline
5053  {
5054  Array3d<T> const * tp(array_);
5055  return tp->back_bottom_right();
5056  }
5057 
5058  template<typename T>
5059  inline
5062  {
5063  return array_->rback_bottom_right();
5064  }
5065 
5066  template<typename T>
5067  inline
5070  {
5071  Array3d<T> const * tp(array_);
5072  return tp->rback_bottom_right();
5073  }
5074 
5075  template<typename T>
5076  inline
5079  {
5080  return array_->rfront_upper_left();
5081  }
5082 
5083  template<typename T>
5084  inline
5087  {
5088  Array3d<T> const * tp(array_);
5089  return tp->rfront_upper_left();
5090  }
5091 
5092  //------------------------ Box iterators------------------------------------
5093 
5094  template<typename T>
5095  inline
5097  {
5098  return array_->front_upper_left(box);
5099  }
5100 
5101  template<typename T>
5102  inline
5104  {
5105  Array3d<T> const * tp(array_);
5106  return tp->front_upper_left(box);
5107  }
5108 
5109 
5110  template<typename T>
5111  inline
5112  typename Matrix3d<T>::iterator3d
5114  {
5115  return array_->back_bottom_right(box);
5116  }
5117 
5118  template<typename T>
5119  inline
5122  {
5123  Array3d<T> const * tp(array_);
5124  return tp->back_bottom_right(box);
5125  }
5126 
5127  template<typename T>
5128  inline
5131  {
5132  return array_->rback_bottom_right(box);
5133  }
5134 
5135  template<typename T>
5136  inline
5139  {
5140  Array3d<T> const * tp(array_);
5141  return tp->rback_bottom_right(box);
5142  }
5143 
5144  template<typename T>
5145  inline
5148  {
5149  return array_->rfront_upper_left(box);
5150  }
5151 
5152  template<typename T>
5153  inline
5156  {
5157  Array3d<T> const * tp(array_);
5158  return tp->rfront_upper_left(box);
5159  }
5160 
5161  //------------------------ Range iterators------------------------------------
5162 
5163  template<typename T>
5164  inline
5167  const Range<int>& row_range,
5168  const Range<int>& col_range)
5169  {
5170  return array_->front_upper_left(slice_range,row_range,col_range);
5171  }
5172 
5173  template<typename T>
5174  inline
5177  const Range<int>& row_range,
5178  const Range<int>& col_range)
5179  {
5180  return array_->back_bottom_right(slice_range,row_range,col_range);
5181  }
5182 
5183 
5184  template<typename T>
5185  inline
5188  const Range<int>& row_range,
5189  const Range<int>& col_range) const
5190  {
5191  Array3d<T> const * tp(array_);
5192  return tp->front_upper_left(slice_range,row_range,col_range);
5193  }
5194 
5195 
5196  template<typename T>
5197  inline
5200  const Range<int>& row_range,
5201  const Range<int>& col_range) const
5202  {
5203  Array3d<T> const * tp(array_);
5204  return tp->back_bottom_right(slice_range,row_range,col_range);
5205  }
5206 
5207  template<typename T>
5208  inline
5211  const Range<int>& row_range,
5212  const Range<int>& col_range)
5213  {
5214  return array_->rfront_upper_left(slice_range,row_range,col_range);
5215  }
5216 
5217  template<typename T>
5218  inline
5221  const Range<int>& row_range,
5222  const Range<int>& col_range) const
5223  {
5224  Array3d<T> const * tp(array_);
5225  return tp->rfront_upper_left(slice_range,row_range,col_range);
5226  }
5227 
5228  template<typename T>
5229  inline
5232  const Range<int>& row_range,
5233  const Range<int>& col_range)
5234  {
5235  return array_->rback_bottom_right(slice_range,row_range,col_range);
5236  }
5237 
5238  template<typename T>
5239  inline
5242  const Range<int>& row_range,
5243  const Range<int>& col_range) const
5244  {
5245  Array3d<T> const * tp(array_);
5246  return tp->rback_bottom_right(slice_range,row_range,col_range);
5247  }
5248 
5249 
5251 
5252 
5253 
5255  /* @{ */
5256  template <typename T>
5257  inline
5258  std::ostream& operator<<(std::ostream & out, const Matrix3d<T>& a)
5259  {
5260  out<<*(a.array_);
5261  return out;
5262  }
5263  /* @} */
5265 
5266 
5268  // Elements access operators
5270  template<typename T>
5271  inline
5272  T**
5274  {
5275  return (*array_)[k];
5276  }
5277 
5278  template<typename T>
5279  inline
5280  const T* const*
5281  Matrix3d<T>::operator[](const typename Matrix3d<T>::size_type k) const
5282  {
5283  return (*array_)[k];
5284  }
5285 
5286  template<typename T>
5287  inline
5288  typename Matrix3d<T>::reference
5290  const typename Matrix3d<T>::size_type i,
5291  const typename Matrix3d<T>::size_type j)
5292  {
5293  return (*array_)[k][i][j];
5294  }
5295 
5296  template<typename T>
5297  inline
5300  const typename Matrix3d<T>::size_type i,
5301  const typename Matrix3d<T>::size_type j) const
5302  {
5303  return (*array_)[k][i][j];
5304  }
5305 
5307 
5308  template<typename T>
5309  inline
5310  std::string
5311  Matrix3d<T>::name() const {return "Matrix3d";}
5312 
5313 
5314  template<typename T>
5315  inline
5316  typename Matrix3d<T>::size_type
5317  Matrix3d<T>::dim1() const {return array_->dim1();}
5318 
5319  template<typename T>
5320  inline
5321  typename Matrix3d<T>::size_type
5322  Matrix3d<T>::slices() const {return array_->dim1();}
5323 
5324  template<typename T>
5325  inline
5326  typename Matrix3d<T>::size_type
5327  Matrix3d<T>::dim2() const {return array_->dim2();}
5328 
5329  template<typename T>
5330  inline
5331  typename Matrix3d<T>::size_type
5332  Matrix3d<T>::rows() const {return array_->dim2();}
5333 
5334  template<typename T>
5335  inline
5336  typename Matrix3d<T>::size_type
5337  Matrix3d<T>::dim3() const {return array_->dim3();;}
5338 
5339  template<typename T>
5340  inline
5341  typename Matrix3d<T>::size_type
5342  Matrix3d<T>::cols() const {return array_->dim3();}
5343 
5344  template<typename T>
5345  inline
5346  typename Matrix3d<T>::size_type
5347  Matrix3d<T>::columns() const {return array_->dim3();;}
5348 
5349 
5350  template<typename T>
5351  inline
5352  typename Matrix3d<T>::size_type
5353  Matrix3d<T>::size() const {return array_->size();}
5354 
5355  template<typename T>
5356  inline
5357  typename Matrix3d<T>::size_type
5358  Matrix3d<T>::max_size() const {return array_->max_size();}
5359 
5360 
5361  template<typename T>
5362  inline
5363  typename Matrix3d<T>::size_type
5364  Matrix3d<T>::slice_size() const {return array_->slice_size();}
5365 
5366  template<typename T>
5367  inline
5368  bool Matrix3d<T>::empty()const {return array_->empty();}
5369 
5370  template<typename T>
5371  inline
5373  {
5374  array_->swap(*(M.array_));
5375  }
5376 
5377 
5379  // comparison operators
5381 
5382  /* @{ */
5383  template<typename T>
5384  inline
5385  bool operator==(const Matrix3d<T>& x,
5386  const Matrix3d<T>& y)
5387  {
5388  return ( x.size() == y.size()
5389  && std::equal(x.begin(),x.end(),y.begin()));
5390  }
5391 
5392  template<typename T>
5393  inline
5394  bool operator!=(const Matrix3d<T>& x,
5395  const Matrix3d<T>& y)
5396  {
5397  return !(x == y);
5398  }
5399  /* @} */
5400 
5402  /* @{ */
5403 
5404  template<typename T>
5405  inline
5406  bool operator<(const Matrix3d<T>& x,
5407  const Matrix3d<T>& y)
5408  {
5409  return std::lexicographical_compare(x.begin(), x.end(),
5410  y.begin(), y.end());
5411  }
5412 
5413 
5414  template<typename T>
5415  inline
5416  bool operator>(const Matrix3d<T>& x,
5417  const Matrix3d<T>& y)
5418  {
5419  return (y < x);
5420  }
5421 
5422  template<typename T>
5423  inline
5424  bool operator<=(const Matrix3d<T>& x,
5425  const Matrix3d<T>& y)
5426  {
5427  return !(y < x);
5428  }
5429 
5430  template<typename T>
5431  inline
5432  bool operator>=(const Matrix3d<T>& x,
5433  const Matrix3d<T>& y)
5434  {
5435  return !(x < y);
5436  }
5437  /* @} */
5438 
5440 
5441 
5443  // arithmetic and mathematic operators
5445  template<typename T>
5446  inline
5448  {
5449  std::transform(array_->begin(),array_->end(),array_->begin(),std::bind2nd(std::plus<T>(),val));
5450  return *this;
5451  }
5452 
5453  template<typename T>
5454  inline
5456  {
5457  std::transform(array_->begin(),array_->end(),array_->begin(),std::bind2nd(std::minus<T>(),val));
5458  return *this;
5459  }
5460 
5461  template<typename T>
5462  inline
5464  {
5465  std::transform(array_->begin(),array_->end(),array_->begin(),std::bind2nd(std::multiplies<T>(),val));
5466  return *this;
5467  }
5468 
5469  template<typename T>
5470  inline
5472  {
5473  std::transform(array_->begin(),array_->end(),array_->begin(),std::bind2nd(std::divides<T>(),val));
5474  return *this;
5475  }
5476 
5477  template<typename T>
5478  inline
5480  {
5481  Matrix3d<T> tmp(*this);
5482  std::transform(array_->begin(),array_->end(),tmp.begin(),std::negate<T>());
5483  return tmp;
5484  }
5485 
5486  template<typename T>
5487  inline
5489  {
5490  assert(this->dim1() == rhs.dim1());
5491  assert(this->dim2() == rhs.dim2());
5492  assert(this->dim3() == rhs.dim3());
5493 
5494  std::transform(array_->begin(),array_->end(),(*(rhs.array_)).begin(),array_->begin(),std::plus<T>());
5495  return *this;
5496  }
5497 
5498  template<typename T>
5499  inline
5501  {
5502  assert(this->dim1() == rhs.dim1());
5503  assert(this->dim2() == rhs.dim2());
5504  assert(this->dim3() == rhs.dim3());
5505  std::transform(array_->begin(),array_->end(),(*(rhs.array_)).begin(),array_->begin(),std::minus<T>());
5506  return *this;
5507  }
5508 
5509  template<typename T>
5510  inline
5512  {
5513  assert(this->dim1() == rhs.dim1());
5514  assert(this->dim2() == rhs.dim2());
5515  assert(this->dim3() == rhs.dim3());
5516  std::transform(array_->begin(),array_->end(),(*(rhs.array_)).begin(),array_->begin(),std::multiplies<T>());
5517  return *this;
5518  }
5519 
5520  template<typename T>
5521  inline
5523  {
5524  assert(this->size() == rhs.size());
5525  std::transform(array_->begin(),array_->end(),(*(rhs.array_)).begin(),array_->begin(),std::divides<T>());
5526  return *this;
5527  }
5528 
5529 
5530 
5531  template<typename T>
5532  inline
5533  T& Matrix3d<T>::min() const
5534  {
5535  assert(array_->size() != 0);
5536  return *std::min_element(array_->begin(),array_->end());
5537  }
5538 
5539  template<typename T>
5540  inline
5541  T& Matrix3d<T>::max() const
5542  {
5543  assert(array_->size() != 0);
5544  return *std::max_element(array_->begin(),array_->end());
5545  }
5546 
5547  template<typename T>
5548  inline
5550  {
5551  assert(array_->size() != 0);
5552  return std::accumulate(array_->begin(),array_->end(),T());
5553  }
5554 
5555 
5556  template<typename T>
5557  inline
5559  {
5560  slip::apply(this->begin(),this->end(),this->begin(),fun);
5561  return *this;
5562  }
5563 
5564  template<typename T>
5565  inline
5566  Matrix3d<T>& Matrix3d<T>::apply(T (*fun)(const T&))
5567  {
5568  slip::apply(this->begin(),this->end(),this->begin(),fun);
5569  return *this;
5570  }
5571 
5572 
5574  /* @{ */
5575  template<typename T>
5576  inline
5578  const Matrix3d<T>& M2)
5579  {
5580  assert(M1.dim1() == M2.dim1());
5581  assert(M1.dim2() == M2.dim2());
5582  assert(M1.dim3() == M2.dim3());
5583 
5584  Matrix3d<T> tmp(M1.dim1(),M1.dim2(),M1.dim3());
5585  std::transform(M1.begin(),M1.end(),M2.begin(),tmp.begin(),std::plus<T>());
5586  return tmp;
5587  }
5588 
5589  template<typename T>
5590  inline
5592  const T& val)
5593  {
5594  Matrix3d<T> tmp(M1);
5595  tmp+=val;
5596  return tmp;
5597  }
5598 
5599  template<typename T>
5600  inline
5601  Matrix3d<T> operator+(const T& val,
5602  const Matrix3d<T>& M1)
5603  {
5604  return M1 + val;
5605  }
5606 
5607 
5608  template<typename T>
5609  inline
5611  const Matrix3d<T>& M2)
5612  {
5613  assert(M1.dim1() == M2.dim1());
5614  assert(M1.dim2() == M2.dim2());
5615  assert(M1.dim3() == M2.dim3());
5616 
5617  Matrix3d<T> tmp(M1.dim1(),M1.dim2(),M1.dim3());
5618  std::transform(M1.begin(),M1.end(),M2.begin(),tmp.begin(),std::minus<T>());
5619  return tmp;
5620  }
5621 
5622  template<typename T>
5623  inline
5625  const T& val)
5626  {
5627  Matrix3d<T> tmp(M1);
5628  tmp-=val;
5629  return tmp;
5630  }
5631 
5632  template<typename T>
5633  inline
5634  Matrix3d<T> operator-(const T& val,
5635  const Matrix3d<T>& M1)
5636  {
5637  return -(M1 - val);
5638  }
5639 
5640  template<typename T>
5641  inline
5643  const Matrix3d<T>& M2)
5644  {
5645  assert(M1.dim1() == M2.dim1());
5646  assert(M1.dim2() == M2.dim2());
5647  assert(M1.dim3() == M2.dim3());
5648 
5649  Matrix3d<T> tmp(M1.dim1(),M1.dim2(),M1.dim3());
5650  std::transform(M1.begin(),M1.end(),M2.begin(),tmp.begin(),std::multiplies<T>());
5651  return tmp;
5652  }
5653 
5654  template<typename T>
5655  inline
5657  const T& val)
5658  {
5659  Matrix3d<T> tmp(M1);
5660  tmp*=val;
5661  return tmp;
5662  }
5663 
5664  template<typename T>
5665  inline
5666  Matrix3d<T> operator*(const T& val,
5667  const Matrix3d<T>& M1)
5668  {
5669  return M1 * val;
5670  }
5671 
5672  template<typename T>
5673  inline
5675  const Matrix3d<T>& M2)
5676  {
5677  assert(M1.dim1() == M2.dim1());
5678  assert(M1.dim2() == M2.dim2());
5679  assert(M1.dim3() == M2.dim3());
5680 
5681  Matrix3d<T> tmp(M1.dim1(),M1.dim2(),M1.dim3());
5682  std::transform(M1.begin(),M1.end(),M2.begin(),tmp.begin(),std::divides<T>());
5683  return tmp;
5684  }
5685 
5686  template<typename T>
5687  inline
5689  const T& val)
5690  {
5691  Matrix3d<T> tmp(M1);
5692  tmp/=val;
5693  return tmp;
5694  }
5695 
5696 /* @} */
5697 
5698  template<typename T>
5699  inline
5700  T& min(const Matrix3d<T>& M1)
5701  {
5702  return M1.min();
5703  }
5704 
5705  template<typename T>
5706  inline
5707  T& max(const Matrix3d<T>& M1)
5708  {
5709  return M1.max();
5710  }
5711 
5712  template<typename T>
5713  inline
5715  {
5716 
5717  Matrix3d<T> tmp(M.dim1(),M.dim2(),M.dim3());
5718  slip::apply(M.begin(),M.end(),tmp.begin(),std::abs);
5719  return tmp;
5720  }
5721 
5722  template<typename T>
5723  inline
5725  {
5726  Matrix3d<T> tmp(M.dim1(),M.dim2(),M.dim3());
5727  slip::apply(M.begin(),M.end(),tmp.begin(),std::sqrt);
5728  return tmp;
5729  }
5730 
5731  template<typename T>
5732  inline
5734  {
5735  Matrix3d<T> tmp(M.dim1(),M.dim2(),M.dim3());
5736  slip::apply(M.begin(),M.end(),tmp.begin(),std::cos);
5737  return tmp;
5738  }
5739 
5740  template<typename T>
5741  inline
5743  {
5744  Matrix3d<T> tmp(M.dim1(),M.dim2(),M.dim3());
5745  slip::apply(M.begin(),M.end(),tmp.begin(),std::acos);
5746  return tmp;
5747  }
5748 
5749  template<typename T>
5750  inline
5752  {
5753  Matrix3d<T> tmp(M.dim1(),M.dim2(),M.dim3());
5754  slip::apply(M.begin(),M.end(),tmp.begin(),std::sin);
5755  return tmp;
5756  }
5757 
5758  template<typename T>
5759  inline
5761  {
5762  Matrix3d<T> tmp(M.dim1(),M.dim2(),M.dim3());
5763  slip::apply(M.begin(),M.end(),tmp.begin(),std::asin);
5764  return tmp;
5765  }
5766 
5767  template<typename T>
5768  inline
5770  {
5771  Matrix3d<T> tmp(M.dim1(),M.dim2(),M.dim3());
5772  slip::apply(M.begin(),M.end(),tmp.begin(),std::tan);
5773  return tmp;
5774  }
5775 
5776  template<typename T>
5777  inline
5779  {
5780  Matrix3d<T> tmp(M.dim1(),M.dim2(),M.dim3());
5781  slip::apply(M.begin(),M.end(),tmp.begin(),std::atan);
5782  return tmp;
5783  }
5784 
5785  template<typename T>
5786  inline
5788  {
5789  Matrix3d<T> tmp(M.dim1(),M.dim2(),M.dim3());
5790  slip::apply(M.begin(),M.end(),tmp.begin(),std::exp);
5791  return tmp;
5792  }
5793 
5794  template<typename T>
5795  inline
5797  {
5798  Matrix3d<T> tmp(M.dim1(),M.dim2(),M.dim3());
5799  slip::apply(M.begin(),M.end(),tmp.begin(),std::log);
5800  return tmp;
5801  }
5802 
5803  template<typename T>
5804  inline
5806  {
5807  Matrix3d<T> tmp(M.dim1(),M.dim2(),M.dim3());
5808  slip::apply(M.begin(),M.end(),tmp.begin(),std::cosh);
5809  return tmp;
5810  }
5811 
5812  template<typename T>
5813  inline
5815  {
5816  Matrix3d<T> tmp(M.dim1(),M.dim2(),M.dim3());
5817  slip::apply(M.begin(),M.end(),tmp.begin(),std::sinh);
5818  return tmp;
5819  }
5820 
5821  template<typename T>
5822  inline
5824  {
5825  Matrix3d<T> tmp(M.dim1(),M.dim2(),M.dim3());
5826  slip::apply(M.begin(),M.end(),tmp.begin(),std::tanh);
5827  return tmp;
5828  }
5829 
5830  template<typename T>
5831  inline
5833  {
5834  Matrix3d<T> tmp(M.dim1(),M.dim2(),M.dim3());
5835  slip::apply(M.begin(),M.end(),tmp.begin(),std::log10);
5836  return tmp;
5837  }
5838 
5839 
5840 }//slip::
5841 
5842 #endif //SLIP_MATRIX3D_HPP
pointer iterator
Definition: Matrix3d.hpp:171
size_type dim2() const
Returns the number of rows (second dimension size) in the Matrix3d.
Definition: Matrix3d.hpp:5327
HyperVolume< T > tanh(const HyperVolume< T > &M)
bool operator!=(const Array< T > &x, const Array< T > &y)
Definition: Array.hpp:1448
Matrix3d< T > asin(const Matrix3d< T > &M)
Definition: Matrix3d.hpp:5760
This is some iterator to iterate a 3d container into a plane area defined by the subscripts of the 3d...
iterator2d plane_bottom_right(PLANE_ORIENTATION P, const size_type plane_coordinate)
Returns a read/write iterator that points to the last element of the plane in the Array3d...
std::reverse_iterator< const_col_range_iterator > const_reverse_col_range_iterator
Definition: Matrix3d.hpp:202
reverse_iterator plane_rbegin(const size_type slice)
Returns a read/write reverse iterator that points to the last element in the slice plane of the Matri...
size_type slices() const
Returns the number of slices (first dimension size) in the Matrix3d.
Definition: Matrix3d.hpp:5322
T & max(const GrayscaleImage< T > &M1)
Returns the max element of a GrayscaleImage.
value_type const & const_reference
Definition: Matrix3d.hpp:166
Matrix3d< T > cos(const Matrix3d< T > &M)
Definition: Matrix3d.hpp:5733
reverse_iterator rbegin()
Returns a read/write reverse iterator that points to the last element in the Matrix3d. Iteration is done in reverse element order.
Definition: Matrix3d.hpp:3970
reverse_slice_iterator slice_rend(const size_type row, const size_type col)
Returns a read/write iterator that points to the one before the first element of the line (row...
bool operator>=(const slip::Matrix3d< T > &x, const slip::Matrix3d< T > &y)
Definition: Matrix3d.hpp:5432
Matrix3d< T > atan(const Matrix3d< T > &M)
Definition: Matrix3d.hpp:5778
value_type const * const_pointer
Definition: Matrix3d.hpp:164
static const std::size_t DIM
Definition: Matrix3d.hpp:233
iterator3d front_upper_left()
Returns a read/write iterator3d that points to the first element of the Array3d. It points to the fro...
Definition: Array3d.hpp:4882
std::reverse_iterator< row_range_iterator > reverse_row_range_iterator
Definition: Matrix3d.hpp:199
self & operator+=(const T &val)
Add val to each element of the Matrix.
Definition: Matrix3d.hpp:5447
slip::Matrix3d< double > Matrix3d_d
double alias
Definition: Matrix3d.hpp:3542
ptrdiff_t difference_type
Definition: Matrix3d.hpp:168
T & min(const Matrix3d< T > &M1)
Definition: Matrix3d.hpp:5700
slip::stride_iterator< pointer > row_range_iterator
Definition: Matrix3d.hpp:186
reverse_iterator3d rback_bottom_right()
Returns a read/write reverse iterator3d. It points to past the front upper left element of the Array3...
Definition: Array3d.hpp:4916
HyperVolume< T > abs(const HyperVolume< T > &V)
Returns the abs value of each element of the HyperVolume.
std::reverse_iterator< iterator2d > reverse_iterator2d
Definition: Matrix3d.hpp:215
size_type dim1() const
Returns the number of slices (first dimension size) in the Matrix3d.
Definition: Matrix3d.hpp:5317
Matrix3d< T > abs(const Matrix3d< T > &M)
Definition: Matrix3d.hpp:5714
std::reverse_iterator< iterator > reverse_iterator
Definition: Matrix3d.hpp:174
Matrix3d< T > tan(const Matrix3d< T > &M)
Definition: Matrix3d.hpp:5769
slip::Matrix3d< unsigned long > Matrix3d_ul
unsigned long alias
Definition: Matrix3d.hpp:3548
size_type dim3() const
Returns the number of columns (third dimension size) in the Matrix3d.
Definition: Matrix3d.hpp:5337
This is a three-dimensional dynamic and generic container. This container statisfies the Bidirectionn...
Definition: Array3d.hpp:109
This is some iterator to iterate a 3d container into two Range defined by the indices and strides of ...
HyperVolume< T > cosh(const HyperVolume< T > &M)
const_iterator begin() const
Returns a read-only (constant) iterator that points to the first element in the Array3d. Iteration is done in ordinary element order.
Definition: Array3d.hpp:3644
const Matrix3d< T > const_self
Definition: Matrix3d.hpp:161
void swap(Matrix3d &M)
Swaps data with another Matrix3d.
Definition: Matrix3d.hpp:5372
slice_iterator slice_end(const size_type row, const size_type col)
Returns a read/write iterator that points to the one past the end element of the line (row...
T & min(const GrayscaleImage< T > &M1)
Returns the min element of a GrayscaleImage.
std::reverse_iterator< const_iterator3d_range > const_reverse_iterator3d_range
Definition: Matrix3d.hpp:227
size_type size() const
Returns the number of elements in the Matrix3d.
Definition: Matrix3d.hpp:5353
Matrix3d< T > exp(const Matrix3d< T > &M)
Definition: Matrix3d.hpp:5787
col_iterator col_begin(const size_type slice, const size_type col)
Returns a read/write iterator that points to the first element of the column column of the slice slic...
slip::stride_iterator< const_pointer > const_row_range_iterator
Definition: Matrix3d.hpp:187
self & operator*=(const T &val)
Definition: Matrix3d.hpp:5463
reverse_iterator2d plane_rupper_left(PLANE_ORIENTATION P, const size_type plane_coordinate)
Returns a read/write reverse_iterator that points to the bottom right element of the plane in the Mat...
Matrix3d< T > tanh(const Matrix3d< T > &M)
Definition: Matrix3d.hpp:5823
Color< T > operator+(const Color< T > &V1, const Color< T > &V2)
Definition: Color.hpp:602
reverse_row_iterator row_rbegin(const size_type slice, const size_type row)
Returns a read/write reverse iterator that points to the last element of the row row of the slice sli...
value_type & reference
Definition: Matrix3d.hpp:165
slip::Array3d< T >::const_iterator3d const_iterator3d
Definition: Matrix3d.hpp:220
T & max() const
Returns the max element of the Matrix according to the operator <.
Definition: Matrix3d.hpp:5541
slip::Array3d< T >::const_iterator3d_range const_iterator3d_range
Definition: Matrix3d.hpp:222
slip::stride_iterator< const_pointer > const_col_iterator
Definition: Matrix3d.hpp:183
const_iterator3d const_default_iterator
Definition: Matrix3d.hpp:231
self operator-() const
Definition: Matrix3d.hpp:5479
slip::stride_iterator< slice_iterator > slice_range_iterator
Definition: Matrix3d.hpp:184
HyperVolume< T > atan(const HyperVolume< T > &M)
reverse_col_iterator col_rend(const size_type slice, const size_type col)
Returns a read/write reverse iterator that points to the first element of the column column of the sl...
HyperVolume< T > sin(const HyperVolume< T > &V)
Returns the sin value of each element of the HyperVolume.
size_type rows() const
Returns the number of rows (second dimension size) in the Matrix3d.
Definition: Matrix3d.hpp:5332
std::reverse_iterator< iterator3d_range > reverse_iterator3d_range
Definition: Matrix3d.hpp:226
size_type slice_size() const
Returns the number of elements in a slice of the Matrix3d.
Definition: Matrix3d.hpp:5364
Matrix3d< T > cosh(const Matrix3d< T > &M)
Definition: Matrix3d.hpp:5805
const_iterator begin() const
Returns a read-only (constant) iterator that points to the first element in the Matrix3d. Iteration is done in ordinary element order.
Definition: Matrix3d.hpp:3953
HyperVolume< T > exp(const HyperVolume< T > &M)
HyperVolume< T > sinh(const HyperVolume< T > &V)
Returns the sinh value of each element of the HyperVolume.
std::reverse_iterator< const_slice_range_iterator > const_reverse_slice_range_iterator
Definition: Matrix3d.hpp:198
reverse_slice_iterator slice_rbegin(const size_type row, const size_type col)
Returns a read/write iterator that points to the last element of the line (row,col) threw the slices ...
void fill(const T *value)
Fills the container range [begin(),begin()+size()) with a copy of the value array.
Definition: Matrix3d.hpp:3208
PLANE_ORIENTATION
Choose between different plane orientations.
reverse_col_iterator col_rbegin(const size_type slice, const size_type col)
Returns a read/write reverse iterator that points to the last element of the column column of the sli...
std::reverse_iterator< const_iterator > const_reverse_row_iterator
Definition: Matrix3d.hpp:194
HyperVolume< T > abs(const HyperVolume< T > &M)
std::size_t size_type
Definition: Matrix3d.hpp:169
bool operator>(const Array< T > &x, const Array< T > &y)
Definition: Array.hpp:1469
Provides a class to manipulate iterator3d within a slip::Range. It is used to iterate throw 3d contai...
HyperVolume< T > sin(const HyperVolume< T > &M)
reverse_iterator rend()
Returns a read/write reverse iterator that points to one before the first element in the Matrix3d...
Definition: Matrix3d.hpp:3977
HyperVolume< T > tan(const HyperVolume< T > &V)
Returns the tan value of each element of the HyperVolume.
HyperVolume< T > cos(const HyperVolume< T > &M)
reverse_iterator2d plane_rbottom_right(PLANE_ORIENTATION P, const size_type plane_coordinate)
Returns a read/write reverse_iterator that points to the upper left element of the plane in the Matri...
HyperVolume< T > log10(const HyperVolume< T > &V)
Returns the log10 value of each element of the HyperVolume.
std::reverse_iterator< const_col_iterator > const_reverse_col_iterator
Definition: Matrix3d.hpp:196
Matrix3d< T > sqrt(const Matrix3d< T > &M)
Definition: Matrix3d.hpp:5724
iterator end()
Returns a read/write iterator that points one past the last element in the Array3d. Iteration is done in ordinary element order.
Definition: Array3d.hpp:3665
reverse_iterator2d plane_rupper_left(PLANE_ORIENTATION P, const size_type plane_coordinate)
Returns a read/write reverse_iterator that points to the bottom right element of the plane in the Arr...
MultivariatePolynomial< T, DIM > operator*(const MultivariatePolynomial< T, DIM > &P1, const MultivariatePolynomial< T, DIM > &P2)
pointwise multiplication of two MultivariatePolynomial
row_iterator row_begin(const size_type slice, const size_type row)
Returns a read/write iterator that points to the first element of the row row of the slice slice in t...
slip::Matrix3d< int > Matrix3d_i
int alias
Definition: Matrix3d.hpp:3554
reverse_iterator3d rfront_upper_left()
Returns a read/write reverse iterator3d. It points to the back bottom right element of the Array3d...
Definition: Array3d.hpp:4932
void resize(std::size_t d1, std::size_t d2, std::size_t d3, const T &val=T())
Resizes a Matrix3d.
Definition: Matrix3d.hpp:3915
std::reverse_iterator< iterator3d > reverse_iterator3d
Definition: Matrix3d.hpp:224
Matrix3d< T > sin(const Matrix3d< T > &M)
Definition: Matrix3d.hpp:5751
HyperVolume< T > asin(const HyperVolume< T > &V)
Returns the sin value of each element of the HyperVolume.
std::reverse_iterator< slice_iterator > reverse_slice_iterator
Definition: Matrix3d.hpp:191
std::reverse_iterator< const_slice_iterator > const_reverse_slice_iterator
Definition: Matrix3d.hpp:192
Matrix3d< T > operator-(const T &val, const Matrix3d< T > &M1)
substraction of a scalar to each element of a Matrix3d
Definition: Matrix3d.hpp:5634
self & operator/=(const T &val)
Definition: Matrix3d.hpp:5471
slip::stride_iterator< pointer > slice_iterator
Definition: Matrix3d.hpp:178
slip::Array3d< T >::iterator3d iterator3d
Definition: Matrix3d.hpp:219
reverse_iterator3d rfront_upper_left()
Returns a read/write reverse iterator3d. It points to the back bottom right element of the Matrix3d...
Definition: Matrix3d.hpp:5078
T sum() const
Returns the sum of the elements of the Matrix.
Definition: Matrix3d.hpp:5549
reverse_row_iterator row_rend(const size_type slice, const size_type row)
Returns a read/write reverse iterator that points to the first element of the row row of the slice sl...
Matrix3d< T > & apply(T(*fun)(T))
Applys the one-parameter C-function fun to each element of the Matrix3d.
Definition: Matrix3d.hpp:5558
void copy(_II first, _II last, _OI output_first)
Copy algorithm optimized for slip iterators.
Definition: copy_ext.hpp:177
slice_iterator slice_begin(const size_type row, const size_type col)
Returns a read/write iterator that points to the first element of the line (row,col) threw the slices...
std::reverse_iterator< const_iterator3d > const_reverse_iterator3d
Definition: Matrix3d.hpp:225
iterator plane_begin(const size_type slice)
Returns a read/write iterator that points to the first element in the in the slice plane of the Matri...
Provides a class to manipulate iterator2d within a slip::Box3d. It is used to iterate throw 3d contai...
MultivariatePolynomial< T, DIM > operator-(const MultivariatePolynomial< T, DIM > &P1, const MultivariatePolynomial< T, DIM > &P2)
pointwise substraction of two MultivariatePolynomial
pointer row_iterator
Definition: Matrix3d.hpp:180
slip::stride_iterator< const_col_iterator > const_col_range_iterator
Definition: Matrix3d.hpp:189
Matrix3d< T > log10(const Matrix3d< T > &M)
Definition: Matrix3d.hpp:5832
col_iterator col_end(const size_type slice, const size_type col)
Returns a read/write iterator that points to the past-the-end element of the column column of the sli...
iterator2d plane_bottom_right(PLANE_ORIENTATION P, const size_type plane_coordinate)
Returns a read/write iterator that points to the last element of the plane in the Matrix3d...
T & max(const Matrix3d< T > &M1)
Definition: Matrix3d.hpp:5707
T & min(const GrayscaleImage< T > &M1)
Returns the min element of a GrayscaleImage.
HyperVolume< T > sqrt(const HyperVolume< T > &M)
std::reverse_iterator< slice_range_iterator > reverse_slice_range_iterator
Definition: Matrix3d.hpp:197
reverse_iterator3d rback_bottom_right()
Returns a read/write reverse iterator3d. It points to past the front upper left element of the Matrix...
Definition: Matrix3d.hpp:5061
HyperVolume< T > cos(const HyperVolume< T > &V)
Returns the cos value of each element of the HyperVolume.
iterator plane_end(const size_type slice)
Returns a read/write iterator that points one past the last element in the slice plane of the Matrix3...
HyperVolume< T > sinh(const HyperVolume< T > &M)
reverse_iterator2d plane_rbottom_right(PLANE_ORIENTATION P, const size_type plane_coordinate)
Returns a read/write reverse_iterator that points to the upper left element of the plane in the Array...
std::reverse_iterator< col_range_iterator > reverse_col_range_iterator
Definition: Matrix3d.hpp:201
row_iterator row_end(const size_type slice, const size_type row)
Returns a read/write iterator that points to the past-the-end element of the row row of the slice sli...
MultivariatePolynomial< T, DIM > operator/(const MultivariatePolynomial< T, DIM > &P, const T &val)
division of a scalar to each element of a MultivariatePolynomial
slip::Array3d< T >::iterator3d_range iterator3d_range
Definition: Matrix3d.hpp:221
size_type columns() const
Returns the number of columns (third dimension size) in the Matrix3d.
Definition: Matrix3d.hpp:5347
Provides a class to iterate 3d containers throw a planes.
slip::stride_iterator< const_slice_iterator > const_slice_range_iterator
Definition: Matrix3d.hpp:185
const_pointer const_row_iterator
Definition: Matrix3d.hpp:181
This is some iterator to iterate a 3d container into a Box area defined by the subscripts of the 3d c...
slip::Matrix3d< char > Matrix3d_c
char alias
Definition: Matrix3d.hpp:3558
slip::Array3d< T >::iterator2d iterator2d
Definition: Matrix3d.hpp:213
self & operator-=(const T &val)
Definition: Matrix3d.hpp:5455
iterator2d plane_upper_left(PLANE_ORIENTATION P, const size_type plane_coordinate)
Returns a read/write iterator that points to the first element of the plane in the Array3d...
std::reverse_iterator< col_iterator > reverse_col_iterator
Definition: Matrix3d.hpp:195
slip::Matrix3d< float > Matrix3d_f
float alias
Definition: Matrix3d.hpp:3544
iterator3d back_bottom_right()
Returns a read/write iterator3d that points to the past the end element of the Array3d. It points to past the end element of the back bottom right element of the Array3d.
Definition: Array3d.hpp:4897
iterator3d default_iterator
Definition: Matrix3d.hpp:230
HyperVolume< T > tanh(const HyperVolume< T > &V)
Returns the tanh value of each element of the HyperVolume.
HyperVolume< T > atan(const HyperVolume< T > &V)
Returns the atan value of each element of the HyperVolume.
Matrix3d(const size_type d1, const size_type d2, const size_type d3, InputIterator first, InputIterator last)
Contructs a Matrix3d from a range.
Definition: Matrix3d.hpp:296
std::string name() const
Returns the name of the class.
Definition: Matrix3d.hpp:5311
bool operator!=(const slip::Matrix3d< T > &x, const slip::Matrix3d< T > &y)
Definition: Matrix3d.hpp:5394
slip::Matrix3d< unsigned char > Matrix3d_uc
unsigned char alias
Definition: Matrix3d.hpp:3560
std::reverse_iterator< iterator > reverse_row_iterator
Definition: Matrix3d.hpp:193
HyperVolume< T > log(const HyperVolume< T > &M)
slip::Matrix3d< long > Matrix3d_l
long alias
Definition: Matrix3d.hpp:3546
HyperVolume< T > acos(const HyperVolume< T > &V)
Returns the acos value of each element of the HyperVolume.
slip::Array3d< T >::const_iterator2d const_iterator2d
Definition: Matrix3d.hpp:214
size_type cols() const
Returns the number of columns (third dimension size) in the Matrix3d.
Definition: Matrix3d.hpp:5342
HyperVolume< T > cosh(const HyperVolume< T > &V)
Returns the cosh value of each element of the HyperVolume.
Matrix3d()
Constructs a Matrix3d.
Definition: Matrix3d.hpp:3844
void fill(InputIterator first, InputIterator last)
Fills the container range [begin(),begin()+size()) with a copy of the range [first,last)
Definition: Matrix3d.hpp:3222
bool empty() const
Returns true if the Matrix3d is empty. (Thus size() == 0)
Definition: Matrix3d.hpp:5368
This is some iterator to iterate a 3d container into two Range defined by the indices and strides of ...
bool operator>(const slip::Matrix3d< T > &x, const slip::Matrix3d< T > &y)
Definition: Matrix3d.hpp:5416
slip::stride_iterator< const_pointer > const_slice_iterator
Definition: Matrix3d.hpp:179
HyperVolume< T > acos(const HyperVolume< T > &M)
value_type * pointer
Definition: Matrix3d.hpp:163
reverse_iterator plane_rend(const size_type slice)
Returns a read/write reverse iterator that points to one before the first element in the slice plane ...
HyperVolume< T > log10(const HyperVolume< T > &M)
Provides a class to manipulate 3d dynamic and generic arrays.
size_type max_size() const
Returns the maximal size (number of elements) in the Matrix3d.
Definition: Matrix3d.hpp:5358
std::reverse_iterator< const_iterator > const_reverse_iterator
Definition: Matrix3d.hpp:175
HyperVolume< T > sqrt(const HyperVolume< T > &V)
Returns the sqrt value of each element of the HyperVolume.
This is some iterator to iterate a 3d container into a plane area defined by the subscripts of the 3d...
Provides some algorithms to apply C like functions to ranges.
bool operator==(const slip::Matrix3d< T > &x, const slip::Matrix3d< T > &y)
Definition: Matrix3d.hpp:5385
slip::Matrix3d< unsigned short > Matrix3d_us
unsigned long alias
Definition: Matrix3d.hpp:3552
void fill(const T &value)
Fills the container range [begin(),begin()+size()) with copies of value.
Definition: Matrix3d.hpp:3197
iterator2d plane_upper_left(PLANE_ORIENTATION P, const size_type plane_coordinate)
Returns a read/write iterator that points to the first element of the plane in the Matrix3d...
Provides a class to iterate a 1d range according to a step.
slip::Matrix3d< unsigned int > Matrix3d_ui
unsigned int alias
Definition: Matrix3d.hpp:3556
~Matrix3d()
Destructor of the Matrix3d.
Definition: Matrix3d.hpp:3883
HyperVolume< T > tan(const HyperVolume< T > &M)
slip::stride_iterator< pointer > col_iterator
Definition: Matrix3d.hpp:182
slip::Matrix3d< short > Matrix3d_s
short alias
Definition: Matrix3d.hpp:3550
const_pointer const_iterator
Definition: Matrix3d.hpp:172
bool operator==(const Array< T > &x, const Array< T > &y)
Definition: Array.hpp:1439
HyperVolume< T > asin(const HyperVolume< T > &M)
std::reverse_iterator< const_iterator2d > const_reverse_iterator2d
Definition: Matrix3d.hpp:216
Matrix3d< T > acos(const Matrix3d< T > &M)
Definition: Matrix3d.hpp:5742
Matrix3d< T > log(const Matrix3d< T > &M)
Definition: Matrix3d.hpp:5796
HyperVolume< T > log(const HyperVolume< T > &V)
Returns the log value of each element of the HyperVolume.
T ** operator[](const size_type k)
Subscript access to the slice datas contained in the GenericMultiComponent3d.
MultivariatePolynomial< T, DIM > operator+(const MultivariatePolynomial< T, DIM > &P1, const MultivariatePolynomial< T, DIM > &P2)
pointwise addition of two MultivariatePolynomial
Color< T > operator*(const Color< T > &V1, const Color< T > &V2)
Definition: Color.hpp:658
iterator end()
Returns a read/write iterator that points one past the last element in the Matrix3d. Iteration is done in ordinary element order.
Definition: Matrix3d.hpp:3946
std::reverse_iterator< const_row_range_iterator > const_reverse_row_range_iterator
Definition: Matrix3d.hpp:200
T & min() const
Returns the min element of the Matrix according to the operator <.
Definition: Matrix3d.hpp:5533
slip::stride_iterator< col_iterator > col_range_iterator
Definition: Matrix3d.hpp:188
reference operator()(const size_type k, const size_type i, const size_type j)
Subscript access to the data contained in the Matrix3d.
void apply(InputIterator first, InputIterator last, OutputIterator result, typename std::iterator_traits< OutputIterator >::value_type(*function)(typename std::iterator_traits< InputIterator >::value_type))
Applies a C-function to each element of a range.
Definition: apply.hpp:128
T & max(const GrayscaleImage< T > &M1)
Returns the max element of a GrayscaleImage.
Color< T > operator/(const Color< T > &V1, const Color< T > &V2)
Definition: Color.hpp:686
Matrix3d< T > sinh(const Matrix3d< T > &M)
Definition: Matrix3d.hpp:5814
iterator3d front_upper_left()
Returns a read/write iterator3d that points to the first element of the Matrix3d. It points to the fr...
Definition: Matrix3d.hpp:5030
iterator3d back_bottom_right()
Returns a read/write iterator3d that points to the past the end element of the Matrix3d. It points to past the end element of the back bottom right element of the Matrix3d.
Definition: Matrix3d.hpp:5045
bool operator>=(const Array< T > &x, const Array< T > &y)
Definition: Array.hpp:1485
Color< T > operator-(const Color< T > &V1, const Color< T > &V2)
Definition: Color.hpp:630
self & operator=(const Matrix3d< T > &rhs)
Assign a Matrix3d.
Definition: Matrix3d.hpp:3896
HyperVolume< T > exp(const HyperVolume< T > &V)
Returns the exp value of each element of the HyperVolume.
This is some iterator to iterate a 3d container into a Box area defined by the subscripts of the 3d c...