SLIP  1.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
iterator4d_box.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 
78 #ifndef SLIP_ITERATOR4D_BOX_HPP
79 #define SLIP_ITERATOR4D_BOX_HPP
80 
81 #include <iterator>
82 #include <cassert>
83 
84 #include "DPoint2d.hpp"
85 #include "DPoint3d.hpp"
86 #include "DPoint4d.hpp"
87 #include "Point4d.hpp"
88 #include "Box4d.hpp"
89 #include "iterator_types.hpp"
90 
91 #define INCR_OPT
92 
93 namespace slip
94 {
114 template <class Container4D>
116 {
117 public:
118  //typedef std::random_access_iterator_tag iterator_category;
120  typedef typename Container4D::value_type value_type;
124  typedef typename Container4D::pointer pointer;
125  typedef typename Container4D::reference reference;
126 
127  typedef iterator4d_box self;
128  typedef typename Container4D::size_type size_type;
129 
134 
140  cont4d_(0),pos_(0),x1_(0),x2_(0),x3_(0),x4_(0),box_(0,0,0,0,0,0,0,0)
141  {}
142 
149  iterator4d_box(Container4D* c,
150  const Box4d<int>& b):
151  cont4d_(c),pos_((*c)[(b.first_front_upper_left())[0]][(b.first_front_upper_left())[1]][(b.first_front_upper_left())[2]]
152  + (b.first_front_upper_left())[3]),
153  x1_((b.first_front_upper_left())[0]),x2_((b.first_front_upper_left())[1]),x3_((b.first_front_upper_left())[2]),
154  x4_((b.first_front_upper_left())[3]),box_(b)
155  {}
156 
162  iterator4d_box(const self& o):
163  cont4d_(o.cont4d_),pos_(o.pos_),x1_(o.x1_),x2_(o.x2_),x3_(o.x3_),x4_(o.x4_),box_(o.box_)
164  {}
165 
180  self& operator=(const self& o)
181  {
182  if(this != &o)
183  {
184  this->cont4d_ = o.cont4d_;
185  this->pos_ = o.pos_;
186  this->x1_ = o.x1_;
187  this->x2_ = o.x2_;
188  this->x3_ = o.x3_;
189  this->x4_ = o.x4_;
190  this->box_ = o.box_;
191  }
192  return *this;
193  }
202  inline
204  {
205  return *pos_;
206  }
207 
208 
209 
216  inline
217  const reference operator*() const
218  {
219  return *pos_;
220  }
221 
222 
223  inline
225  {
226  return &(operator*());
227  }
228 
229  inline
231  {
232  return &(operator*());
233  }
234 
239 
245  inline
246  self& operator++()
247  {
248  if(x4_ < (box_.last_back_bottom_right())[3])
249  {
250  this->x4_++;
251  this->pos_++;
252  }
253  else if(x3_ < (box_.last_back_bottom_right())[2])
254  {
255  this->x3_++;
256  this->x4_ = (box_.first_front_upper_left())[3];
257 #ifdef INCR_OPT
258 this->pos_+= static_cast<int>(cont4d_->cols()) - box_.width() + 1 ;
259 #else
260 this->pos_ = cont4d_->begin() +
261  (this->x1_ * static_cast<int>(cont4d_->slices()) * static_cast<int>(cont4d_->rows()) * static_cast<int>(cont4d_->cols())) +
262  (this->x2_* static_cast<int>(cont4d_->rows()) * static_cast<int>(cont4d_->cols())) +
263  (this->x3_* static_cast<int>(cont4d_->cols())) + this->x4_;
264 #endif
265  }
266  else if(x2_ < (box_.last_back_bottom_right())[1])
267  {
268  this->x2_++;
269  this->x3_ = (box_.first_front_upper_left())[2];
270  this->x4_ = (box_.first_front_upper_left())[3];
271 #ifdef INCR_OPT
272  this->pos_+= static_cast<int>(cont4d_->cols())*(static_cast<int>(cont4d_->rows()) - box_.height() + 1)
273  - box_.width() + 1 ;
274 #else
275  this->pos_ = cont4d_->begin() +
276  (this->x1_ * static_cast<int>(cont4d_->slices()) * static_cast<int>(cont4d_->rows()) * static_cast<int>(cont4d_->cols())) +
277  (this->x2_* static_cast<int>(cont4d_->rows()) * static_cast<int>(cont4d_->cols())) +
278  (this->x3_ * static_cast<int>(cont4d_->cols())) + this->x4_;
279 #endif
280  }
281 
282  else if(x1_ < (box_.last_back_bottom_right())[0])
283  {
284  this->x1_++;
285  this->x2_ = (box_.first_front_upper_left())[1];
286  this->x3_ = (box_.first_front_upper_left())[2];
287  this->x4_ = (box_.first_front_upper_left())[3];
288 #ifdef INCR_OPT
289 this->pos_+= static_cast<int>(cont4d_->cols())*(static_cast<int>(cont4d_->rows()) *
290  (static_cast<int>(cont4d_->slices()) - box_.depth() + 1)
291  - box_.height() + 1) - box_.width() + 1 ;
292 #else
293  this->pos_ = cont4d_->begin() +
294  (this->x1_ * static_cast<int>(cont4d_->slices()) * static_cast<int>(cont4d_->rows()) * static_cast<int>(cont4d_->cols())) +
295  (this->x2_* static_cast<int>(cont4d_->rows()) * static_cast<int>(cont4d_->cols())) +
296  (this->x3_ * static_cast<int>(cont4d_->cols())) + this->x4_;
297 #endif
298  }
299  else
300  {
301  this->x1_ = (box_.last_back_bottom_right())[0] + 1;
302  this->x2_ = (box_.last_back_bottom_right())[1] + 1;
303  this->x3_ = (box_.last_back_bottom_right())[2] + 1;
304  this->x4_ = (box_.last_back_bottom_right())[3] + 1;
305 #ifdef INCR_OPT
306 this->pos_ += static_cast<int>(cont4d_->cols()) * (static_cast<int>(cont4d_->rows()) *
307  (static_cast<int>(cont4d_->slices()) + 1) + 1) + 1;
308 #else
309 this->pos_ = cont4d_->begin() +
310  (this->x1_ * static_cast<int>(cont4d_->slices()) * static_cast<int>(cont4d_->rows()) * static_cast<int>(cont4d_->cols())) +
311  (this->x2_* static_cast<int>(cont4d_->rows()) * static_cast<int>(cont4d_->cols())) +
312  (this->x3_ * static_cast<int>(cont4d_->cols())) + this->x4_;
313 #endif
314  }
315  return *this;
316  }
317 
323  inline
324  self operator++(int)
325  {
326  self tmp = *this;
327  ++(*this);
328  return tmp;
329  }
330 
342  inline
343  self& operator--()
344  {
345  if(x4_ > (box_.first_front_upper_left())[3])
346  {
347  this->x4_--;
348  this->pos_--;
349  }
350  else if (x3_ > (box_.first_front_upper_left())[2])
351  {
352  this->x3_--;
353  this->x4_ = (box_.last_back_bottom_right())[3];
354 #ifdef INCR_OPT
355 this->pos_-= (static_cast<int>(cont4d_->cols()) - box_.width() + 1) ;
356 #else
357 this->pos_ = cont4d_->begin() +
358  (this->x1_ * static_cast<int>(cont4d_->slices()) * static_cast<int>(cont4d_->rows()) * static_cast<int>(cont4d_->cols())) +
359  (this->x2_* static_cast<int>(cont4d_->rows()) * static_cast<int>(cont4d_->cols())) +
360  (this->x3_ * static_cast<int>(cont4d_->cols())) + this->x4_;
361 #endif
362  }
363  else if (x2_ > (box_.first_front_upper_left())[1])
364  {
365  this->x2_--;
366  this->x3_ = (box_.last_back_bottom_right())[2];
367  this->x4_ = (box_.last_back_bottom_right())[3];
368 #ifdef INCR_OPT
369  this->pos_-= (static_cast<int>(cont4d_->cols())*(static_cast<int>(cont4d_->rows()) - box_.height() + 1)
370  - box_.width() + 1) ;
371 #else
372  this->pos_ = cont4d_->begin() +
373  (this->x1_ * static_cast<int>(cont4d_->slices()) * static_cast<int>(cont4d_->rows()) * static_cast<int>(cont4d_->cols())) +
374  (this->x2_* static_cast<int>(cont4d_->rows()) * static_cast<int>(cont4d_->cols())) +
375  (this->x3_ * static_cast<int>(cont4d_->cols())) + this->x4_;
376 #endif
377  }
378  else if (x1_ > (box_.first_front_upper_left())[0])
379  {
380  this->x1_--;
381  this->x2_ = (box_.last_back_bottom_right())[1];
382  this->x3_ = (box_.last_back_bottom_right())[2];
383  this->x4_ = (box_.last_back_bottom_right())[3];
384 #ifdef INCR_OPT
385 this->pos_ -= (static_cast<int>(cont4d_->cols())*(static_cast<int>(cont4d_->rows()) *
386  (static_cast<int>(cont4d_->slices()) - box_.depth() + 1)
387  - box_.height() + 1) - box_.width() + 1) ;
388 #else
389  this->pos_ = cont4d_->begin() +
390  (this->x1_ * static_cast<int>(cont4d_->slices()) * static_cast<int>(cont4d_->rows()) * static_cast<int>(cont4d_->cols())) +
391  (this->x2_* static_cast<int>(cont4d_->rows()) * static_cast<int>(cont4d_->cols())) +
392  (this->x3_ * static_cast<int>(cont4d_->cols())) + this->x4_;
393 #endif
394  }
395  else
396  {
397  this->x1_ = (box_.first_front_upper_left())[0] - 1;
398  this->x2_ = (box_.first_front_upper_left())[1] - 1;
399  this->x3_ = (box_.first_front_upper_left())[2] - 1;
400  this->x4_ = (box_.first_front_upper_left())[3] - 1;
401 #ifdef INCR_OPT
402 this->pos_ -= static_cast<int>(cont4d_->cols()) * (static_cast<int>(cont4d_->rows()) *
403  (static_cast<int>(cont4d_->slices()) + 1) + 1) + 1;
404 #else
405 this->pos_ = cont4d_->begin() +
406  (this->x1_ * static_cast<int>(cont4d_->slices()) * static_cast<int>(cont4d_->rows()) * static_cast<int>(cont4d_->cols())) +
407  (this->x2_* static_cast<int>(cont4d_->rows()) * static_cast<int>(cont4d_->cols())) +
408  (this->x3_ * static_cast<int>(cont4d_->cols())) + this->x4_;
409 #endif
410  }
411 
412  return *this;
413  }
414 
420  inline
421  self operator--(int)
422  {
423  self tmp = *this;
424  --(*this);
425  return tmp;
426  }
427 
441  inline
442  friend bool operator==(const self& i1,
443  const self& i2)
444  {
445 
446  return ( (i1.cont4d_ == i2.cont4d_) && (i1.pos_ == i2.pos_)
447  && (i1.x1_ == i2.x1_) && (i1.x2_ == i2.x2_) && (i1.x3_ == i2.x3_) && (i1.x4_ == i2.x4_));
448  }
449 
456  inline
457  friend bool operator!=(const self& i1,
458  const self& i2)
459  {
460  return ( (i1.cont4d_ != i2.cont4d_) || (i1.pos_ != i2.pos_)
461  || (i1.x1_ != i2.x1_) || (i1.x2_ != i2.x2_) || (i1.x3_ != i2.x3_) || (i1.x4_ != i2.x4_));
462  }
475  inline
476  friend bool operator<(const self& i1,
477  const self& i2)
478  {
479  return ( i1.pos_ < i2.pos_);
480  }
481 
488  inline
489  friend bool operator>(const self& i1,
490  const self& i2)
491  {
492  return (i2 < i1);
493  }
494 
501  inline
502  friend bool operator<=(const self& i1, const self& i2)
503  {
504  return !(i2 < i1);
505  }
506 
513  inline
514  friend bool operator>=(const self& i1, const self& i2)
515  {
516  return !(i1 < i2);
517  }
532  inline
533  self& operator+=(const difference_type& d)
534  {
535  this->x1_ += d.dx1();
536  this->x2_ += d.dx2();
537  this->x3_ += d.dx3();
538  this->x4_ += d.dx4();
539  this->pos_ = cont4d_->begin() +
540  (this->x1_ * static_cast<int>(cont4d_->slices()) * static_cast<int>(cont4d_->rows()) * static_cast<int>(cont4d_->cols())) +
541  (this->x2_ * static_cast<int>(cont4d_->rows()) * static_cast<int>(cont4d_->cols())) +
542  (this->x3_ * static_cast<int>(cont4d_->cols())) + this->x4_;
543  return *this;
544  }
545 
546 
547 
555  inline
556  self& operator-=(const difference_type& d)
557  {
558  this->x1_ -= d.dx1();
559  this->x2_ -= d.dx2();
560  this->x3_ -= d.dx3();
561  this->x4_ -= d.dx4();
562  this->pos_ = cont4d_->begin() +
563  (this->x1_ * static_cast<int>(cont4d_->slices()) * static_cast<int>(cont4d_->rows()) * static_cast<int>(cont4d_->cols())) +
564  (this->x2_ * static_cast<int>(cont4d_->rows()) * static_cast<int>(cont4d_->cols())) +
565  (this->x3_ * static_cast<int>(cont4d_->cols())) + this->x4_;
566  return *this;
567  }
568 
569 
570 
578  inline
579  self operator+(const difference_type& d)
580  {
581  self tmp = *this;
582  tmp += d;
583  return tmp;
584  }
585 
593  inline
594  self operator-(const difference_type& d)
595  {
596  self tmp = *this;
597  tmp -= d;
598  return tmp;
599  }
600 
608  inline
609  friend difference_type operator-(const self& i1,
610  const self& i2)
611  {
612  return difference_type(int(i1.x1_ - i2.x1_),int(i1.x2_ - i2.x2_),int(i1.x3_ - i2.x3_),int(i1.x4_ - i2.x4_));
613  }
614 
615 
624  inline
626  {
627  return (*cont4d_)[this->x1_+d.dx1()][this->x2_+d.dx2()][this->x3_+d.dx3()][this->x4_+d.dx4()];
628  }
629 
639  inline
641  {
642  return (*cont4d_)[this->x1_+ d.dx1()][this->x2_ + d.dx2()][this->x3_ + d.dx3()];
643  }
644 
654  inline
656  {
657  return (*cont4d_)[this->x1_+ d.dx1()][this->x2_ + d.dx2()];
658  }
659 
669  inline
671  {
672  return (*cont4d_)[this->x1_+ n];
673  }
674 
675 
676 
685  inline
686  const pointer** operator[](int n) const
687  {
688  return (*cont4d_)[this->x1_+ n];
689  }
690 
700  inline
701  typename Container4D::slab_iterator slab_begin(size_type slice, size_type row, size_type col)
702  {
703  return cont4d_->slab_begin(this->box_.first_front_upper_left()[1] + slice, this->box_.first_front_upper_left()[2] + row,
704  this->box_.first_front_upper_left()[3] + col) + this->box_.first_front_upper_left()[0];
705  }
706 
716  inline
717  typename Container4D::slab_iterator slab_end(size_type slice, size_type row, size_type col)
718  {
719  return this->slab_begin(slice,row,col) + this->box_.duration();
720  }
721 
722 
732  inline
733  typename Container4D::slice_iterator slice_begin(size_type slab, size_type row, size_type col)
734  {
735  return cont4d_->slice_begin(this->box_.first_front_upper_left()[0] + slab, this->box_.first_front_upper_left()[2] + row,
736  this->box_.first_front_upper_left()[3] + col) + this->box_.first_front_upper_left()[1];
737  }
738 
748  inline
749  typename Container4D::slice_iterator slice_end(size_type slab, size_type row, size_type col)
750  {
751  return this->slice_begin(slab,row,col) + this->box_.depth();
752  }
753 
754 
766  inline
767  typename Container4D::row_iterator row_begin(size_type slab, size_type slice, size_type row)
768  {
769  return cont4d_->row_begin(this->box_.first_front_upper_left()[0] + slab, this->box_.first_front_upper_left()[1] + slice,
770  this->box_.first_front_upper_left()[2] + row) + this->box_.first_front_upper_left()[3];
771  }
772 
784  inline
785  typename Container4D::row_iterator row_end(size_type slab, size_type slice, size_type row)
786  {
787  return this->row_begin(slab,slice,row) + this->box_.width();
788  }
789 
801  inline
802  typename Container4D::col_iterator col_begin(size_type slab, size_type slice, size_type col)
803  {
804  return cont4d_->col_begin(this->box_.first_front_upper_left()[0] + slab, this->box_.first_front_upper_left()[1] + slice,
805  this->box_.first_front_upper_left()[3] + col) + this->box_.first_front_upper_left()[2];
806  }
807 
819  inline
820  typename Container4D::col_iterator col_end(size_type slab, size_type slice, size_type col)
821  {
822  return this->col_begin(slab,slice,col) + this->box_.height();
823  }
824 
836  inline
837  int x1() const
838  {
839  return this->x1_;
840  }
845  inline
846  int t() const
847  {
848  return this->x1_;
849  }
854  inline
855  int x2() const
856  {
857  return this->x2_;
858  }
863  inline
864  int k() const
865  {
866  return this->x2_;
867  }
872  inline
873  int x3() const
874  {
875  return this->x3_;
876  }
881  inline
882  int i() const
883  {
884  return this->x3_;
885  }
886 
891  inline
892  int x4() const
893  {
894  return this->x4_;
895  }
900  inline
901  int j() const
902  {
903  return this->x4_;
904  }
905 
910 private:
911  Container4D* cont4d_; // pointer to the 4d container
912  pointer pos_; // linear position within the container
913  int x1_; // first subscript position
914  int x2_; // second subscript position
915  int x3_; // third subscript position
916  int x4_; // fourth subscript position
917  Box4d<int> box_; // box to iterate
918 };
919 
920 
943 template <class Container4D>
945 {
946 public:
947  //typedef std::random_access_iterator_tag iterator_category;
949  typedef typename Container4D::value_type value_type;
953  typedef typename Container4D::const_pointer pointer;
954  typedef typename Container4D::const_reference reference;
955 
956  typedef const_iterator4d_box self;
957 
958  typedef typename Container4D::size_type size_type;
963 
969  cont4d_(0),pos_(0),x1_(0),x2_(0),x3_(0),x4_(0),box_(0,0,0,0,0,0,0,0)
970  {}
971 
978  const_iterator4d_box(Container4D* c,
979  const Box4d<int>& b):
980  cont4d_(c),pos_((*c)[(b.first_front_upper_left())[0]]
981  [(b.first_front_upper_left())[1]]
982  [(b.first_front_upper_left())[2]]
983  + (b.first_front_upper_left())[3]),
984  x1_((b.first_front_upper_left())[0]),
985  x2_((b.first_front_upper_left())[1]),
986  x3_((b.first_front_upper_left())[2]),
987  x4_((b.first_front_upper_left())[3]),box_(b)
988  {}
989 
995  const_iterator4d_box(const self& o):
996  cont4d_(o.cont4d_),pos_(o.pos_),x1_(o.x1_),x2_(o.x2_),x3_(o.x3_),x4_(o.x4_),box_(o.box_)
997  {}
998 
1013  self& operator=(const self& o)
1014  {
1015  if(this != &o)
1016  {
1017  this->cont4d_ = o.cont4d_;
1018  this->pos_ = o.pos_;
1019  this->x1_ = o.x1_;
1020  this->x2_ = o.x2_;
1021  this->x3_ = o.x3_;
1022  this->x4_ = o.x4_;
1023  this->box_ = o.box_;
1024  }
1025  return *this;
1026  }
1035  inline
1037  {
1038  return *pos_;
1039  }
1040 
1041  inline
1043  {
1044  return &(operator*());
1045  }
1046 
1051 
1057  inline
1058  self& operator++()
1059  {
1060  if(x4_ < (box_.last_back_bottom_right())[3])
1061  {
1062  this->x4_++;
1063  this->pos_++;
1064  }
1065  else if(x3_ < (box_.last_back_bottom_right())[2])
1066  {
1067  this->x3_++;
1068  this->x4_ = (box_.first_front_upper_left())[3];
1069 #ifdef INCR_OPT
1070 this->pos_+= static_cast<int>(cont4d_->cols()) - box_.width() + 1 ;
1071 #else
1072 this->pos_ = cont4d_->begin() +
1073  (this->x1_ * static_cast<int>(cont4d_->slices()) * static_cast<int>(cont4d_->rows()) * static_cast<int>(cont4d_->cols())) +
1074  (this->x2_* static_cast<int>(cont4d_->rows()) * static_cast<int>(cont4d_->cols())) +
1075  (this->x3_* static_cast<int>(cont4d_->cols())) + this->x4_;
1076 #endif
1077  }
1078  else if(x2_ < (box_.last_back_bottom_right())[1])
1079  {
1080  this->x2_++;
1081  this->x3_ = (box_.first_front_upper_left())[2];
1082  this->x4_ = (box_.first_front_upper_left())[3];
1083 #ifdef INCR_OPT
1084  this->pos_+= static_cast<int>(cont4d_->cols())*(static_cast<int>(cont4d_->rows()) - box_.height() + 1)
1085  - box_.width() + 1 ;
1086 #else
1087  this->pos_ = cont4d_->begin() +
1088  (this->x1_ * static_cast<int>(cont4d_->slices()) * static_cast<int>(cont4d_->rows()) * static_cast<int>(cont4d_->cols())) +
1089  (this->x2_* static_cast<int>(cont4d_->rows()) * static_cast<int>(cont4d_->cols())) +
1090  (this->x3_ * static_cast<int>(cont4d_->cols())) + this->x4_;
1091 #endif
1092  }
1093 
1094  else if(x1_ < (box_.last_back_bottom_right())[0])
1095  {
1096  this->x1_++;
1097  this->x2_ = (box_.first_front_upper_left())[1];
1098  this->x3_ = (box_.first_front_upper_left())[2];
1099  this->x4_ = (box_.first_front_upper_left())[3];
1100 #ifdef INCR_OPT
1101 this->pos_+= static_cast<int>(cont4d_->cols())*(static_cast<int>(cont4d_->rows()) *
1102  (static_cast<int>(cont4d_->slices()) - box_.depth() + 1)
1103  - box_.height() + 1) - box_.width() + 1 ;
1104 #else
1105  this->pos_ = cont4d_->begin() +
1106  (this->x1_ * static_cast<int>(cont4d_->slices()) * static_cast<int>(cont4d_->rows()) * static_cast<int>(cont4d_->cols())) +
1107  (this->x2_* static_cast<int>(cont4d_->rows()) * static_cast<int>(cont4d_->cols())) +
1108  (this->x3_ * static_cast<int>(cont4d_->cols())) + this->x4_;
1109 #endif
1110  }
1111  else
1112  {
1113  this->x1_ = (box_.last_back_bottom_right())[0] + 1;
1114  this->x2_ = (box_.last_back_bottom_right())[1] + 1;
1115  this->x3_ = (box_.last_back_bottom_right())[2] + 1;
1116  this->x4_ = (box_.last_back_bottom_right())[3] + 1;
1117 #ifdef INCR_OPT
1118 this->pos_ += static_cast<int>(cont4d_->cols()) * (static_cast<int>(cont4d_->rows()) *
1119  (static_cast<int>(cont4d_->slices()) + 1) + 1) + 1;
1120 #else
1121 this->pos_ = cont4d_->begin() +
1122  (this->x1_ * static_cast<int>(cont4d_->slices()) * static_cast<int>(cont4d_->rows()) * static_cast<int>(cont4d_->cols())) +
1123  (this->x2_* static_cast<int>(cont4d_->rows()) * static_cast<int>(cont4d_->cols())) +
1124  (this->x3_ * static_cast<int>(cont4d_->cols())) + this->x4_;
1125 #endif
1126  }
1127  return *this;
1128  }
1129 
1135  inline
1136  self operator++(int)
1137  {
1138  self tmp = *this;
1139  ++(*this);
1140  return tmp;
1141  }
1142 
1154  inline
1155  self& operator--()
1156  {
1157  if(x4_ > (box_.first_front_upper_left())[3])
1158  {
1159  this->x4_--;
1160  this->pos_--;
1161  }
1162  else if (x3_ > (box_.first_front_upper_left())[2])
1163  {
1164  this->x3_--;
1165  this->x4_ = (box_.last_back_bottom_right())[3];
1166 #ifdef INCR_OPT
1167 this->pos_-= (static_cast<int>(cont4d_->cols()) - box_.width() + 1) ;
1168 #else
1169 this->pos_ = cont4d_->begin() +
1170  (this->x1_ * static_cast<int>(cont4d_->slices()) * static_cast<int>(cont4d_->rows()) * static_cast<int>(cont4d_->cols())) +
1171  (this->x2_* static_cast<int>(cont4d_->rows()) * static_cast<int>(cont4d_->cols())) +
1172  (this->x3_ * static_cast<int>(cont4d_->cols())) + this->x4_;
1173 #endif
1174  }
1175  else if (x2_ > (box_.first_front_upper_left())[1])
1176  {
1177  this->x2_--;
1178  this->x3_ = (box_.last_back_bottom_right())[2];
1179  this->x4_ = (box_.last_back_bottom_right())[3];
1180 #ifdef INCR_OPT
1181  this->pos_-= (static_cast<int>(cont4d_->cols())*(static_cast<int>(cont4d_->rows()) - box_.height() + 1)
1182  - box_.width() + 1) ;
1183 #else
1184  this->pos_ = cont4d_->begin() +
1185  (this->x1_ * static_cast<int>(cont4d_->slices()) * static_cast<int>(cont4d_->rows()) * static_cast<int>(cont4d_->cols())) +
1186  (this->x2_* static_cast<int>(cont4d_->rows()) * static_cast<int>(cont4d_->cols())) +
1187  (this->x3_ * static_cast<int>(cont4d_->cols())) + this->x4_;
1188 #endif
1189  }
1190  else if (x1_ > (box_.first_front_upper_left())[0])
1191  {
1192  this->x1_--;
1193  this->x2_ = (box_.last_back_bottom_right())[1];
1194  this->x3_ = (box_.last_back_bottom_right())[2];
1195  this->x4_ = (box_.last_back_bottom_right())[3];
1196 #ifdef INCR_OPT
1197 this->pos_ -= (static_cast<int>(cont4d_->cols())*(static_cast<int>(cont4d_->rows()) *
1198  (static_cast<int>(cont4d_->slices()) - box_.depth() + 1)
1199  - box_.height() + 1) - box_.width() + 1) ;
1200 #else
1201  this->pos_ = cont4d_->begin() +
1202  (this->x1_ * static_cast<int>(cont4d_->slices()) * static_cast<int>(cont4d_->rows()) * static_cast<int>(cont4d_->cols())) +
1203  (this->x2_* static_cast<int>(cont4d_->rows()) * static_cast<int>(cont4d_->cols())) +
1204  (this->x3_ * static_cast<int>(cont4d_->cols())) + this->x4_;
1205 #endif
1206  }
1207  else
1208  {
1209  this->x1_ = (box_.first_front_upper_left())[0] - 1;
1210  this->x2_ = (box_.first_front_upper_left())[1] - 1;
1211  this->x3_ = (box_.first_front_upper_left())[2] - 1;
1212  this->x4_ = (box_.first_front_upper_left())[3] - 1;
1213 #ifdef INCR_OPT
1214 this->pos_ -= static_cast<int>(cont4d_->cols()) * (static_cast<int>(cont4d_->rows()) *
1215  (static_cast<int>(cont4d_->slices()) + 1) + 1) + 1;
1216 #else
1217 this->pos_ = cont4d_->begin() +
1218  (this->x1_ * static_cast<int>(cont4d_->slices()) * static_cast<int>(cont4d_->rows()) * static_cast<int>(cont4d_->cols())) +
1219  (this->x2_* static_cast<int>(cont4d_->rows()) * static_cast<int>(cont4d_->cols())) +
1220  (this->x3_ * static_cast<int>(cont4d_->cols())) + this->x4_;
1221 #endif
1222  }
1223 
1224  return *this;
1225  }
1226 
1232  inline
1233  self operator--(int)
1234  {
1235  self tmp = *this;
1236  --(*this);
1237  return tmp;
1238  }
1239 
1253  inline
1254  friend bool operator==(const self& i1,
1255  const self& i2)
1256  {
1257 
1258  return ( (i1.cont4d_ == i2.cont4d_) && (i1.pos_ == i2.pos_)
1259  && (i1.x1_ == i2.x1_) && (i1.x2_ == i2.x2_) && (i1.x3_ == i2.x3_) && (i1.x4_ == i2.x4_));
1260  }
1261 
1268  inline
1269  friend bool operator!=(const self& i1,
1270  const self& i2)
1271  {
1272  return ( (i1.cont4d_ != i2.cont4d_) || (i1.pos_ != i2.pos_)
1273  || (i1.x1_ != i2.x1_) || (i1.x2_ != i2.x2_) || (i1.x3_ != i2.x3_) || (i1.x4_ != i2.x4_));
1274  }
1287  inline
1288  friend bool operator<(const self& i1,
1289  const self& i2)
1290  {
1291  return ( i1.pos_ < i2.pos_);
1292  }
1293 
1300  inline
1301  friend bool operator>(const self& i1,
1302  const self& i2)
1303  {
1304  return (i2 < i1);
1305  }
1306 
1313  inline
1314  friend bool operator<=(const self& i1, const self& i2)
1315  {
1316  return !(i2 < i1);
1317  }
1318 
1325  inline
1326  friend bool operator>=(const self& i1, const self& i2)
1327  {
1328  return !(i1 < i2);
1329  }
1344  inline
1345  self& operator+=(const difference_type& d)
1346  {
1347  this->x1_ += d.dx1();
1348  this->x2_ += d.dx2();
1349  this->x3_ += d.dx3();
1350  this->x4_ += d.dx4();
1351  this->pos_ = cont4d_->begin() +
1352  (this->x1_ * static_cast<int>(cont4d_->slices()) * static_cast<int>(cont4d_->rows()) * static_cast<int>(cont4d_->cols())) +
1353  (this->x2_ * static_cast<int>(cont4d_->rows()) * static_cast<int>(cont4d_->cols())) +
1354  (this->x3_ * static_cast<int>(cont4d_->cols())) + this->x4_;
1355  return *this;
1356  }
1357 
1358 
1359 
1367  inline
1368  self& operator-=(const difference_type& d)
1369  {
1370  this->x1_ -= d.dx1();
1371  this->x2_ -= d.dx2();
1372  this->x3_ -= d.dx3();
1373  this->x4_ -= d.dx4();
1374  this->pos_ = cont4d_->begin() +
1375  (this->x1_ * static_cast<int>(cont4d_->slices()) * static_cast<int>(cont4d_->rows()) * static_cast<int>(cont4d_->cols())) +
1376  (this->x2_ * static_cast<int>(cont4d_->rows()) * static_cast<int>(cont4d_->cols())) +
1377  (this->x3_ * static_cast<int>(cont4d_->cols())) + this->x4_;
1378  return *this;
1379  }
1380 
1381 
1382 
1390  inline
1392  {
1393  self tmp = *this;
1394  tmp += d;
1395  return tmp;
1396  }
1397 
1405  inline
1407  {
1408  self tmp = *this;
1409  tmp -= d;
1410  return tmp;
1411  }
1412 
1420  inline
1421  friend difference_type operator-(const self& i1,
1422  const self& i2)
1423  {
1424  return difference_type(int(i1.x1_ - i2.x1_),int(i1.x2_ - i2.x2_),int(i1.x3_ - i2.x3_),int(i1.x4_ - i2.x4_));
1425  }
1426 
1427 
1436  inline
1438  {
1439  return (*cont4d_)[this->x1_+d.dx1()][this->x2_+d.dx2()][this->x3_+d.dx3()][this->x4_+d.dx4()];
1440  }
1441 
1451  inline
1453  {
1454  return (*cont4d_)[this->x1_+ d.dx1()][this->x2_ + d.dx2()][this->x3_ + d.dx3()];
1455  }
1456 
1466  inline
1468  {
1469  return (*cont4d_)[this->x1_+ d.dx1()][this->x2_ + d.dx2()];
1470  }
1471 
1481  inline
1482  pointer** operator[](int n) const
1483  {
1484  return (*cont4d_)[this->x1_+ n];
1485  }
1486 
1487 
1497  inline
1498  typename Container4D::const_slab_iterator slab_begin(size_type slice, size_type row, size_type col) const
1499  {
1500  return cont4d_->slab_begin(this->box_.first_front_upper_left()[1] + slice,
1501  this->box_.first_front_upper_left()[2] + row,
1502  this->box_.first_front_upper_left()[3] + col) +
1503  this->box_.first_front_upper_left()[0];
1504  }
1505 
1515  inline
1516  typename Container4D::const_slab_iterator slab_end(size_type slice, size_type row, size_type col) const
1517  {
1518  return this->slab_begin(slice,row,col) + this->box_.duration();
1519  }
1520 
1521 
1531  inline
1532  typename Container4D::const_slice_iterator slice_begin(size_type slab, size_type row, size_type col) const
1533  {
1534  return cont4d_->slice_begin(this->box_.first_front_upper_left()[0] + slab,
1535  this->box_.first_front_upper_left()[2] + row,
1536  this->box_.first_front_upper_left()[3] + col) +
1537  this->box_.first_front_upper_left()[1];
1538  }
1539 
1549  inline
1550  typename Container4D::const_slice_iterator slice_end(size_type slab, size_type row, size_type col) const
1551  {
1552  return this->slice_begin(slab,row,col) + this->box_.depth();
1553  }
1554 
1555 
1567  inline
1568  typename Container4D::const_row_iterator row_begin(size_type slab, size_type slice, size_type row) const
1569  {
1570  return cont4d_->row_begin(this->box_.first_front_upper_left()[0] + slab, this->box_.first_front_upper_left()[1] + slice,
1571  this->box_.first_front_upper_left()[2] + row) + this->box_.first_front_upper_left()[3];
1572  }
1573 
1585  inline
1586  typename Container4D::const_row_iterator row_end(size_type slab, size_type slice, size_type row) const
1587  {
1588  return this->row_begin(slab,slice,row) + this->box_.width();
1589  }
1590 
1602  inline
1603  typename Container4D::const_col_iterator col_begin(size_type slab, size_type slice, size_type col) const
1604  {
1605  return cont4d_->col_begin(this->box_.first_front_upper_left()[0] + slab, this->box_.first_front_upper_left()[1] + slice,
1606  this->box_.first_front_upper_left()[3] + col) + this->box_.first_front_upper_left()[2];
1607  }
1619  inline
1620  typename Container4D::const_col_iterator col_end(size_type slab, size_type slice, size_type col) const
1621  {
1622  return this->col_begin(slab,slice,col) + this->box_.height();
1623  }
1624 
1636  inline
1637  int x1() const
1638  {
1639  return this->x1_;
1640  }
1645  inline
1646  int t() const
1647  {
1648  return this->x1_;
1649  }
1654  inline
1655  int x2() const
1656  {
1657  return this->x2_;
1658  }
1663  inline
1664  int k() const
1665  {
1666  return this->x2_;
1667  }
1672  inline
1673  int x3() const
1674  {
1675  return this->x3_;
1676  }
1681  inline
1682  int i() const
1683  {
1684  return this->x3_;
1685  }
1686 
1691  inline
1692  int x4() const
1693  {
1694  return this->x4_;
1695  }
1700  inline
1701  int j() const
1702  {
1703  return this->x4_;
1704  }
1705 
1711 private:
1712  Container4D* cont4d_; // pointer to the 4d container
1713  pointer pos_; // linear position within the container
1714  int x1_; // first subscript position
1715  int x2_; // second subscript position
1716  int x3_; // third subscript position
1717  int x4_; // fourth subscript position
1718  Box4d<int> box_; // box to iterate
1719 };
1720 
1721 
1722 
1723 }//slip::
1724 
1725 #endif //SLIP_ITERATOR4D_BOX_HPP
iterator4d_box()
Constructs a iterator4d_box.
self operator--(int)
Postdecrement a const_iterator4d_box. Iterate to the previous location inside the Box4d...
This is some iterator to iterate a 4d container into a Box area defined by the subscripts of the 4d c...
void first_front_upper_left(slip::Point< CoordType, 4 >)
Accessor/Mutator of the first_front_upper_left point (p1) of Box4d.
Definition: Box4d.hpp:364
self operator--(int)
Postdecrement a iterator4d_box. Iterate to the previous location inside the Box4d.
Container4D::slab_iterator slab_begin(size_type slice, size_type row, size_type col)
iterator4d_box element assignment operator.
Provides a class to modelize the difference of slip::Point2d.
void dx3(const CoordType &dx)
Accessor of the first coordinate of DPoint3d.
Definition: DPoint3d.hpp:273
pointer * operator[](diff2d d) const
const_iterator4d_box element assignment operator. Equivalent to *(k + d) = t.
slip::DPoint3d< int > diff3d
self & operator--()
Predecrement a const_iterator4d_box. Iterate to the previous location inside the Box4d.
friend bool operator<=(const self &i1, const self &i2)
<= operator.
std::random_access_iterator4d_tag iterator_category
void dx2(const CoordType &dx)
Accessor of the second coordinate of DPoint2d.
Definition: DPoint2d.hpp:241
Difference of Point3D class, specialization of DPoint<CoordType,DIM> with DIM = 3.
friend bool operator!=(const self &i1, const self &i2)
Inequality operator.
CoordType depth() const
compute the depth of the Box4d (second dimension size).
Definition: Box4d.hpp:428
self operator++(int)
Postincrement a const_iterator4d_box. Iterate to the next location inside the Box4d.
Container4D::const_slab_iterator slab_end(size_type slice, size_type row, size_type col) const
const_iterator4d_box element assignment operator.
friend bool operator==(const self &i1, const self &i2)
Equality operator.
self & operator+=(const difference_type &d)
iterator4d_box addition.
Container4D::slice_iterator slice_begin(size_type slab, size_type row, size_type col)
iterator4d_box element assignment operator.
friend difference_type operator-(const self &i1, const self &i2)
const_iterator4d_box difference operator.
slip::DPoint3d< int > diff3d
int t() const
Access to the first subscript of the current const_iterator4d_box.
pointer ** operator[](int n)
iterator4d_box element assignment operator. Equivalent to *(k + n).
self operator-(const difference_type &d)
const_iterator4d_box substraction.
friend bool operator!=(const self &i1, const self &i2)
Inequality operator.
Provides a class to tag SLIP iterators.
This is some iterator to iterate a 4d container into a Box area defined by the subscripts of the 4d c...
const pointer ** operator[](int n) const
iterator4d_box element assignment operator. Equivalent to *(k + n).
DPoint4d< int > difference_type
Container4D::const_row_iterator row_end(size_type slab, size_type slice, size_type row) const
const_iterator4d_box element assignment operator.
self operator++(int)
Postincrement a iterator4d_box. Iterate to the next location inside the Box4d.
int x4() const
Access to the fourth subscript of the current const_iterator4d_box.
int x1() const
Access to the first subscript of the current const_iterator4d_box.
Container4D::row_iterator row_begin(size_type slab, size_type slice, size_type row)
iterator4d_box element assignment operator.
friend bool operator==(const self &i1, const self &i2)
Equality operator.
Provides a class to modelize 4d points.
self & operator=(const self &o)
Assign a const_iterator4d_box.
Provides a class to modelize the difference of slip::Point3d.
Container4D::const_slice_iterator slice_end(size_type slab, size_type row, size_type col) const
const_iterator4d_box element assignment operator.
self & operator-=(const difference_type &d)
iterator4d_box substraction.
Container4D::size_type size_type
Container4D::col_iterator col_begin(size_type slab, size_type slice, size_type col)
iterator4d_box element assignment operator.
friend bool operator>=(const self &i1, const self &i2)
>= operator.
friend bool operator<=(const self &i1, const self &i2)
<= operator.
Container4D::slab_iterator slab_end(size_type slice, size_type row, size_type col)
iterator4d_box element assignment operator.
int x2() const
Access to the second subscript of the current iterator4d_box.
iterator4d_box(Container4D *c, const Box4d< int > &b)
Constructs a iterator4d_box.
friend bool operator>=(const self &i1, const self &i2)
>= operator.
void dx1(const CoordType &dx)
Accessor of the first coordinate of DPoint2d.
Definition: DPoint2d.hpp:229
int j() const
Access to the fourth subscript of the current iterator4d_box.
int x3() const
Access to the third subscript of the current iterator4d_box.
void dx2(const CoordType &dx)
Accessor of the second coordinate of DPoint4d.
Definition: DPoint4d.hpp:281
int i() const
Access to the third subscript of the current const_iterator4d_box.
pointer operator[](diff3d d)
iterator4d_box element assignment operator. Equivalent to *(k + d) = t.
Container4D::const_row_iterator row_begin(size_type slab, size_type slice, size_type row) const
const_iterator4d_box element assignment operator.
void dx1(const CoordType &dx)
Accessor of the first coordinate of DPoint4d.
Definition: DPoint4d.hpp:269
Difference of Point4D class, specialization of DPoint<CoordType,DIM> with DIM = 4.
Definition: DPoint4d.hpp:99
Container4D::const_reference reference
reference operator*()
Dereference assignment operator. Returns the element that the current iterator4d_box i point to...
Container4D::const_pointer pointer
Provides a class to modelize the difference of 4d points.
slip::DPoint2d< int > diff2d
Container4D::row_iterator row_end(size_type slab, size_type slice, size_type row)
iterator4d_box element assignment operator.
Container4D::const_slice_iterator slice_begin(size_type slab, size_type row, size_type col) const
const_iterator4d_box element assignment operator.
pointer operator[](diff3d d) const
const_iterator4d_box element assignment operator. Equivalent to *(k + d) = t.
pointer ** operator[](int n) const
const_iterator4d_box element assignment operator. Equivalent to *(k + n).
Container4D::value_type value_type
int x2() const
Access to the second subscript of the current const_iterator4d_box.
void last_back_bottom_right(slip::Point< CoordType, 4 >)
Accessor/Mutator of the last_back_bottom_right point (p2) of Box4d.
Definition: Box4d.hpp:376
self & operator-=(const difference_type &d)
const_iterator4d_box substraction.
pointer operator->() const
void dx2(const CoordType &dx)
Accessor of the second coordinate of DPoint3d.
Definition: DPoint3d.hpp:261
Difference of Point2D class, specialization of DPoint<CoordType,DIM> with DIM = 2.
Definition: Array2d.hpp:129
Container4D::const_slab_iterator slab_begin(size_type slice, size_type row, size_type col) const
const_iterator4d_box element assignment operator.
self & operator++()
Preincrement a iterator4d_box. Iterate to the next location inside the Box4d.
self & operator++()
Preincrement a const_iterator4d_box. Iterate to the next location inside the Box4d.
Container4D::value_type value_type
void dx3(const CoordType &dx)
Accessor of the third coordinate of DPoint4d.
Definition: DPoint4d.hpp:293
int x1() const
Access to the first subscript of the current iterator4d_box.
Container4D::reference reference
Container4D::size_type size_type
Container4D::const_col_iterator col_end(size_type slab, size_type slice, size_type col) const
const_iterator4d_box element assignment operator.
Container4D::col_iterator col_end(size_type slab, size_type slice, size_type col)
iterator4d_box element assignment operator.
int x4() const
Access to the fourth subscript of the current iterator4d_box.
CoordType width() const
compute the width of the Box4d (fourth dimension size).
Definition: Box4d.hpp:420
self & operator+=(const difference_type &d)
const_iterator4d_box addition.
friend bool operator<(const self &i1, const self &i2)
< operator.
int x3() const
Access to the third subscript of the current const_iterator4d_box.
Provides a class to manipulate 4d box.
friend bool operator>(const self &i1, const self &i2)
operator.
void dx4(const CoordType &dx)
Accessor of the fourth coordinate of DPoint4d.
Definition: DPoint4d.hpp:305
int j() const
Access to the fourth subscript of the current const_iterator4d_box.
self & operator--()
Predecrement a iterator4d_box. Iterate to the previous location inside the Box4d. ...
slip::DPoint2d< int > diff2d
reference operator[](difference_type d)
iterator4d_box element assignment operator. Equivalent to *(k + d) = t.
self & operator=(const self &o)
Assign a iterator4d_box.
int k() const
Access to the second subscript of the current iterator4d_box.
self operator+(const difference_type &d)
iterator4d_box addition.
friend difference_type operator-(const self &i1, const self &i2)
iterator4d_box difference operator.
CoordType duration() const
compute the duration of the Box4d (first dimension size).
Definition: Box4d.hpp:432
int k() const
Access to the second subscript of the current const_iterator4d_box.
iterator4d_box(const self &o)
Constructs a copy of the iterator4d_box o.
const reference operator*() const
Dereference operator. Returns the element that the current iterator4d_box i point to...
self operator+(const difference_type &d)
const_iterator4d_box addition.
CoordType height() const
compute the height of the Box4d (third dimension size).
Definition: Box4d.hpp:424
reference operator[](difference_type d) const
const_iterator4d_box element assignment operator. Equivalent to *(k + d) = t.
void dx1(const CoordType &dx)
Accessor of the first coordinate of DPoint3d.
Definition: DPoint3d.hpp:249
self operator-(const difference_type &d)
iterator4d_box substraction.
std::random_access_iterator4d_tag iterator_category
friend bool operator<(const self &i1, const self &i2)
< operator.
int t() const
Access to the first subscript of the current iterator4d_box.
Container4D::pointer pointer
friend bool operator>(const self &i1, const self &i2)
operator.
pointer * operator[](diff2d d)
iterator4d_box element assignment operator. Equivalent to *(k + d) = t.
Container4D::const_col_iterator col_begin(size_type slab, size_type slice, size_type col) const
const_iterator4d_box element assignment operator.
const_iterator4d_box(Container4D *c, const Box4d< int > &b)
Constructs a const_iterator4d_box.
reference operator*() const
Dereference assignment operator. Returns the element that the current iterator4d_box i point to...
const_iterator4d_box(const self &o)
Constructs a copy of the const_iterator4d_box o.
int i() const
Access to the third subscript of the current iterator4d_box.
const_iterator4d_box()
Constructs a const_iterator4d_box.
Container4D::slice_iterator slice_end(size_type slab, size_type row, size_type col)
iterator4d_box element assignment operator.