SLIP  1.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
component_iterator2d_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 
67 
68 
75 #ifndef SLIP_COMPONENT_ITERATOR2D_RANGE_HPP
76 #define SLIP_COMPONENT_ITERATOR2D_RANGE_HPP
77 
78 #include <iterator>
79 #include <cassert>
80 
81 #include "Point2d.hpp"
82 #include "DPoint2d.hpp"
83 #include "Range.hpp"
84 #include "iterator_types.hpp"
85 
86 namespace slip
87 {
107 template <class MultiComponentContainer2D, std::size_t N>
109 {
110 public:
111  //typedef std::random_access_iterator_tag iterator_category;
113  typedef typename MultiComponentContainer2D::value_type Block;
114  typedef typename Block::value_type value_type;
116  typedef value_type* pointer;
118 
120 
121  typedef typename MultiComponentContainer2D::size_type size_type;
126 
132  cont2d_(0),pos_(0),x1_(0),x2_(0),cp_(0),range_x1_(0,0),range_x2_(0,0)
133  {}
134 
146  component_iterator2d_range(MultiComponentContainer2D* c, std::size_t cp,
147  const slip::Range<int>& r1,
148  const slip::Range<int>& r2):
149  cont2d_(c),pos_(&(*c)[0][0][cp] + (r1.start() * int(c->cols()) * N) + (r2.start() * N)),x1_(r1.start()),x2_(r2.start()),cp_(cp),range_x1_(r1),range_x2_(r2)
150  {}
151 
158  cont2d_(o.cont2d_),pos_(o.pos_),x1_(o.x1_),x2_(o.x2_),cp_(o.cp_),range_x1_(o.range_x1_), range_x2_(o.range_x2_)
159  {}
160 
175  self& operator=(const self& o)
176  {
177  if(this != &o)
178  {
179  this->cont2d_ = o.cont2d_;
180  this->pos_ = o.pos_;
181  this->x1_ = o.x1_;
182  this->x2_ = o.x2_;
183  this->cp_ = o.cp_;
184  this->range_x1_ = o.range_x1_;
185  this->range_x2_ = o.range_x2_;
186  }
187  return *this;
188  }
197  inline
199  {
200  return *pos_;
201  }
202 
203  inline
205  {
206  return &(operator*());
207  }
208 
213 
218  inline
219  self& operator++()
220  {
221  if( (x1_ < int(range_x1_.start() + range_x1_.iterations() * range_x1_.stride()))
222  || (x2_ < int(range_x2_.start() + range_x2_.iterations() * range_x2_.stride())) )
223  {
224  if( (x2_ < int(range_x2_.start() + range_x2_.iterations() * range_x2_.stride()))
225  || (x1_ == int(range_x1_.start() + range_x1_.iterations() * range_x1_.stride())) )
226  {
227  this->x2_+= range_x2_.stride();
228  this->pos_+= range_x2_.stride()*N;
229  }
230  else
231  {
232  this->x1_+= range_x1_.stride();
233  this->x2_ = range_x2_.start();
234  this->pos_ = &(*cont2d_)[0][0][this->cp_] + (this->x1_ * int(cont2d_->cols()) * N) + this->x2_ * N;
235  }
236  }
237  else
238  {
239  this->x1_ = int(range_x1_.start()
240  + (range_x1_.iterations() + 1) * range_x1_.stride());
241  this->x2_ = int(range_x2_.start()
242  + (range_x2_.iterations() + 1) * range_x2_.stride());
243  this->pos_ = &(*cont2d_)[0][0][this->cp_] + (this->x1_ * int(cont2d_->cols()) * N) + this->x2_ * N;
244  }
245  return *this;
246  }
247 
253  inline
254  self operator++(int)
255  {
256  self tmp = *this;
257  ++(*this);
258  return tmp;
259  }
260 
272  inline
273  self& operator--()
274  {
275  if( (x1_ > int(range_x1_.stop() - range_x1_.iterations() * range_x1_.stride())) || (x2_ > int(range_x2_.stop() - range_x2_.iterations() * range_x2_.stride())) )
276  {
277  if( (x2_ > (int(range_x2_.stop() - range_x2_.iterations() * range_x2_.stride())))
278  || (x1_ == int(range_x1_.stop() - range_x1_.iterations() * range_x1_.stride())) )
279  {
280  this->x2_ -= range_x2_.stride();
281  this->pos_ -= range_x2_.stride()*N;
282  }
283  else
284  {
285  this->x1_-= range_x1_.stride();
286  this->x2_ = int(range_x2_.start() + range_x2_.iterations() * range_x2_.stride());
287  this->pos_ = &(*cont2d_)[0][0][this->cp_] + (this->x1_ * int(cont2d_->cols()) * N) + this->x2_ * N;
288  }
289  }
290  else
291  {
292  this->x1_ = int(range_x1_.stop() - (range_x1_.iterations() + 1) * range_x1_.stride());
293  this->x2_ = int(range_x2_.stop() - (range_x2_.iterations() + 1) * range_x2_.stride());
294  this->pos_ = &(*cont2d_)[0][0][this->cp_] + (this->x1_ * int(cont2d_->cols()) * N) + this->x2_ * N;
295  }
296 
297  return *this;
298  }
299 
305  inline
306  self operator--(int)
307  {
308  self tmp = *this;
309  --(*this);
310  return tmp;
311  }
312 
326  inline
327  friend bool operator==(const self& i1,
328  const self& i2)
329  {
330 
331  return ( (i1.cont2d_ == i2.cont2d_) && (i1.pos_ == i2.pos_)
332  && (i1.x1_ == i2.x1_) && (i1.x2_ == i2.x2_) && (i1.cp_ == i2.cp_));
333  }
334 
341  inline
342  friend bool operator!=(const self& i1,
343  const self& i2)
344  {
345  return ( (i1.cont2d_ != i2.cont2d_) || (i1.pos_ != i2.pos_)
346  || (i1.x1_ != i2.x1_) || (i1.x2_ != i2.x2_) || (i1.cp_ != i2.cp_));
347  }
360  inline
361  friend bool operator<(const self& i1,
362  const self& i2)
363  {
364 
365  return ( i1.pos_ < i2.pos_);
366  }
367 
374  inline
375  friend bool operator>(const self& i1,
376  const self& i2)
377  {
378 
379  return (i2 < i1);
380  }
381 
388  inline
389  friend bool operator<=(const self& i1,
390  const self& i2)
391  {
392 
393  return !(i2 < i1);
394  }
395 
402  inline
403  friend bool operator>=(const self& i1,
404  const self& i2)
405  {
406 
407  return !(i1 < i2);
408  }
423  inline
424  self& operator+=(const difference_type& d)
425  {
426  this->x1_ += this->range_x1_.stride() * d.dx1();
427  this->x2_ += this->range_x2_.stride() * d.dx2();
428  this->pos_ = &(*cont2d_)[0][0][this->cp_] + (this->x1_ * int(cont2d_->cols()) * N) + this->x2_ * N;
429  return *this;
430  }
431 
439  inline
440  self& operator-=(const difference_type& d)
441  {
442  this->x1_ -= this->range_x1_.stride() * d.dx1();
443  this->x2_ -= this->range_x2_.stride() * d.dx2();
444  this->pos_ = &(*cont2d_)[0][0][this->cp_] + (this->x1_ * int(cont2d_->cols()) * N) + this->x2_ * N;
445  return *this;
446  }
447 
455  inline
456  self operator+(const difference_type& d)
457  {
458  self tmp = *this;
459  tmp += d;
460  return tmp;
461  }
462 
470  inline
471  self operator-(const difference_type& d)
472  {
473  self tmp = *this;
474  tmp -= d;
475  return tmp;
476  }
477 
486  inline
487  friend difference_type operator-(const self& i1,
488  const self& i2)
489  {
490  assert(i1.range_x1_.stride() == i2.range_x1_.stride());
491  assert(i1.range_x2_.stride() == i2.range_x2_.stride());
492  return difference_type(int((i1.x1_ - i2.x1_)/i1.range_x1_.stride()),int((i1.x2_ - i2.x2_))/i1.range_x2_.stride());
493  }
494 
495 
504  inline
506  {
507  assert( (this->x1_+ range_x1_.stride() * d.dx1()) < cont2d_->dim1() );
508  assert( (this->x2_+ range_x2_.stride() * d.dx2()) < cont2d_->dim2() );
509  return (*cont2d_)[this->x1_+ range_x1_.stride() * d.dx1()][this->x2_+ range_x2_.stride() * d.dx2()][cp_];
510  }
511 
512 
513 
514 
521  inline
522  typename MultiComponentContainer2D::component_row_range_iterator row_begin(size_type row)
523  {
524  return cont2d_->row_begin(this->cp_, range_x1_.start() + row * range_x1_.stride(), range_x2_);
525  }
526 
527 
534  inline
535  typename MultiComponentContainer2D::component_row_range_iterator row_end(size_type row)
536  {
537  return this->row_begin(this->cp_, row) + ((range_x2_.iterations() + 1) * N);
538  }
539 
540 
541 
548  inline
549  typename MultiComponentContainer2D::component_col_range_iterator col_begin(size_type col)
550  {
551  return cont2d_->col_begin(this->cp_, range_x2_.start() + col * range_x2_.stride(), range_x1_);
552  }
553 
560  inline
561  typename MultiComponentContainer2D::component_col_range_iterator col_end(size_type col)
562  {
563  return this->col_begin(this->cp_, col) + ((range_x1_.iterations() + 1) * N);
564  }
565 
566 
578  inline
579  int x1() const
580  {
581  return this->x1_;
582  }
587  inline
588  int i() const
589  {
590  return this->x1_;
591  }
596  inline
597  int x2() const
598  {
599  return this->x2_;
600  }
605  inline
606  int j() const
607  {
608  return this->x2_;
609  }
610 
615  inline
616  int cp() const
617  {
618  return this->cp_;
619  }
620 
621 
626 private:
627  MultiComponentContainer2D* cont2d_; // pointer to the 2d container
628  pointer pos_; // linear position within the container
629  int x1_; // first index position
630  int x2_; // second index position
631  int cp_; // component index number
632  slip::Range<int> range_x1_; // range to iterate on the first axis
633  slip::Range<int> range_x2_; //range to iterate on the second axis
634 };
635 
636 
656 template <class MultiComponentContainer2D, std::size_t N>
658 {
659 public:
660  //typedef std::random_access_iterator_tag iterator_category;
662  typedef typename MultiComponentContainer2D::value_type Block;
663  typedef typename Block::value_type value_type;
665  typedef value_type const * pointer;
666  typedef value_type const & reference;
667 
669 
670  typedef typename MultiComponentContainer2D::size_type size_type;
675 
681  cont2d_(0),pos_(0),x1_(0),x2_(0),cp_(0),range_x1_(0,0),range_x2_(0,0)
682  {}
683 
694  const_component_iterator2d_range(MultiComponentContainer2D* c, std::size_t cp,
695  const slip::Range<int>& r1,
696  const slip::Range<int>& r2):
697  cont2d_(c),pos_(&(*c)[0][0][cp] + (r1.start() * int(c->cols()) * N) + (r2.start() * N)),x1_(r1.start()),x2_(r2.start()),cp_(cp),range_x1_(r1),range_x2_(r2)
698  {}
699 
706  cont2d_(o.cont2d_),pos_(o.pos_),x1_(o.x1_),x2_(o.x2_),cp_(o.cp_),
707  range_x1_(o.range_x1_), range_x2_(o.range_x2_)
708  {}
709 
724  self& operator=(const self& o)
725  {
726  if(this != &o)
727  {
728  this->cont2d_ = o.cont2d_;
729  this->pos_ = o.pos_;
730  this->x1_ = o.x1_;
731  this->x2_ = o.x2_;
732  this->cp_ = o.cp_;
733  this->range_x1_ = o.range_x1_;
734  this->range_x2_ = o.range_x2_;
735  }
736  return *this;
737  }
747  inline
749  {
750  return *pos_;
751  }
752 
753  inline
755  {
756  return &(operator*());
757  }
758 
759 
760 
765 
771  inline
772  self& operator++()
773  {
774  if( (x1_ < int(range_x1_.start() + range_x1_.iterations() * range_x1_.stride()))
775  || (x2_ < int(range_x2_.start() + range_x2_.iterations() * range_x2_.stride())) )
776  {
777  if( (x2_ < int(range_x2_.start() + range_x2_.iterations() * range_x2_.stride()))
778  || (x1_ == int(range_x1_.start() + range_x1_.iterations() * range_x1_.stride())) )
779  {
780  this->x2_+= range_x2_.stride();
781  this->pos_+= range_x2_.stride()*N;
782  }
783  else
784  {
785  this->x1_+= range_x1_.stride();
786  this->x2_ = range_x2_.start();
787  this->pos_ = &(*cont2d_)[0][0][this->cp_] + (this->x1_ * int(cont2d_->cols()) * N) + this->x2_ * N;
788  }
789  }
790  else
791  {
792  this->x1_ = int(range_x1_.start()
793  + (range_x1_.iterations() + 1)* range_x1_.stride());
794  this->x2_ = int(range_x2_.start()
795  + (range_x2_.iterations() + 1)* range_x2_.stride());
796  this->pos_ = &(*cont2d_)[0][0][this->cp_] + (this->x1_ * int(cont2d_->cols()) * N) + this->x2_ * N;
797  }
798  return *this;
799  }
800 
806  inline
807  self operator++(int)
808  {
809  self tmp = *this;
810  ++(*this);
811  return tmp;
812  }
813 
825  inline
826  self& operator--()
827  {
828  if( (x1_ > int(range_x1_.stop() - range_x1_.iterations() * range_x1_.stride())) || (x2_ > int(range_x2_.stop() - range_x2_.iterations() * range_x2_.stride())) )
829  {
830  if( (x2_ > (int(range_x2_.stop() - range_x2_.iterations() * range_x2_.stride())))
831  || (x1_ == int(range_x1_.stop() - range_x1_.iterations() * range_x1_.stride())) )
832  {
833  this->x2_ -= range_x2_.stride();
834  this->pos_ -= range_x2_.stride()*N;
835  }
836  else
837  {
838  this->x1_-= range_x1_.stride();
839  this->x2_ = int(range_x2_.start() + range_x2_.iterations() * range_x2_.stride());
840  this->pos_ = &(*cont2d_)[0][0][this->cp_] + (this->x1_ * int(cont2d_->cols()) * N) + this->x2_ * N;
841  }
842  }
843  else
844  {
845  this->x1_ = int(range_x1_.stop() - (range_x1_.iterations() + 1) * range_x1_.stride());
846  this->x2_ = int(range_x2_.stop() - (range_x2_.iterations() + 1) * range_x2_.stride());
847  this->pos_ = &(*cont2d_)[0][0][this->cp_] + (this->x1_ * int(cont2d_->cols()) * N) + this->x2_ * N;
848  }
849 
850  return *this;
851  }
852 
858  inline
859  self operator--(int)
860  {
861  self tmp = *this;
862  --(*this);
863  return tmp;
864  }
865 
879  inline
880  friend bool operator==(const self& i1,
881  const self& i2)
882  {
883 
884  return ( (i1.cont2d_ == i2.cont2d_) && (i1.pos_ == i2.pos_)
885  && (i1.x1_ == i2.x1_) && (i1.x2_ == i2.x2_) && (i1.cp_ == i2.cp_));
886  }
887 
894  inline
895  friend bool operator!=(const self& i1,
896  const self& i2)
897  {
898  return ( (i1.cont2d_ != i2.cont2d_) || (i1.pos_ != i2.pos_)
899  || (i1.x1_ != i2.x1_) || (i1.x2_ != i2.x2_) || (i1.cp_ != i2.cp_));
900  }
913  inline
914  friend bool operator<(const self& i1,
915  const self& i2)
916  {
917 
918  return ( i1.pos_ < i2.pos_);
919  }
920 
927  inline
928  friend bool operator>(const self& i1,
929  const self& i2)
930  {
931 
932  return (i2 < i1);
933  }
934 
941  inline
942  friend bool operator<=(const self& i1,
943  const self& i2)
944  {
945 
946  return !(i2 < i1);
947  }
948 
955  inline
956  friend bool operator>=(const self& i1,
957  const self& i2)
958  {
959 
960  return !(i1 < i2);
961  }
981  inline
982  self& operator+=(const difference_type& d)
983  {
984  this->x1_ += this->range_x1_.stride() * d.dx1();
985  this->x2_ += this->range_x2_.stride() * d.dx2();
986  this->pos_ = &(*cont2d_)[0][0][this->cp_] + (this->x1_ * int(cont2d_->cols()) * N) + this->x2_ * N;
987  return *this;
988  }
989 
1001  inline
1002  self& operator-=(const difference_type& d)
1003  {
1004  this->x1_ -= this->range_x1_.stride() * d.dx1();
1005  this->x2_ -= this->range_x2_.stride() * d.dx2();
1006  this->pos_ = &(*cont2d_)[0][0][this->cp_] + (this->x1_ * int(cont2d_->cols()) * N) + this->x2_ * N;
1007  return *this;
1008  }
1009 
1017  inline
1019  {
1020  self tmp = *this;
1021  tmp += d;
1022  return tmp;
1023  }
1024 
1032  inline
1034  {
1035  self tmp = *this;
1036  tmp -= d;
1037  return tmp;
1038  }
1039 
1048  inline
1049  friend difference_type operator-(const self& i1,
1050  const self& i2)
1051  {
1052  assert(i1.range_x1_.stride() == i2.range_x1_.stride());
1053  assert(i1.range_x2_.stride() == i2.range_x2_.stride());
1054  return difference_type(int((i1.x1_ - i2.x1_)/i1.range_x1_.stride()),int((i1.x2_ - i2.x2_))/i1.range_x2_.stride());
1055  }
1056 
1057 
1058 
1059 
1060 
1061 
1069  inline
1071  {
1072  assert( (this->x1_+ range_x1_.stride() * d.dx1()) < cont2d_->dim1() );
1073  assert( (this->x2_+ range_x2_.stride() * d.dx2()) < cont2d_->dim2() );
1074  return (*cont2d_)[this->x1_+ range_x1_.stride() * d.dx1()][this->x2_+ range_x2_.stride() * d.dx2()][cp_];
1075  }
1076 
1077 
1078 
1086  inline
1087  typename MultiComponentContainer2D::const_row_range_iterator row_begin(size_type row) const
1088  {
1089  return cont2d_->row_begin(this->cp_, range_x1_.start() + row * range_x1_.stride(), range_x2_);
1090  }
1091 
1092 
1100  inline
1101  typename MultiComponentContainer2D::const_row_range_iterator row_end(size_type row) const
1102  {
1103  return cont2d_->row_begin(this->cp_, row) + ((range_x2_.iterations() + 1) * N);
1104  }
1105 
1106 
1114  inline
1115  typename MultiComponentContainer2D::const_col_range_iterator col_begin(size_type col) const
1116  {
1117  return cont2d_->col_begin(this->cp_, range_x2_.start() + col * range_x2_.stride(), range_x1_);
1118  }
1119 
1120 
1121 
1129  inline
1130  typename MultiComponentContainer2D::const_col_range_iterator col_end(size_type col) const
1131  {
1132  return cont2d_->col_begin(this->cp_, col) + ((range_x1_.iterations() + 1) * N);
1133  }
1134 
1135 
1136 
1148  inline
1149  int x1() const
1150  {
1151  return this->x1_;
1152  }
1157  inline
1158  int i() const
1159  {
1160  return this->x1_;
1161  }
1166  inline
1167  int x2() const
1168  {
1169  return this->x2_;
1170  }
1175  inline
1176  int j() const
1177  {
1178  return this->x2_;
1179  }
1180 
1185  inline
1186  int cp() const
1187  {
1188  return this->cp_;
1189  }
1190 
1193 private:
1194  MultiComponentContainer2D* cont2d_; // pointer to the 2d container
1195  pointer pos_; // linear position within the container
1196  int x1_; // first index position
1197  int x2_; // second index position
1198  int cp_; // component index number
1199  slip::Range<int> range_x1_; // range to iterate on the first axis
1200  slip::Range<int> range_x2_; //range to iterate on the second axis
1201 };
1202 
1203 
1204 
1205 
1206 }//slip::
1207 
1208 #endif //SLIP_COMPONENT_ITERATOR2D_RANGE_HPP
self operator--(int)
Postdecrement a component_iterator2d_range. Iterate to the previous location inside the Range2d...
std::size_t iterations() const
Rerturns the number of iterations of the range.
Definition: Range.hpp:305
friend bool operator>(const self &i1, const self &i2)
operator.
self & operator+=(const difference_type &d)
component_iterator2d_range addition.
Provides a class to modelize the difference of slip::Point2d.
reference operator*() const
Dereference operator. Returns the element that the current const_component_iterator2d_range i point t...
self & operator=(const self &o)
Assign a component_iterator2d_range.
MultiComponentContainer2D::const_col_range_iterator col_end(size_type col) const
const_component_iterator2d_range element assignment operator.
self & operator++()
Preincrement a component_iterator2d_range. Iterate to the next location inside the Range...
MultiComponentContainer2D::size_type size_type
void dx2(const CoordType &dx)
Accessor of the second coordinate of DPoint2d.
Definition: DPoint2d.hpp:241
self operator-(const difference_type &d)
component_iterator2d_range substraction.
const_component_iterator2d_range(MultiComponentContainer2D *c, std::size_t cp, const slip::Range< int > &r1, const slip::Range< int > &r2)
Constructs a const_component_iterator2d_range.
MultiComponentContainer2D::size_type size_type
const_component_iterator2d_range(const self &o)
Constructs a copy of the const_component_iterator2d_range o.
self operator++(int)
Postincrement a const_component_iterator2d_range. Iterate to the next location inside the Range2d...
std::random_access_iterator2d_tag iterator_category
const_component_iterator2d_range()
Constructs a const_component_iterator2d_range.
component_iterator2d_range(const self &o)
Constructs a copy of the component_iterator2d_range o.
Provides a class to tag SLIP iterators.
self & operator=(const self &o)
Assign a const_component_iterator2d_range.
friend bool operator==(const self &i1, const self &i2)
Equality operator.
self operator-(const difference_type &d)
const_component_iterator2d_range substraction.
int x1() const
Access to the first index of the current component_iterator2d_range.
friend difference_type operator-(const self &i1, const self &i2)
component_iterator2d_range difference operator.
self & operator-=(const difference_type &d)
const_component_iterator2d_range substraction.
MultiComponentContainer2D::const_row_range_iterator row_begin(size_type row) const
const_component_iterator2d_range element assignment operator.
MultiComponentContainer2D::const_row_range_iterator row_end(size_type row) const
const_component_iterator2d_range element assignment operator.
component_iterator2d_range(MultiComponentContainer2D *c, std::size_t cp, const slip::Range< int > &r1, const slip::Range< int > &r2)
Constructs a component_iterator2d_range.
int cp() const
Access to the component index of the current const_component_iterator2d_box.
int x2() const
Access to the second index of the current component_iterator2d_range.
self & operator++()
Preincrement a const_component_iterator2d_range. Iterate to the next location inside the Range...
void dx1(const CoordType &dx)
Accessor of the first coordinate of DPoint2d.
Definition: DPoint2d.hpp:229
friend bool operator!=(const self &i1, const self &i2)
Inequality operator.
This is some iterator to iterate a 2d container into two Range defined by the indices and strides of ...
friend bool operator>=(const self &i1, const self &i2)
>= operator.
int x1() const
Access to the first index of the current const_component_iterator2d_range.
self & operator+=(const difference_type &d)
const_component_iterator2d_range addition.
friend bool operator>(const self &i1, const self &i2)
operator.
self & operator-=(const difference_type &d)
component_iterator2d_range substraction.
int i() const
Access to the first index of the current const_component_iterator2d_range.
Difference of Point2D class, specialization of DPoint<CoordType,DIM> with DIM = 2.
Definition: Array2d.hpp:129
SubType start() const
Accessor of the start subscript of the Range.
Definition: Range.hpp:284
MultiComponentContainer2D::component_col_range_iterator col_end(size_type col)
component_iterator2d_range element assignment operator.
self operator+(const difference_type &d)
const_component_iterator2d_range addition.
self operator+(const difference_type &d)
component_iterator2d_range addition.
self & operator--()
Predecrement a component_iterator2d_range. Iterate to the previous location inside the Range2d...
int x2() const
Access to the second index of the current const_component_iterator2d_range.
int cp() const
Access to the component index of the current component_iterator2d_range.
MultiComponentContainer2D::component_col_range_iterator col_begin(size_type col)
component_iterator2d_range element assignment operator.
reference operator[](difference_type d) const
const_component_iterator2d_range element assignment operator. Equivalent to *(i + d)...
friend bool operator>=(const self &i1, const self &i2)
>= operator.
component_iterator2d_range()
Constructs a component_iterator2d_range.
This is some iterator to iterate a 2d container into two Range defined by the indices and strides of ...
int j() const
Access to the second index of the current const_component_iterator2d_range.
reference operator[](difference_type d)
component_iterator2d_range element assignment operator. Equivalent to *(i + d) = t.
std::random_access_iterator2d_tag iterator_category
int i() const
Access to the first index of the current component_iterator2d_range.
MultiComponentContainer2D::component_row_range_iterator row_end(size_type row)
component_iterator2d_range element assignment operator.
friend difference_type operator-(const self &i1, const self &i2)
const_component_iterator2d_range difference operator.
int j() const
Access to the second index of the current component_iterator2d_range.
int stride() const
Accessor of the stride of the Range.
Definition: Range.hpp:298
friend bool operator<(const self &i1, const self &i2)
< operator.
Provides a class to modelize 2d points.
reference operator*()
Dereference assignment operator. Returns the element that the current component_iterator2d_range i po...
MultiComponentContainer2D::value_type Block
friend bool operator==(const self &i1, const self &i2)
Equality operator.
self & operator--()
Predecrement a const_component_iterator2d_range. Iterate to the previous location inside the Range2d...
friend bool operator<=(const self &i1, const self &i2)
<= operator.
friend bool operator!=(const self &i1, const self &i2)
Inequality operator.
friend bool operator<(const self &i1, const self &i2)
< operator.
MultiComponentContainer2D::value_type Block
self operator++(int)
Postincrement a component_iterator2d_range. Iterate to the next location inside the Range2d...
MultiComponentContainer2D::component_row_range_iterator row_begin(size_type row)
component_iterator2d_range element assignment operator.
Provides a class to manipulate Ranges.
SubType stop() const
Accessor of the stop subscript of the Range.
Definition: Range.hpp:291
self operator--(int)
Postdecrement a const_component_iterator2d_range. Iterate to the previous location inside the Range2d...
MultiComponentContainer2D::const_col_range_iterator col_begin(size_type col) const
const_component_iterator2d_range element assignment operator.
friend bool operator<=(const self &i1, const self &i2)
<= operator.