SLIP  1.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
component_iterator4d_range.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 
75 #ifndef SLIP_COMPONENT_ITERATOR4D_RANGE_HPP
76 #define SLIP_COMPONENT_ITERATOR4D_RANGE_HPP
77 
78 #include <iterator>
79 #include <cassert>
80 
81 #include "Point4d.hpp"
82 #include "DPoint4d.hpp"
83 #include "Range.hpp"
84 #include "iterator_types.hpp"
85 
86 namespace slip
87 {
106 template <class MultiComponentContainer4d, std::size_t N>
108 {
109 public:
110  //typedef std::random_access_iterator_tag iterator_category;
112  typedef typename MultiComponentContainer4d::value_type Block;
113  typedef typename Block::value_type value_type;
115  typedef value_type* pointer;
117 
119 
120  typedef typename MultiComponentContainer4d::size_type size_type;
125 
131  cont4d_(0),pos_(0),x1_(0),x2_(0),x3_(0),x4_(0),cp_(0),range_x1_(0,0),range_x2_(0,0)
132  ,range_x3_(0,0),range_x4_(0,0)
133  {}
134 
149  component_iterator4d_range(MultiComponentContainer4d* c, std::size_t cp,
150  const slip::Range<int>& r1,
151  const slip::Range<int>& r2,
152  const slip::Range<int>& r3,
153  const slip::Range<int>& r4):
154  cont4d_(c),
155  pos_(&(*c)[0][0][0][0][cp] +
156  (r1.start() * static_cast<int>(c->slices()) * static_cast<int>(c->rows()) * static_cast<int>(c->cols()) * N) +
157  (r2.start() * static_cast<int>(c->rows()) * static_cast<int>(c->cols()) * N) +
158  (r3.start() * static_cast<int>(c->cols()) * N) +
159  (r4.start() * N)),
160  x1_(r1.start()),x2_(r2.start()),x3_(r3.start()),x4_(r4.start()),
161  cp_(cp),range_x1_(r1),range_x2_(r2),range_x3_(r3),range_x4_(r4)
162  {}
163 
170  cont4d_(o.cont4d_),pos_(o.pos_),x1_(o.x1_),x2_(o.x2_),x3_(o.x3_),x4_(o.x4_),cp_(o.cp_),
171  range_x1_(o.range_x1_), range_x2_(o.range_x2_), range_x3_(o.range_x3_), range_x4_(o.range_x4_)
172  {}
173 
188  self& operator=(const self& o)
189  {
190  if(this != &o)
191  {
192  this->cont4d_ = o.cont4d_;
193  this->pos_ = o.pos_;
194  this->x1_ = o.x1_;
195  this->x2_ = o.x2_;
196  this->x3_ = o.x3_;
197  this->x4_ = o.x4_;
198  this->cp_ = o.cp_;
199  this->range_x1_ = o.range_x1_;
200  this->range_x2_ = o.range_x2_;
201  this->range_x3_ = o.range_x3_;
202  this->range_x4_ = o.range_x4_;
203  }
204  return *this;
205  }
214  inline
216  {
217  return *pos_;
218  }
219 
220  inline
222  {
223  return &(operator*());
224  }
225 
230 
235  inline
236  self& operator++()
237  {
238  if( (x4_ < static_cast<int>(range_x4_.start() + range_x4_.iterations() * range_x4_.stride()))){
239  this->x4_+= range_x4_.stride();
240  this->pos_+= range_x4_.stride()*N;
241  }
242  else if(x3_ < static_cast<int>(range_x3_.start() + range_x3_.iterations() * range_x3_.stride()))
243  {
244  this->x3_+= range_x3_.stride();
245  this->x4_ = range_x4_.start();
246  this->pos_ = &(*cont4d_)[0][0][0][0][this->cp_] +
247  (this->x1_ * static_cast<int>(cont4d_->slices()) * static_cast<int>(cont4d_->rows())
248  * static_cast<int>(cont4d_->cols()) * N) +
249  (this->x2_ * static_cast<int>(cont4d_->rows()) * static_cast<int>(cont4d_->cols()) * N) +
250  (this->x3_ * static_cast<int>(cont4d_->cols()) * N) +
251  (this->x4_ * N);
252  }
253  else if(x2_ < static_cast<int>(range_x2_.start() + range_x2_.iterations() * range_x2_.stride())){
254  this->x2_+= range_x2_.stride();
255  this->x3_ = range_x3_.start();
256  this->x4_ = range_x4_.start();
257  this->pos_ = &(*cont4d_)[0][0][0][0][this->cp_] +
258  (this->x1_ * static_cast<int>(cont4d_->slices()) * static_cast<int>(cont4d_->rows())
259  * static_cast<int>(cont4d_->cols()) * N) +
260  (this->x2_ * static_cast<int>(cont4d_->rows()) * static_cast<int>(cont4d_->cols()) * N) +
261  (this->x3_ * static_cast<int>(cont4d_->cols()) * N) +
262  (this->x4_ * N);
263  }
264  else if(x1_ < static_cast<int>(range_x1_.start() + range_x1_.iterations() * range_x1_.stride())){
265  this->x1_+= range_x1_.stride();
266  this->x2_ = range_x2_.start();
267  this->x3_ = range_x3_.start();
268  this->x4_ = range_x4_.start();
269  this->pos_ = &(*cont4d_)[0][0][0][0][this->cp_] +
270  (this->x1_ * static_cast<int>(cont4d_->slices()) * static_cast<int>(cont4d_->rows())
271  * static_cast<int>(cont4d_->cols()) * N) +
272  (this->x2_ * static_cast<int>(cont4d_->rows()) * static_cast<int>(cont4d_->cols()) * N) +
273  (this->x3_ * static_cast<int>(cont4d_->cols()) * N) +
274  (this->x4_ * N);
275  }
276  else{
277  this->x1_ = static_cast<int>(range_x1_.start() + (range_x1_.iterations() + 1) * range_x1_.stride());
278  this->x2_ = static_cast<int>(range_x2_.start() + (range_x2_.iterations() + 1) * range_x2_.stride());
279  this->x3_ = static_cast<int>(range_x3_.start() + (range_x3_.iterations() + 1) * range_x3_.stride());
280  this->x4_ = static_cast<int>(range_x4_.start() + (range_x4_.iterations() + 1) * range_x4_.stride());
281  this->pos_ = &(*cont4d_)[0][0][0][0][this->cp_] +
282  (this->x1_ * static_cast<int>(cont4d_->slices()) * static_cast<int>(cont4d_->rows())
283  * static_cast<int>(cont4d_->cols()) * N) +
284  (this->x2_ * static_cast<int>(cont4d_->rows()) * static_cast<int>(cont4d_->cols()) * N) +
285  (this->x3_ * static_cast<int>(cont4d_->cols()) * N) +
286  (this->x4_ * N);
287  }
288 
289  return *this;
290  }
291 
297  inline
298  self operator++(int)
299  {
300  self tmp = *this;
301  ++(*this);
302  return tmp;
303  }
304 
316  inline
317  self& operator--()
318  {
319  if(x4_ > static_cast<int>(range_x4_.stop() - range_x4_.iterations() * range_x4_.stride()))
320  {
321  this->x4_ -= range_x4_.stride();
322  this->pos_ -= N * range_x4_.stride();
323  }
324  else if (x3_ > static_cast<int>(range_x3_.stop() - range_x3_.iterations() * range_x3_.stride()))
325  {
326  this->x4_ = static_cast<int>(range_x4_.start() + range_x4_.iterations() * range_x4_.stride());
327  this->x3_ -= range_x3_.stride();
328  this->pos_ = &(*cont4d_)[0][0][0][0][this->cp_] +
329  (this->x1_ * static_cast<int>(cont4d_->slices()) * static_cast<int>(cont4d_->rows())
330  * static_cast<int>(cont4d_->cols()) * N) +
331  (this->x2_ * static_cast<int>(cont4d_->rows()) * static_cast<int>(cont4d_->cols()) * N) +
332  (this->x3_ * static_cast<int>(cont4d_->cols()) * N) +
333  (this->x4_ * N);
334  }
335  else if (x2_ > static_cast<int>(range_x2_.stop() - range_x2_.iterations() * range_x2_.stride()))
336  {
337  this->x4_ = static_cast<int>(range_x4_.start() + range_x4_.iterations() * range_x4_.stride());
338  this->x3_ = static_cast<int>(range_x3_.start() + range_x3_.iterations() * range_x3_.stride());
339  this->x2_ -= range_x2_.stride();
340  this->pos_ = &(*cont4d_)[0][0][0][0][this->cp_] +
341  (this->x1_ * static_cast<int>(cont4d_->slices()) * static_cast<int>(cont4d_->rows())
342  * static_cast<int>(cont4d_->cols()) * N) +
343  (this->x2_ * static_cast<int>(cont4d_->rows()) * static_cast<int>(cont4d_->cols()) * N) +
344  (this->x3_ * static_cast<int>(cont4d_->cols()) * N) +
345  (this->x4_ * N);
346  }
347  else if (x1_ > static_cast<int>(range_x1_.stop() - range_x1_.iterations() * range_x1_.stride()))
348  {
349  this->x4_ = static_cast<int>(range_x4_.start() + range_x4_.iterations() * range_x4_.stride());
350  this->x3_ = static_cast<int>(range_x3_.start() + range_x3_.iterations() * range_x3_.stride());
351  this->x2_ = static_cast<int>(range_x2_.start() + range_x2_.iterations() * range_x2_.stride());
352  this->x1_ -= range_x1_.stride();
353  this->pos_ = &(*cont4d_)[0][0][0][0][this->cp_] +
354  (this->x1_ * static_cast<int>(cont4d_->slices()) * static_cast<int>(cont4d_->rows())
355  * static_cast<int>(cont4d_->cols()) * N) +
356  (this->x2_ * static_cast<int>(cont4d_->rows()) * static_cast<int>(cont4d_->cols()) * N) +
357  (this->x3_ * static_cast<int>(cont4d_->cols()) * N) +
358  (this->x4_ * N);
359  }
360  else{
361  this->x4_ = static_cast<int>(range_x4_.stop() + (range_x4_.iterations() + 1) * range_x4_.stride());
362  this->x3_ = static_cast<int>(range_x3_.stop() + (range_x3_.iterations() + 1) * range_x3_.stride());
363  this->x2_ = static_cast<int>(range_x2_.stop() + (range_x2_.iterations() + 1) * range_x2_.stride());
364  this->x1_ = static_cast<int>(range_x1_.stop() + (range_x1_.iterations() + 1) * range_x1_.stride());
365  this->pos_ = &(*cont4d_)[0][0][0][0][this->cp_] +
366  (this->x1_ * static_cast<int>(cont4d_->slices()) * static_cast<int>(cont4d_->rows())
367  * static_cast<int>(cont4d_->cols()) * N) +
368  (this->x2_ * static_cast<int>(cont4d_->rows()) * static_cast<int>(cont4d_->cols()) * N) +
369  (this->x3_ * static_cast<int>(cont4d_->cols()) * N) +
370  (this->x4_ * N);
371  }
372 
373  return *this;
374  }
375 
381  inline
382  self operator--(int)
383  {
384  self tmp = *this;
385  --(*this);
386  return tmp;
387  }
388 
402  inline
403  friend bool operator==(const self& i1,
404  const self& i2)
405  {
406 
407  return ( (i1.cont4d_ == i2.cont4d_) && (i1.pos_ == i2.pos_)
408  && (i1.x1_ == i2.x1_) && (i1.x2_ == i2.x2_) && (i1.x3_ == i2.x3_)
409  && (i1.x4_ == i2.x4_) && (i1.cp_ == i2.cp_));
410  }
411 
418  inline
419  friend bool operator!=(const self& i1,
420  const self& i2)
421  {
422  return ( (i1.cont4d_ != i2.cont4d_) || (i1.pos_ != i2.pos_)
423  || (i1.x1_ != i2.x1_) || (i1.x2_ != i2.x2_)
424  || (i1.x3_ != i2.x3_) || (i1.x4_ != i2.x4_) || (i1.cp_ != i2.cp_));
425  }
438  inline
439  friend bool operator<(const self& i1,
440  const self& i2)
441  {
442 
443  return ( i1.pos_ < i2.pos_);
444  }
445 
452  inline
453  friend bool operator>(const self& i1,
454  const self& i2)
455  {
456 
457  return (i2 < i1);
458  }
459 
466  inline
467  friend bool operator<=(const self& i1,
468  const self& i2)
469  {
470 
471  return !(i2 < i1);
472  }
473 
480  inline
481  friend bool operator>=(const self& i1,
482  const self& i2)
483  {
484 
485  return !(i1 < i2);
486  }
501  inline
502  self& operator+=(const difference_type& d)
503  {
504  this->x1_ += this->range_x1_.stride() * d.dx1();
505  this->x2_ += this->range_x2_.stride() * d.dx2();
506  this->x3_ += this->range_x3_.stride() * d.dx3();
507  this->x4_ += this->range_x4_.stride() * d.dx4();
508  this->pos_ = &(*cont4d_)[0][0][0][0][this->cp_] +
509  (this->x1_ * static_cast<int>(cont4d_->slices()) * static_cast<int>(cont4d_->rows())
510  * static_cast<int>(cont4d_->cols()) * N) +
511  (this->x2_ * static_cast<int>(cont4d_->rows()) * static_cast<int>(cont4d_->cols()) * N) +
512  (this->x3_ * static_cast<int>(cont4d_->cols()) * N) +
513  (this->x4_ * N);
514  return *this;
515  }
516 
524  inline
525  self& operator-=(const difference_type& d)
526  {
527  this->x1_ -= this->range_x1_.stride() * d.dx1();
528  this->x2_ -= this->range_x2_.stride() * d.dx2();
529  this->x3_ -= this->range_x3_.stride() * d.dx3();
530  this->x4_ -= this->range_x4_.stride() * d.dx4();
531  this->pos_ = &(*cont4d_)[0][0][0][0][this->cp_] +
532  (this->x1_ * static_cast<int>(cont4d_->slices()) * static_cast<int>(cont4d_->rows())
533  * static_cast<int>(cont4d_->cols()) * N) +
534  (this->x2_ * static_cast<int>(cont4d_->rows()) * static_cast<int>(cont4d_->cols()) * N) +
535  (this->x3_ * static_cast<int>(cont4d_->cols()) * N) +
536  (this->x4_ * N);
537  return *this;
538  }
539 
547  inline
548  self operator+(const difference_type& d)
549  {
550  self tmp = *this;
551  tmp += d;
552  return tmp;
553  }
554 
562  inline
563  self operator-(const difference_type& d)
564  {
565  self tmp = *this;
566  tmp -= d;
567  return tmp;
568  }
569 
578  inline
579  friend difference_type operator-(const self& i1,
580  const self& i2)
581  {
582  assert(i1.range_x1_.stride() == i2.range_x1_.stride());
583  assert(i1.range_x2_.stride() == i2.range_x2_.stride());
584  assert(i1.range_x3_.stride() == i2.range_x3_.stride());
585  assert(i1.range_x4_.stride() == i2.range_x4_.stride());
586  return difference_type(static_cast<int>((i1.x1_ - i2.x1_)/i1.range_x1_.stride()),
587  static_cast<int>((i1.x2_ - i2.x2_))/i1.range_x2_.stride(),
588  static_cast<int>((i1.x3_ - i2.x3_))/i1.range_x3_.stride(),
589  static_cast<int>((i1.x4_ - i2.x4_))/i1.range_x4_.stride());
590  }
591 
592 
601  inline
603  {
604  assert( (this->x1_+ range_x1_.stride() * d.dx1()) < cont4d_->dim1() );
605  assert( (this->x2_+ range_x2_.stride() * d.dx2()) < cont4d_->dim2() );
606  assert( (this->x3_+ range_x3_.stride() * d.dx3()) < cont4d_->dim3() );
607  assert( (this->x4_+ range_x4_.stride() * d.dx4()) < cont4d_->dim4() );
608  return (*cont4d_)[this->x1_+ range_x1_.stride() * d.dx1()]
609  [this->x2_+ range_x2_.stride() * d.dx2()]
610  [this->x3_+ range_x3_.stride() * d.dx3()]
611  [this->x4_+ range_x4_.stride() * d.dx4()][cp_];
612  }
613 
623  inline
624  typename MultiComponentContainer4d::component_slice_range_iterator
626  {
627  return cont4d_->slice_begin(this->cp_,
628  range_x1_,
629  range_x2_.start() + slice * range_x2_.stride(),
630  range_x3_.start() + row * range_x3_.stride(),
631  range_x4_.start() + col * range_x4_.stride());
632  }
633 
634 
644  inline
645  typename MultiComponentContainer4d::component_slice_range_iterator
647  {
648  return this->slab_begin(slice, row, col) + ((range_x1_.iterations() + 1) * N);
649  }
650 
651 
661  inline
662  typename MultiComponentContainer4d::component_slice_range_iterator
664  {
665  return cont4d_->slice_begin(this->cp_,
666  range_x1_.start() + slab * range_x1_.stride(),
667  range_x2_,
668  range_x3_.start() + row * range_x3_.stride(),
669  range_x4_.start() + col * range_x4_.stride());
670  }
671 
672 
682  inline
683  typename MultiComponentContainer4d::component_slice_range_iterator
685  {
686  return this->slice_begin(slab, row, col) + ((range_x2_.iterations() + 1) * N);
687  }
688 
689 
699  inline
700  typename MultiComponentContainer4d::component_row_range_iterator
702  {
703  return cont4d_->row_begin(this->cp_,
704  range_x1_.start() + slab * range_x1_.stride(),
705  range_x2_.start() + slice * range_x2_.stride(),
706  range_x3_.start() + row * range_x3_.stride(),
707  range_x4_);
708  }
709 
710 
720  inline
721  typename MultiComponentContainer4d::component_row_range_iterator
723  {
724  return this->row_begin(slab, slice, row) + ((range_x4_.iterations() + 1) * N);
725  }
726 
727 
728 
738  inline
739  typename MultiComponentContainer4d::component_col_range_iterator
741  {
742  return cont4d_->col_begin(this->cp_,
743  range_x1_.start() + slab * range_x1_.stride(),
744  range_x2_.start() + slice * range_x2_.stride(),
745  range_x3_,
746  range_x4_.start() + col * range_x4_.stride());
747  }
748 
758  inline
759  typename MultiComponentContainer4d::component_col_range_iterator
761  {
762  return this->col_begin(slab, slice, col) + ((range_x3_.iterations() + 1) * N);
763  }
764 
765 
773 
778  inline
779  int x1() const
780  {
781  return this->x1_;
782  }
787  inline
788  int t() const
789  {
790  return this->x1_;
791  }
792 
797  inline
798  int x2() const
799  {
800  return this->x2_;
801  }
806  inline
807  int k() const
808  {
809  return this->x2_;
810  }
811 
816  inline
817  int x3() const
818  {
819  return this->x3_;
820  }
825  inline
826  int i() const
827  {
828  return this->x3_;
829  }
830 
835  inline
836  int x4() const
837  {
838  return this->x4_;
839  }
844  inline
845  int j() const
846  {
847  return this->x4_;
848  }
849 
850 
855  inline
856  int cp() const
857  {
858  return this->cp_;
859  }
860 
861 
866 private:
867  MultiComponentContainer4d* cont4d_; // pointer to the 4d container
868  pointer pos_; // linear position within the container
869  int x1_; // first index position
870  int x2_; // second index position
871  int x3_; // third index position
872  int x4_; // fourth index position
873  int cp_; // component index number
874  slip::Range<int> range_x1_; // range to iterate on the first axis
875  slip::Range<int> range_x2_; //range to iterate on the second axis
876  slip::Range<int> range_x3_; //range to iterate on the third axis
877  slip::Range<int> range_x4_; //range to iterate on the fourth axis
878 };
879 
880 
899 template <class MultiComponentContainer4d, std::size_t N>
901 {
902 public:
903  //typedef std::random_access_iterator_tag iterator_category;
905  typedef typename MultiComponentContainer4d::value_type Block;
906  typedef typename Block::value_type value_type;
908  typedef value_type const * pointer;
909  typedef value_type const & reference;
910 
912 
913  typedef typename MultiComponentContainer4d::size_type size_type;
918 
924  cont4d_(0),pos_(0),x1_(0),x2_(0),x3_(0),x4_(0),cp_(0),range_x1_(0,0),range_x2_(0,0)
925  ,range_x3_(0,0),range_x4_(0,0)
926  {}
927 
941  const_component_iterator4d_range(MultiComponentContainer4d* c, std::size_t cp,
942  const slip::Range<int>& r1,
943  const slip::Range<int>& r2,
944  const slip::Range<int>& r3,
945  const slip::Range<int>& r4):
946  cont4d_(c),
947  pos_(&(*c)[0][0][0][0][cp] +
948  (r1.start() * static_cast<int>(c->slices()) * static_cast<int>(c->rows())
949  * static_cast<int>(c->cols()) * N) +
950  (r2.start() * static_cast<int>(c->rows()) * static_cast<int>(c->cols()) * N) +
951  (r3.start() * static_cast<int>(c->cols()) * N) +
952  (r4.start() * N)),
953  x1_(r1.start()),x2_(r2.start()),x3_(r3.start()),x4_(r4.start()),
954  cp_(cp),range_x1_(r1),range_x2_(r2),range_x3_(r3),range_x4_(r4)
955  {}
956 
963  cont4d_(o.cont4d_),pos_(o.pos_),x1_(o.x1_),x2_(o.x2_),x3_(o.x3_),x4_(o.x4_),cp_(o.cp_),
964  range_x1_(o.range_x1_), range_x2_(o.range_x2_), range_x3_(o.range_x3_), range_x4_(o.range_x4_)
965  {}
966 
981  self& operator=(const self& o)
982  {
983  if(this != &o)
984  {
985  this->cont4d_ = o.cont4d_;
986  this->pos_ = o.pos_;
987  this->x1_ = o.x1_;
988  this->x2_ = o.x2_;
989  this->x3_ = o.x3_;
990  this->x4_ = o.x4_;
991  this->cp_ = o.cp_;
992  this->range_x1_ = o.range_x1_;
993  this->range_x2_ = o.range_x2_;
994  this->range_x3_ = o.range_x3_;
995  this->range_x4_ = o.range_x4_;
996  }
997  return *this;
998  }
1008  inline
1010  {
1011  return *pos_;
1012  }
1013 
1014  inline
1016  {
1017  return &(operator*());
1018  }
1019 
1020 
1021 
1026 
1032  inline
1033  self& operator++()
1034  {
1035  if( (x4_ < static_cast<int>(range_x4_.start() + range_x4_.iterations() * range_x4_.stride()))){
1036  this->x4_+= range_x4_.stride();
1037  this->pos_+= range_x4_.stride()*N;
1038  }
1039  else if(x3_ < static_cast<int>(range_x3_.start() + range_x3_.iterations() * range_x3_.stride()))
1040  {
1041  this->x3_+= range_x3_.stride();
1042  this->x4_ = range_x4_.start();
1043  this->pos_ = &(*cont4d_)[0][0][0][0][this->cp_] +
1044  (this->x1_ * static_cast<int>(cont4d_->slices()) * static_cast<int>(cont4d_->rows())
1045  * static_cast<int>(cont4d_->cols()) * N) +
1046  (this->x2_ * static_cast<int>(cont4d_->rows()) * static_cast<int>(cont4d_->cols()) * N) +
1047  (this->x3_ * static_cast<int>(cont4d_->cols()) * N) +
1048  (this->x4_ * N);
1049  }
1050  else if(x2_ < static_cast<int>(range_x2_.start() + range_x2_.iterations() * range_x2_.stride())){
1051  this->x2_+= range_x2_.stride();
1052  this->x3_ = range_x3_.start();
1053  this->x4_ = range_x4_.start();
1054  this->pos_ = &(*cont4d_)[0][0][0][0][this->cp_] +
1055  (this->x1_ * static_cast<int>(cont4d_->slices()) * static_cast<int>(cont4d_->rows())
1056  * static_cast<int>(cont4d_->cols()) * N) +
1057  (this->x2_ * static_cast<int>(cont4d_->rows()) * static_cast<int>(cont4d_->cols()) * N) +
1058  (this->x3_ * static_cast<int>(cont4d_->cols()) * N) +
1059  (this->x4_ * N);
1060  }
1061  else if(x1_ < static_cast<int>(range_x1_.start() + range_x1_.iterations() * range_x1_.stride())){
1062  this->x1_+= range_x1_.stride();
1063  this->x2_ = range_x2_.start();
1064  this->x3_ = range_x3_.start();
1065  this->x4_ = range_x4_.start();
1066  this->pos_ = &(*cont4d_)[0][0][0][0][this->cp_] +
1067  (this->x1_ * static_cast<int>(cont4d_->slices()) * static_cast<int>(cont4d_->rows())
1068  * static_cast<int>(cont4d_->cols()) * N) +
1069  (this->x2_ * static_cast<int>(cont4d_->rows()) * static_cast<int>(cont4d_->cols()) * N) +
1070  (this->x3_ * static_cast<int>(cont4d_->cols()) * N) +
1071  (this->x4_ * N);
1072  }
1073  else{
1074  this->x1_ = static_cast<int>(range_x1_.start() + (range_x1_.iterations() + 1) * range_x1_.stride());
1075  this->x2_ = static_cast<int>(range_x2_.start() + (range_x2_.iterations() + 1) * range_x2_.stride());
1076  this->x3_ = static_cast<int>(range_x3_.start() + (range_x3_.iterations() + 1) * range_x3_.stride());
1077  this->x4_ = static_cast<int>(range_x4_.start() + (range_x4_.iterations() + 1) * range_x4_.stride());
1078  this->pos_ = &(*cont4d_)[0][0][0][0][this->cp_] +
1079  (this->x1_ * static_cast<int>(cont4d_->slices()) * static_cast<int>(cont4d_->rows())
1080  * static_cast<int>(cont4d_->cols()) * N) +
1081  (this->x2_ * static_cast<int>(cont4d_->rows()) * static_cast<int>(cont4d_->cols()) * N) +
1082  (this->x3_ * static_cast<int>(cont4d_->cols()) * N) +
1083  (this->x4_ * N);
1084  }
1085 
1086  return *this;
1087  }
1088 
1094  inline
1095  self operator++(int)
1096  {
1097  self tmp = *this;
1098  ++(*this);
1099  return tmp;
1100  }
1101 
1113  inline
1114  self& operator--()
1115  {
1116  if(x4_ > static_cast<int>(range_x4_.stop() - range_x4_.iterations() * range_x4_.stride()))
1117  {
1118  this->x4_ -= range_x4_.stride();
1119  this->pos_ -= N * range_x4_.stride();
1120  }
1121  else if (x3_ > static_cast<int>(range_x3_.stop() - range_x3_.iterations() * range_x3_.stride()))
1122  {
1123  this->x4_ = static_cast<int>(range_x4_.start() + range_x4_.iterations() * range_x4_.stride());
1124  this->x3_ -= range_x3_.stride();
1125  this->pos_ = &(*cont4d_)[0][0][0][0][this->cp_] +
1126  (this->x1_ * static_cast<int>(cont4d_->slices()) * static_cast<int>(cont4d_->rows())
1127  * static_cast<int>(cont4d_->cols()) * N) +
1128  (this->x2_ * static_cast<int>(cont4d_->rows()) * static_cast<int>(cont4d_->cols()) * N) +
1129  (this->x3_ * static_cast<int>(cont4d_->cols()) * N) +
1130  (this->x4_ * N);
1131  }
1132  else if (x2_ > static_cast<int>(range_x2_.stop() - range_x2_.iterations() * range_x2_.stride()))
1133  {
1134  this->x4_ = static_cast<int>(range_x4_.start() + range_x4_.iterations() * range_x4_.stride());
1135  this->x3_ = static_cast<int>(range_x3_.start() + range_x3_.iterations() * range_x3_.stride());
1136  this->x2_ -= range_x2_.stride();
1137  this->pos_ = &(*cont4d_)[0][0][0][0][this->cp_] +
1138  (this->x1_ * static_cast<int>(cont4d_->slices()) * static_cast<int>(cont4d_->rows())
1139  * static_cast<int>(cont4d_->cols()) * N) +
1140  (this->x2_ * static_cast<int>(cont4d_->rows()) * static_cast<int>(cont4d_->cols()) * N) +
1141  (this->x3_ * static_cast<int>(cont4d_->cols()) * N) +
1142  (this->x4_ * N);
1143  }
1144  else if (x1_ > static_cast<int>(range_x1_.stop() - range_x1_.iterations() * range_x1_.stride()))
1145  {
1146  this->x4_ = static_cast<int>(range_x4_.start() + range_x4_.iterations() * range_x4_.stride());
1147  this->x3_ = static_cast<int>(range_x3_.start() + range_x3_.iterations() * range_x3_.stride());
1148  this->x2_ = static_cast<int>(range_x2_.start() + range_x2_.iterations() * range_x2_.stride());
1149  this->x1_ -= range_x1_.stride();
1150  this->pos_ = &(*cont4d_)[0][0][0][0][this->cp_] +
1151  (this->x1_ * static_cast<int>(cont4d_->slices()) * static_cast<int>(cont4d_->rows())
1152  * static_cast<int>(cont4d_->cols()) * N) +
1153  (this->x2_ * static_cast<int>(cont4d_->rows()) * static_cast<int>(cont4d_->cols()) * N) +
1154  (this->x3_ * static_cast<int>(cont4d_->cols()) * N) +
1155  (this->x4_ * N);
1156  }
1157  else{
1158  this->x4_ = static_cast<int>(range_x4_.stop() + (range_x4_.iterations() + 1) * range_x4_.stride());
1159  this->x3_ = static_cast<int>(range_x3_.stop() + (range_x3_.iterations() + 1) * range_x3_.stride());
1160  this->x2_ = static_cast<int>(range_x2_.stop() + (range_x2_.iterations() + 1) * range_x2_.stride());
1161  this->x1_ = static_cast<int>(range_x1_.stop() + (range_x1_.iterations() + 1) * range_x1_.stride());
1162  this->pos_ = &(*cont4d_)[0][0][0][0][this->cp_] +
1163  (this->x1_ * static_cast<int>(cont4d_->slices()) * static_cast<int>(cont4d_->rows())
1164  * static_cast<int>(cont4d_->cols()) * N) +
1165  (this->x2_ * static_cast<int>(cont4d_->rows()) * static_cast<int>(cont4d_->cols()) * N) +
1166  (this->x3_ * static_cast<int>(cont4d_->cols()) * N) +
1167  (this->x4_ * N);
1168  }
1169 
1170  return *this;
1171  }
1172 
1178  inline
1179  self operator--(int)
1180  {
1181  self tmp = *this;
1182  --(*this);
1183  return tmp;
1184  }
1185 
1199  inline
1200  friend bool operator==(const self& i1,
1201  const self& i2)
1202  {
1203 
1204  return ( (i1.cont4d_ == i2.cont4d_) && (i1.pos_ == i2.pos_)
1205  && (i1.x1_ == i2.x1_) && (i1.x2_ == i2.x2_)
1206  && (i1.x3_ == i2.x3_) && (i1.x4_ == i2.x4_)
1207  && (i1.cp_ == i2.cp_));
1208  }
1209 
1216  inline
1217  friend bool operator!=(const self& i1,
1218  const self& i2)
1219  {
1220  return ( (i1.cont4d_ != i2.cont4d_) || (i1.pos_ != i2.pos_)
1221  || (i1.x1_ != i2.x1_) || (i1.x2_ != i2.x2_)
1222  || (i1.x3_ != i2.x3_) || (i1.x4_ != i2.x4_)
1223  || (i1.cp_ != i2.cp_));
1224  }
1237  inline
1238  friend bool operator<(const self& i1,
1239  const self& i2)
1240  {
1241 
1242  return ( i1.pos_ < i2.pos_);
1243  }
1244 
1251  inline
1252  friend bool operator>(const self& i1,
1253  const self& i2)
1254  {
1255 
1256  return (i2 < i1);
1257  }
1258 
1265  inline
1266  friend bool operator<=(const self& i1,
1267  const self& i2)
1268  {
1269 
1270  return !(i2 < i1);
1271  }
1272 
1279  inline
1280  friend bool operator>=(const self& i1,
1281  const self& i2)
1282  {
1283 
1284  return !(i1 < i2);
1285  }
1302  inline
1303  self& operator+=(const difference_type& d)
1304  {
1305  this->x1_ += this->range_x1_.stride() * d.dx1();
1306  this->x2_ += this->range_x2_.stride() * d.dx2();
1307  this->x3_ += this->range_x3_.stride() * d.dx3();
1308  this->x4_ += this->range_x4_.stride() * d.dx4();
1309  this->pos_ = &(*cont4d_)[0][0][0][0][this->cp_] +
1310  (this->x1_ * static_cast<int>(cont4d_->slices()) * static_cast<int>(cont4d_->rows())
1311  * static_cast<int>(cont4d_->cols()) * N) +
1312  (this->x2_ * static_cast<int>(cont4d_->rows()) * static_cast<int>(cont4d_->cols()) * N) +
1313  (this->x3_ * static_cast<int>(cont4d_->cols()) * N) +
1314  (this->x4_ * N);
1315  return *this;
1316  }
1317 
1325  inline
1326  self& operator-=(const difference_type& d)
1327  {
1328  this->x1_ -= this->range_x1_.stride() * d.dx1();
1329  this->x2_ -= this->range_x2_.stride() * d.dx2();
1330  this->x3_ -= this->range_x3_.stride() * d.dx3();
1331  this->x4_ -= this->range_x4_.stride() * d.dx4();
1332  this->pos_ = &(*cont4d_)[0][0][0][0][this->cp_] +
1333  (this->x1_ * static_cast<int>(cont4d_->slices()) * static_cast<int>(cont4d_->rows())
1334  * static_cast<int>(cont4d_->cols()) * N) +
1335  (this->x2_ * static_cast<int>(cont4d_->rows()) * static_cast<int>(cont4d_->cols()) * N) +
1336  (this->x3_ * static_cast<int>(cont4d_->cols()) * N) +
1337  (this->x4_ * N);
1338  return *this;
1339  }
1340 
1348  inline
1350  {
1351  self tmp = *this;
1352  tmp += d;
1353  return tmp;
1354  }
1355 
1363  inline
1365  {
1366  self tmp = *this;
1367  tmp -= d;
1368  return tmp;
1369  }
1370 
1379  inline
1380  friend difference_type operator-(const self& i1,
1381  const self& i2)
1382  {
1383  assert(i1.range_x1_.stride() == i2.range_x1_.stride());
1384  assert(i1.range_x2_.stride() == i2.range_x2_.stride());
1385  assert(i1.range_x3_.stride() == i2.range_x3_.stride());
1386  assert(i1.range_x4_.stride() == i2.range_x4_.stride());
1387  return difference_type(static_cast<int>((i1.x1_ - i2.x1_)/i1.range_x1_.stride()),
1388  static_cast<int>((i1.x2_ - i2.x2_))/i1.range_x2_.stride(),
1389  static_cast<int>((i1.x3_ - i2.x3_))/i1.range_x3_.stride(),
1390  static_cast<int>((i1.x4_ - i2.x4_))/i1.range_x4_.stride());
1391  }
1392 
1393 
1401  inline
1403  {
1404  assert( (this->x1_+ range_x1_.stride() * d.dx1()) < cont4d_->dim1() );
1405  assert( (this->x2_+ range_x2_.stride() * d.dx2()) < cont4d_->dim2() );
1406  assert( (this->x3_+ range_x3_.stride() * d.dx3()) < cont4d_->dim3() );
1407  assert( (this->x4_+ range_x4_.stride() * d.dx4()) < cont4d_->dim4() );
1408  return (*cont4d_)[this->x1_+ range_x1_.stride() * d.dx1()]
1409  [this->x2_+ range_x2_.stride() * d.dx2()]
1410  [this->x3_+ range_x3_.stride() * d.dx3()]
1411  [this->x4_+ range_x4_.stride() * d.dx4()][cp_];
1412  }
1413 
1423  inline
1424  typename MultiComponentContainer4d::const_component_slice_range_iterator
1426  {
1427  return cont4d_->slice_begin(this->cp_,
1428  range_x1_,
1429  range_x2_.start() + slice * range_x2_.stride(),
1430  range_x3_.start() + row * range_x3_.stride(),
1431  range_x4_.start() + col * range_x4_.stride());
1432  }
1433 
1434 
1444  inline
1445  typename MultiComponentContainer4d::const_component_slice_range_iterator
1447  {
1448  return this->slab_begin(slice, row, col) + ((range_x1_.iterations() + 1) * N);
1449  }
1450 
1451 
1461  inline
1462  typename MultiComponentContainer4d::const_component_slice_range_iterator
1464  {
1465  return cont4d_->slice_begin(this->cp_,
1466  range_x1_.start() + slab * range_x1_.stride(),
1467  range_x2_,
1468  range_x3_.start() + row * range_x3_.stride(),
1469  range_x4_.start() + col * range_x4_.stride());
1470  }
1471 
1472 
1482  inline
1483  typename MultiComponentContainer4d::const_component_slice_range_iterator
1485  {
1486  return this->slice_begin(slab, row, col) + ((range_x2_.iterations() + 1) * N);
1487  }
1488 
1489 
1499  inline
1500  typename MultiComponentContainer4d::const_component_row_range_iterator
1502  {
1503  return cont4d_->row_begin(this->cp_,
1504  range_x1_.start() + slab * range_x1_.stride(),
1505  range_x2_.start() + slice * range_x2_.stride(),
1506  range_x3_.start() + row * range_x3_.stride(),
1507  range_x4_);
1508  }
1509 
1510 
1520  inline
1521  typename MultiComponentContainer4d::const_component_row_range_iterator
1523  {
1524  return this->row_begin(slab, slice, row) + ((range_x4_.iterations() + 1) * N);
1525  }
1526 
1527 
1528 
1538  inline
1539  typename MultiComponentContainer4d::const_component_col_range_iterator
1541  {
1542  return cont4d_->col_begin(this->cp_,
1543  range_x1_.start() + slab * range_x1_.stride(),
1544  range_x2_.start() + slice * range_x2_.stride(),
1545  range_x3_,
1546  range_x4_.start() + col * range_x4_.stride());
1547  }
1548 
1558  inline
1559  typename MultiComponentContainer4d::const_component_col_range_iterator
1561  {
1562  return this->col_begin(slab, slice, col) + ((range_x3_.iterations() + 1) * N);
1563  }
1564 
1565 
1566 
1578  inline
1579  int x1() const
1580  {
1581  return this->x1_;
1582  }
1587  inline
1588  int t() const
1589  {
1590  return this->x1_;
1591  }
1592 
1597  inline
1598  int x2() const
1599  {
1600  return this->x2_;
1601  }
1606  inline
1607  int k() const
1608  {
1609  return this->x2_;
1610  }
1615  inline
1616  int x3() const
1617  {
1618  return this->x3_;
1619  }
1624  inline
1625  int i() const
1626  {
1627  return this->x3_;
1628  }
1629 
1634  inline
1635  int x4() const
1636  {
1637  return this->x4_;
1638  }
1643  inline
1644  int j() const
1645  {
1646  return this->x4_;
1647  }
1648 
1653  inline
1654  int cp() const
1655  {
1656  return this->cp_;
1657  }
1658 
1661 private:
1662  MultiComponentContainer4d* cont4d_; // pointer to the 4d container
1663  pointer pos_; // linear position within the container
1664  int x1_; // first index position
1665  int x2_; // second index position
1666  int x3_; // third index position
1667  int x4_; // fourth index position
1668  int cp_; // component index number
1669  slip::Range<int> range_x1_; // range to iterate on the first axis
1670  slip::Range<int> range_x2_; //range to iterate on the second axis
1671  slip::Range<int> range_x3_; //range to iterate on the third axis
1672  slip::Range<int> range_x4_; //range to iterate on the fourth axis
1673 };
1674 
1675 
1676 
1677 
1678 }//slip::
1679 
1680 #endif //SLIP_COMPONENT_ITERATOR4D_RANGE_HPP
friend bool operator<(const self &i1, const self &i2)
< operator.
self & operator+=(const difference_type &d)
component_iterator4d_range addition.
reference operator*()
Dereference assignment operator. Returns the element that the current component_iterator4d_range i po...
int t() const
Access to the first index of the current const_component_iterator4d_range.
std::size_t iterations() const
Rerturns the number of iterations of the range.
Definition: Range.hpp:305
int x1() const
Access to the first index of the current component_iterator4d_range.
friend bool operator>(const self &i1, const self &i2)
operator.
const_component_iterator4d_range(const self &o)
Constructs a copy of the const_component_iterator4d_range o.
MultiComponentContainer4d::component_row_range_iterator row_end(size_type slab, size_type slice, size_type row)
component_iterator4d_range element assignment operator.
MultiComponentContainer4d::const_component_row_range_iterator row_begin(size_type slab, size_type slice, size_type row)
const_component_iterator4d_range element assignment operator.
self operator-(const difference_type &d)
component_iterator4d_range substraction.
int j() const
Access to the fourth index of the current const_component_iterator4d_range.
self & operator-=(const difference_type &d)
component_iterator4d_range substraction.
friend bool operator>=(const self &i1, const self &i2)
>= operator.
friend bool operator>=(const self &i1, const self &i2)
>= operator.
MultiComponentContainer4d::const_component_slice_range_iterator slice_begin(size_type slab, size_type row, size_type col)
const_component_iterator4d_range element assignment operator.
MultiComponentContainer4d::component_col_range_iterator col_begin(size_type slab, size_type slice, size_type col)
component_iterator4d_range element assignment operator.
int x2() const
Access to the second index of the current component_iterator4d_range.
MultiComponentContainer4d::value_type Block
friend bool operator!=(const self &i1, const self &i2)
Inequality operator.
const_component_iterator4d_range(MultiComponentContainer4d *c, std::size_t cp, const slip::Range< int > &r1, const slip::Range< int > &r2, const slip::Range< int > &r3, const slip::Range< int > &r4)
Constructs a const_component_iterator4d_range.
int j() const
Access to the fourthindex of the current component_iterator4d_range.
self & operator+=(const difference_type &d)
const_component_iterator4d_range addition.
int k() const
Access to the second index of the current const_component_iterator4d_range.
self operator--(int)
Postdecrement a const_component_iterator4d_range. Iterate to the previous location inside the Range4d...
Provides a class to tag SLIP iterators.
self & operator-=(const difference_type &d)
const_component_iterator4d_range substraction.
Provides a class to modelize 4d points.
MultiComponentContainer4d::component_slice_range_iterator slab_end(size_type slice, size_type row, size_type col)
component_iterator4d_range element assignment operator.
MultiComponentContainer4d::const_component_col_range_iterator col_end(size_type slab, size_type slice, size_type col)
const_component_iterator4d_range element assignment operator.
MultiComponentContainer4d::const_component_slice_range_iterator slice_end(size_type slab, size_type row, size_type col)
const_component_iterator4d_range element assignment operator.
std::random_access_iterator4d_tag iterator_category
MultiComponentContainer4d::size_type size_type
component_iterator4d_range(const self &o)
Constructs a copy of the component_iterator4d_range o.
self & operator=(const self &o)
Assign a component_iterator4d_range.
friend bool operator<(const self &i1, const self &i2)
< operator.
self & operator++()
Preincrement a const_component_iterator4d_range. Iterate to the next location inside the Range...
This is some iterator to iterate a 4d container into two Range defined by the indices and strides of ...
self & operator++()
Preincrement a component_iterator4d_range. Iterate to the next location inside the Range...
MultiComponentContainer4d::component_slice_range_iterator slab_begin(size_type slice, size_type row, size_type col)
component_iterator4d_range element assignment operator.
friend bool operator<=(const self &i1, const self &i2)
<= operator.
self operator+(const difference_type &d)
const_component_iterator4d_range addition.
friend bool operator>(const self &i1, const self &i2)
operator.
void dx2(const CoordType &dx)
Accessor of the second coordinate of DPoint4d.
Definition: DPoint4d.hpp:281
friend bool operator!=(const self &i1, const self &i2)
Inequality operator.
component_iterator4d_range(MultiComponentContainer4d *c, std::size_t cp, const slip::Range< int > &r1, const slip::Range< int > &r2, const slip::Range< int > &r3, const slip::Range< int > &r4)
Constructs a component_iterator4d_range.
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
friend bool operator==(const self &i1, const self &i2)
Equality operator.
Provides a class to modelize the difference of 4d points.
self & operator--()
Predecrement a component_iterator4d_range. Iterate to the previous location inside the Range4d...
MultiComponentContainer4d::const_component_slice_range_iterator slab_end(size_type slice, size_type row, size_type col)
const_component_iterator4d_range element assignment operator.
friend difference_type operator-(const self &i1, const self &i2)
const_component_iterator4d_range difference operator.
int t() const
Access to the first index of the current component_iterator4d_range.
MultiComponentContainer4d::size_type size_type
int k() const
Access to the second index of the current component_iterator4d_range.
reference operator[](difference_type d)
component_iterator4d_range element assignment operator. Equivalent to *(i + d) = t.
SubType start() const
Accessor of the start subscript of the Range.
Definition: Range.hpp:284
component_iterator4d_range()
Constructs a component_iterator4d_range.
int x1() const
Access to the first index of the current const_component_iterator4d_range.
int cp() const
Access to the component index of the current const_component_iterator4d_box.
void dx3(const CoordType &dx)
Accessor of the third coordinate of DPoint4d.
Definition: DPoint4d.hpp:293
int i() const
Access to the third index of the current component_iterator4d_range.
friend bool operator==(const self &i1, const self &i2)
Equality operator.
reference operator*() const
Dereference operator. Returns the element that the current const_component_iterator4d_range i point t...
MultiComponentContainer4d::const_component_col_range_iterator col_begin(size_type slab, size_type slice, size_type col)
const_component_iterator4d_range element assignment operator.
This is some iterator to iterate a 4d container into two Range defined by the indices and strides of ...
int x4() const
Access to the fourth index of the current const_component_iterator4d_range.
friend difference_type operator-(const self &i1, const self &i2)
component_iterator4d_range difference operator.
int x3() const
Access to the third index of the current component_iterator4d_range.
MultiComponentContainer4d::component_slice_range_iterator slice_end(size_type slab, size_type row, size_type col)
component_iterator4d_range element assignment operator.
void dx4(const CoordType &dx)
Accessor of the fourth coordinate of DPoint4d.
Definition: DPoint4d.hpp:305
friend bool operator<=(const self &i1, const self &i2)
<= operator.
self operator++(int)
Postincrement a component_iterator4d_range. Iterate to the next location inside the Range4d...
int x4() const
Access to the fourth index of the current component_iterator4d_range.
MultiComponentContainer4d::component_col_range_iterator col_end(size_type slab, size_type slice, size_type col)
component_iterator4d_range element assignment operator.
int cp() const
Access to the component index of the current component_iterator4d_range.
MultiComponentContainer4d::component_row_range_iterator row_begin(size_type slab, size_type slice, size_type row)
component_iterator4d_range element assignment operator.
self operator-(const difference_type &d)
const_component_iterator4d_range substraction.
std::random_access_iterator4d_tag iterator_category
MultiComponentContainer4d::value_type Block
int stride() const
Accessor of the stride of the Range.
Definition: Range.hpp:298
int x3() const
Access to the third index of the current const_component_iterator4d_range.
const_component_iterator4d_range()
Constructs a const_component_iterator4d_range.
self & operator--()
Predecrement a const_component_iterator4d_range. Iterate to the previous location inside the Range4d...
reference operator[](difference_type d) const
const_component_iterator4d_range element assignment operator. Equivalent to *(i + d)...
self & operator=(const self &o)
Assign a const_component_iterator4d_range.
int i() const
Access to the third index of the current const_component_iterator4d_range.
MultiComponentContainer4d::const_component_slice_range_iterator slab_begin(size_type slice, size_type row, size_type col)
const_component_iterator4d_range element assignment operator.
MultiComponentContainer4d::const_component_row_range_iterator row_end(size_type slab, size_type slice, size_type row)
const_component_iterator4d_range element assignment operator.
self operator++(int)
Postincrement a const_component_iterator4d_range. Iterate to the next location inside the Range4d...
Provides a class to manipulate Ranges.
int x2() const
Access to the second index of the current const_component_iterator4d_range.
SubType stop() const
Accessor of the stop subscript of the Range.
Definition: Range.hpp:291
self operator--(int)
Postdecrement a component_iterator4d_range. Iterate to the previous location inside the Range4d...
self operator+(const difference_type &d)
component_iterator4d_range addition.
MultiComponentContainer4d::component_slice_range_iterator slice_begin(size_type slab, size_type row, size_type col)
component_iterator4d_range element assignment operator.