SLIP  1.4
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GenericMultiComponent4d.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 
74 #ifndef SLIP_GENERICMULTICOMPONENT4D_HPP
75 #define SLIP_GENERICMULTICOMPONENT4D_HPP
76 
77 #include <iostream>
78 #include <iterator>
79 #include <cassert>
80 #include <numeric>
81 #include <cmath>
82 #include <string>
83 #include <vector>
84 #include <cstddef>
85 #include "Matrix4d.hpp"
86 #include "Matrix.hpp"
87 #include "stride_iterator.hpp"
88 #include "kstride_iterator.hpp"
89 #include "apply.hpp"
90 #include "iterator4d_box.hpp"
91 #include "iterator4d_range.hpp"
92 
95 
96 #include <boost/serialization/access.hpp>
97 #include <boost/serialization/split_member.hpp>
98 #include <boost/serialization/version.hpp>
99 
100 namespace slip
101 {
102 
103 template<class Block>
104 class stride_iterator;
105 
106 }//slip::
107 
108 namespace slip
109 {
110 
111 template <class Block>
112 class DPoint4d;
113 
114 template <class Block>
115 class Point4d;
116 
117 template <class Block>
118 class Box4d;
119 
120 template <typename Block>
122 
123 template <typename Block>
124 class Matrix4d;
125 
126 template <class MultiComponentContainer4D, std::size_t N>
128 
129 template <class MultiComponentContainer4d, std::size_t N>
131 
132 template <typename Block>
133 std::ostream& operator<<(std::ostream & out, const GenericMultiComponent4d<Block>& a);
134 
135 template<typename Block>
138 
139 template<typename Block>
142 
143 // template<typename Block>
144 // bool operator<(const GenericMultiComponent4d<Block>& x,
145 // const GenericMultiComponent4d<Block>& y);
146 
147 // template<typename Block>
148 // bool operator>(const GenericMultiComponent4d<Block>& x,
149 // const GenericMultiComponent4d<Block>& y);
150 
151 // template<typename Block>
152 // bool operator<=(const GenericMultiComponent4d<Block>& x,
153 // const GenericMultiComponent4d<Block>& y);
154 
155 // template<typename Block>
156 // bool operator>=(const GenericMultiComponent4d<Block>& x,
157 // const GenericMultiComponent4d<Block>& y);
158 
189 template <typename Block>
191 {
192 public :
193 
194  typedef Block value_type;
197  typedef value_type* pointer;
198  typedef value_type const * const_pointer;
200  typedef value_type const & const_reference;
201 
202  typedef ptrdiff_t difference_type;
203  typedef std::size_t size_type;
204 
205  typedef pointer iterator;
207 
208  typedef std::reverse_iterator<iterator> reverse_iterator;
209  typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
210 
211  //slab, slice, row and col iterators
220  //slab, slice, row and col range iterators
229  //slab, slice, row and col reverse iterators
230  typedef std::reverse_iterator<slab_iterator> reverse_slab_iterator;
231  typedef std::reverse_iterator<const_slab_iterator> const_reverse_slab_iterator;
232  typedef std::reverse_iterator<slice_iterator> reverse_slice_iterator;
233  typedef std::reverse_iterator<const_slice_iterator> const_reverse_slice_iterator;
234  typedef std::reverse_iterator<iterator> reverse_row_iterator;
235  typedef std::reverse_iterator<const_iterator> const_reverse_row_iterator;
236  typedef std::reverse_iterator<col_iterator> reverse_col_iterator;
237  typedef std::reverse_iterator<const_col_iterator> const_reverse_col_iterator;
238  //slab, slice, row and col reverse range iterators
239  typedef std::reverse_iterator<slab_range_iterator> reverse_slab_range_iterator;
240  typedef std::reverse_iterator<const_slab_range_iterator> const_reverse_slab_range_iterator;
241  typedef std::reverse_iterator<slice_range_iterator> reverse_slice_range_iterator;
242  typedef std::reverse_iterator<const_slice_range_iterator> const_reverse_slice_range_iterator;
243  typedef std::reverse_iterator<row_range_iterator> reverse_row_range_iterator;
244  typedef std::reverse_iterator<const_row_range_iterator> const_reverse_row_range_iterator;
245  typedef std::reverse_iterator<col_range_iterator> reverse_col_range_iterator;
246  typedef std::reverse_iterator<const_col_range_iterator> const_reverse_col_range_iterator;
247 
248  //Component iterators
249  typedef typename Block::value_type block_value_type;
256  //Component reverse iterators
257  typedef std::reverse_iterator<component_iterator> reverse_component_iterator;
258  typedef std::reverse_iterator<const_component_iterator> const_reverse_component_iterator;
259 
260  //component slab, slice, row and col iterator
269  //component slab, slice, row and col range iterator
278  //component slab, slice, row and col reverse iterator
279  typedef std::reverse_iterator<component_slab_iterator> reverse_component_slab_iterator;
280  typedef std::reverse_iterator<const_component_slab_iterator> const_reverse_component_slab_iterator;
281  typedef std::reverse_iterator<component_slice_iterator> reverse_component_slice_iterator;
282  typedef std::reverse_iterator<const_component_slice_iterator> const_reverse_component_slice_iterator;
283  typedef std::reverse_iterator<component_row_iterator> reverse_component_row_iterator;
284  typedef std::reverse_iterator<const_component_row_iterator> const_reverse_component_row_iterator;
285  typedef std::reverse_iterator<component_col_iterator> reverse_component_col_iterator;
286  typedef std::reverse_iterator<const_component_col_iterator> const_reverse_component_col_iterator;
287  //component slab, slice, row and col reverse range iterator
288  typedef std::reverse_iterator<component_slab_range_iterator> reverse_component_slab_range_iterator;
289  typedef std::reverse_iterator<const_component_slab_range_iterator> const_reverse_component_slab_range_iterator;
290  typedef std::reverse_iterator<component_slice_range_iterator> reverse_component_slice_range_iterator;
291  typedef std::reverse_iterator<const_component_slice_range_iterator> const_reverse_component_slice_range_iterator;
292  typedef std::reverse_iterator<component_row_range_iterator> reverse_component_row_range_iterator;
293  typedef std::reverse_iterator<const_component_row_range_iterator> const_reverse_component_row_range_iterator;
294  typedef std::reverse_iterator<component_col_range_iterator> reverse_component_col_range_iterator;
295  typedef std::reverse_iterator<const_component_col_range_iterator> const_reverse_component_col_range_iterator;
296 
297  //iterator 4d
302  //iterator reverse 4d
303  typedef std::reverse_iterator<iterator4d> reverse_iterator4d;
304  typedef std::reverse_iterator<const_iterator4d> const_reverse_iterator4d;
305  typedef std::reverse_iterator<iterator4d_range> reverse_iterator4d_range;
306  typedef std::reverse_iterator<const_iterator4d_range> const_reverse_iterator4d_range;
307 
308 
309  //component iterator 4d
314  //component reverse iterator 4d
315  typedef std::reverse_iterator<component_iterator4d> reverse_component_iterator4d;
316  typedef std::reverse_iterator<const_component_iterator4d> const_reverse_component_iterator4d;
317  typedef std::reverse_iterator<component_iterator4d_range> reverse_component_iterator4d_range;
318  typedef std::reverse_iterator<const_component_iterator4d_range> const_reverse_component_iterator4d_range;
319 
320 
321  //default iterator of the container
324 
325 
326  static const std::size_t DIM = 4;
327  static const std::size_t COMPONENTS = Block::SIZE;
328 
329 public:
334 
339 
348  const size_type rows,
349  const size_type cols);
350 
360  const size_type rows,
361  const size_type cols,
362  const Block& val);
363 
373  const size_type rows,
374  const size_type cols,
375  typename Block::const_pointer val);
376 
386  const size_type rows,
387  const size_type cols,
388  const Block* val);
389 
390 
403  template<typename InputIterator>
405  const size_type rows,
406  const size_type cols,
407  InputIterator first,
408  InputIterator last)
409  {
410  matrix_ = new Matrix4d<Block>(slabs,slices,rows,cols,first,last);
411  }
412 
428  template<typename InputIterator>
430  const size_type rows,
431  const size_type cols,
432  std::vector<InputIterator> first_iterators_list,
433  InputIterator last)
434 
435  {
436  matrix_ = new Matrix4d<Block>(slabs,slices,rows,cols);
437  this->fill(first_iterators_list,last);
438  }
439 
440 
444  GenericMultiComponent4d(const self& rhs);
445 
449  virtual ~GenericMultiComponent4d();
450 
451 
463  void resize(const size_type slabs,
464  const size_type slices,
465  const size_type rows,
466  const size_type cols,
467  const Block& val = Block());
468 
473 
474  //****************************************************************************
475  // One dimensional iterators
476  //****************************************************************************
477 
478 
479 
480  //----------------------Global iterators------------------------------
481 
499  iterator begin();
500 
520  const_iterator begin() const;
521 
539  iterator end();
540 
556  const_iterator end() const;
557 
576 
595 
614 
633 
640  //--------------------One dimensional slab iterators----------------------
641 
660  slab_iterator slab_begin(const size_type slice, const size_type row, const size_type col);
661 
680  const_slab_iterator slab_begin(const size_type slice, const size_type row, const size_type col) const;
681 
700  slab_iterator slab_end(const size_type slice, const size_type row, const size_type col);
701 
720  const_slab_iterator slab_end(const size_type slice, const size_type row, const size_type col) const;
721 
722 
742  reverse_slab_iterator slab_rbegin(const size_type slice, const size_type row, const size_type col);
743 
763  const_reverse_slab_iterator slab_rbegin(const size_type slice, const size_type row, const size_type col) const;
764 
784  reverse_slab_iterator slab_rend(const size_type slice, const size_type row, const size_type col);
785 
786 
806  const_reverse_slab_iterator slab_rend(const size_type slice, const size_type row, const size_type col) const;
807 
815  //--------------------One dimensional slice iterators----------------------
816 
836  slice_iterator slice_begin(const size_type slab, const size_type row, const size_type col);
837 
857  const_slice_iterator slice_begin(const size_type slab, const size_type row, const size_type col) const;
858 
878  slice_iterator slice_end(const size_type slab, const size_type row, const size_type col);
879 
899  const_slice_iterator slice_end(const size_type slab, const size_type row, const size_type col) const;
900 
901 
921  reverse_slice_iterator slice_rbegin(const size_type slab, const size_type row, const size_type col);
922 
942  const_reverse_slice_iterator slice_rbegin(const size_type slab, const size_type row, const size_type col) const;
943 
963  reverse_slice_iterator slice_rend(const size_type slab, const size_type row, const size_type col);
964 
965 
986  const size_type row, const size_type col) const;
987 
994  //-------------------row iterators----------
995 
1008  row_iterator row_begin(const size_type slab, const size_type slice,
1009  const size_type row);
1010 
1023  const_row_iterator row_begin(const size_type slab, const size_type slice,
1024  const size_type row) const;
1025 
1026 
1039  row_iterator row_end(const size_type slab, const size_type slice,
1040  const size_type row);
1041 
1042 
1055  const_row_iterator row_end(const size_type slab, const size_type slice,
1056  const size_type row) const;
1057 
1058 
1071  reverse_row_iterator row_rbegin(const size_type slab, const size_type slice,
1072  const size_type row);
1073 
1086  const_reverse_row_iterator row_rbegin(const size_type slab, const size_type slice,
1087  const size_type row) const;
1088 
1089 
1102  reverse_row_iterator row_rend(const size_type slab, const size_type slice,
1103  const size_type row);
1104 
1105 
1118  const_reverse_row_iterator row_rend(const size_type slab, const size_type slice,
1119  const size_type row) const;
1120 
1121 
1127  //-------------------Constant col iterators----------
1128 
1141  col_iterator col_begin(const size_type slab, const size_type slice,
1142  const size_type col);
1143 
1144 
1157  const_col_iterator col_begin(const size_type slab, const size_type slice,
1158  const size_type col) const;
1159 
1172  col_iterator col_end(const size_type slab, const size_type slice,
1173  const size_type col);
1174 
1175 
1188  const_col_iterator col_end(const size_type slab, const size_type slice,
1189  const size_type col) const;
1190 
1191 
1204  reverse_col_iterator col_rbegin(const size_type slab, const size_type slice,
1205  const size_type col);
1206 
1207 
1220  const_reverse_col_iterator col_rbegin(const size_type slab, const size_type slice,
1221  const size_type col) const;
1222 
1235  reverse_col_iterator col_rend(const size_type slab, const size_type slice,
1236  const size_type col);
1237 
1238 
1251  const_reverse_col_iterator col_rend(const size_type slab, const size_type slice,
1252  const size_type col) const;
1253 
1254 
1261  //------------------------slab range iterators -----------------------
1262 
1288  slab_range_iterator slab_begin(const size_type slice, const size_type row,const size_type col,
1289  const slip::Range<int>& range);
1290 
1291 
1318  slab_range_iterator slab_end(const size_type slice, const size_type row,const size_type col,
1319  const slip::Range<int>& range);
1320 
1321 
1348  const_slab_range_iterator slab_begin(const size_type slice, const size_type row,const size_type col,
1349  const slip::Range<int>& range) const;
1350 
1377  const_slab_range_iterator slab_end(const size_type slice, const size_type row,const size_type col,
1378  const slip::Range<int>& range) const;
1379 
1380 
1407  reverse_slab_range_iterator slab_rbegin(const size_type slice, const size_type row,const size_type col,
1408  const slip::Range<int>& range);
1409 
1410 
1437  reverse_slab_range_iterator slab_rend(const size_type slice, const size_type row,const size_type col,
1438  const slip::Range<int>& range);
1439 
1440 
1468  const slip::Range<int>& range) const;
1469 
1496  const_reverse_slab_range_iterator slab_rend(const size_type slice, const size_type row,const size_type col,
1497  const slip::Range<int>& range) const;
1498 
1499 
1506  //------------------------slice range iterators -----------------------
1507 
1534  slice_range_iterator slice_begin(const size_type slab, const size_type row, const size_type col,
1535  const slip::Range<int>& range);
1536 
1537 
1564  slice_range_iterator slice_end(const size_type slab, const size_type row, const size_type col,
1565  const slip::Range<int>& range);
1566 
1567 
1594  const_slice_range_iterator slice_begin(const size_type slab, const size_type row, const size_type col,
1595  const slip::Range<int>& range) const;
1596 
1623  const_slice_range_iterator slice_end(const size_type slab, const size_type row, const size_type col,
1624  const slip::Range<int>& range) const;
1625 
1626 
1653  reverse_slice_range_iterator slice_rbegin(const size_type slab, const size_type row, const size_type col,
1654  const slip::Range<int>& range);
1655 
1656 
1683  reverse_slice_range_iterator slice_rend(const size_type slab, const size_type row, const size_type col,
1684  const slip::Range<int>& range);
1685 
1686 
1714  const slip::Range<int>& range) const;
1715 
1743  const slip::Range<int>& range) const;
1744 
1745 
1752  //------------------------row range iterators -----------------------
1753 
1780  row_range_iterator row_begin(const size_type slab, const size_type slice, const size_type row,
1781  const slip::Range<int>& range);
1782 
1809  row_range_iterator row_end(const size_type slab, const size_type slice, const size_type row,
1810  const slip::Range<int>& range);
1811 
1812 
1839  const_row_range_iterator row_begin(const size_type slab, const size_type slice, const size_type row,
1840  const slip::Range<int>& range) const;
1841 
1842 
1868  const_row_range_iterator row_end(const size_type slab, const size_type slice, const size_type row,
1869  const slip::Range<int>& range) const;
1870 
1896  reverse_row_range_iterator row_rbegin(const size_type slab, const size_type slice, const size_type row,
1897  const slip::Range<int>& range);
1898 
1899 
1926  reverse_row_range_iterator row_rend(const size_type slab, const size_type slice, const size_type row,
1927  const slip::Range<int>& range);
1928 
1929 
1930 
1955  const_reverse_row_range_iterator row_rbegin(const size_type slab, const size_type slice, const size_type row,
1956  const slip::Range<int>& range) const;
1957 
1958 
1985  const_reverse_row_range_iterator row_rend(const size_type slab, const size_type slice, const size_type row,
1986  const slip::Range<int>& range) const;
1987 
1993  //------------------------col range iterators -----------------------
1994 
1995 
2022  col_range_iterator col_begin(const size_type slab, const size_type slice, const size_type col,
2023  const slip::Range<int>& range);
2024 
2051  col_range_iterator col_end(const size_type slab, const size_type slice, const size_type col,
2052  const slip::Range<int>& range);
2053 
2054 
2081  const_col_range_iterator col_begin(const size_type slab, const size_type slice, const size_type col,
2082  const slip::Range<int>& range) const;
2083 
2084 
2111  const_col_range_iterator col_end(const size_type slab, const size_type slice, const size_type col,
2112  const slip::Range<int>& range) const;
2113 
2140  reverse_col_range_iterator col_rbegin(const size_type slab, const size_type slice,
2141  const size_type col, const slip::Range<int>& range);
2142 
2169  reverse_col_range_iterator col_rend(const size_type slab, const size_type slice,
2170  const size_type col, const slip::Range<int>& range);
2171 
2199  const size_type col, const slip::Range<int>& range) const;
2200 
2228  const size_type col, const slip::Range<int>& range) const;
2229 
2233  //****************************************************************************
2234  // Four dimensional iterators
2235  //****************************************************************************
2236 
2241 
2242  //------------------------ Global iterators------------------------------------
2243 
2261 
2262 
2280 
2281 
2299 
2300 
2318 
2336 
2354 
2372 
2373 
2391 
2398 
2399  //------------------------ Box iterators------------------------------------
2400 
2423 
2424 
2448 
2449 
2473 
2474 
2498 
2499 
2500 
2524 
2548 
2572 
2573 
2597 
2598 
2606 
2607  //------------------------ Range iterators------------------------------------
2608 
2638  const slip::Range<int>& slice_range, const slip::Range<int>& row_range,
2639  const slip::Range<int>& col_range);
2640 
2670  const slip::Range<int>& slice_range, const slip::Range<int>& row_range,
2671  const slip::Range<int>& col_range);
2672 
2703  const slip::Range<int>& slice_range, const slip::Range<int>& row_range,
2704  const slip::Range<int>& col_range) const;
2705 
2706 
2736  const slip::Range<int>& slice_range, const slip::Range<int>& row_range,
2737  const slip::Range<int>& col_range) const;
2738 
2769  const slip::Range<int>& slice_range, const slip::Range<int>& row_range,
2770  const slip::Range<int>& col_range);
2771 
2802  const slip::Range<int>& slice_range, const slip::Range<int>& row_range,
2803  const slip::Range<int>& col_range);
2804 
2835  const slip::Range<int>& slice_range, const slip::Range<int>& row_range,
2836  const slip::Range<int>& col_range) const;
2837 
2869  const slip::Range<int>& slice_range, const slip::Range<int>& row_range,
2870  const slip::Range<int>& col_range) const;
2871 
2872 
2875  //**************************************************************************************************************
2876  //**************************************************************************************************************
2877  //************************ Component iterator ***********************************
2878  //**************************************************************************************************************
2879  //**************************************************************************************************************
2880 
2885 
2886  //------------------------ Component iterators------------------------------------
2887 
2895  component_iterator begin(const std::size_t component);
2896 
2904  const_component_iterator begin(const std::size_t component) const;
2905 
2913  component_iterator end(const std::size_t component);
2914 
2922  const_component_iterator end(const std::size_t component) const;
2923 
2931  reverse_component_iterator rbegin(const std::size_t component);
2932 
2940  const_reverse_component_iterator rbegin(const std::size_t component) const;
2941 
2949  reverse_component_iterator rend(const std::size_t component);
2950 
2958  const_reverse_component_iterator rend(const std::size_t component) const;
2959 
2960 
2961 
2968  //--------------------One dimensional component slab iterators----------------------
2969 
2990  component_slab_iterator slab_begin(const std::size_t component, const size_type slice,
2991  const size_type row, const size_type col);
2992 
3013  const_component_slab_iterator slab_begin(const std::size_t component, const size_type slice,
3014  const size_type row, const size_type col) const;
3015 
3036  component_slab_iterator slab_end(const std::size_t component, const size_type slice,
3037  const size_type row, const size_type col);
3038 
3060  const_component_slab_iterator slab_end(const std::size_t component, const size_type slice,
3061  const size_type row, const size_type col) const;
3062 
3063 
3084  reverse_component_slab_iterator slab_rbegin(const std::size_t component, const size_type slice,
3085  const size_type row, const size_type col);
3086 
3107  const_reverse_component_slab_iterator slab_rbegin(const std::size_t component, const size_type slice,
3108  const size_type row, const size_type col) const;
3109 
3130  reverse_component_slab_iterator slab_rend(const std::size_t component, const size_type slice,
3131  const size_type row, const size_type col);
3132 
3133 
3154  const_reverse_component_slab_iterator slab_rend(const std::size_t component, const size_type slice,
3155  const size_type row, const size_type col) const;
3156 
3164  //--------------------One dimensional component slice iterators----------------------
3165 
3176  component_slice_iterator slice_begin(const std::size_t component, const size_type slab,
3177  const size_type row, const size_type col);
3178 
3189  const_component_slice_iterator slice_begin(const std::size_t component, const size_type slab,
3190  const size_type row, const size_type col) const;
3191 
3202  component_slice_iterator slice_end(const std::size_t component, const size_type slab,
3203  const size_type row, const size_type col);
3204 
3215  const_component_slice_iterator slice_end(const std::size_t component, const size_type slab,
3216  const size_type row, const size_type col) const;
3217 
3218 
3229  reverse_component_slice_iterator slice_rbegin(const std::size_t component, const size_type slab,
3230  const size_type row, const size_type col);
3231 
3242  const_reverse_component_slice_iterator slice_rbegin(const std::size_t component, const size_type slab,
3243  const size_type row, const size_type col) const;
3244 
3255  reverse_component_slice_iterator slice_rend(const std::size_t component, const size_type slab,
3256  const size_type row, const size_type col);
3257 
3258 
3269  const_reverse_component_slice_iterator slice_rend(const std::size_t component, const size_type slab,
3270  const size_type row, const size_type col) const;
3271 
3278  //-------------------row component iterators----------
3279 
3291  component_row_iterator row_begin(const std::size_t component, const size_type slab,
3292  const size_type slice, const size_type row);
3293 
3305  const_component_row_iterator row_begin(const std::size_t component, const size_type slab,
3306  const size_type slice, const size_type row) const;
3307 
3308 
3320  component_row_iterator row_end(const std::size_t component, const size_type slab,
3321  const size_type slice, const size_type row);
3322 
3323 
3336  const_component_row_iterator row_end(const std::size_t component, const size_type slab,
3337  const size_type slice, const size_type row) const;
3338 
3339 
3351  reverse_component_row_iterator row_rbegin(const std::size_t component, const size_type slab,
3352  const size_type slice, const size_type row);
3353 
3365  const_reverse_component_row_iterator row_rbegin(const std::size_t component, const size_type slab,
3366  const size_type slice, const size_type row) const;
3367 
3368 
3380  reverse_component_row_iterator row_rend(const std::size_t component, const size_type slab,
3381  const size_type slice, const size_type row);
3382 
3383 
3395  const_reverse_component_row_iterator row_rend(const std::size_t component, const size_type slab,
3396  const size_type slice, const size_type row) const;
3397 
3398 
3404  //-------------------Constant component col iterators----------
3405 
3417  component_col_iterator col_begin(const std::size_t component, const size_type slab,
3418  const size_type slice, const size_type col);
3419 
3420 
3432  const_component_col_iterator col_begin(const std::size_t component, const size_type slab,
3433  const size_type slice, const size_type col) const;
3434 
3446  component_col_iterator col_end(const std::size_t component, const size_type slab,
3447  const size_type slice, const size_type col);
3448 
3449 
3461  const_component_col_iterator col_end(const std::size_t component, const size_type slab,
3462  const size_type slice, const size_type col) const;
3463 
3464 
3476  reverse_component_col_iterator col_rbegin(const std::size_t component, const size_type slab,
3477  const size_type slice, const size_type col);
3478 
3479 
3491  const_reverse_component_col_iterator col_rbegin(const std::size_t component, const size_type slab,
3492  const size_type slice, const size_type col) const;
3493 
3505  reverse_component_col_iterator col_rend(const std::size_t component, const size_type slab,
3506  const size_type slice, const size_type col);
3507 
3508 
3520  const_reverse_component_col_iterator col_rend(const std::size_t component, const size_type slab,
3521  const size_type slice, const size_type col) const;
3522 
3523 
3530  //------------------------component slab range iterators -----------------------
3531 
3559  component_slab_range_iterator slab_begin(const std::size_t component, const size_type slice,
3560  const size_type row, const size_type col, const slip::Range<int>& range);
3561 
3562 
3590  component_slab_range_iterator slab_end(const std::size_t component, const size_type slice,
3591  const size_type row, const size_type col, const slip::Range<int>& range);
3592 
3593 
3621  const_component_slab_range_iterator slab_begin(const std::size_t component, const size_type slice,
3622  const size_type row, const size_type col, const slip::Range<int>& range) const;
3623 
3651  const_component_slab_range_iterator slab_end(const std::size_t component, const size_type slice,
3652  const size_type row, const size_type col, const slip::Range<int>& range) const;
3653 
3654 
3682  reverse_component_slab_range_iterator slab_rbegin(const std::size_t component, const size_type slice,
3683  const size_type row, const size_type col, const slip::Range<int>& range);
3684 
3685 
3713  reverse_component_slab_range_iterator slab_rend(const std::size_t component, const size_type slice,
3714  const size_type row, const size_type col, const slip::Range<int>& range);
3715 
3716 
3744  const_reverse_component_slab_range_iterator slab_rbegin(const std::size_t component, const size_type slice,
3745  const size_type row, const size_type col, const slip::Range<int>& range) const;
3746 
3774  const_reverse_component_slab_range_iterator slab_rend(const std::size_t component, const size_type slice,
3775  const size_type row, const size_type col, const slip::Range<int>& range) const;
3776 
3777 
3784  //------------------------component slice range iterators -----------------------
3785 
3812  component_slice_range_iterator slice_begin(const std::size_t component, const size_type slab,
3813  const size_type row, const size_type col, const slip::Range<int>& range);
3814 
3815 
3842  component_slice_range_iterator slice_end(const std::size_t component, const size_type slab,
3843  const size_type row, const size_type col, const slip::Range<int>& range);
3844 
3845 
3872  const_component_slice_range_iterator slice_begin(const std::size_t component, const size_type slab,
3873  const size_type row, const size_type col, const slip::Range<int>& range) const;
3874 
3901  const_component_slice_range_iterator slice_end(const std::size_t component, const size_type slab,
3902  const size_type row, const size_type col, const slip::Range<int>& range) const;
3903 
3904 
3931  reverse_component_slice_range_iterator slice_rbegin(const std::size_t component, const size_type slab,
3932  const size_type row, const size_type col, const slip::Range<int>& range);
3933 
3934 
3961  reverse_component_slice_range_iterator slice_rend(const std::size_t component, const size_type slab,
3962  const size_type row, const size_type col, const slip::Range<int>& range);
3963 
3964 
3991  const_reverse_component_slice_range_iterator slice_rbegin(const std::size_t component, const size_type slab,
3992  const size_type row, const size_type col, const slip::Range<int>& range) const;
3993 
4020  const_reverse_component_slice_range_iterator slice_rend(const std::size_t component, const size_type slab,
4021  const size_type row, const size_type col, const slip::Range<int>& range) const;
4022 
4023 
4030  //------------------------component row range iterators -----------------------
4031 
4058  component_row_range_iterator row_begin(const std::size_t component, const size_type slab,
4059  const size_type slice, const size_type row, const slip::Range<int>& range);
4060 
4087  component_row_range_iterator row_end(const std::size_t component, const size_type slab,
4088  const size_type slice, const size_type row, const slip::Range<int>& range);
4089 
4090 
4117  const_component_row_range_iterator row_begin(const std::size_t component, const size_type slab,
4118  const size_type slice, const size_type row, const slip::Range<int>& range) const;
4119 
4120 
4146  const_component_row_range_iterator row_end(const std::size_t component, const size_type slab,
4147  const size_type slice, const size_type row, const slip::Range<int>& range) const;
4148 
4175  reverse_component_row_range_iterator row_rbegin(const std::size_t component, const size_type slab,
4176  const size_type slice, const size_type row, const slip::Range<int>& range);
4177 
4204  reverse_component_row_range_iterator row_rend(const std::size_t component, const size_type slab,
4205  const size_type slice, const size_type row, const slip::Range<int>& range);
4206 
4231  const_reverse_component_row_range_iterator row_rbegin(const std::size_t component, const size_type slab,
4232  const size_type slice, const size_type row, const slip::Range<int>& range) const;
4233 
4234 
4261  const_reverse_component_row_range_iterator row_rend(const std::size_t component, const size_type slab,
4262  const size_type slice, const size_type row, const slip::Range<int>& range) const;
4263 
4269  //------------------------component col range iterators -----------------------
4270 
4271 
4298  component_col_range_iterator col_begin(const std::size_t component, const size_type slab,
4299  const size_type slice, const size_type col, const slip::Range<int>& range);
4300 
4327  component_col_range_iterator col_end(const std::size_t component, const size_type slab,
4328  const size_type slice, const size_type col, const slip::Range<int>& range);
4329 
4330 
4357  const_component_col_range_iterator col_begin(const std::size_t component, const size_type slab,
4358  const size_type slice, const size_type col, const slip::Range<int>& range) const;
4359 
4360 
4387  const_component_col_range_iterator col_end(const std::size_t component, const size_type slab,
4388  const size_type slice, const size_type col, const slip::Range<int>& range) const;
4389 
4416  reverse_component_col_range_iterator col_rbegin(const std::size_t component, const size_type slab,
4417  const size_type slice, const size_type col, const slip::Range<int>& range);
4418 
4445  reverse_component_col_range_iterator col_rend(const std::size_t component, const size_type slab,
4446  const size_type slice, const size_type col, const slip::Range<int>& range);
4447 
4474  const_reverse_component_col_range_iterator col_rbegin(const std::size_t component, const size_type slab,
4475  const size_type slice, const size_type col, const slip::Range<int>& range) const;
4476 
4503  const_reverse_component_col_range_iterator col_rend(const std::size_t component, const size_type slab,
4504  const size_type slice, const size_type col, const slip::Range<int>& range) const;
4505 
4509  //****************************************************************************
4510  // four dimensional component iterators
4511  //****************************************************************************
4512 
4517 
4518  //------------------------ Global component iterators------------------------------------
4519 
4537  component_iterator4d first_front_upper_left(const std::size_t component);
4538 
4556  component_iterator4d last_back_bottom_right(const std::size_t component);
4557 
4575  const_component_iterator4d first_front_upper_left(const std::size_t component) const;
4576 
4594  const_component_iterator4d last_back_bottom_right(const std::size_t component) const;
4595 
4613  reverse_component_iterator4d rfirst_front_upper_left(const std::size_t component);
4614 
4632  reverse_component_iterator4d rlast_back_bottom_right(const std::size_t component);
4633 
4651  const_reverse_component_iterator4d rfirst_front_upper_left(const std::size_t component) const;
4652 
4653 
4671  const_reverse_component_iterator4d rlast_back_bottom_right(const std::size_t component) const;
4672 
4673  //------------------------ Box component iterators------------------------------------
4674 
4688  component_iterator4d first_front_upper_left(const std::size_t component,
4689  const Box4d<int>& box);
4690 
4706  component_iterator4d last_back_bottom_right(const std::size_t component,
4707  const Box4d<int>& box);
4708 
4723  const_component_iterator4d first_front_upper_left(const std::size_t component,
4724  const Box4d<int>& box) const;
4725 
4741  const_component_iterator4d last_back_bottom_right(const std::size_t component,
4742  const Box4d<int>& box) const;
4743 
4759  reverse_component_iterator4d rfirst_front_upper_left(const std::size_t component,
4760  const Box4d<int>& box);
4761 
4777  reverse_component_iterator4d rlast_back_bottom_right(const std::size_t component,
4778  const Box4d<int>& box);
4779 
4795  const_reverse_component_iterator4d rfirst_front_upper_left(const std::size_t component,
4796  const Box4d<int>& box) const;
4797 
4798 
4814  const_reverse_component_iterator4d rlast_back_bottom_right(const std::size_t component,
4815  const Box4d<int>& box) const;
4816 
4817  //------------------------ Range component iterators------------------------------------
4818 
4837  component_iterator4d_range first_front_upper_left(const std::size_t component,
4838  const slip::Range<int>& slab_range, const slip::Range<int>& slice_range,
4839  const slip::Range<int>& row_range, const slip::Range<int>& col_range);
4840 
4859  component_iterator4d_range last_back_bottom_right(const std::size_t component,
4860  const slip::Range<int>& slab_range, const slip::Range<int>& slice_range,
4861  const slip::Range<int>& row_range, const slip::Range<int>& col_range);
4862 
4881  const_component_iterator4d_range first_front_upper_left(const std::size_t component,
4882  const slip::Range<int>& slab_range, const slip::Range<int>& slice_range,
4883  const slip::Range<int>& row_range, const slip::Range<int>& col_range) const;
4884 
4903  const_component_iterator4d_range last_back_bottom_right(const std::size_t component,
4904  const slip::Range<int>& slab_range, const slip::Range<int>& slice_range,
4905  const slip::Range<int>& row_range, const slip::Range<int>& col_range) const;
4906 
4925  reverse_component_iterator4d_range rfirst_front_upper_left(const std::size_t component,
4926  const slip::Range<int>& slab_range, const slip::Range<int>& slice_range,
4927  const slip::Range<int>& row_range, const slip::Range<int>& col_range);
4928 
4947  reverse_component_iterator4d_range rlast_back_bottom_right(const std::size_t component,
4948  const slip::Range<int>& slab_range, const slip::Range<int>& slice_range,
4949  const slip::Range<int>& row_range, const slip::Range<int>& col_range);
4950 
4970  const slip::Range<int>& slab_range, const slip::Range<int>& slice_range,
4971  const slip::Range<int>& row_range, const slip::Range<int>& col_range) const;
4972 
4992  const slip::Range<int>& slab_range, const slip::Range<int>& slice_range,
4993  const slip::Range<int>& row_range, const slip::Range<int>& col_range) const;
4994 
5001 
5007  friend std::ostream& operator<< <>(std::ostream & out, const self& a);
5008 
5015 
5022  self& operator=(const self & rhs);
5023 
5029  self& operator=(const Block& val);
5030 
5036  self& operator=(const typename Block::value_type& val);
5037 
5043  void fill(const Block& value)
5044  {
5045  std::fill_n(this->begin(),size(),value);
5046  }
5047 
5054  void fill(const typename Block::pointer value)
5055  {
5056  std::copy(value,value + size(), (typename Block::pointer)begin());
5057  }
5058 
5065  void fill(const Block* value)
5066  {
5067  std::copy(value,value + size(), this->begin());
5068  }
5069 
5078  template<typename InputIterator>
5079  void fill(InputIterator first,
5080  InputIterator last)
5081  {
5082  std::copy(first,last,this->begin());
5083  }
5084 
5093  template<typename InputIterator>
5094  void fill(std::vector<InputIterator> first_iterators_list,
5095  InputIterator last)
5096  {
5097  std::vector<typename slip::kstride_iterator<typename Block::pointer,Block::SIZE> >
5098  iterators_list(Block::SIZE);
5099 
5100  for(std::size_t component = 0; component < Block::SIZE; ++component)
5101  {
5103  ((typename Block::pointer)this->begin() + component);
5104  }
5105 
5106 
5107  while(first_iterators_list[0] != last)
5108  {
5109  for(std::size_t component = 0; component < Block::SIZE; ++component)
5110  {
5111  *iterators_list[component]++ = *first_iterators_list[component]++;
5112  }
5113  }
5114  iterators_list.clear();
5115  }
5116 
5117 
5127  template<typename InputIterator>
5128  void fill(std::size_t component,
5129  InputIterator first,
5130  InputIterator last)
5131  {
5132  std::copy(first,last,this->begin(component));
5133  }
5134 
5148  friend bool operator== <>(const GenericMultiComponent4d<Block>& x,
5150 
5158  friend bool operator!= <>(const GenericMultiComponent4d<Block>& x,
5160 
5161  // /*!
5162  // ** \brief Less than comparison operator (GenericMultiComponent4d ordering relation)
5163  // ** \param x A %GenericMultiComponent4d
5164  // ** \param y A %GenericMultiComponent4d of the same type of \a x
5165  // ** \return true iff \a x is lexicographically less than \a y
5166  // ** \pre x.size() == y.size()
5167  // */
5168  // friend bool operator< <>(const GenericMultiComponent4d<Block>& x,
5169  // const GenericMultiComponent4d<Block>& y);
5170 
5171  // /*!
5172  // ** \brief More than comparison operator
5173  // ** \param x A %GenericMultiComponent4d
5174  // ** \param y A %GenericMultiComponent4d of the same type of \a x
5175  // ** \return true iff y > x
5176  // ** \pre x.size() == y.size()
5177  // */
5178  // friend bool operator> <>(const GenericMultiComponent4d<Block>& x,
5179  // const GenericMultiComponent4d<Block>& y);
5180 
5181  // /*!
5182  // ** \brief Less than equal comparison operator
5183  // ** \param x A %GenericMultiComponent4d
5184  // ** \param y A %GenericMultiComponent4d of the same type of \a x
5185  // ** \return true iff !(y > x)
5186  // ** \pre x.size() == y.size()
5187  // */
5188  // friend bool operator<= <>(const GenericMultiComponent4d<Block>& x,
5189  // const GenericMultiComponent4d<Block>& y);
5190 
5191  // /*!
5192  // ** \brief More than equal comparison operator
5193  // ** \param x A %GenericMultiComponent4d
5194  // ** \param y A %GenericMultiComponent4d of the same type of \a x
5195  // ** \return true iff !(x < y)
5196  // ** \pre x.size() == y.size()
5197  // */
5198  // friend bool operator>= <>(const GenericMultiComponent4d<Block>& x,
5199  // const GenericMultiComponent4d<Block>& y);
5200 
5201 
5218  pointer** operator[](const size_type t);
5219 
5230  const_pointer* const * operator[](const size_type t) const;
5231 
5247  reference operator()(const size_type t,
5248  const size_type k,
5249  const size_type i,
5250  const size_type j);
5251 
5268  const size_type k,
5269  const size_type i,
5270  const size_type j) const;
5271 
5277  size_type dim1() const;
5278 
5283  size_type slabs() const;
5284 
5289  size_type dim2() const;
5290 
5295  size_type slices() const;
5296 
5297 
5302  size_type dim3() const;
5303 
5304 
5309  size_type rows() const;
5310 
5311 
5316  size_type dim4() const;
5317 
5322  size_type columns() const;
5323 
5328  size_type cols() const;
5329 
5330 
5334  size_type size() const;
5335 
5339  size_type max_size() const;
5340 
5344  bool empty()const;
5345 
5350  void swap(self& M);
5351 
5352 
5358  Block min() const;
5359 
5360 
5366  Block max() const;
5367 
5368  // /*!
5369  // ** \brief Returns the sums of the elements of the %GenericMultiComponent4d
5370  // ** \pre size() != 0
5371  // */
5372  // Block sum() const;
5373 
5380  GenericMultiComponent4d<Block>& apply(Block(*fun)(Block));
5381 
5388  GenericMultiComponent4d<Block>& apply(Block(*fun)(const Block&));
5389 
5390 
5391 private:
5392  Matrix4d<Block>* matrix_;
5393  private:
5394  friend class boost::serialization::access;
5395  template<class Archive>
5396  void save(Archive & ar, const unsigned int version) const
5397  {
5398  ar & this->matrix_;
5399  }
5400  template<class Archive>
5401  void load(Archive & ar, const unsigned int version)
5402  {
5403  ar & this->matrix_;
5404  }
5405  BOOST_SERIALIZATION_SPLIT_MEMBER();
5406 
5407 }; // end of MultiComponent4dContainer group
5409 }//slip::
5410 
5411 
5412 namespace slip
5413 {
5414 
5415 template<typename Block>
5416 inline
5418 matrix_(new Matrix4d<Block>()){}
5419 
5420 template<typename Block>
5421 inline
5425  matrix_(new Matrix4d<Block>(slabs,slices,rows,cols)){}
5426 
5427 template<typename Block>
5428 inline
5431  const GenericMultiComponent4d<Block>::size_type cols, const Block& val):
5432  matrix_(new Matrix4d<Block>(slabs,slices,rows,cols,val)){}
5433 
5434 template<typename Block>
5435 inline
5438  const GenericMultiComponent4d<Block>::size_type cols, typename Block::const_pointer val):
5439  matrix_(new Matrix4d<Block>(slabs,slices,rows,cols)){
5440  typename Matrix4d<Block>::iterator it = matrix_->begin();
5441  typename Matrix4d<Block>::iterator ite = matrix_->end();
5442  for(;it!=ite; it++)
5443  {
5444  for(typename GenericMultiComponent4d<Block>::size_type component = 0;
5445  component < Block::SIZE; ++component)
5446  {
5447  (*it)[component] = *val++;
5448  }
5449  }
5450 }
5451 
5452 template<typename Block>
5453 inline
5456  const GenericMultiComponent4d<Block>::size_type cols, const Block* val):
5457  matrix_(new Matrix4d<Block>(slabs,slices,rows,cols,val)){}
5458 
5459 template<typename Block>
5460 inline
5462 matrix_(new Matrix4d<Block>(*rhs.matrix_)){}
5463 
5464 template<typename Block>
5465 inline
5467  delete matrix_;
5468 }
5469 
5470 template<typename Block>
5471 inline
5476  const Block& val){
5477  matrix_->resize(slabs,slices,rows,cols,val);
5478 }
5479 
5480 
5481 //****************************************************************************
5482 // One dimensional iterators
5483 //****************************************************************************
5484 
5485 //----------------------Global iterators------------------------------
5486 
5487 
5488 template<typename Block>
5489 inline
5492  return matrix_->begin();
5493 }
5494 
5495 template<typename Block>
5496 inline
5499  Matrix4d<Block> const * tp(matrix_);
5500  return tp->begin();
5501 }
5502 
5503 template<typename Block>
5504 inline
5507  return matrix_->end();
5508 }
5509 
5510 template<typename Block>
5511 inline
5514  Matrix4d<Block> const * tp(matrix_);
5515  return tp->end();
5516 }
5517 
5518 template<typename Block>
5519 inline
5522  return typename GenericMultiComponent4d<Block>::reverse_iterator(this->end());
5523 }
5524 
5525 template<typename Block>
5526 inline
5529  return typename GenericMultiComponent4d<Block>::const_reverse_iterator(this->end());
5530 }
5531 
5532 template<typename Block>
5533 inline
5536  return typename GenericMultiComponent4d<Block>::reverse_iterator(this->begin());
5537 }
5538 
5539 template<typename Block>
5540 inline
5543  return typename GenericMultiComponent4d<Block>::const_reverse_iterator(this->begin());
5544 }
5545 
5546 //--------------------One dimensional slab iterators----------------------
5547 
5548 template<typename Block>
5549 inline
5554  return matrix_->slab_begin(slice,row,col);
5555 }
5556 
5557 template<typename Block>
5558 inline
5559 typename GenericMultiComponent4d<Block>::const_slab_iterator
5560 GenericMultiComponent4d<Block>::slab_begin(const GenericMultiComponent4d<Block>::size_type slice,
5561  const GenericMultiComponent4d<Block>::size_type row,
5562  const GenericMultiComponent4d<Block>::size_type col) const{
5563  Matrix4d<Block> const * tp(matrix_);
5564  return tp->slab_begin(slice,row,col);
5565 }
5566 
5567 template<typename Block>
5568 inline
5569 typename GenericMultiComponent4d<Block>::slab_iterator
5570 GenericMultiComponent4d<Block>::slab_end(const GenericMultiComponent4d<Block>::size_type slice,
5571  const GenericMultiComponent4d<Block>::size_type row,
5572  const GenericMultiComponent4d<Block>::size_type col){
5573  return matrix_->slab_end(slice,row,col);
5574 }
5575 
5576 template<typename Block>
5577 inline
5578 typename GenericMultiComponent4d<Block>::const_slab_iterator
5579 GenericMultiComponent4d<Block>::slab_end(const GenericMultiComponent4d<Block>::size_type slice,
5580  const GenericMultiComponent4d<Block>::size_type row,
5581  const GenericMultiComponent4d<Block>::size_type col) const{
5582  Matrix4d<Block> const * tp(matrix_);
5583  return tp->slab_end(slice,row,col);
5584 }
5585 
5586 template<typename Block>
5587 inline
5588 typename GenericMultiComponent4d<Block>::reverse_slab_iterator
5589 GenericMultiComponent4d<Block>::slab_rbegin(const GenericMultiComponent4d<Block>::size_type slice,
5590  const GenericMultiComponent4d<Block>::size_type row,
5591  const GenericMultiComponent4d<Block>::size_type col){
5592  return matrix_->slab_rbegin(slice,row,col);
5593 }
5594 
5595 template<typename Block>
5596 inline
5597 typename GenericMultiComponent4d<Block>::const_reverse_slab_iterator
5598 GenericMultiComponent4d<Block>::slab_rbegin(const GenericMultiComponent4d<Block>::size_type slice,
5599  const GenericMultiComponent4d<Block>::size_type row,
5600  const GenericMultiComponent4d<Block>::size_type col) const{
5601  Matrix4d<Block> const * tp(matrix_);
5602  return tp->slab_rbegin(slice,row,col);
5603 }
5604 
5605 template<typename Block>
5606 inline
5607 typename GenericMultiComponent4d<Block>::reverse_slab_iterator
5608 GenericMultiComponent4d<Block>::slab_rend(const GenericMultiComponent4d<Block>::size_type slice,
5609  const GenericMultiComponent4d<Block>::size_type row,
5610  const GenericMultiComponent4d<Block>::size_type col){
5611  return matrix_->slab_rend(slice,row,col);
5612 }
5613 
5614 template<typename Block>
5615 inline
5616 typename GenericMultiComponent4d<Block>::const_reverse_slab_iterator
5617 GenericMultiComponent4d<Block>::slab_rend(const GenericMultiComponent4d<Block>::size_type slice,
5618  const GenericMultiComponent4d<Block>::size_type row,
5619  const GenericMultiComponent4d<Block>::size_type col) const{
5620  Matrix4d<Block> const * tp(matrix_);
5621  return tp->slab_rend(slice,row,col);
5622 }
5623 
5624 //--------------------One dimensional slice iterators----------------------
5625 
5626 template<typename Block>
5627 inline
5628 typename GenericMultiComponent4d<Block>::slice_iterator
5629 GenericMultiComponent4d<Block>::slice_begin(const GenericMultiComponent4d<Block>::size_type slab,
5630  const GenericMultiComponent4d<Block>::size_type row,
5631  const GenericMultiComponent4d<Block>::size_type col){
5632  return matrix_->slice_begin(slab,row,col);
5633 }
5634 
5635 template<typename Block>
5636 inline
5637 typename GenericMultiComponent4d<Block>::const_slice_iterator
5638 GenericMultiComponent4d<Block>::slice_begin(const GenericMultiComponent4d<Block>::size_type slab,
5639  const GenericMultiComponent4d<Block>::size_type row,
5640  const GenericMultiComponent4d<Block>::size_type col) const{
5641  Matrix4d<Block> const * tp(matrix_);
5642  return tp->slice_begin(slab,row,col);
5643 }
5644 
5645 template<typename Block>
5646 inline
5647 typename GenericMultiComponent4d<Block>::slice_iterator
5648 GenericMultiComponent4d<Block>::slice_end(const GenericMultiComponent4d<Block>::size_type slab,
5649  const GenericMultiComponent4d<Block>::size_type row,
5650  const GenericMultiComponent4d<Block>::size_type col){
5651  return matrix_->slice_end(slab,row,col);
5652 }
5653 
5654 template<typename Block>
5655 inline
5656 typename GenericMultiComponent4d<Block>::const_slice_iterator
5657 GenericMultiComponent4d<Block>::slice_end(const GenericMultiComponent4d<Block>::size_type slab,
5658  const GenericMultiComponent4d<Block>::size_type row,
5659  const GenericMultiComponent4d<Block>::size_type col) const{
5660  Matrix4d<Block> const * tp(matrix_);
5661  return tp->slice_end(slab,row,col);
5662 }
5663 
5664 template<typename Block>
5665 inline
5666 typename GenericMultiComponent4d<Block>::reverse_slice_iterator
5667 GenericMultiComponent4d<Block>::slice_rbegin(const GenericMultiComponent4d<Block>::size_type slab,
5668  const GenericMultiComponent4d<Block>::size_type row,
5669  const GenericMultiComponent4d<Block>::size_type col){
5670  return matrix_->slice_rbegin(slab,row,col);
5671 }
5672 
5673 template<typename Block>
5674 inline
5675 typename GenericMultiComponent4d<Block>::const_reverse_slice_iterator
5676 GenericMultiComponent4d<Block>::slice_rbegin(const GenericMultiComponent4d<Block>::size_type slab,
5677  const GenericMultiComponent4d<Block>::size_type row,
5678  const GenericMultiComponent4d<Block>::size_type col) const{
5679  Matrix4d<Block> const * tp(matrix_);
5680  return tp->slice_rbegin(slab,row,col);
5681 }
5682 
5683 template<typename Block>
5684 inline
5685 typename GenericMultiComponent4d<Block>::reverse_slice_iterator
5686 GenericMultiComponent4d<Block>::slice_rend(const GenericMultiComponent4d<Block>::size_type slab,
5687  const GenericMultiComponent4d<Block>::size_type row,
5688  const GenericMultiComponent4d<Block>::size_type col){
5689  return matrix_->slice_rend(slab,row,col);
5690 }
5691 
5692 template<typename Block>
5693 inline
5694 typename GenericMultiComponent4d<Block>::const_reverse_slice_iterator
5695 GenericMultiComponent4d<Block>::slice_rend(const GenericMultiComponent4d<Block>::size_type slab,
5696  const GenericMultiComponent4d<Block>::size_type row,
5697  const GenericMultiComponent4d<Block>::size_type col) const{
5698  Matrix4d<Block> const * tp(matrix_);
5699  return tp->slice_rend(slab,row,col);
5700 }
5701 
5702 //-------------------row iterators----------
5703 
5704 template<typename Block>
5705 inline
5706 typename GenericMultiComponent4d<Block>::row_iterator
5707 GenericMultiComponent4d<Block>::row_begin(const GenericMultiComponent4d<Block>::size_type slab,
5708  const GenericMultiComponent4d<Block>::size_type slice,
5709  const GenericMultiComponent4d<Block>::size_type row){
5710  return matrix_->row_begin(slab,slice,row);
5711 }
5712 
5713 template<typename Block>
5714 inline
5715 typename GenericMultiComponent4d<Block>::const_row_iterator
5716 GenericMultiComponent4d<Block>::row_begin(const GenericMultiComponent4d<Block>::size_type slab,
5717  const GenericMultiComponent4d<Block>::size_type slice,
5718  const GenericMultiComponent4d<Block>::size_type row) const{
5719  Matrix4d<Block> const * tp(matrix_);
5720  return tp->row_begin(slab,slice,row);
5721 }
5722 
5723 template<typename Block>
5724 inline
5725 typename GenericMultiComponent4d<Block>::row_iterator
5726 GenericMultiComponent4d<Block>::row_end(const GenericMultiComponent4d<Block>::size_type slab,
5727  const GenericMultiComponent4d<Block>::size_type slice,
5728  const GenericMultiComponent4d<Block>::size_type row){
5729  return matrix_->row_end(slab,slice,row);
5730 }
5731 
5732 template<typename Block>
5733 inline
5734 typename GenericMultiComponent4d<Block>::const_row_iterator
5735 GenericMultiComponent4d<Block>::row_end(const GenericMultiComponent4d<Block>::size_type slab,
5736  const GenericMultiComponent4d<Block>::size_type slice,
5737  const GenericMultiComponent4d<Block>::size_type row) const{
5738  Matrix4d<Block> const * tp(matrix_);
5739  return tp->row_end(slab,slice,row);
5740 }
5741 
5742 template<typename Block>
5743 inline
5744 typename GenericMultiComponent4d<Block>::reverse_row_iterator
5745 GenericMultiComponent4d<Block>::row_rbegin(const GenericMultiComponent4d<Block>::size_type slab,
5746  const GenericMultiComponent4d<Block>::size_type slice,
5747  const GenericMultiComponent4d<Block>::size_type row){
5748  return matrix_->row_rbegin(slab,slice,row);
5749 }
5750 
5751 template<typename Block>
5752 inline
5753 typename GenericMultiComponent4d<Block>::const_reverse_row_iterator
5754 GenericMultiComponent4d<Block>::row_rbegin(const GenericMultiComponent4d<Block>::size_type slab,
5755  const GenericMultiComponent4d<Block>::size_type slice,
5756  const GenericMultiComponent4d<Block>::size_type row) const{
5757  Matrix4d<Block> const * tp(matrix_);
5758  return tp->row_rbegin(slab,slice,row);
5759 }
5760 
5761 template<typename Block>
5762 inline
5763 typename GenericMultiComponent4d<Block>::reverse_row_iterator
5764 GenericMultiComponent4d<Block>::row_rend(const GenericMultiComponent4d<Block>::size_type slab,
5765  const GenericMultiComponent4d<Block>::size_type slice,
5766  const GenericMultiComponent4d<Block>::size_type row){
5767  return matrix_->row_rend(slab,slice,row);
5768 }
5769 
5770 template<typename Block>
5771 inline
5772 typename GenericMultiComponent4d<Block>::const_reverse_row_iterator
5773 GenericMultiComponent4d<Block>::row_rend(const GenericMultiComponent4d<Block>::size_type slab,
5774  const GenericMultiComponent4d<Block>::size_type slice,
5775  const GenericMultiComponent4d<Block>::size_type row) const{
5776  Matrix4d<Block> const * tp(matrix_);
5777  return tp->row_rend(slab,slice,row);
5778 }
5779 
5780 //-------------------Constant col iterators----------
5781 
5782 template<typename Block>
5783 inline
5784 typename GenericMultiComponent4d<Block>::col_iterator
5785 GenericMultiComponent4d<Block>::col_begin(const GenericMultiComponent4d<Block>::size_type slab,
5786  const GenericMultiComponent4d<Block>::size_type slice,
5787  const GenericMultiComponent4d<Block>::size_type col){
5788  return matrix_->col_begin(slab,slice,col);
5789 }
5790 
5791 template<typename Block>
5792 inline
5793 typename GenericMultiComponent4d<Block>::const_col_iterator
5794 GenericMultiComponent4d<Block>::col_begin(const GenericMultiComponent4d<Block>::size_type slab,
5795  const GenericMultiComponent4d<Block>::size_type slice,
5796  const GenericMultiComponent4d<Block>::size_type col) const{
5797  Matrix4d<Block> const * tp(matrix_);
5798  return tp->col_begin(slab,slice,col);
5799 }
5800 
5801 template<typename Block>
5802 inline
5803 typename GenericMultiComponent4d<Block>::col_iterator
5804 GenericMultiComponent4d<Block>::col_end(const GenericMultiComponent4d<Block>::size_type slab,
5805  const GenericMultiComponent4d<Block>::size_type slice,
5806  const GenericMultiComponent4d<Block>::size_type col){
5807  return matrix_->col_end(slab,slice,col);
5808 }
5809 
5810 template<typename Block>
5811 inline
5812 typename GenericMultiComponent4d<Block>::const_col_iterator
5813 GenericMultiComponent4d<Block>::col_end(const GenericMultiComponent4d<Block>::size_type slab,
5814  const GenericMultiComponent4d<Block>::size_type slice,
5815  const GenericMultiComponent4d<Block>::size_type col) const{
5816  Matrix4d<Block> const * tp(matrix_);
5817  return tp->col_end(slab,slice,col);
5818 }
5819 
5820 template<typename Block>
5821 inline
5822 typename GenericMultiComponent4d<Block>::reverse_col_iterator
5823 GenericMultiComponent4d<Block>::col_rbegin(const GenericMultiComponent4d<Block>::size_type slab,
5824  const GenericMultiComponent4d<Block>::size_type slice,
5825  const GenericMultiComponent4d<Block>::size_type col){
5826  return matrix_->col_rbegin(slab,slice,col);
5827 }
5828 
5829 template<typename Block>
5830 inline
5831 typename GenericMultiComponent4d<Block>::const_reverse_col_iterator
5832 GenericMultiComponent4d<Block>::col_rbegin(const GenericMultiComponent4d<Block>::size_type slab,
5833  const GenericMultiComponent4d<Block>::size_type slice,
5834  const GenericMultiComponent4d<Block>::size_type col) const{
5835  Matrix4d<Block> const * tp(matrix_);
5836  return tp->col_rbegin(slab,slice,col);
5837 }
5838 
5839 template<typename Block>
5840 inline
5841 typename GenericMultiComponent4d<Block>::reverse_col_iterator
5842 GenericMultiComponent4d<Block>::col_rend(const GenericMultiComponent4d<Block>::size_type slab,
5843  const GenericMultiComponent4d<Block>::size_type slice,
5844  const GenericMultiComponent4d<Block>::size_type col){
5845  return matrix_->col_rend(slab,slice,col);
5846 }
5847 
5848 template<typename Block>
5849 inline
5850 typename GenericMultiComponent4d<Block>::const_reverse_col_iterator
5851 GenericMultiComponent4d<Block>::col_rend(const GenericMultiComponent4d<Block>::size_type slab,
5852  const GenericMultiComponent4d<Block>::size_type slice,
5853  const GenericMultiComponent4d<Block>::size_type col) const{
5854  Matrix4d<Block> const * tp(matrix_);
5855  return tp->col_rend(slab,slice,col);
5856 }
5857 
5858 //------------------------slab range iterators -----------------------
5859 
5860 template<typename Block>
5861 inline
5862 typename GenericMultiComponent4d<Block>::slab_range_iterator
5863 GenericMultiComponent4d<Block>::slab_begin(const GenericMultiComponent4d<Block>::size_type slice,
5864  const GenericMultiComponent4d<Block>::size_type row,
5865  const GenericMultiComponent4d<Block>::size_type col,
5866  const slip::Range<int>& range){
5867  return matrix_->slab_begin(slice,row,col,range);
5868 }
5869 
5870 template<typename Block>
5871 inline
5872 typename GenericMultiComponent4d<Block>::slab_range_iterator
5873 GenericMultiComponent4d<Block>::slab_end(const GenericMultiComponent4d<Block>::size_type slice,
5874  const GenericMultiComponent4d<Block>::size_type row,
5875  const GenericMultiComponent4d<Block>::size_type col,
5876  const slip::Range<int>& range){
5877  return matrix_->slab_end(slice,row,col,range);
5878 }
5879 
5880 template<typename Block>
5881 inline
5882 typename GenericMultiComponent4d<Block>::const_slab_range_iterator
5883 GenericMultiComponent4d<Block>::slab_begin(const GenericMultiComponent4d<Block>::size_type slice,
5884  const GenericMultiComponent4d<Block>::size_type row,
5885  const GenericMultiComponent4d<Block>::size_type col,
5886  const slip::Range<int>& range) const{
5887  Matrix4d<Block> const * tp(matrix_);
5888  return tp->slab_begin(slice,row,col,range);
5889 }
5890 
5891 template<typename Block>
5892 inline
5893 typename GenericMultiComponent4d<Block>::const_slab_range_iterator
5894 GenericMultiComponent4d<Block>::slab_end(const GenericMultiComponent4d<Block>::size_type slice,
5895  const GenericMultiComponent4d<Block>::size_type row,
5896  const GenericMultiComponent4d<Block>::size_type col,
5897  const slip::Range<int>& range) const{
5898  Matrix4d<Block> const * tp(matrix_);
5899  return tp->slab_end(slice,row,col,range);
5900 }
5901 
5902 template<typename Block>
5903 inline
5904 typename GenericMultiComponent4d<Block>::reverse_slab_range_iterator
5905 GenericMultiComponent4d<Block>::slab_rbegin(const GenericMultiComponent4d<Block>::size_type slice,
5906  const GenericMultiComponent4d<Block>::size_type row,
5907  const GenericMultiComponent4d<Block>::size_type col,
5908  const slip::Range<int>& range){
5909  return matrix_->slab_rbegin(slice,row,col,range);
5910 }
5911 
5912 template<typename Block>
5913 inline
5914 typename GenericMultiComponent4d<Block>::reverse_slab_range_iterator
5915 GenericMultiComponent4d<Block>::slab_rend(const GenericMultiComponent4d<Block>::size_type slice,
5916  const GenericMultiComponent4d<Block>::size_type row,
5917  const GenericMultiComponent4d<Block>::size_type col,
5918  const slip::Range<int>& range){
5919  return matrix_->slab_rend(slice,row,col,range);
5920 }
5921 
5922 template<typename Block>
5923 inline
5924 typename GenericMultiComponent4d<Block>::const_reverse_slab_range_iterator
5925 GenericMultiComponent4d<Block>::slab_rbegin(const GenericMultiComponent4d<Block>::size_type slice,
5926  const GenericMultiComponent4d<Block>::size_type row,
5927  const GenericMultiComponent4d<Block>::size_type col,
5928  const slip::Range<int>& range) const{
5929  Matrix4d<Block> const * tp(matrix_);
5930  return tp->slab_rbegin(slice,row,col,range);
5931 }
5932 
5933 template<typename Block>
5934 inline
5935 typename GenericMultiComponent4d<Block>::const_reverse_slab_range_iterator
5936 GenericMultiComponent4d<Block>::slab_rend(const GenericMultiComponent4d<Block>::size_type slice,
5937  const GenericMultiComponent4d<Block>::size_type row,
5938  const GenericMultiComponent4d<Block>::size_type col,
5939  const slip::Range<int>& range) const{
5940  Matrix4d<Block> const * tp(matrix_);
5941  return tp->slab_rend(slice,row,col,range);
5942 }
5943 
5944 //------------------------slice range iterators -----------------------
5945 
5946 template<typename Block>
5947 inline
5948 typename GenericMultiComponent4d<Block>::slice_range_iterator
5949 GenericMultiComponent4d<Block>::slice_begin(const GenericMultiComponent4d<Block>::size_type slab,
5950  const GenericMultiComponent4d<Block>::size_type row,
5951  const GenericMultiComponent4d<Block>::size_type col,
5952  const slip::Range<int>& range){
5953  return matrix_->slice_begin(slab,row,col,range);
5954 }
5955 
5956 template<typename Block>
5957 inline
5958 typename GenericMultiComponent4d<Block>::slice_range_iterator
5959 GenericMultiComponent4d<Block>::slice_end(const GenericMultiComponent4d<Block>::size_type slab,
5960  const GenericMultiComponent4d<Block>::size_type row,
5961  const GenericMultiComponent4d<Block>::size_type col,
5962  const slip::Range<int>& range){
5963  return matrix_->slice_end(slab,row,col,range);
5964 }
5965 
5966 template<typename Block>
5967 inline
5968 typename GenericMultiComponent4d<Block>::const_slice_range_iterator
5969 GenericMultiComponent4d<Block>::slice_begin(const GenericMultiComponent4d<Block>::size_type slab,
5970  const GenericMultiComponent4d<Block>::size_type row,
5971  const GenericMultiComponent4d<Block>::size_type col,
5972  const slip::Range<int>& range) const{
5973  Matrix4d<Block> const * tp(matrix_);
5974  return tp->slice_begin(slab,row,col,range);
5975 }
5976 
5977 template<typename Block>
5978 inline
5979 typename GenericMultiComponent4d<Block>::const_slice_range_iterator
5980 GenericMultiComponent4d<Block>::slice_end(const GenericMultiComponent4d<Block>::size_type slab,
5981  const GenericMultiComponent4d<Block>::size_type row,
5982  const GenericMultiComponent4d<Block>::size_type col,
5983  const slip::Range<int>& range) const{
5984  Matrix4d<Block> const * tp(matrix_);
5985  return tp->slice_end(slab,row,col,range);
5986 }
5987 
5988 template<typename Block>
5989 inline
5990 typename GenericMultiComponent4d<Block>::reverse_slice_range_iterator
5991 GenericMultiComponent4d<Block>::slice_rbegin(const GenericMultiComponent4d<Block>::size_type slab,
5992  const GenericMultiComponent4d<Block>::size_type row,
5993  const GenericMultiComponent4d<Block>::size_type col,
5994  const slip::Range<int>& range){
5995  return matrix_->slice_rbegin(slab,row,col,range);
5996 }
5997 
5998 template<typename Block>
5999 inline
6000 typename GenericMultiComponent4d<Block>::reverse_slice_range_iterator
6001 GenericMultiComponent4d<Block>::slice_rend(const GenericMultiComponent4d<Block>::size_type slab,
6002  const GenericMultiComponent4d<Block>::size_type row,
6003  const GenericMultiComponent4d<Block>::size_type col,
6004  const slip::Range<int>& range){
6005  return matrix_->slice_rend(slab,row,col,range);
6006 }
6007 
6008 template<typename Block>
6009 inline
6010 typename GenericMultiComponent4d<Block>::const_reverse_slice_range_iterator
6011 GenericMultiComponent4d<Block>::slice_rbegin(const GenericMultiComponent4d<Block>::size_type slab,
6012  const GenericMultiComponent4d<Block>::size_type row,
6013  const GenericMultiComponent4d<Block>::size_type col,
6014  const slip::Range<int>& range) const{
6015  Matrix4d<Block> const * tp(matrix_);
6016  return tp->slice_rbegin(slab,row,col,range);
6017 }
6018 
6019 template<typename Block>
6020 inline
6021 typename GenericMultiComponent4d<Block>::const_reverse_slice_range_iterator
6022 GenericMultiComponent4d<Block>::slice_rend(const GenericMultiComponent4d<Block>::size_type slab,
6023  const GenericMultiComponent4d<Block>::size_type row,
6024  const GenericMultiComponent4d<Block>::size_type col,
6025  const slip::Range<int>& range) const{
6026  Matrix4d<Block> const * tp(matrix_);
6027  return tp->slice_rend(slab,row,col,range);
6028 }
6029 
6030 //------------------------row range iterators -----------------------
6031 
6032 template<typename Block>
6033 inline
6034 typename GenericMultiComponent4d<Block>::row_range_iterator
6035 GenericMultiComponent4d<Block>::row_begin(const GenericMultiComponent4d<Block>::size_type slab,
6036  const GenericMultiComponent4d<Block>::size_type slice,
6037  const GenericMultiComponent4d<Block>::size_type row,
6038  const slip::Range<int>& range){
6039  return matrix_->row_begin(slab,slice,row,range);
6040 }
6041 
6042 template<typename Block>
6043 inline
6044 typename GenericMultiComponent4d<Block>::row_range_iterator
6045 GenericMultiComponent4d<Block>::row_end(const GenericMultiComponent4d<Block>::size_type slab,
6046  const GenericMultiComponent4d<Block>::size_type slice,
6047  const GenericMultiComponent4d<Block>::size_type row,
6048  const slip::Range<int>& range){
6049  return matrix_->row_end(slab,slice,row,range);
6050 }
6051 
6052 template<typename Block>
6053 inline
6054 typename GenericMultiComponent4d<Block>::const_row_range_iterator
6055 GenericMultiComponent4d<Block>::row_begin(const GenericMultiComponent4d<Block>::size_type slab,
6056  const GenericMultiComponent4d<Block>::size_type slice,
6057  const GenericMultiComponent4d<Block>::size_type row,
6058  const slip::Range<int>& range) const{
6059  Matrix4d<Block> const * tp(matrix_);
6060  return tp->row_begin(slab,slice,row,range);
6061 }
6062 
6063 template<typename Block>
6064 inline
6065 typename GenericMultiComponent4d<Block>::const_row_range_iterator
6066 GenericMultiComponent4d<Block>::row_end(const GenericMultiComponent4d<Block>::size_type slab,
6067  const GenericMultiComponent4d<Block>::size_type slice,
6068  const GenericMultiComponent4d<Block>::size_type row,
6069  const slip::Range<int>& range) const{
6070  Matrix4d<Block> const * tp(matrix_);
6071  return tp->row_end(slab,slice,row,range);
6072 }
6073 
6074 template<typename Block>
6075 inline
6076 typename GenericMultiComponent4d<Block>::reverse_row_range_iterator
6077 GenericMultiComponent4d<Block>::row_rbegin(const GenericMultiComponent4d<Block>::size_type slab,
6078  const GenericMultiComponent4d<Block>::size_type slice,
6079  const GenericMultiComponent4d<Block>::size_type row,
6080  const slip::Range<int>& range){
6081  return matrix_->row_rbegin(slab,slice,row,range);
6082 }
6083 
6084 template<typename Block>
6085 inline
6086 typename GenericMultiComponent4d<Block>::reverse_row_range_iterator
6087 GenericMultiComponent4d<Block>::row_rend(const GenericMultiComponent4d<Block>::size_type slab,
6088  const GenericMultiComponent4d<Block>::size_type slice,
6089  const GenericMultiComponent4d<Block>::size_type row,
6090  const slip::Range<int>& range){
6091  return matrix_->row_rend(slab,slice,row,range);
6092 }
6093 
6094 template<typename Block>
6095 inline
6096 typename GenericMultiComponent4d<Block>::const_reverse_row_range_iterator
6097 GenericMultiComponent4d<Block>::row_rbegin(const GenericMultiComponent4d<Block>::size_type slab,
6098  const GenericMultiComponent4d<Block>::size_type slice,
6099  const GenericMultiComponent4d<Block>::size_type row,
6100  const slip::Range<int>& range) const{
6101  Matrix4d<Block> const * tp(matrix_);
6102  return tp->row_rbegin(slab,slice,row,range);
6103 }
6104 
6105 template<typename Block>
6106 inline
6107 typename GenericMultiComponent4d<Block>::const_reverse_row_range_iterator
6108 GenericMultiComponent4d<Block>::row_rend(const GenericMultiComponent4d<Block>::size_type slab,
6109  const GenericMultiComponent4d<Block>::size_type slice,
6110  const GenericMultiComponent4d<Block>::size_type row,
6111  const slip::Range<int>& range) const{
6112  Matrix4d<Block> const * tp(matrix_);
6113  return tp->row_rend(slab,slice,row,range);
6114 }
6115 
6116 //------------------------col range iterators -----------------------
6117 
6118 template<typename Block>
6119 inline
6120 typename GenericMultiComponent4d<Block>::col_range_iterator
6121 GenericMultiComponent4d<Block>::col_begin(const GenericMultiComponent4d<Block>::size_type slab,
6122  const GenericMultiComponent4d<Block>::size_type slice,
6123  const GenericMultiComponent4d<Block>::size_type col,
6124  const slip::Range<int>& range){
6125  return matrix_->col_begin(slab,slice,col,range);
6126 }
6127 
6128 template<typename Block>
6129 inline
6130 typename GenericMultiComponent4d<Block>::col_range_iterator
6131 GenericMultiComponent4d<Block>::col_end(const GenericMultiComponent4d<Block>::size_type slab,
6132  const GenericMultiComponent4d<Block>::size_type slice,
6133  const GenericMultiComponent4d<Block>::size_type col,
6134  const slip::Range<int>& range){
6135  return matrix_->col_end(slab,slice,col,range);
6136 }
6137 
6138 template<typename Block>
6139 inline
6140 typename GenericMultiComponent4d<Block>::const_col_range_iterator
6141 GenericMultiComponent4d<Block>::col_begin(const GenericMultiComponent4d<Block>::size_type slab,
6142  const GenericMultiComponent4d<Block>::size_type slice,
6143  const GenericMultiComponent4d<Block>::size_type col,
6144  const slip::Range<int>& range) const{
6145  Matrix4d<Block> const * tp(matrix_);
6146  return tp->col_begin(slab,slice,col,range);
6147 }
6148 
6149 template<typename Block>
6150 inline
6151 typename GenericMultiComponent4d<Block>::const_col_range_iterator
6152 GenericMultiComponent4d<Block>::col_end(const GenericMultiComponent4d<Block>::size_type slab,
6153  const GenericMultiComponent4d<Block>::size_type slice,
6154  const GenericMultiComponent4d<Block>::size_type col,
6155  const slip::Range<int>& range) const{
6156  Matrix4d<Block> const * tp(matrix_);
6157  return tp->col_end(slab,slice,col,range);
6158 }
6159 
6160 template<typename Block>
6161 inline
6162 typename GenericMultiComponent4d<Block>::reverse_col_range_iterator
6163 GenericMultiComponent4d<Block>::col_rbegin(const GenericMultiComponent4d<Block>::size_type slab,
6164  const GenericMultiComponent4d<Block>::size_type slice,
6165  const GenericMultiComponent4d<Block>::size_type col,
6166  const slip::Range<int>& range){
6167  return matrix_->col_rbegin(slab,slice,col,range);
6168 }
6169 
6170 template<typename Block>
6171 inline
6172 typename GenericMultiComponent4d<Block>::reverse_col_range_iterator
6173 GenericMultiComponent4d<Block>::col_rend(const GenericMultiComponent4d<Block>::size_type slab,
6174  const GenericMultiComponent4d<Block>::size_type slice,
6175  const GenericMultiComponent4d<Block>::size_type col,
6176  const slip::Range<int>& range){
6177  return matrix_->col_rend(slab,slice,col,range);
6178 }
6179 
6180 template<typename Block>
6181 inline
6182 typename GenericMultiComponent4d<Block>::const_reverse_col_range_iterator
6183 GenericMultiComponent4d<Block>::col_rbegin(const GenericMultiComponent4d<Block>::size_type slab,
6184  const GenericMultiComponent4d<Block>::size_type slice,
6185  const GenericMultiComponent4d<Block>::size_type col,
6186  const slip::Range<int>& range) const{
6187  Matrix4d<Block> const * tp(matrix_);
6188  return tp->col_rbegin(slab,slice,col,range);
6189 }
6190 
6191 template<typename Block>
6192 inline
6193 typename GenericMultiComponent4d<Block>::const_reverse_col_range_iterator
6194 GenericMultiComponent4d<Block>::col_rend(const GenericMultiComponent4d<Block>::size_type slab,
6195  const GenericMultiComponent4d<Block>::size_type slice,
6196  const GenericMultiComponent4d<Block>::size_type col,
6197  const slip::Range<int>& range) const{
6198  Matrix4d<Block> const * tp(matrix_);
6199  return tp->col_rend(slab,slice,col,range);
6200 }
6201 
6202 //****************************************************************************
6203 // Four dimensional iterators
6204 //****************************************************************************
6205 
6206 //------------------------ Global iterators------------------------------------
6207 
6208 template<typename Block>
6209 inline
6210 typename GenericMultiComponent4d<Block>::iterator4d
6212  return matrix_->first_front_upper_left();
6213 }
6214 
6215 template<typename Block>
6216 inline
6219  return matrix_->last_back_bottom_right();
6220 }
6221 
6222 template<typename Block>
6223 inline
6226  Matrix4d<Block> const * tp(matrix_);
6227  return tp->first_front_upper_left();
6228 }
6229 
6230 template<typename Block>
6231 inline
6234  Matrix4d<Block> const * tp(matrix_);
6235  return tp->last_back_bottom_right();
6236 }
6237 
6238 template<typename Block>
6239 inline
6242  return matrix_->rfirst_front_upper_left();
6243 }
6244 
6245 template<typename Block>
6246 inline
6249  return matrix_->rlast_back_bottom_right();
6250 }
6251 
6252 template<typename Block>
6253 inline
6256  Matrix4d<Block> const * tp(matrix_);
6257  return tp->rfirst_front_upper_left();
6258 }
6259 
6260 template<typename Block>
6261 inline
6264  Matrix4d<Block> const * tp(matrix_);
6265  return tp->rlast_back_bottom_right();
6266 }
6267 
6268 //------------------------ Box iterators------------------------------------
6269 
6270 template<typename Block>
6271 inline
6274  return matrix_->first_front_upper_left(box);
6275 }
6276 
6277 template<typename Block>
6278 inline
6281  return matrix_->last_back_bottom_right(box);
6282 }
6283 
6284 template<typename Block>
6285 inline
6288  Matrix4d<Block> const * tp(matrix_);
6289  return tp->first_front_upper_left(box);
6290 }
6291 
6292 template<typename Block>
6293 inline
6296  Matrix4d<Block> const * tp(matrix_);
6297  return tp->last_back_bottom_right(box);
6298 }
6299 
6300 template<typename Block>
6301 inline
6304  return matrix_->rfirst_front_upper_left(box);
6305 }
6306 
6307 template<typename Block>
6308 inline
6311  return matrix_->rlast_back_bottom_right(box);
6312 }
6313 
6314 template<typename Block>
6315 inline
6318  Matrix4d<Block> const * tp(matrix_);
6319  return tp->rfirst_front_upper_left(box);
6320 }
6321 
6322 template<typename Block>
6323 inline
6326  Matrix4d<Block> const * tp(matrix_);
6327  return tp->rlast_back_bottom_right(box);
6328 }
6329 
6330 //------------------------ Range iterators------------------------------------
6331 
6332 template<typename Block>
6333 inline
6336  const slip::Range<int>& slice_range, const slip::Range<int>& row_range,
6337  const slip::Range<int>& col_range){
6338  return matrix_->first_front_upper_left(slab_range,slice_range,row_range,col_range);
6339 }
6340 
6341 template<typename Block>
6342 inline
6345  const slip::Range<int>& slice_range, const slip::Range<int>& row_range,
6346  const slip::Range<int>& col_range){
6347  return matrix_->last_back_bottom_right(slab_range,slice_range,row_range,col_range);
6348 }
6349 
6350 template<typename Block>
6351 inline
6354  const slip::Range<int>& slice_range, const slip::Range<int>& row_range,
6355  const slip::Range<int>& col_range) const{
6356  Matrix4d<Block> const * tp(matrix_);
6357  return tp->first_front_upper_left(slab_range,slice_range,row_range,col_range);
6358 }
6359 
6360 template<typename Block>
6361 inline
6364  const slip::Range<int>& slice_range, const slip::Range<int>& row_range,
6365  const slip::Range<int>& col_range) const{
6366  Matrix4d<Block> const * tp(matrix_);
6367  return tp->last_back_bottom_right(slab_range,slice_range,row_range,col_range);
6368 }
6369 
6370 template<typename Block>
6371 inline
6374  const slip::Range<int>& slice_range, const slip::Range<int>& row_range,
6375  const slip::Range<int>& col_range){
6376  return matrix_->rfirst_front_upper_left(slab_range,slice_range,row_range,col_range);
6377 }
6378 
6379 template<typename Block>
6380 inline
6383  const slip::Range<int>& slice_range, const slip::Range<int>& row_range,
6384  const slip::Range<int>& col_range){
6385  return matrix_->rlast_back_bottom_right(slab_range,slice_range,row_range,col_range);
6386 }
6387 
6388 template<typename Block>
6389 inline
6392  const slip::Range<int>& slice_range, const slip::Range<int>& row_range,
6393  const slip::Range<int>& col_range) const{
6394  Matrix4d<Block> const * tp(matrix_);
6395  return tp->rfirst_front_upper_left(slab_range,slice_range,row_range,col_range);
6396 }
6397 
6398 template<typename Block>
6399 inline
6402  const slip::Range<int>& slice_range, const slip::Range<int>& row_range,
6403  const slip::Range<int>& col_range) const{
6404  Matrix4d<Block> const * tp(matrix_);
6405  return tp->rlast_back_bottom_right(slab_range,slice_range,row_range,col_range);
6406 }
6407 
6408 
6409 
6410 //********************************************************************************
6411 // Component iterators
6412 //********************************************************************************
6413 
6414 //------------------------ Component iterators------------------------------------
6415 
6416 template<typename Block>
6417 inline
6419 GenericMultiComponent4d<Block>::begin(const std::size_t component){
6420  return typename GenericMultiComponent4d<Block>::component_iterator((typename Block::pointer)begin() + component);
6421 }
6422 
6423 template<typename Block>
6424 inline
6426 GenericMultiComponent4d<Block>::begin(const std::size_t component) const{
6427  return typename GenericMultiComponent4d<Block>::const_component_iterator((typename Block::const_pointer)begin() + component);
6428 }
6429 
6430 template<typename Block>
6431 inline
6433 GenericMultiComponent4d<Block>::end(const std::size_t component){
6434  return typename GenericMultiComponent4d<Block>::component_iterator((typename Block::pointer)end() + component);
6435 }
6436 
6437 template<typename Block>
6438 inline
6440 GenericMultiComponent4d<Block>::end(const std::size_t component) const{
6441  return typename GenericMultiComponent4d<Block>::const_component_iterator((typename Block::const_pointer)end() + component);
6442 }
6443 
6444 template<typename Block>
6445 inline
6447 GenericMultiComponent4d<Block>::rbegin(const std::size_t component){
6448  return typename GenericMultiComponent4d<Block>::reverse_component_iterator(this->end(component));
6449 }
6450 
6451 template<typename Block>
6452 inline
6454 GenericMultiComponent4d<Block>::rbegin(const std::size_t component) const{
6455  return typename GenericMultiComponent4d<Block>::const_reverse_component_iterator(this->end(component));
6456 }
6457 
6458 template<typename Block>
6459 inline
6461 GenericMultiComponent4d<Block>::rend(const std::size_t component){
6462  return typename GenericMultiComponent4d<Block>::reverse_component_iterator(this->begin(component));
6463 }
6464 
6465 template<typename Block>
6466 inline
6468 GenericMultiComponent4d<Block>::rend(const std::size_t component) const{
6469  return typename GenericMultiComponent4d<Block>::const_reverse_component_iterator(this->begin(component));
6470 }
6471 
6472 //--------------------One dimensional component slab iterators----------------------
6473 
6474 template<typename Block>
6475 inline
6479  return typename GenericMultiComponent4d<Block>::component_slab_iterator(&((*this)[0][slice][row][col][component]),
6480  Block::SIZE * this->dim2() * this->dim3() * this->dim4());
6481 }
6482 
6483 template<typename Block>
6484 inline
6485 typename GenericMultiComponent4d<Block>::const_component_slab_iterator
6486 GenericMultiComponent4d<Block>::slab_begin(const std::size_t component, const GenericMultiComponent4d<Block>::size_type slice,
6487  const GenericMultiComponent4d<Block>::size_type row, const GenericMultiComponent4d<Block>::size_type col) const{
6488  return typename GenericMultiComponent4d<Block>::const_component_slab_iterator(&((*this)[0][slice][row][col][component]),
6489  Block::SIZE * this->dim2() * this->dim3() * this->dim4());
6490 }
6491 
6492 template<typename Block>
6493 inline
6494 typename GenericMultiComponent4d<Block>::component_slab_iterator
6495 GenericMultiComponent4d<Block>::slab_end(const std::size_t component, const GenericMultiComponent4d<Block>::size_type slice,
6496  const GenericMultiComponent4d<Block>::size_type row, const GenericMultiComponent4d<Block>::size_type col){
6497  return ++(typename GenericMultiComponent4d<Block>::component_slab_iterator(&((*this)[this->dim1()-1][slice][row][col][component]),
6498  Block::SIZE * this->dim2() * this->dim3() * this->dim4()));
6499 }
6500 
6501 template<typename Block>
6502 inline
6503 typename GenericMultiComponent4d<Block>::const_component_slab_iterator
6504 GenericMultiComponent4d<Block>::slab_end(const std::size_t component, const GenericMultiComponent4d<Block>::size_type slice,
6505  const GenericMultiComponent4d<Block>::size_type row, const GenericMultiComponent4d<Block>::size_type col) const{
6506  return ++(typename GenericMultiComponent4d<Block>::const_component_slab_iterator(&((*this)[this->dim1()-1][slice][row][col][component]),
6507  Block::SIZE * this->dim2() * this->dim3() * this->dim4()));
6508 }
6509 
6510 template<typename Block>
6511 inline
6512 typename GenericMultiComponent4d<Block>::reverse_component_slab_iterator
6513 GenericMultiComponent4d<Block>::slab_rbegin(const std::size_t component, const GenericMultiComponent4d<Block>::size_type slice,
6514  const GenericMultiComponent4d<Block>::size_type row, const GenericMultiComponent4d<Block>::size_type col){
6515  return typename GenericMultiComponent4d<Block>::reverse_component_slab_iterator(this->slab_end(component,slice,row,col));
6516 }
6517 
6518 template<typename Block>
6519 inline
6520 typename GenericMultiComponent4d<Block>::const_reverse_component_slab_iterator
6521 GenericMultiComponent4d<Block>::slab_rbegin(const std::size_t component, const GenericMultiComponent4d<Block>::size_type slice,
6522  const GenericMultiComponent4d<Block>::size_type row, const GenericMultiComponent4d<Block>::size_type col) const{
6523  return typename GenericMultiComponent4d<Block>::const_reverse_component_slab_iterator(this->slab_end(component,slice,row,col));
6524 }
6525 
6526 template<typename Block>
6527 inline
6528 typename GenericMultiComponent4d<Block>::reverse_component_slab_iterator
6529 GenericMultiComponent4d<Block>::slab_rend(const std::size_t component, const GenericMultiComponent4d<Block>::size_type slice,
6530  const GenericMultiComponent4d<Block>::size_type row, const GenericMultiComponent4d<Block>::size_type col){
6531  return typename GenericMultiComponent4d<Block>::reverse_component_slab_iterator(this->slab_begin(component,slice,row,col));
6532 }
6533 
6534 template<typename Block>
6535 inline
6536 typename GenericMultiComponent4d<Block>::const_reverse_component_slab_iterator
6537 GenericMultiComponent4d<Block>::slab_rend(const std::size_t component, const GenericMultiComponent4d<Block>::size_type slice,
6538  const GenericMultiComponent4d<Block>::size_type row, const GenericMultiComponent4d<Block>::size_type col) const{
6539  return typename GenericMultiComponent4d<Block>::const_reverse_component_slab_iterator(this->slab_begin(component,slice,row,col));
6540 }
6541 
6542 //--------------------One dimensional component slice iterators----------------------
6543 
6544 template<typename Block>
6545 inline
6546 typename GenericMultiComponent4d<Block>::component_slice_iterator
6547 GenericMultiComponent4d<Block>::slice_begin(const std::size_t component, const GenericMultiComponent4d<Block>::size_type slab,
6548  const GenericMultiComponent4d<Block>::size_type row, const GenericMultiComponent4d<Block>::size_type col){
6549  return GenericMultiComponent4d<Block>::component_slice_iterator(&((*this)[slab][0][row][col][component]),
6550  Block::SIZE * this->dim3() * this->dim4());
6551 }
6552 
6553 template<typename Block>
6554 inline
6555 typename GenericMultiComponent4d<Block>::const_component_slice_iterator
6556 GenericMultiComponent4d<Block>::slice_begin(const std::size_t component, const GenericMultiComponent4d<Block>::size_type slab,
6557  const GenericMultiComponent4d<Block>::size_type row, const GenericMultiComponent4d<Block>::size_type col) const{
6558  return GenericMultiComponent4d<Block>::const_component_slice_iterator(&((*this)[slab][0][row][col][component]),
6559  Block::SIZE * this->dim3() * this->dim4());
6560 }
6561 
6562 template<typename Block>
6563 inline
6564 typename GenericMultiComponent4d<Block>::component_slice_iterator
6565 GenericMultiComponent4d<Block>::slice_end(const std::size_t component, const GenericMultiComponent4d<Block>::size_type slab,
6566  const GenericMultiComponent4d<Block>::size_type row, const GenericMultiComponent4d<Block>::size_type col){
6567  return ++(typename GenericMultiComponent4d<Block>::component_slice_iterator(&((*this)[slab][this->dim2()-1][row][col][component]),
6568  Block::SIZE * this->dim3() * this->dim4()));
6569 }
6570 
6571 template<typename Block>
6572 inline
6573 typename GenericMultiComponent4d<Block>::const_component_slice_iterator
6574 GenericMultiComponent4d<Block>::slice_end(const std::size_t component, const GenericMultiComponent4d<Block>::size_type slab,
6575  const GenericMultiComponent4d<Block>::size_type row, const GenericMultiComponent4d<Block>::size_type col) const{
6576  return ++(typename GenericMultiComponent4d<Block>::const_component_slice_iterator(&((*this)[slab][this->dim2()-1][row][col][component]),
6577  Block::SIZE * this->dim3() * this->dim4()));
6578 }
6579 
6580 template<typename Block>
6581 inline
6582 typename GenericMultiComponent4d<Block>::reverse_component_slice_iterator
6583 GenericMultiComponent4d<Block>::slice_rbegin(const std::size_t component, const GenericMultiComponent4d<Block>::size_type slab,
6584  const GenericMultiComponent4d<Block>::size_type row, const GenericMultiComponent4d<Block>::size_type col){
6585  return typename GenericMultiComponent4d<Block>::reverse_component_slice_iterator(this->slice_end(component,slab,row,col));
6586 }
6587 
6588 template<typename Block>
6589 inline
6590 typename GenericMultiComponent4d<Block>::const_reverse_component_slice_iterator
6591 GenericMultiComponent4d<Block>::slice_rbegin(const std::size_t component, const GenericMultiComponent4d<Block>::size_type slab,
6592  const GenericMultiComponent4d<Block>::size_type row, const GenericMultiComponent4d<Block>::size_type col) const{
6593  return typename GenericMultiComponent4d<Block>::const_reverse_component_slice_iterator(this->slice_end(component,slab,row,col));
6594 }
6595 
6596 template<typename Block>
6597 inline
6598 typename GenericMultiComponent4d<Block>::reverse_component_slice_iterator
6599 GenericMultiComponent4d<Block>::slice_rend(const std::size_t component, const GenericMultiComponent4d<Block>::size_type slab,
6600  const GenericMultiComponent4d<Block>::size_type row, const GenericMultiComponent4d<Block>::size_type col){
6601  return typename GenericMultiComponent4d<Block>::reverse_component_slice_iterator(this->slice_begin(component,slab,row,col));
6602 }
6603 
6604 template<typename Block>
6605 inline
6606 typename GenericMultiComponent4d<Block>::const_reverse_component_slice_iterator
6607 GenericMultiComponent4d<Block>::slice_rend(const std::size_t component, const GenericMultiComponent4d<Block>::size_type slab,
6608  const GenericMultiComponent4d<Block>::size_type row, const GenericMultiComponent4d<Block>::size_type col) const{
6609  return typename GenericMultiComponent4d<Block>::const_reverse_component_slice_iterator(this->slice_begin(component,slab,row,col));
6610 }
6611 
6612 //-------------------row component iterators----------
6613 
6614 template<typename Block>
6615 inline
6616 typename GenericMultiComponent4d<Block>::component_row_iterator
6617 GenericMultiComponent4d<Block>::row_begin(const std::size_t component, const GenericMultiComponent4d<Block>::size_type slab,
6618  const GenericMultiComponent4d<Block>::size_type slice, const GenericMultiComponent4d<Block>::size_type row){
6620  (typename Block::pointer)this->row_begin(slab,slice,row) + component);
6621 }
6622 
6623 template<typename Block>
6624 inline
6625 typename GenericMultiComponent4d<Block>::const_component_row_iterator
6626 GenericMultiComponent4d<Block>::row_begin(const std::size_t component, const GenericMultiComponent4d<Block>::size_type slab,
6627  const GenericMultiComponent4d<Block>::size_type slice, const GenericMultiComponent4d<Block>::size_type row) const{
6629  (typename Block::const_pointer)this->row_begin(slab,slice,row) + component);
6630 }
6631 
6632 template<typename Block>
6633 inline
6634 typename GenericMultiComponent4d<Block>::component_row_iterator
6635 GenericMultiComponent4d<Block>::row_end(const std::size_t component, const GenericMultiComponent4d<Block>::size_type slab,
6636  const GenericMultiComponent4d<Block>::size_type slice, const GenericMultiComponent4d<Block>::size_type row){
6638  (typename Block::pointer)this->row_end(slab,slice,row) + component);
6639 }
6640 
6641 template<typename Block>
6642 inline
6643 typename GenericMultiComponent4d<Block>::const_component_row_iterator
6644 GenericMultiComponent4d<Block>::row_end(const std::size_t component, const GenericMultiComponent4d<Block>::size_type slab,
6645  const GenericMultiComponent4d<Block>::size_type slice, const GenericMultiComponent4d<Block>::size_type row) const{
6647  (typename Block::const_pointer)this->row_end(slab,slice,row) + component);
6648 }
6649 
6650 template<typename Block>
6651 inline
6652 typename GenericMultiComponent4d<Block>::reverse_component_row_iterator
6653 GenericMultiComponent4d<Block>::row_rbegin(const std::size_t component, const GenericMultiComponent4d<Block>::size_type slab,
6654  const GenericMultiComponent4d<Block>::size_type slice, const GenericMultiComponent4d<Block>::size_type row){
6655  return typename GenericMultiComponent4d<Block>::reverse_component_row_iterator(this->row_end(component,slab,slice,row));
6656 }
6657 
6658 template<typename Block>
6659 inline
6660 typename GenericMultiComponent4d<Block>::const_reverse_component_row_iterator
6661 GenericMultiComponent4d<Block>::row_rbegin(const std::size_t component, const GenericMultiComponent4d<Block>::size_type slab,
6662  const GenericMultiComponent4d<Block>::size_type slice, const GenericMultiComponent4d<Block>::size_type row) const{
6663  return typename GenericMultiComponent4d<Block>::const_reverse_component_row_iterator(this->row_end(component,slab,slice,row));
6664 }
6665 
6666 template<typename Block>
6667 inline
6668 typename GenericMultiComponent4d<Block>::reverse_component_row_iterator
6669 GenericMultiComponent4d<Block>::row_rend(const std::size_t component, const GenericMultiComponent4d<Block>::size_type slab,
6670  const GenericMultiComponent4d<Block>::size_type slice, const GenericMultiComponent4d<Block>::size_type row){
6671  return typename GenericMultiComponent4d<Block>::reverse_component_row_iterator(this->row_begin(component,slab,slice,row));
6672 }
6673 
6674 template<typename Block>
6675 inline
6676 typename GenericMultiComponent4d<Block>::const_reverse_component_row_iterator
6677 GenericMultiComponent4d<Block>::row_rend(const std::size_t component, const GenericMultiComponent4d<Block>::size_type slab,
6678  const GenericMultiComponent4d<Block>::size_type slice, const GenericMultiComponent4d<Block>::size_type row) const{
6679  return typename GenericMultiComponent4d<Block>::const_reverse_component_row_iterator(this->row_begin(component,slab,slice,row));
6680 }
6681 
6682 //-------------------Constant component col iterators----------
6683 
6684 template<typename Block>
6685 inline
6686 typename GenericMultiComponent4d<Block>::component_col_iterator
6687 GenericMultiComponent4d<Block>::col_begin(const std::size_t component, const GenericMultiComponent4d<Block>::size_type slab,
6688  const GenericMultiComponent4d<Block>::size_type slice, const GenericMultiComponent4d<Block>::size_type col){
6689  return typename GenericMultiComponent4d<Block>::component_col_iterator(&((*this)[slab][slice][0][col][component]),
6690  Block::SIZE * this->dim4());
6691 }
6692 
6693 template<typename Block>
6694 inline
6695 typename GenericMultiComponent4d<Block>::const_component_col_iterator
6696 GenericMultiComponent4d<Block>::col_begin(const std::size_t component, const GenericMultiComponent4d<Block>::size_type slab,
6697  const GenericMultiComponent4d<Block>::size_type slice, const GenericMultiComponent4d<Block>::size_type col) const{
6698  return typename GenericMultiComponent4d<Block>::const_component_col_iterator(&((*this)[slab][slice][0][col][component]),
6699  Block::SIZE * this->dim4());
6700 }
6701 
6702 template<typename Block>
6703 inline
6704 typename GenericMultiComponent4d<Block>::component_col_iterator
6705 GenericMultiComponent4d<Block>::col_end(const std::size_t component, const GenericMultiComponent4d<Block>::size_type slab,
6706  const GenericMultiComponent4d<Block>::size_type slice, const GenericMultiComponent4d<Block>::size_type col){
6707  return ++(typename GenericMultiComponent4d<Block>::component_col_iterator(&((*this)[slab][slice][this->dim3()-1][col][component]),
6708  Block::SIZE * this->dim4()));
6709 }
6710 
6711 template<typename Block>
6712 inline
6713 typename GenericMultiComponent4d<Block>::const_component_col_iterator
6714 GenericMultiComponent4d<Block>::col_end(const std::size_t component, const GenericMultiComponent4d<Block>::size_type slab,
6715  const GenericMultiComponent4d<Block>::size_type slice, const GenericMultiComponent4d<Block>::size_type col) const{
6716  return ++(typename GenericMultiComponent4d<Block>::const_component_col_iterator(&((*this)[slab][slice][this->dim3()-1][col][component]),
6717  Block::SIZE * this->dim4()));
6718 }
6719 
6720 template<typename Block>
6721 inline
6722 typename GenericMultiComponent4d<Block>::reverse_component_col_iterator
6723 GenericMultiComponent4d<Block>::col_rbegin(const std::size_t component, const GenericMultiComponent4d<Block>::size_type slab,
6724  const GenericMultiComponent4d<Block>::size_type slice, const GenericMultiComponent4d<Block>::size_type col){
6725  return typename GenericMultiComponent4d<Block>::reverse_component_col_iterator(this->col_end(component,slab,slice,col));
6726 }
6727 
6728 template<typename Block>
6729 inline
6730 typename GenericMultiComponent4d<Block>::const_reverse_component_col_iterator
6731 GenericMultiComponent4d<Block>::col_rbegin(const std::size_t component, const GenericMultiComponent4d<Block>::size_type slab,
6732  const GenericMultiComponent4d<Block>::size_type slice, const GenericMultiComponent4d<Block>::size_type col) const{
6733  return typename GenericMultiComponent4d<Block>::const_reverse_component_col_iterator(this->col_end(component,slab,slice,col));
6734 }
6735 
6736 template<typename Block>
6737 inline
6738 typename GenericMultiComponent4d<Block>::reverse_component_col_iterator
6739 GenericMultiComponent4d<Block>::col_rend(const std::size_t component, const GenericMultiComponent4d<Block>::size_type slab,
6740  const GenericMultiComponent4d<Block>::size_type slice, const GenericMultiComponent4d<Block>::size_type col){
6741  return typename GenericMultiComponent4d<Block>::reverse_component_col_iterator(this->col_begin(component,slab,slice,col));
6742 }
6743 
6744 template<typename Block>
6745 inline
6746 typename GenericMultiComponent4d<Block>::const_reverse_component_col_iterator
6747 GenericMultiComponent4d<Block>::col_rend(const std::size_t component, const GenericMultiComponent4d<Block>::size_type slab,
6748  const GenericMultiComponent4d<Block>::size_type slice, const GenericMultiComponent4d<Block>::size_type col) const{
6749  return typename GenericMultiComponent4d<Block>::const_reverse_component_col_iterator(this->col_begin(component,slab,slice,col));
6750 }
6751 
6752 //------------------------component slab range iterators -----------------------
6753 
6754 template<typename Block>
6755 inline
6756 typename GenericMultiComponent4d<Block>::component_slab_range_iterator
6757 GenericMultiComponent4d<Block>::slab_begin(const std::size_t component, const GenericMultiComponent4d<Block>::size_type slice,
6758  const GenericMultiComponent4d<Block>::size_type row, const GenericMultiComponent4d<Block>::size_type col,
6759  const slip::Range<int>& range){
6760  return typename GenericMultiComponent4d<Block>::component_slab_range_iterator(&((*this)[range.start()][slice][row][col][component]),
6761  Block::SIZE * this->dim2() * this->dim3() * this->dim4() * range.stride());
6762 }
6763 
6764 template<typename Block>
6765 inline
6766 typename GenericMultiComponent4d<Block>::component_slab_range_iterator
6767 GenericMultiComponent4d<Block>::slab_end(const std::size_t component, const GenericMultiComponent4d<Block>::size_type slice,
6768  const GenericMultiComponent4d<Block>::size_type row, const GenericMultiComponent4d<Block>::size_type col,
6769  const slip::Range<int>& range){
6771  (&((*this)[range.start() + range.iterations() * range.stride()][slice][row][col][component]),
6772  Block::SIZE * this->dim2() * this->dim3() * this->dim4() * range.stride()));
6773 }
6774 
6775 template<typename Block>
6776 inline
6777 typename GenericMultiComponent4d<Block>::const_component_slab_range_iterator
6778 GenericMultiComponent4d<Block>::slab_begin(const std::size_t component, const GenericMultiComponent4d<Block>::size_type slice,
6779  const GenericMultiComponent4d<Block>::size_type row, const GenericMultiComponent4d<Block>::size_type col,
6780  const slip::Range<int>& range) const{
6781  return typename GenericMultiComponent4d<Block>::const_component_slab_range_iterator(&((*this)[range.start()][slice][row][col][component]),
6782  Block::SIZE * this->dim2() * this->dim3() * this->dim4() * range.stride());
6783 }
6784 
6785 template<typename Block>
6786 inline
6787 typename GenericMultiComponent4d<Block>::const_component_slab_range_iterator
6788 GenericMultiComponent4d<Block>::slab_end(const std::size_t component, const GenericMultiComponent4d<Block>::size_type slice,
6789  const GenericMultiComponent4d<Block>::size_type row, const GenericMultiComponent4d<Block>::size_type col,
6790  const slip::Range<int>& range) const{
6792  (&((*this)[range.start() + range.iterations() * range.stride()][slice][row][col][component]),
6793  Block::SIZE * this->dim2() * this->dim3() * this->dim4() * range.stride()));
6794 }
6795 
6796 template<typename Block>
6797 inline
6798 typename GenericMultiComponent4d<Block>::reverse_component_slab_range_iterator
6799 GenericMultiComponent4d<Block>::slab_rbegin(const std::size_t component, const GenericMultiComponent4d<Block>::size_type slice,
6800  const GenericMultiComponent4d<Block>::size_type row, const GenericMultiComponent4d<Block>::size_type col,
6801  const slip::Range<int>& range){
6802  return typename GenericMultiComponent4d<Block>::reverse_component_slab_range_iterator(this->slab_end(component,slice,row,col,range));
6803 }
6804 
6805 template<typename Block>
6806 inline
6807 typename GenericMultiComponent4d<Block>::reverse_component_slab_range_iterator
6808 GenericMultiComponent4d<Block>::slab_rend(const std::size_t component, const GenericMultiComponent4d<Block>::size_type slice,
6809  const GenericMultiComponent4d<Block>::size_type row, const GenericMultiComponent4d<Block>::size_type col,
6810  const slip::Range<int>& range){
6811  return typename GenericMultiComponent4d<Block>::reverse_component_slab_range_iterator(this->slab_begin(component,slice,row,col,range));
6812 }
6813 
6814 template<typename Block>
6815 inline
6816 typename GenericMultiComponent4d<Block>::const_reverse_component_slab_range_iterator
6817 GenericMultiComponent4d<Block>::slab_rbegin(const std::size_t component, const GenericMultiComponent4d<Block>::size_type slice,
6818  const GenericMultiComponent4d<Block>::size_type row, const GenericMultiComponent4d<Block>::size_type col,
6819  const slip::Range<int>& range) const{
6820  return typename GenericMultiComponent4d<Block>::const_reverse_component_slab_range_iterator(this->slab_end(component,slice,row,col,range));
6821 }
6822 
6823 template<typename Block>
6824 inline
6825 typename GenericMultiComponent4d<Block>::const_reverse_component_slab_range_iterator
6826 GenericMultiComponent4d<Block>::slab_rend(const std::size_t component, const GenericMultiComponent4d<Block>::size_type slice,
6827  const GenericMultiComponent4d<Block>::size_type row, const GenericMultiComponent4d<Block>::size_type col,
6828  const slip::Range<int>& range) const{
6829  return typename GenericMultiComponent4d<Block>::const_reverse_component_slab_range_iterator(this->slab_begin(component,slice,row,col,range));
6830 }
6831 
6832 //------------------------component slice range iterators -----------------------
6833 
6834 template<typename Block>
6835 inline
6836 typename GenericMultiComponent4d<Block>::component_slice_range_iterator
6837 GenericMultiComponent4d<Block>::slice_begin(const std::size_t component, const GenericMultiComponent4d<Block>::size_type slab,
6838  const GenericMultiComponent4d<Block>::size_type row, const GenericMultiComponent4d<Block>::size_type col,
6839  const slip::Range<int>& range){
6840  return typename GenericMultiComponent4d<Block>::component_slice_range_iterator(&((*this)[slab][range.start()][row][col][component]),
6841  Block::SIZE * this->dim3() * this->dim4() * range.stride());
6842 }
6843 
6844 template<typename Block>
6845 inline
6846 typename GenericMultiComponent4d<Block>::component_slice_range_iterator
6847 GenericMultiComponent4d<Block>::slice_end(const std::size_t component, const GenericMultiComponent4d<Block>::size_type slab,
6848  const GenericMultiComponent4d<Block>::size_type row, const GenericMultiComponent4d<Block>::size_type col,
6849  const slip::Range<int>& range){
6851  (&((*this)[slab][range.start() + range.iterations() * range.stride()][row][col][component]),
6852  Block::SIZE * this->dim3() * this->dim4() * range.stride()));
6853 }
6854 
6855 template<typename Block>
6856 inline
6857 typename GenericMultiComponent4d<Block>::const_component_slice_range_iterator
6858 GenericMultiComponent4d<Block>::slice_begin(const std::size_t component, const GenericMultiComponent4d<Block>::size_type slab,
6859  const GenericMultiComponent4d<Block>::size_type row, const GenericMultiComponent4d<Block>::size_type col,
6860  const slip::Range<int>& range) const{
6861  return typename GenericMultiComponent4d<Block>::const_component_slice_range_iterator(&((*this)[slab][range.start()][row][col][component]),
6862  Block::SIZE * this->dim3() * this->dim4() * range.stride());
6863 }
6864 
6865 template<typename Block>
6866 inline
6867 typename GenericMultiComponent4d<Block>::const_component_slice_range_iterator
6868 GenericMultiComponent4d<Block>::slice_end(const std::size_t component, const GenericMultiComponent4d<Block>::size_type slab,
6869  const GenericMultiComponent4d<Block>::size_type row, const GenericMultiComponent4d<Block>::size_type col,
6870  const slip::Range<int>& range) const{
6872  (&((*this)[slab][range.start() + range.iterations() * range.stride()][row][col][component]),
6873  Block::SIZE * this->dim3() * this->dim4() * range.stride()));
6874 }
6875 
6876 template<typename Block>
6877 inline
6878 typename GenericMultiComponent4d<Block>::reverse_component_slice_range_iterator
6879 GenericMultiComponent4d<Block>::slice_rbegin(const std::size_t component, const GenericMultiComponent4d<Block>::size_type slab,
6880  const GenericMultiComponent4d<Block>::size_type row, const GenericMultiComponent4d<Block>::size_type col,
6881  const slip::Range<int>& range){
6882  return typename GenericMultiComponent4d<Block>::reverse_component_slice_range_iterator(this->slice_end(component,slab,row,col,range));
6883 }
6884 
6885 template<typename Block>
6886 inline
6887 typename GenericMultiComponent4d<Block>::reverse_component_slice_range_iterator
6888 GenericMultiComponent4d<Block>::slice_rend(const std::size_t component, const GenericMultiComponent4d<Block>::size_type slab,
6889  const GenericMultiComponent4d<Block>::size_type row, const GenericMultiComponent4d<Block>::size_type col,
6890  const slip::Range<int>& range){
6891  return typename GenericMultiComponent4d<Block>::reverse_component_slice_range_iterator(this->slice_begin(component,slab,row,col,range));
6892 }
6893 
6894 template<typename Block>
6895 inline
6896 typename GenericMultiComponent4d<Block>::const_reverse_component_slice_range_iterator
6897 GenericMultiComponent4d<Block>::slice_rbegin(const std::size_t component, const GenericMultiComponent4d<Block>::size_type slab,
6898  const GenericMultiComponent4d<Block>::size_type row, const GenericMultiComponent4d<Block>::size_type col,
6899  const slip::Range<int>& range) const{
6900  return typename GenericMultiComponent4d<Block>::const_reverse_component_slice_range_iterator(this->slice_end(component,slab,row,col,range));
6901 }
6902 
6903 template<typename Block>
6904 inline
6905 typename GenericMultiComponent4d<Block>::const_reverse_component_slice_range_iterator
6906 GenericMultiComponent4d<Block>::slice_rend(const std::size_t component, const GenericMultiComponent4d<Block>::size_type slab,
6907  const GenericMultiComponent4d<Block>::size_type row, const GenericMultiComponent4d<Block>::size_type col,
6908  const slip::Range<int>& range) const{
6909  return typename GenericMultiComponent4d<Block>::const_reverse_component_slice_range_iterator(this->slice_begin(component,slab,row,col,range));
6910 }
6911 
6912 //------------------------component row range iterators -----------------------
6913 
6914 template<typename Block>
6915 inline
6916 typename GenericMultiComponent4d<Block>::component_row_range_iterator
6917 GenericMultiComponent4d<Block>::row_begin(const std::size_t component, const GenericMultiComponent4d<Block>::size_type slab,
6918  const GenericMultiComponent4d<Block>::size_type slice, const GenericMultiComponent4d<Block>::size_type row,
6919  const slip::Range<int>& range){
6921  (&((*this)[slab][slice][row][range.start()][component]), Block::SIZE * range.stride());
6922 }
6923 
6924 template<typename Block>
6925 inline
6926 typename GenericMultiComponent4d<Block>::component_row_range_iterator
6927 GenericMultiComponent4d<Block>::row_end(const std::size_t component, const GenericMultiComponent4d<Block>::size_type slab,
6928  const GenericMultiComponent4d<Block>::size_type slice, const GenericMultiComponent4d<Block>::size_type row,
6929  const slip::Range<int>& range){
6931  (&((*this)[slab][slice][row][range.start()+ range.iterations() * range.stride()][component]), Block::SIZE * range.stride()));
6932 }
6933 
6934 template<typename Block>
6935 inline
6936 typename GenericMultiComponent4d<Block>::const_component_row_range_iterator
6937 GenericMultiComponent4d<Block>::row_begin(const std::size_t component, const GenericMultiComponent4d<Block>::size_type slab,
6938  const GenericMultiComponent4d<Block>::size_type slice, const GenericMultiComponent4d<Block>::size_type row,
6939  const slip::Range<int>& range) const{
6941  (&((*this)[slab][slice][row][range.start()][component]), Block::SIZE * range.stride());
6942 }
6943 
6944 template<typename Block>
6945 inline
6946 typename GenericMultiComponent4d<Block>::const_component_row_range_iterator
6947 GenericMultiComponent4d<Block>::row_end(const std::size_t component, const GenericMultiComponent4d<Block>::size_type slab,
6948  const GenericMultiComponent4d<Block>::size_type slice, const GenericMultiComponent4d<Block>::size_type row,
6949  const slip::Range<int>& range) const{
6951  (&((*this)[slab][slice][row][range.start()+ range.iterations() * range.stride()][component]), Block::SIZE * range.stride()));
6952 }
6953 
6954 template<typename Block>
6955 inline
6956 typename GenericMultiComponent4d<Block>::reverse_component_row_range_iterator
6957 GenericMultiComponent4d<Block>::row_rbegin(const std::size_t component, const GenericMultiComponent4d<Block>::size_type slab,
6958  const GenericMultiComponent4d<Block>::size_type slice, const GenericMultiComponent4d<Block>::size_type row,
6959  const slip::Range<int>& range){
6960  return typename GenericMultiComponent4d<Block>::reverse_component_row_range_iterator(this->row_end(component,slab,slice,row,range));
6961 }
6962 
6963 template<typename Block>
6964 inline
6965 typename GenericMultiComponent4d<Block>::reverse_component_row_range_iterator
6966 GenericMultiComponent4d<Block>::row_rend(const std::size_t component, const GenericMultiComponent4d<Block>::size_type slab,
6967  const GenericMultiComponent4d<Block>::size_type slice, const GenericMultiComponent4d<Block>::size_type row,
6968  const slip::Range<int>& range){
6969  return typename GenericMultiComponent4d<Block>::reverse_component_row_range_iterator(this->row_begin(component,slab,slice,row,range));
6970 }
6971 
6972 template<typename Block>
6973 inline
6974 typename GenericMultiComponent4d<Block>::const_reverse_component_row_range_iterator
6975 GenericMultiComponent4d<Block>::row_rbegin(const std::size_t component, const GenericMultiComponent4d<Block>::size_type slab,
6976  const GenericMultiComponent4d<Block>::size_type slice, const GenericMultiComponent4d<Block>::size_type row,
6977  const slip::Range<int>& range) const{
6978  return typename GenericMultiComponent4d<Block>::const_reverse_component_row_range_iterator(this->row_end(component,slab,slice,row,range));
6979 }
6980 
6981 template<typename Block>
6982 inline
6983 typename GenericMultiComponent4d<Block>::const_reverse_component_row_range_iterator
6984 GenericMultiComponent4d<Block>::row_rend(const std::size_t component, const GenericMultiComponent4d<Block>::size_type slab,
6985  const GenericMultiComponent4d<Block>::size_type slice, const GenericMultiComponent4d<Block>::size_type row,
6986  const slip::Range<int>& range) const{
6987  return typename GenericMultiComponent4d<Block>::const_reverse_component_row_range_iterator(this->row_begin(component,slab,slice,row,range));
6988 }
6989 
6990 //------------------------component col range iterators -----------------------
6991 
6992 template<typename Block>
6993 inline
6994 typename GenericMultiComponent4d<Block>::component_col_range_iterator
6995 GenericMultiComponent4d<Block>::col_begin(const std::size_t component, const GenericMultiComponent4d<Block>::size_type slab,
6996  const GenericMultiComponent4d<Block>::size_type slice, const GenericMultiComponent4d<Block>::size_type col,
6997  const slip::Range<int>& range){
6998  return typename GenericMultiComponent4d<Block>::component_col_range_iterator(&((*this)[slab][slice][range.start()][col][component]),
6999  Block::SIZE * this->dim4() * range.stride());
7000 }
7001 
7002 template<typename Block>
7003 inline
7004 typename GenericMultiComponent4d<Block>::component_col_range_iterator
7005 GenericMultiComponent4d<Block>::col_end(const std::size_t component, const GenericMultiComponent4d<Block>::size_type slab,
7006  const GenericMultiComponent4d<Block>::size_type slice, const GenericMultiComponent4d<Block>::size_type col,
7007  const slip::Range<int>& range){
7009  (&((*this)[slab][slice][range.start()+ range.iterations() * range.stride()][col][component]),
7010  Block::SIZE * this->dim4() * range.stride()));
7011 }
7012 
7013 template<typename Block>
7014 inline
7015 typename GenericMultiComponent4d<Block>::const_component_col_range_iterator
7016 GenericMultiComponent4d<Block>::col_begin(const std::size_t component, const GenericMultiComponent4d<Block>::size_type slab,
7017  const GenericMultiComponent4d<Block>::size_type slice, const GenericMultiComponent4d<Block>::size_type col,
7018  const slip::Range<int>& range) const{
7019  return typename GenericMultiComponent4d<Block>::const_component_col_range_iterator(&((*this)[slab][slice][range.start()][col][component]),
7020  Block::SIZE * this->dim4() * range.stride());
7021 }
7022 
7023 template<typename Block>
7024 inline
7025 typename GenericMultiComponent4d<Block>::const_component_col_range_iterator
7026 GenericMultiComponent4d<Block>::col_end(const std::size_t component, const GenericMultiComponent4d<Block>::size_type slab,
7027  const GenericMultiComponent4d<Block>::size_type slice, const GenericMultiComponent4d<Block>::size_type col,
7028  const slip::Range<int>& range) const{
7030  (&((*this)[slab][slice][range.start()+ range.iterations() * range.stride()][col][component]),
7031  Block::SIZE * this->dim4() * range.stride()));
7032 }
7033 
7034 template<typename Block>
7035 inline
7036 typename GenericMultiComponent4d<Block>::reverse_component_col_range_iterator
7037 GenericMultiComponent4d<Block>::col_rbegin(const std::size_t component, const GenericMultiComponent4d<Block>::size_type slab,
7038  const GenericMultiComponent4d<Block>::size_type slice, const GenericMultiComponent4d<Block>::size_type col,
7039  const slip::Range<int>& range){
7040  return typename GenericMultiComponent4d<Block>::reverse_component_col_range_iterator(this->col_end(component,slab,slice,col,range));
7041 }
7042 
7043 template<typename Block>
7044 inline
7045 typename GenericMultiComponent4d<Block>::reverse_component_col_range_iterator
7046 GenericMultiComponent4d<Block>::col_rend(const std::size_t component, const GenericMultiComponent4d<Block>::size_type slab,
7047  const GenericMultiComponent4d<Block>::size_type slice, const GenericMultiComponent4d<Block>::size_type col,
7048  const slip::Range<int>& range){
7049  return typename GenericMultiComponent4d<Block>::reverse_component_col_range_iterator(this->col_begin(component,slab,slice,col,range));
7050 }
7051 
7052 template<typename Block>
7053 inline
7054 typename GenericMultiComponent4d<Block>::const_reverse_component_col_range_iterator
7055 GenericMultiComponent4d<Block>::col_rbegin(const std::size_t component, const GenericMultiComponent4d<Block>::size_type slab,
7056  const GenericMultiComponent4d<Block>::size_type slice, const GenericMultiComponent4d<Block>::size_type col,
7057  const slip::Range<int>& range) const{
7058  return typename GenericMultiComponent4d<Block>::const_reverse_component_col_range_iterator(this->col_end(component,slab,slice,col,range));
7059 }
7060 
7061 template<typename Block>
7062 inline
7063 typename GenericMultiComponent4d<Block>::const_reverse_component_col_range_iterator
7064 GenericMultiComponent4d<Block>::col_rend(const std::size_t component, const GenericMultiComponent4d<Block>::size_type slab,
7065  const GenericMultiComponent4d<Block>::size_type slice, const GenericMultiComponent4d<Block>::size_type col,
7066  const slip::Range<int>& range) const{
7067  return typename GenericMultiComponent4d<Block>::const_reverse_component_col_range_iterator(this->col_begin(component,slab,slice,col,range));
7068 }
7069 
7070 //****************************************************************************
7071 // four dimensional component iterators
7072 //****************************************************************************
7073 
7074 //------------------------ Global component iterators------------------------------------
7075 
7076 template<typename Block>
7077 inline
7078 typename GenericMultiComponent4d<Block>::component_iterator4d
7081  (this,component,Box4d<int>(0,0,0,0,this->dim1()-1,this->dim2()-1,this->dim3()-1,this->dim4()-1));
7082 }
7083 
7084 template<typename Block>
7085 inline
7088  DPoint4d<int> dp(this->dim1(),this->dim2(),this->dim3(),this->dim4());
7090  (*this).first_front_upper_left(component) + dp;
7091  return it;
7092 }
7093 
7094 template<typename Block>
7095 inline
7099  (this,component,Box4d<int>(0,0,0,0,this->dim1()-1,this->dim2()-1,this->dim3()-1,this->dim4()-1));
7100 }
7101 
7102 template<typename Block>
7103 inline
7106  DPoint4d<int> dp(this->dim1(),this->dim2(),this->dim3(),this->dim4());
7108  (*this).first_front_upper_left(component) + dp;
7109  return it;
7110 }
7111 
7112 template<typename Block>
7113 inline
7116  DPoint4d<int> dp(1,1,1,0);
7118  (this->last_back_bottom_right(component) - dp);
7119 }
7120 
7121 template<typename Block>
7122 inline
7126  (this->first_front_upper_left(component));
7127 }
7128 
7129 template<typename Block>
7130 inline
7133  DPoint4d<int> dp(1,1,1,0);
7135  (this->last_back_bottom_right(component) - dp);
7136 }
7137 
7138 template<typename Block>
7139 inline
7143  (this->first_front_upper_left(component));
7144 }
7145 
7146 //------------------------ Box component iterators------------------------------------
7147 
7148 template<typename Block>
7149 inline
7152  const Box4d<int>& box){
7153  return typename GenericMultiComponent4d<Block>::component_iterator4d(this,component,box);
7154 }
7155 
7156 template<typename Block>
7157 inline
7160  const Box4d<int>& box){
7161  DPoint4d<int> dp(box.duration(),box.depth(),box.height(),box.width());
7163  ((*this).first_front_upper_left(component,box) + dp));
7164 }
7165 
7166 template<typename Block>
7167 inline
7170  const Box4d<int>& box) const{
7171  return typename GenericMultiComponent4d<Block>::const_component_iterator4d(this,component,box);
7172 }
7173 
7174 template<typename Block>
7175 inline
7178  const Box4d<int>& box) const{
7179  DPoint4d<int> dp(box.duration(),box.depth(),box.height(),box.width());
7181  ((*this).first_front_upper_left(component,box) + dp));
7182 }
7183 
7184 template<typename Block>
7185 inline
7188  const Box4d<int>& box){
7189  DPoint4d<int> dp(1,1,1,0);
7191  (this->last_back_bottom_right(component,box) - dp);
7192 }
7193 
7194 template<typename Block>
7195 inline
7198  const Box4d<int>& box){
7200  (this->first_front_upper_left(component,box));
7201 }
7202 
7203 template<typename Block>
7204 inline
7207  const Box4d<int>& box) const{
7208  DPoint4d<int> dp(1,1,1,0);
7210  (this->last_back_bottom_right(component,box) - dp);
7211 }
7212 
7213 template<typename Block>
7214 inline
7217  const Box4d<int>& box) const{
7219  (this->first_front_upper_left(component,box));
7220 }
7221 
7222 //------------------------ Range component iterators------------------------------------
7223 
7224 template<typename Block>
7225 inline
7228  const slip::Range<int>& slab_range, const slip::Range<int>& slice_range,
7229  const slip::Range<int>& row_range, const slip::Range<int>& col_range){
7231  (this,component,slab_range,slice_range,row_range,col_range);
7232 }
7233 
7234 template<typename Block>
7235 inline
7238  const slip::Range<int>& slab_range, const slip::Range<int>& slice_range,
7239  const slip::Range<int>& row_range, const slip::Range<int>& col_range){
7240  DPoint4d<int> dp(slab_range.iterations()+1,slice_range.iterations()+1,row_range.iterations()+1,col_range.iterations()+1);
7242  ((*this).first_front_upper_left(component,slab_range,slice_range,row_range,col_range) + dp);
7243 }
7244 
7245 template<typename Block>
7246 inline
7249  const slip::Range<int>& slab_range, const slip::Range<int>& slice_range,
7250  const slip::Range<int>& row_range, const slip::Range<int>& col_range) const{
7252  (this,component,slab_range,slice_range,row_range,col_range);
7253 }
7254 
7255 template<typename Block>
7256 inline
7259  const slip::Range<int>& slab_range, const slip::Range<int>& slice_range,
7260  const slip::Range<int>& row_range, const slip::Range<int>& col_range) const{
7261  DPoint4d<int> dp(slab_range.iterations()+1,slice_range.iterations()+1,row_range.iterations()+1,col_range.iterations()+1);
7263  ((*this).first_front_upper_left(component,slab_range,slice_range,row_range,col_range) + dp);
7264 }
7265 
7266 template<typename Block>
7267 inline
7270  const slip::Range<int>& slab_range, const slip::Range<int>& slice_range,
7271  const slip::Range<int>& row_range, const slip::Range<int>& col_range){
7272  DPoint4d<int> dp(1,1,1,0);
7274  (this->last_back_bottom_right(component,slab_range,slice_range,row_range,col_range) - dp);
7275 }
7276 
7277 template<typename Block>
7278 inline
7281  const slip::Range<int>& slab_range, const slip::Range<int>& slice_range,
7282  const slip::Range<int>& row_range, const slip::Range<int>& col_range){
7284  (this->first_front_upper_left(component,slab_range,slice_range,row_range,col_range));
7285 }
7286 
7287 template<typename Block>
7288 inline
7291  const slip::Range<int>& slab_range, const slip::Range<int>& slice_range,
7292  const slip::Range<int>& row_range, const slip::Range<int>& col_range) const{
7293  DPoint4d<int> dp(1,1,1,0);
7295  (this->last_back_bottom_right(component,slab_range,slice_range,row_range,col_range) - dp);
7296 }
7297 
7298 template<typename Block>
7299 inline
7302  const slip::Range<int>& slab_range, const slip::Range<int>& slice_range,
7303  const slip::Range<int>& row_range, const slip::Range<int>& col_range) const{
7305  (this->first_front_upper_left(component,slab_range,slice_range,row_range,col_range));
7306 }
7307 
7308 // i/o operators
7309 
7310 template<typename Block>
7311 inline
7312 std::ostream& operator<<(std::ostream & out, const GenericMultiComponent4d<Block>& a){
7313  out << *(a.matrix_);
7314  out << std::endl;
7315  return out;
7316 }
7317 
7318 // Assignment operators and methods
7319 template<typename Block>
7320 inline
7321 GenericMultiComponent4d<Block>& GenericMultiComponent4d<Block>::operator=
7323  if(this != &rhs)
7324  {
7325  *matrix_ = *(rhs.matrix_);
7326  }
7327  return *this;
7328 }
7329 
7330 template<typename Block>
7331 inline
7333  (const Block& val){
7334  std::fill_n(matrix_->begin(),matrix_->size(),val);
7335  return *this;
7336 }
7337 
7338 template<typename Block>
7339 inline
7341  (const typename Block::value_type& val){
7342  std::fill_n(matrix_->begin(),matrix_->size(),val);
7343  return *this;
7344 }
7345 
7346 // Comparison operators
7347 template<typename Block>
7348 inline
7351  return ( x.size() == y.size()
7352  && std::equal(x.begin(),x.end(),y.begin()));
7353 }
7354 
7355 template<typename Block>
7356 inline
7359  return !(x == y);
7360 }
7361 
7362 // Element access operators
7363 template<typename Block>
7364 inline
7365 typename GenericMultiComponent4d<Block>::pointer**
7366 GenericMultiComponent4d<Block>::operator[](const GenericMultiComponent4d<Block>::size_type t){
7367  return (*matrix_)[t];
7368 }
7369 
7370 template<typename Block>
7371 inline
7372 typename GenericMultiComponent4d<Block>::const_pointer* const *
7373 GenericMultiComponent4d<Block>::operator[](const GenericMultiComponent4d<Block>::size_type t) const{
7374  Matrix4d<Block> const *tp(matrix_);
7375  return (*tp)[t];
7376 }
7377 
7378 template<typename Block>
7379 inline
7380 typename GenericMultiComponent4d<Block>::reference
7381 GenericMultiComponent4d<Block>::operator()(const GenericMultiComponent4d<Block>::size_type t,
7382  const GenericMultiComponent4d<Block>::size_type k,
7383  const GenericMultiComponent4d<Block>::size_type i,
7384  const GenericMultiComponent4d<Block>::size_type j){
7385  return (*matrix_)[t][k][i][j];
7386 }
7387 
7388 template<typename Block>
7389 inline
7390 typename GenericMultiComponent4d<Block>::const_reference
7391 GenericMultiComponent4d<Block>::operator()(const GenericMultiComponent4d<Block>::size_type t,
7392  const GenericMultiComponent4d<Block>::size_type k,
7393  const GenericMultiComponent4d<Block>::size_type i,
7394  const GenericMultiComponent4d<Block>::size_type j) const{
7395  Matrix4d<Block> const *tp(matrix_);
7396  return (*tp)[t][k][i][j];
7397 }
7398 
7399 template<typename Block>
7400 inline
7401 typename GenericMultiComponent4d<Block>::size_type
7403  return matrix_->dim1();
7404 }
7405 
7406 template<typename Block>
7407 inline
7410  return matrix_->dim1();
7411 }
7412 
7413 template<typename Block>
7414 inline
7417  return matrix_->dim2();
7418 }
7419 
7420 template<typename Block>
7421 inline
7424  return matrix_->dim2();
7425 }
7426 
7427 template<typename Block>
7428 inline
7431  return matrix_->dim3();
7432 }
7433 
7434 template<typename Block>
7435 inline
7438  return matrix_->dim3();
7439 }
7440 
7441 template<typename Block>
7442 inline
7445  return matrix_->dim4();
7446 }
7447 
7448 template<typename Block>
7449 inline
7452  return matrix_->dim4();
7453 }
7454 
7455 template<typename Block>
7456 inline
7459  return matrix_->dim4();
7460 }
7461 
7462 template<typename Block>
7463 inline
7466  return matrix_->size();
7467 }
7468 
7469 template<typename Block>
7470 inline
7473  return matrix_->max_size();
7474 }
7475 
7476 template<typename Block>
7477 inline
7478 bool
7480  return matrix_->empty();
7481 }
7482 
7483 template<typename Block>
7484 inline
7485 void
7487  matrix_->swap(*(M.matrix_));
7488 }
7489 
7490 template<typename Block>
7491 inline
7492 Block
7494  Block tmp;
7495  for(typename GenericMultiComponent4d<Block>::size_type component = 0; component < Block::SIZE; ++component)
7496  {
7497  typename Block::value_type min = *std::min_element(this->begin(component),this->end(component));
7498  tmp[component] = min;
7499  }
7500  return tmp;
7501 }
7502 
7503 template<typename Block>
7504 inline
7505 Block
7507  Block tmp;
7508  for(typename GenericMultiComponent4d<Block>::size_type component = 0; component < Block::SIZE; ++component)
7509  {
7510  typename Block::value_type max = *std::max_element(this->begin(component),this->end(component));
7511  tmp[component] = max;
7512  }
7513  return tmp;
7514 }
7515 
7516 template<typename Block>
7517 inline
7520  matrix_->apply(fun);
7521  return *this;
7522 }
7523 
7524 template<typename Block>
7525 inline
7527 GenericMultiComponent4d<Block>::apply(Block(*fun)(const Block&)){
7528  matrix_->apply(fun);
7529  return *this;
7530 }
7531 
7532 }//slip::
7533 
7534 #endif //SLIP_GENERICMULTICOMPONENT4D_HPP
std::reverse_iterator< const_component_slab_range_iterator > const_reverse_component_slab_range_iterator
std::reverse_iterator< const_slab_iterator > const_reverse_slab_iterator
bool operator!=(const Array< T > &x, const Array< T > &y)
Definition: Array.hpp:1448
std::reverse_iterator< iterator4d > reverse_iterator4d
std::reverse_iterator< component_col_range_iterator > reverse_component_col_range_iterator
std::reverse_iterator< component_slice_range_iterator > reverse_component_slice_range_iterator
This is some iterator to iterate a 4d container into a Box area defined by the subscripts of the 4d c...
std::size_t iterations() const
Rerturns the number of iterations of the range.
Definition: Range.hpp:305
iterator4d first_front_upper_left()
Returns a read/write iterator4d that points to the first element of the Matrix4d. It points to the fi...
Definition: Matrix4d.hpp:4372
reverse_col_iterator col_rend(const size_type slab, 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...
pointer ** operator[](const size_type t)
Subscript access to the slice datas contained in the GenericMultiComponent4d.
reverse_iterator4d rfirst_front_upper_left()
Returns a read/write reverse iterator4d. It points to the last back bottom right element of the Matri...
Definition: Matrix4d.hpp:4421
std::reverse_iterator< const_component_slab_iterator > const_reverse_component_slab_iterator
slip::stride_iterator< const_slice_iterator > const_slice_range_iterator
slip::stride_iterator< const_block_pointer > const_component_col_range_iterator
Array4d< Block >::iterator4d iterator4d
iterator4d last_back_bottom_right()
Returns a read/write iterator4d that points to the past the end element of the Matrix4d. It points to past the end element of the last back bottom right element of the Matrix4d.
Definition: Matrix4d.hpp:4388
size_type cols() const
Returns the number of columns (fourth dimension size) in the GenericMultiComponent4d.
Array4d< Block >::iterator4d_range iterator4d_range
size_type rows() const
Returns the number of rows (third dimension size) in the GenericMultiComponent4d. ...
size_type dim2() const
Returns the number of slices (second dimension size) in the GenericMultiComponent4d.
std::reverse_iterator< const_iterator4d > const_reverse_iterator4d
const_component_iterator const_component_row_iterator
slice_iterator slice_end(const size_type slab, 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 (slab...
reverse_slab_iterator slab_rend(const size_type slice, 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 (slice...
slip::stride_iterator< block_pointer > component_slice_range_iterator
reference operator()(const size_type t, const size_type k, const size_type i, const size_type j)
Subscript access to the data contained in the GenericMultiComponent4d.
slip::stride_iterator< block_pointer > component_slice_iterator
void fill(InputIterator first, InputIterator last)
Fills the container range [begin(),begin()+size()) with a copy of the range [first,last)
GenericMultiComponent4d(const size_type slabs, const size_type slices, const size_type rows, const size_type cols, InputIterator first, InputIterator last)
Contructs a GenericMultiComponent4d from a range.
slice_iterator slice_begin(const size_type slab, const size_type row, const size_type col)
Returns a read/write iterator that points to the first element of the line (slab,row,col) through the slices in the GenericMultiComponent4d. Iteration is done in ordinary element order (increasing slice number).
GenericMultiComponent4d< Block > & apply(Block(*fun)(Block))
Returns the sums of the elements of the GenericMultiComponent4d.
std::reverse_iterator< const_row_range_iterator > const_reverse_row_range_iterator
std::reverse_iterator< const_slab_range_iterator > const_reverse_slab_range_iterator
CoordType depth() const
compute the depth of the Box4d (second dimension size).
Definition: Box4d.hpp:428
std::reverse_iterator< const_component_col_iterator > const_reverse_component_col_iterator
reverse_iterator4d rlast_back_bottom_right()
Returns a read/write reverse iterator4d. It points to past the first front upper left element of the ...
Block max() const
Returns the max elements of the GenericMultiComponent4d according to the operator <...
This is some iterator to iterate a 4d container into two Range defined by the indices and strides of ...
This is a GenericMultiComponent4d class. This container statisfies the BidirectionnalContainer concep...
Numerical matrix4d class. This container statisfies the RandomAccessContainer concepts of the STL exc...
T & min(const GrayscaleImage< T > &M1)
Returns the min element of a GrayscaleImage.
slip::stride_iterator< const_block_pointer > const_component_slab_range_iterator
std::reverse_iterator< const_col_iterator > const_reverse_col_iterator
iterator begin()
Returns a read/write iterator that points to the first element in the GenericMultiComponent4d. Iteration is done in ordinary element order.
This is some iterator to iterate a 4d container into a Box area defined by the subscripts of the 4d c...
std::reverse_iterator< component_col_iterator > reverse_component_col_iterator
slip::stride_iterator< const_block_pointer > const_component_col_iterator
size_type columns() const
Returns the number of columns (fourth dimension size) in the GenericMultiComponent4d.
Provides a class to iterate a 4d multicomponent container into four Ranges.
size_type dim4() const
Returns the number of columns (fourth dimension size) in the GenericMultiComponent4d.
slip::stride_iterator< pointer > slab_iterator
This is some iterator to iterate a 4d MultiComponentContainer into a Box area defined by the indices ...
Array4d< Block >::const_iterator4d_range const_iterator4d_range
std::reverse_iterator< const_slice_iterator > const_reverse_slice_iterator
std::reverse_iterator< col_range_iterator > reverse_col_range_iterator
std::reverse_iterator< const_slice_range_iterator > const_reverse_slice_range_iterator
slip::stride_iterator< const_block_pointer > const_component_slab_iterator
slip::kstride_iterator< typename Block::pointer, Block::SIZE > component_iterator
reverse_slice_iterator slice_rend(const size_type slab, 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 (slab...
reverse_slab_iterator slab_rbegin(const size_type slice, const size_type row, const size_type col)
Returns a read/write iterator that points to the last element of the line (slice,row,col) through the slabs in the GenericMultiComponent4d. Iteration is done in reverse element order (decreasing slab number).
slab_iterator slab_end(const size_type slice, 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 (slice...
slip::stride_iterator< pointer > row_range_iterator
size_type max_size() const
Returns the maximal size (number of elements) in the GenericMultiComponent4d.
slip::stride_iterator< const_block_pointer > const_component_slice_iterator
This is a Box4d class, a specialized version of slip::Box<CoordType,DIM> with DIM = 4...
Definition: Box4d.hpp:107
std::reverse_iterator< component_slab_iterator > reverse_component_slab_iterator
std::reverse_iterator< const_component_row_range_iterator > const_reverse_component_row_range_iterator
std::reverse_iterator< component_iterator > reverse_component_iterator
const block_value_type const_block_reference
slip::const_component_iterator4d_range< const_self, Block::SIZE > const_component_iterator4d_range
size_type dim3() const
Returns the number of rows (third dimension size) in the GenericMultiComponent4d. ...
slip::component_iterator4d_range< self, Block::SIZE > component_iterator4d_range
void fill(std::vector< InputIterator > first_iterators_list, InputIterator last)
Fills the container range [begin(),begin()+size()) with a copy of the range [first,last)
row_iterator row_begin(const size_type slab, 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 and ...
std::reverse_iterator< const_component_slice_iterator > const_reverse_component_slice_iterator
slip::stride_iterator< block_pointer > component_row_range_iterator
slip::stride_iterator< const_block_pointer > const_component_row_range_iterator
Provides a class to iterate a 1d range according to a constant step.
size_type dim1() const
Returns the number of slabs (first dimension size) in the GenericMultiComponent4d.
GenericMultiComponent4d(const size_type slabs, const size_type slices, const size_type rows, const size_type cols, std::vector< InputIterator > first_iterators_list, InputIterator last)
Contructs a GenericMultiComponent4d from a 3 ranges.
Provides a class to manipulate Matrix4d.
const_component_iterator4d_box< const_self, Block::SIZE > const_component_iterator4d
std::reverse_iterator< component_slab_range_iterator > reverse_component_slab_range_iterator
slip::stride_iterator< block_pointer > component_col_iterator
void fill(const Block &value)
Fills the container range [begin(),begin()+size()) with copies of value.
reverse_row_iterator row_rend(const size_type slab, 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...
This is some iterator to iterate a 4d container into two Range defined by the indices and strides of ...
const GenericMultiComponent4d< Block > const_self
std::reverse_iterator< const_iterator > const_reverse_row_iterator
slip::stride_iterator< const_pointer > const_row_range_iterator
std::reverse_iterator< iterator > reverse_row_iterator
reverse_slice_iterator slice_rbegin(const size_type slab, const size_type row, const size_type col)
Returns a read/write iterator that points to the last element of the line (slab,row,col) through the slices in the GenericMultiComponent4d. Iteration is done in reverse element order (decreasing slice number).
slip::stride_iterator< const_col_iterator > const_col_range_iterator
std::reverse_iterator< slice_range_iterator > reverse_slice_range_iterator
std::reverse_iterator< const_component_iterator4d > const_reverse_component_iterator4d
Difference of Point4D class, specialization of DPoint<CoordType,DIM> with DIM = 4.
Definition: DPoint4d.hpp:99
slip::stride_iterator< slice_iterator > slice_range_iterator
Block min() const
Returns the min elements of the GenericMultiComponent4d according to the operator <...
slip::stride_iterator< block_pointer > component_slab_range_iterator
This is a point4d class, a specialized version of Point<CoordType,DIM> with DIM = 4...
void swap(self &M)
Swaps data with another GenericMultiComponent4d.
bool empty() const
Returns true if the GenericMultiComponent4d is empty. (Thus size() == 0)
std::reverse_iterator< col_iterator > reverse_col_iterator
const_iterator begin() const
Returns a read-only (constant) iterator that points to the first element in the Matrix4d. Iteration is done in ordinary element order.
Definition: Matrix4d.hpp:3668
void copy(_II first, _II last, _OI output_first)
Copy algorithm optimized for slip iterators.
Definition: copy_ext.hpp:177
std::reverse_iterator< const_component_slice_range_iterator > const_reverse_component_slice_range_iterator
SubType start() const
Accessor of the start subscript of the Range.
Definition: Range.hpp:284
slip::stride_iterator< pointer > col_iterator
pointer iterator
Definition: Matrix4d.hpp:183
size_type slices() const
Returns the number of slices (second dimension size) in the GenericMultiComponent4d.
iterator end()
Returns a read/write iterator that points one past the last element in the Matrix4d. Iteration is done in ordinary element order.
Definition: Matrix4d.hpp:3691
slip::stride_iterator< block_pointer > component_slab_iterator
slab_iterator slab_begin(const size_type slice, const size_type row, const size_type col)
Returns a read/write iterator that points to the first element of the line (slice,row,col) through the slabs in the GenericMultiComponent4d. Iteration is done in ordinary element order (increasing slab number).
slip::stride_iterator< const_block_pointer > const_component_slice_range_iterator
iterator end()
Returns a read/write iterator that points one past the last element in the GenericMultiComponent4d. Iteration is done in ordinary element order.
Array4d< Block >::const_iterator4d const_iterator4d
void fill(const typename Block::pointer value)
Fills the container range [begin(),begin()+size()) with a copy of the value array.
std::reverse_iterator< slab_range_iterator > reverse_slab_range_iterator
slip::stride_iterator< const_pointer > const_col_iterator
std::reverse_iterator< iterator4d_range > reverse_iterator4d_range
std::reverse_iterator< const_col_range_iterator > const_reverse_col_range_iterator
reverse_col_iterator col_rbegin(const size_type slab, 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< component_slice_iterator > reverse_component_slice_iterator
This is some iterator to iterate a 4d container into two Range defined by the indices and strides of ...
CoordType width() const
compute the width of the Box4d (fourth dimension size).
Definition: Box4d.hpp:420
GenericMultiComponent4d()
Constructs a GenericMultiComponent4d.
component_iterator4d_box< self, Block::SIZE > component_iterator4d
std::reverse_iterator< const_iterator4d_range > const_reverse_iterator4d_range
const block_value_type * const_block_pointer
slip::kstride_iterator< typename Block::const_pointer, Block::SIZE > const_component_iterator
reverse_iterator4d rfirst_front_upper_left()
Returns a read/write reverse iterator4d. It points to the last back bottom right element of the Gener...
std::reverse_iterator< component_iterator4d_range > reverse_component_iterator4d_range
std::reverse_iterator< slab_iterator > reverse_slab_iterator
Some const iterator to iterate a 4d container into two Range defined by the indices and strides of th...
std::reverse_iterator< const_component_iterator4d_range > const_reverse_component_iterator4d_range
slip::stride_iterator< const_slab_iterator > const_slab_range_iterator
slip::stride_iterator< const_pointer > const_slice_iterator
iterator4d last_back_bottom_right()
Returns a read/write iterator4d that points to the past the end element of the GenericMultiComponent4...
int stride() const
Accessor of the stride of the Range.
Definition: Range.hpp:298
std::reverse_iterator< const_component_iterator > const_reverse_component_iterator
CoordType duration() const
compute the duration of the Box4d (first dimension size).
Definition: Box4d.hpp:432
slip::stride_iterator< block_pointer > component_col_range_iterator
Provides a class to manipulate Numerical Matrix.
Provides some algorithms to apply C like functions to ranges.
std::reverse_iterator< iterator > reverse_iterator
std::reverse_iterator< const_component_row_iterator > const_reverse_component_row_iterator
Provides a class to manipulate iterator4d within a slip::Range. It is used to iterate throw 4d contai...
Provides a class to iterate a 1d range according to a step.
size_type size() const
Returns the number of elements in the GenericMultiComponent4d.
virtual ~GenericMultiComponent4d()
Destructor of the GenericMultiComponent4d.
CoordType height() const
compute the height of the Box4d (third dimension size).
Definition: Box4d.hpp:424
slip::stride_iterator< const_pointer > const_slab_iterator
std::reverse_iterator< component_row_range_iterator > reverse_component_row_range_iterator
std::reverse_iterator< component_iterator4d > reverse_component_iterator4d
Provides a class to iterate a 4d MultiComponentContainer into a slip::Box4d.
void fill(const Block *value)
Fills the container range [begin(),begin()+size()) with a copy of the value array.
bool operator==(const Array< T > &x, const Array< T > &y)
Definition: Array.hpp:1439
slip::stride_iterator< pointer > slice_iterator
row_iterator row_end(const size_type slab, 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...
reverse_row_iterator row_rbegin(const size_type slab, 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...
Provides a class to manipulate iterator4d within a slip::Box4d. It is used to iterate throw 4d contai...
self & operator=(const self &rhs)
Assign a GenericMultiComponent4d. Assign elements from the GenericMultiComponent4d rhs...
std::reverse_iterator< const_component_col_range_iterator > const_reverse_component_col_range_iterator
std::reverse_iterator< slice_iterator > reverse_slice_iterator
std::reverse_iterator< component_row_iterator > reverse_component_row_iterator
reverse_iterator4d rlast_back_bottom_right()
Returns a read/write reverse iterator4d. It points to past the first front upper left element of the ...
Definition: Matrix4d.hpp:4404
col_iterator col_begin(const size_type slab, 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...
iterator4d first_front_upper_left()
Returns a read/write iterator4d that points to the first element of the GenericMultiComponent4d. It points to the first front upper left element of the GenericMultiComponent4d.
T & max(const GrayscaleImage< T > &M1)
Returns the max element of a GrayscaleImage.
void fill(std::size_t component, InputIterator first, InputIterator last)
Fills the container range [begin(),begin()+size()) with a copy of the range [first,last)
size_type slabs() const
Returns the number of slabs (first dimension size) in the GenericMultiComponent4d.
slip::stride_iterator< slab_iterator > slab_range_iterator
col_iterator col_end(const size_type slab, 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...
reverse_iterator rbegin()
Returns a read/write reverse iterator that points to the last element in the GenericMultiComponent4d...
This is some iterator to iterate a 4d MultiComponentContainer into a Box area defined by the indices ...
This is a Color struct.
Definition: Color.hpp:93
reverse_iterator rend()
Returns a read/write reverse iterator that points to one before the first element in the GenericMulti...
slip::stride_iterator< col_iterator > col_range_iterator
void resize(const size_type slabs, const size_type slices, const size_type rows, const size_type cols, const Block &val=Block())
Resizes a GenericMultiComponent4d.
std::reverse_iterator< row_range_iterator > reverse_row_range_iterator
std::reverse_iterator< const_iterator > const_reverse_iterator