SLIP  1.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 
76 #ifndef SLIP_ITERATOR2D_RANGE_HPP
77 #define SLIP_ITERATOR2D_RANGE_HPP
78 
79 #include <iterator>
80 #include <cassert>
81 
82 #include "Point2d.hpp"
83 #include "DPoint2d.hpp"
84 #include "Range.hpp"
85 
86 #include "iterator_types.hpp"
87 
88 namespace slip
89 {
118 template <class Container2D>
119 class iterator2d_range
120 {
121 public:
122  //typedef std::random_access_iterator_tag iterator_category;
124  typedef typename Container2D::value_type value_type;
126  typedef typename Container2D::pointer pointer;
127  typedef typename Container2D::reference reference;
128 
129  typedef iterator2d_range self;
130 
131  typedef typename Container2D::size_type size_type;
136 
142  cont2d_(0),pos_(0),x1_(0),x2_(0),range_x1_(0,0),range_x2_(0,0)
143  {}
144 
155  iterator2d_range(Container2D* c,
156  const slip::Range<int>& r1,
157  const slip::Range<int>& r2):
158  cont2d_(c),pos_((*c)[r1.start()] + r2.start()),x1_(r1.start()),x2_(r2.start()),range_x1_(r1),range_x2_(r2)
159  {}
160 
166  iterator2d_range(const self& o):
167  cont2d_(o.cont2d_),pos_(o.pos_),x1_(o.x1_),x2_(o.x2_),
168  range_x1_(o.range_x1_), range_x2_(o.range_x2_)
169  {}
170 
185  self& operator=(const self& o)
186  {
187  if(this != &o)
188  {
189  this->cont2d_ = o.cont2d_;
190  this->pos_ = o.pos_;
191  this->x1_ = o.x1_;
192  this->x2_ = o.x2_;
193  this->range_x1_ = o.range_x1_;
194  this->range_x2_ = o.range_x2_;
195  }
196  return *this;
197  }
206  inline
208  {
209  return *pos_;
210  }
211 
212  inline
214  {
215  return &(operator*());
216  }
217 
222 
227  inline
228  self& operator++()
229  {
230  if( (x1_ < int(range_x1_.start() + range_x1_.iterations() * range_x1_.stride()))
231  || (x2_ < int(range_x2_.start() + range_x2_.iterations() * range_x2_.stride())) )
232  {
233  if( (x2_ < int(range_x2_.start() + range_x2_.iterations() * range_x2_.stride()))
234  || (x1_ == int(range_x1_.start() + range_x1_.iterations() * range_x1_.stride())) )
235  {
236  this->x2_+= range_x2_.stride();
237  this->pos_+= range_x2_.stride();
238  }
239  else
240  {
241  this->x1_+= range_x1_.stride();
242  this->x2_ = range_x2_.start();
243  this->pos_ = cont2d_->begin() + (this->x1_ * int(cont2d_->cols())) + this->x2_;
244  }
245  }
246  else
247  {
248  this->x1_ = int(range_x1_.start()
249  + (range_x1_.iterations() + 1) * range_x1_.stride());
250  this->x2_ = int(range_x2_.start()
251  + (range_x2_.iterations() + 1) * range_x2_.stride());
252  this->pos_ = cont2d_->begin() + (this->x1_ * int(cont2d_->cols())) + this->x2_;
253  }
254  return *this;
255  }
256 
262  inline
263  self operator++(int)
264  {
265  self tmp = *this;
266  ++(*this);
267  return tmp;
268  }
269 
281  inline
282  self& operator--()
283  {
284  if( (x1_ > int(range_x1_.stop() - range_x1_.iterations() * range_x1_.stride())) || (x2_ > int(range_x2_.stop() - range_x2_.iterations() * range_x2_.stride())) )
285  {
286  if( (x2_ > (int(range_x2_.stop() - range_x2_.iterations() * range_x2_.stride())))
287  || (x1_ == int(range_x1_.stop() - range_x1_.iterations() * range_x1_.stride())) )
288  {
289  this->x2_ -= range_x2_.stride();
290  this->pos_ -= range_x2_.stride();
291  }
292  else
293  {
294  this->x1_-= range_x1_.stride();
295  this->x2_ = int(range_x2_.start() + range_x2_.iterations() * range_x2_.stride());
296  this->pos_ = cont2d_->begin() + (this->x1_ * int(cont2d_->cols())) + this->x2_;
297  }
298  }
299  else
300  {
301  this->x1_ = int(range_x1_.stop() - (range_x1_.iterations() + 1) * range_x1_.stride());
302  this->x2_ = int(range_x2_.stop() - (range_x2_.iterations() + 1) * range_x2_.stride());
303  this->pos_ = cont2d_->begin() + (this->x1_ * int(cont2d_->cols())) + this->x2_;
304  }
305 
306  return *this;
307  }
308 
314  inline
315  self operator--(int)
316  {
317  self tmp = *this;
318  --(*this);
319  return tmp;
320  }
321 
335  inline
336  friend bool operator==(const self& i1,
337  const self& i2)
338  {
339 
340  return ( (i1.cont2d_ == i2.cont2d_) && (i1.pos_ == i2.pos_)
341  && (i1.x1_ == i2.x1_) && (i1.x2_ == i2.x2_) );
342  }
343 
350  inline
351  friend bool operator!=(const self& i1,
352  const self& i2)
353  {
354  return ( (i1.cont2d_ != i2.cont2d_) || (i1.pos_ != i2.pos_)
355  || (i1.x1_ != i2.x1_) || (i1.x2_ != i2.x2_) );
356  }
369  inline
370  friend bool operator<(const self& i1,
371  const self& i2)
372  {
373 
374  return ( i1.pos_ < i2.pos_);
375  }
376 
383  inline
384  friend bool operator>(const self& i1,
385  const self& i2)
386  {
387 
388  return (i2 < i1);
389  }
390 
397  inline
398  friend bool operator<=(const self& i1,
399  const self& i2)
400  {
401 
402  return !(i2 < i1);
403  }
404 
411  inline
412  friend bool operator>=(const self& i1,
413  const self& i2)
414  {
415 
416  return !(i1 < i2);
417  }
432  inline
433  self& operator+=(const difference_type& d)
434  {
435  this->x1_ += this->range_x1_.stride() * d.dx1();
436  this->x2_ += this->range_x2_.stride() * d.dx2();
437  this->pos_ = cont2d_->begin() + (this->x1_ * int(cont2d_->cols())) + this->x2_;
438  return *this;
439  }
440 
448  inline
449  self& operator-=(const difference_type& d)
450  {
451  this->x1_ -= this->range_x1_.stride() * d.dx1();
452  this->x2_ -= this->range_x2_.stride() * d.dx2();
453  this->pos_ = cont2d_->begin() + (this->x1_ * int(cont2d_->cols())) + this->x2_;
454  return *this;
455  }
456 
464  inline
465  self operator+(const difference_type& d)
466  {
467  self tmp = *this;
468  tmp += d;
469  return tmp;
470  }
471 
479  inline
480  self operator-(const difference_type& d)
481  {
482  self tmp = *this;
483  tmp -= d;
484  return tmp;
485  }
486 
495  inline
496  friend difference_type operator-(const self& i1,
497  const self& i2)
498  {
499  assert(i1.range_x1_.stride() == i2.range_x1_.stride());
500  assert(i1.range_x2_.stride() == i2.range_x2_.stride());
501  return difference_type(int((i1.x1_ - i2.x1_)/i1.range_x1_.stride()),int((i1.x2_ - i2.x2_))/i1.range_x2_.stride());
502  }
503 
504 
513  inline
515  {
516  assert( (int(this->x1_)+ range_x1_.stride() * d.dx1()) < int(cont2d_->dim1() ));
517  assert( (int(this->x2_)+ range_x2_.stride() * d.dx2()) < int(cont2d_->dim2() ));
518  return (*cont2d_)[this->x1_+ range_x1_.stride() * d.dx1()][this->x2_+ range_x2_.stride() * d.dx2()];
519  }
520 
521 
522 
529  inline
530  typename Container2D::row_range_iterator row_begin(size_type row)
531  {
532  return cont2d_->row_begin(range_x1_.start() + row * range_x1_.stride(), range_x2_);
533  }
534 
535 
542  inline
543  typename Container2D::row_range_iterator row_end(size_type row)
544  {
545  return this->row_begin(row) + (range_x2_.iterations() + 1);
546  }
547 
548 
549 
556  inline
557  typename Container2D::col_range_iterator col_begin(size_type col)
558  {
559  return cont2d_->col_begin(range_x2_.start() + col * range_x2_.stride(), range_x1_);
560  }
561 
568  inline
569  typename Container2D::col_range_iterator col_end(size_type col)
570  {
571  return this->col_begin(col) + (range_x1_.iterations() + 1);
572  }
573 
574 
586  inline
587  int x1() const
588  {
589  return this->x1_;
590  }
595  inline
596  int i() const
597  {
598  return this->x1_;
599  }
604  inline
605  int x2() const
606  {
607  return this->x2_;
608  }
613  inline
614  int j() const
615  {
616  return this->x2_;
617  }
618 
623 private:
624  Container2D* cont2d_; // pointer to the 2d container
625  pointer pos_; // linear position within the container
626  int x1_; // first index position
627  int x2_; // second index position
628  slip::Range<int> range_x1_; // range to iterate on the first axis
629  slip::Range<int> range_x2_; //range to iterate on the second axis
630 };
631 
632 
661 template <class Container2D>
662 class const_iterator2d_range
663 {
664 public:
665  //typedef std::random_access_iterator_tag iterator_category;
667  typedef typename Container2D::value_type value_type;
669  typedef typename Container2D::const_pointer pointer;
670  typedef typename Container2D::const_reference reference;
671 
673 
674  typedef typename Container2D::size_type size_type;
679 
685  cont2d_(0),pos_(0),x1_(0),x2_(0),range_x1_(0,0),range_x2_(0,0)
686  {}
687 
698  const_iterator2d_range(Container2D* c,
699  const slip::Range<int>& r1,
700  const slip::Range<int>& r2):
701  cont2d_(c),pos_((*c)[r1.start()] + r2.start()),x1_(r1.start()),x2_(r2.start()),range_x1_(r1),range_x2_(r2)
702  {}
703 
709  const_iterator2d_range(const self& o):
710  cont2d_(o.cont2d_),pos_(o.pos_),x1_(o.x1_),x2_(o.x2_),
711  range_x1_(o.range_x1_), range_x2_(o.range_x2_)
712  {}
713 
728  self& operator=(const self& o)
729  {
730  if(this != &o)
731  {
732  this->cont2d_ = o.cont2d_;
733  this->pos_ = o.pos_;
734  this->x1_ = o.x1_;
735  this->x2_ = o.x2_;
736  this->range_x1_ = o.range_x1_;
737  this->range_x2_ = o.range_x2_;
738  }
739  return *this;
740  }
750  inline
752  {
753  return *pos_;
754  }
755 
756  inline
758  {
759  return &(operator*());
760  }
761 
762 
763 
768 
774  inline
775  self& operator++()
776  {
777  if( (x1_ < int(range_x1_.start() + range_x1_.iterations() * range_x1_.stride()))
778  || (x2_ < int(range_x2_.start() + range_x2_.iterations() * range_x2_.stride())) )
779  {
780  if( (x2_ < int(range_x2_.start() + range_x2_.iterations() * range_x2_.stride()))
781  || (x1_ == int(range_x1_.start() + range_x1_.iterations() * range_x1_.stride())) )
782  {
783  this->x2_+= range_x2_.stride();
784  this->pos_+= range_x2_.stride();
785  }
786  else
787  {
788  this->x1_+= range_x1_.stride();
789  this->x2_ = range_x2_.start();
790  this->pos_ = cont2d_->begin() + (this->x1_ * int(cont2d_->cols())) + this->x2_;
791  }
792  }
793  else
794  {
795  this->x1_ = int(range_x1_.start()
796  + (range_x1_.iterations() + 1)* range_x1_.stride());
797  this->x2_ = int(range_x2_.start()
798  + (range_x2_.iterations() + 1)* range_x2_.stride());
799  this->pos_ = cont2d_->begin() + (this->x1_ * int(cont2d_->cols())) + this->x2_;
800  }
801  return *this;
802  }
803 
809  inline
810  self operator++(int)
811  {
812  self tmp = *this;
813  ++(*this);
814  return tmp;
815  }
816 
828  inline
829  self& operator--()
830  {
831  if( (x1_ > int(range_x1_.stop() - range_x1_.iterations() * range_x1_.stride())) || (x2_ > int(range_x2_.stop() - range_x2_.iterations() * range_x2_.stride())) )
832  {
833  if( (x2_ > (int(range_x2_.stop() - range_x2_.iterations() * range_x2_.stride())))
834  || (x1_ == int(range_x1_.stop() - range_x1_.iterations() * range_x1_.stride())) )
835  {
836  this->x2_ -= range_x2_.stride();
837  this->pos_ -= range_x2_.stride();
838  }
839  else
840  {
841  this->x1_-= range_x1_.stride();
842  this->x2_ = int(range_x2_.start() + range_x2_.iterations() * range_x2_.stride());
843  this->pos_ = cont2d_->begin() + (this->x1_ * int(cont2d_->cols())) + this->x2_;
844  }
845  }
846  else
847  {
848  this->x1_ = int(range_x1_.stop() - (range_x1_.iterations() + 1) * range_x1_.stride());
849  this->x2_ = int(range_x2_.stop() - (range_x2_.iterations() + 1) * range_x2_.stride());
850  this->pos_ = cont2d_->begin() + (this->x1_ * int(cont2d_->cols())) + this->x2_;
851  }
852 
853  return *this;
854  }
855 
861  inline
862  self operator--(int)
863  {
864  self tmp = *this;
865  --(*this);
866  return tmp;
867  }
868 
882  inline
883  friend bool operator==(const self& i1,
884  const self& i2)
885  {
886 
887  return ( (i1.cont2d_ == i2.cont2d_) && (i1.pos_ == i2.pos_)
888  && (i1.x1_ == i2.x1_) && (i1.x2_ == i2.x2_) );
889  }
890 
897  inline
898  friend bool operator!=(const self& i1,
899  const self& i2)
900  {
901  return ( (i1.cont2d_ != i2.cont2d_) || (i1.pos_ != i2.pos_)
902  || (i1.x1_ != i2.x1_) || (i1.x2_ != i2.x2_) );
903  }
916  inline
917  friend bool operator<(const self& i1,
918  const self& i2)
919  {
920 
921  return ( i1.pos_ < i2.pos_);
922  }
923 
930  inline
931  friend bool operator>(const self& i1,
932  const self& i2)
933  {
934 
935  return (i2 < i1);
936  }
937 
944  inline
945  friend bool operator<=(const self& i1,
946  const self& i2)
947  {
948 
949  return !(i2 < i1);
950  }
951 
958  inline
959  friend bool operator>=(const self& i1,
960  const self& i2)
961  {
962 
963  return !(i1 < i2);
964  }
984  inline
985  self& operator+=(const difference_type& d)
986  {
987  this->x1_ += this->range_x1_.stride() * d.dx1();
988  this->x2_ += this->range_x2_.stride() * d.dx2();
989  this->pos_ = cont2d_->begin() + (this->x1_ * int(cont2d_->cols())) + this->x2_;
990  return *this;
991  }
992 
1004  inline
1005  self& operator-=(const difference_type& d)
1006  {
1007  this->x1_ -= this->range_x1_.stride() * d.dx1();
1008  this->x2_ -= this->range_x2_.stride() * d.dx2();
1009  this->pos_ = cont2d_->begin() + (this->x1_ * int(cont2d_->cols())) + this->x2_;
1010  return *this;
1011  }
1012 
1020  inline
1022  {
1023  self tmp = *this;
1024  tmp += d;
1025  return tmp;
1026  }
1027 
1035  inline
1037  {
1038  self tmp = *this;
1039  tmp -= d;
1040  return tmp;
1041  }
1042 
1051  inline
1052  friend difference_type operator-(const self& i1,
1053  const self& i2)
1054  {
1055  assert(i1.range_x1_.stride() == i2.range_x1_.stride());
1056  assert(i1.range_x2_.stride() == i2.range_x2_.stride());
1057  return difference_type(int((i1.x1_ - i2.x1_)/i1.range_x1_.stride()),int((i1.x2_ - i2.x2_))/i1.range_x2_.stride());
1058  }
1059 
1060 
1061 
1062 
1063 
1064 
1072  inline
1074  {
1075  assert( (this->x1_+ range_x1_.stride() * d.dx1()) < cont2d_->dim1() );
1076  assert( (this->x2_+ range_x2_.stride() * d.dx2()) < cont2d_->dim2() );
1077  return (*cont2d_)[this->x1_+ range_x1_.stride() * d.dx1()][this->x2_+ range_x2_.stride() * d.dx2()];
1078  }
1079 
1080 
1081 
1089  inline
1090  typename Container2D::const_row_range_iterator row_begin(size_type row) const
1091  {
1092  return cont2d_->row_begin(range_x1_.start() + row * range_x1_.stride(), range_x2_);
1093  }
1094 
1095 
1103  inline
1104  typename Container2D::const_row_range_iterator row_end(size_type row) const
1105  {
1106  return this->row_begin(row) + (range_x2_.iterations() + 1);
1107  }
1108 
1109 
1117  inline
1118  typename Container2D::const_col_range_iterator col_begin(size_type col) const
1119  {
1120  return cont2d_->col_begin(range_x2_.start() + col * range_x2_.stride(), range_x1_);
1121  }
1122 
1123 
1124 
1132  inline
1133  typename Container2D::const_col_range_iterator col_end(size_type col) const
1134  {
1135  return this->col_begin(col) + (range_x1_.iterations() + 1);
1136  }
1137 
1138 
1139 
1151  inline
1152  int x1() const
1153  {
1154  return this->x1_;
1155  }
1160  inline
1161  int i() const
1162  {
1163  return this->x1_;
1164  }
1169  inline
1170  int x2() const
1171  {
1172  return this->x2_;
1173  }
1178  inline
1179  int j() const
1180  {
1181  return this->x2_;
1182  }
1183 
1188 private:
1189  Container2D* cont2d_; // pointer to the 2d container
1190  pointer pos_; // linear position within the container
1191  int x1_; // first index position
1192  int x2_; // second index position
1193  slip::Range<int> range_x1_; // range to iterate on the first axis
1194  slip::Range<int> range_x2_; //range to iterate on the second axis
1195 };
1196 
1197 
1198 
1199 
1200 }//slip::
1201 
1202 #endif //SLIP_ITERATOR2D_RANGE_HPP
std::size_t iterations() const
Rerturns the number of iterations of the range.
Definition: Range.hpp:305
self & operator-=(const difference_type &d)
iterator2d_range substraction.
friend bool operator!=(const self &i1, const self &i2)
Inequality operator.
friend bool operator<=(const self &i1, const self &i2)
<= operator.
Provides a class to modelize the difference of slip::Point2d.
friend bool operator==(const self &i1, const self &i2)
Equality operator.
Container2D::const_pointer pointer
Container2D::value_type value_type
friend bool operator<(const self &i1, const self &i2)
< operator.
friend bool operator>=(const self &i1, const self &i2)
>= operator.
void dx2(const CoordType &dx)
Accessor of the second coordinate of DPoint2d.
Definition: DPoint2d.hpp:241
const_iterator2d_range(const self &o)
Constructs a copy of the const_iterator2d_range o.
Container2D::col_range_iterator col_end(size_type col)
iterator2d_range element assignment operator.
reference operator*() const
Dereference operator. Returns the element that the current const_iterator2d_range i point to...
friend bool operator>(const self &i1, const self &i2)
operator.
self & operator--()
Predecrement a const_iterator2d_range. Iterate to the previous location inside the Range2d...
iterator2d_range(Container2D *c, const slip::Range< int > &r1, const slip::Range< int > &r2)
Constructs a iterator2d_range.
self operator--(int)
Postdecrement a const_iterator2d_range. Iterate to the previous location inside the Range2d...
This is some iterator to iterate a 2d container into two Range defined by the indices and strides of ...
Definition: Array2d.hpp:119
Container2D::row_range_iterator row_begin(size_type row)
iterator2d_range element assignment operator.
self operator++(int)
Postincrement a const_iterator2d_range. Iterate to the next location inside the Range2d.
Container2D::const_reference reference
friend bool operator<(const self &i1, const self &i2)
< operator.
self operator-(const difference_type &d)
iterator2d_range substraction.
Provides a class to tag SLIP iterators.
Container2D::const_row_range_iterator row_begin(size_type row) const
const_iterator2d_range element assignment operator.
iterator2d_range()
Constructs a iterator2d_range.
friend bool operator<=(const self &i1, const self &i2)
<= operator.
int i() const
Access to the first index of the current iterator2d_range.
int j() const
Access to the second index of the current const_iterator2d_range.
self operator--(int)
Postdecrement a iterator2d_range. Iterate to the previous location inside the Range2d.
friend difference_type operator-(const self &i1, const self &i2)
iterator2d_range difference operator.
self & operator++()
Preincrement a const_iterator2d_range. Iterate to the next location inside the Range.
int x2() const
Access to the second index of the current iterator2d_range.
friend bool operator==(const self &i1, const self &i2)
Equality operator.
Container2D::value_type value_type
self operator++(int)
Postincrement a iterator2d_range. Iterate to the next location inside the Range2d.
Container2D::reference reference
void dx1(const CoordType &dx)
Accessor of the first coordinate of DPoint2d.
Definition: DPoint2d.hpp:229
self operator-(const difference_type &d)
const_iterator2d_range substraction.
friend bool operator>=(const self &i1, const self &i2)
>= operator.
int x2() const
Access to the second index of the current const_iterator2d_range.
Container2D::const_col_range_iterator col_end(size_type col) const
const_iterator2d_range element assignment operator.
Container2D::pointer pointer
DPoint2d< int > difference_type
self operator+(const difference_type &d)
iterator2d_range addition.
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
std::random_access_iterator2d_tag iterator_category
self & operator-=(const difference_type &d)
const_iterator2d_range substraction.
reference operator[](difference_type d)
iterator2d_range element assignment operator. Equivalent to *(i + d) = t.
self operator+(const difference_type &d)
const_iterator2d_range addition.
int j() const
Access to the second index of the current iterator2d_range.
Container2D::const_col_range_iterator col_begin(size_type col) const
const_iterator2d_range element assignment operator.
self & operator+=(const difference_type &d)
const_iterator2d_range addition.
self & operator+=(const difference_type &d)
iterator2d_range addition.
const_iterator2d_range(Container2D *c, const slip::Range< int > &r1, const slip::Range< int > &r2)
Constructs a const_iterator2d_range.
self & operator--()
Predecrement a iterator2d_range. Iterate to the previous location inside the Range2d.
int i() const
Access to the first index of the current const_iterator2d_range.
Container2D::size_type size_type
reference operator*()
Dereference assignment operator. Returns the element that the current iterator2d_range i point to...
This is some iterator to iterate a 2d container into two Range defined by the indices and strides of ...
Definition: Array2d.hpp:125
const_iterator2d_range()
Constructs a const_iterator2d_range.
int stride() const
Accessor of the stride of the Range.
Definition: Range.hpp:298
Container2D::col_range_iterator col_begin(size_type col)
iterator2d_range element assignment operator.
int x1() const
Access to the first index of the current const_iterator2d_range.
Provides a class to modelize 2d points.
Container2D::size_type size_type
iterator2d_range(const self &o)
Constructs a copy of the iterator2d_range o.
Container2D::const_row_range_iterator row_end(size_type row) const
const_iterator2d_range element assignment operator.
self & operator=(const self &o)
Assign a const_iterator2d_range.
friend difference_type operator-(const self &i1, const self &i2)
const_iterator2d_range difference operator.
friend bool operator>(const self &i1, const self &i2)
operator.
Container2D::row_range_iterator row_end(size_type row)
iterator2d_range element assignment operator.
int x1() const
Access to the first index of the current iterator2d_range.
self & operator++()
Preincrement a iterator2d_range. Iterate to the next location inside the Range.
Provides a class to manipulate Ranges.
friend bool operator!=(const self &i1, const self &i2)
Inequality operator.
self & operator=(const self &o)
Assign a iterator2d_range.
SubType stop() const
Accessor of the stop subscript of the Range.
Definition: Range.hpp:291
std::random_access_iterator2d_tag iterator_category
reference operator[](difference_type d) const
const_iterator2d_range element assignment operator. Equivalent to *(i + d).