SLIP  1.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Array.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_ARRAY_HPP
76 #define SLIP_ARRAY_HPP
77 #include <iostream>
78 #include <iterator>
79 #include <cassert>
80 #include <cstddef>
81 #include "Range.hpp"
82 #include "Box1d.hpp"
83 #include "stride_iterator.hpp"
84 
85 #include <boost/serialization/access.hpp>
86 #include <boost/serialization/split_member.hpp>
87 #include <boost/serialization/string.hpp>
88 #include <boost/serialization/complex.hpp>
89 #include <boost/serialization/version.hpp>
90 namespace slip
91 {
92 
93 template <typename T>
94 class Array;
95 
96 template <typename T>
97 std::ostream& operator<<(std::ostream & out,
98  const Array<T>& a);
99 
100 template<typename T>
101 bool operator==(const Array<T>& x,
102  const Array<T>& y);
103 
104 template<typename T>
105 bool operator!=(const Array<T>& x,
106  const Array<T>& y);
107 
108 template<typename T>
109 bool operator<(const Array<T>& x,
110  const Array<T>& y);
111 
112 template<typename T>
113 bool operator>(const Array<T>& x,
114  const Array<T>& y);
115 
116 template<typename T>
117 bool operator<=(const Array<T>& x,
118  const Array<T>& y);
119 
120 template<typename T>
121 bool operator>=(const Array<T>& x,
122  const Array<T>& y);
123 
142 template <typename T>
143 class Array
144 {
145 public:
146  typedef T value_type;
147  typedef Array<T> self;
148  typedef const Array<T> const_self;
149 
150  typedef value_type* pointer;
151  typedef const value_type* const_pointer;
153  typedef const value_type& const_reference;
154 
155  typedef ptrdiff_t difference_type;
156  typedef std::size_t size_type;
157 
158  typedef pointer iterator;
160 
163 
164  typedef std::reverse_iterator<iterator> reverse_iterator;
165  typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
166 
167  typedef std::reverse_iterator<iterator_range> reverse_iterator_range;
168  typedef std::reverse_iterator<const_iterator_range> const_reverse_iterator_range;
169 
170  //default iterator of the container
173 
174  static const std::size_t DIM = 1;
175 
176 public:
181 
185  Array();
186 
193  Array(const size_type size);
194 
200  Array(const size_type size,
201  const T& val);
202 
208  Array(const size_type size,
209  const T* val);
210 
220  template<typename InputIterator>
221  Array(const size_type n,
222  InputIterator first,
223  InputIterator last):
224  size_(n)
225  {
226  this->allocate();
227  std::fill_n(this->begin(),n,T());
228  std::copy(first,last,this->begin());
229  }
230 
234  Array(const self& rhs);
235 
239  ~Array();
240 
241 
250  void resize(const size_type size,
251  const T& val = T());
252 
257 
266  iterator begin();
267 
276  const_iterator begin() const;
277 
286  iterator end();
287 
296  const_iterator end() const;
297 
307 
317 
327 
337 
356  iterator_range begin(const slip::Range<int>& range);
357 
376  const_iterator_range begin(const slip::Range<int>& range) const;
377 
395  iterator_range end(const slip::Range<int>& range);
396 
415  const_iterator_range end(const slip::Range<int>& range) const;
416 
417 
418 
436  iterator begin(const slip::Box1d<int>& box);
437 
455  const_iterator begin(const slip::Box1d<int>& box) const;
456 
474  iterator end(const slip::Box1d<int>& box);
475 
493  const_iterator end(const slip::Box1d<int>& box) const;
494 
495  //
515 
535 
554 
574 
575 
576 
595 
614 
633 
651  const_reverse_iterator rend(const slip::Box1d<int>& box) const;
659 
665  friend std::ostream& operator<< <>(std::ostream & out,
666  const self& a);
674 
681  self& operator=(const self& rhs);
682 
690  self& operator=(const T& value)
691  {
692  this->fill(value);
693  return *this;
694  }
695 
700  void fill(const T& value)
701  {
702  std::fill_n(this->begin(),size_,value);
703  }
704 
710  void fill(const T* value)
711  {
712  std::copy(value,value + size_,this->begin());
713  }
714 
723  template<typename InputIterator>
724  void fill(InputIterator first,
725  InputIterator last)
726  {
727  std::copy(first,last,this->begin());
728  }
741  friend bool operator== <>(const Array<T>& x,
742  const Array<T>& y);
743 
750  friend bool operator!= <>(const Array<T>& x,
751  const Array<T>& y);
752 
759  friend bool operator< <>(const Array<T>& x,
760  const Array<T>& y);
761 
768  friend bool operator> <>(const Array<T>& x,
769  const Array<T>& y);
770 
777  friend bool operator<= <>(const Array<T>& x,
778  const Array<T>& y);
779 
786  friend bool operator>= <>(const Array<T>& x,
787  const Array<T>& y);
788 
789 
807  reference operator[](const size_type n);
808 
809 
821  const_reference operator[](const size_type n) const;
822 
834  reference operator()(const size_type n);
835 
847  const_reference operator()(const size_type n) const;
848 
849 
862 
875 
887  self operator()(const slip::Range<int>& range);
888 
896  std::string name() const;
897 
901  size_type size() const;
905  size_type max_size() const;
906 
910  bool empty()const;
911 
916  void swap(self& rhs);
917 
918 private:
919  size_type size_;
920  T* data_;
921 
923  void allocate();
925  void desallocate();
930  void copy_attributes(const self& rhs);
931 
932  friend class boost::serialization::access;
933  template<class Archive>
934  void save(Archive & ar, const unsigned int version) const
935  {
936  ar & this->size_ ;
937  for(std::size_t i = 0; i < this->size_; ++i)
938  {
939  ar & *(data_ + i);
940  }
941  }
942  template<class Archive>
943  void load(Archive & ar, const unsigned int version)
944  {
945  ar & this->size_;
946  this->desallocate();
947  this->allocate();
948  for(std::size_t i = 0; i < this->size_; ++i)
949  {
950  ar & *(data_+ i);
951  }
952  }
953  BOOST_SERIALIZATION_SPLIT_MEMBER();
954 
955 }; // end of Containers1d group
957 
978 
979 }//slip::
980 
981 namespace slip
982 {
983 
984  template<typename T>
985  inline
987  size_(0),data_(0)
988  {}
989 
990 
991  template<typename T>
992  inline
994  size_(n)
995  {
996  this->allocate();
997  std::fill_n(this->data_,this->size_,T());
998  }
999 
1000  template<typename T>
1001  inline
1003  const T& val):
1004  size_(n)
1005  {
1006  this->allocate();
1007  std::fill_n(this->data_,this->size_,val);
1008  }
1009 
1010  template<typename T>
1011  inline
1013  const T* val):
1014  size_(n)
1015  {
1016  this->allocate();
1017  std::copy(val,val + this->size_, this->data_);
1018  }
1019 
1020  template<typename T>
1021  inline
1023  size_(rhs.size_)
1024  {
1025  this->allocate();
1026  std::copy(rhs.data_,rhs.data_ + this->size_,this->data_);
1027  }
1028 
1029  template<typename T>
1030  inline
1032  {
1033  this->desallocate();
1034  }
1035 
1036  template<typename T>
1037  inline
1038  Array<T>& Array<T>::operator=(const self& rhs)
1039  {
1040  if(this != &rhs)
1041  {
1042  if(this->size_ != rhs.size_)
1043  {
1044  this->desallocate();
1045  this->copy_attributes(rhs);
1046  this->allocate();
1047  }
1048  if(rhs.size_ != 0)
1049  {
1050  std::copy(rhs.data_,rhs.data_ + this->size_,this->data_);
1051  }
1052  }
1053  return *this;
1054  }
1055 
1056 
1057  template<typename T>
1058  inline
1060  const T& val)
1061  {
1062  if( this->size_ != size)
1063  {
1064  this->desallocate();
1065  this->size_ = size;
1066  this->allocate();
1067  }
1068  if(size != 0)
1069  {
1070  std::fill_n(this->data_,this->size_,val);
1071  }
1072 
1073  }
1074 
1075  template<typename T>
1076  inline
1078  {
1079  return this->data_;
1080  }
1081 
1082  template<typename T>
1083  inline
1085  {
1086  return this->data_ + this->size_;
1087  }
1088 
1089  template<typename T>
1090  inline
1092  {
1093  return this->data_;
1094  }
1095 
1096  template<typename T>
1097  inline
1099  {
1100  return this->data_ + this->size_;
1101  }
1102 
1103 
1104  //
1105  template<typename T>
1106  inline
1107  typename Array<T>::iterator_range
1109  {
1110  assert(range.is_valid());
1111  assert(range.start() >= 0);
1112  assert(range.stop() >= 0);
1113  assert(range.start() < int(this->size()));
1114  assert(range.stop() < int(this->size()));
1115  return typename slip::Array<T>::iterator_range(this->data_+range.start(),range.stride());
1116  }
1117 
1118  template<typename T>
1119  inline
1120  typename Array<T>::iterator_range
1122  {
1123 
1124  return this->begin(range) + (range.iterations() + 1);
1125  }
1126 
1127  template<typename T>
1128  inline
1130  Array<T>::begin(const slip::Range<int>& range) const
1131  {
1132  assert(range.is_valid());
1133  assert(range.start() >= 0);
1134  assert(range.stop() >= 0);
1135  assert(range.start() < int(this->size()));
1136  assert(range.stop() < int(this->size()));
1137  return typename slip::Array<T>::const_iterator_range(this->data_+range.start(),range.stride());
1138  }
1139 
1140  template<typename T>
1141  inline
1143  Array<T>::end(const slip::Range<int>& range) const
1144  {
1145  return this->begin(range) + (range.iterations() + 1);
1146  }
1147 
1148 
1149  //
1150  template<typename T>
1151  inline
1152  typename Array<T>::iterator
1154  {
1155  assert(box.is_consistent());
1156  return this->data_ + (box.upper_left())[0];
1157  }
1158 
1159  template<typename T>
1160  inline
1161  typename Array<T>::iterator
1163  {
1164  assert(box.is_consistent());
1165  return this->begin(box) + box.length();
1166  }
1167 
1168  template<typename T>
1169  inline
1170  typename Array<T>::const_iterator
1172  {
1173  assert(box.is_consistent());
1174  return this->data_ + (box.upper_left())[0];
1175  }
1176 
1177  template<typename T>
1178  inline
1179  typename Array<T>::const_iterator
1181  {
1182  assert(box.is_consistent());
1183  return this->begin(box) + box.length();
1184  }
1185  //
1186  template<typename T>
1187  inline
1189  {
1190  return typename Array<T>::reverse_iterator(this->end());
1191  }
1192 
1193  template<typename T>
1194  inline
1196  {
1197  return typename Array<T>::reverse_iterator(this->begin());
1198  }
1199 
1200  template<typename T>
1201  inline
1203  {
1204  return typename Array<T>::const_reverse_iterator(this->end());
1205  }
1206 
1207  template<typename T>
1208  inline
1210  {
1211  return typename Array<T>::const_reverse_iterator(this->begin());
1212  }
1213 
1214  //
1215  template<typename T>
1216  inline
1218  {
1219  return typename Array<T>::reverse_iterator(this->end(box));
1220  }
1221 
1222  template<typename T>
1223  inline
1224  typename Array<T>::reverse_iterator
1226  {
1227  return typename Array<T>::reverse_iterator(this->begin(box));
1228  }
1229 
1230  template<typename T>
1231  inline
1234  {
1235  return typename Array<T>::const_reverse_iterator(this->end(box));
1236  }
1237 
1238  template<typename T>
1239  inline
1242  {
1243  return typename Array<T>::const_reverse_iterator(this->begin(box));
1244  }
1245  //
1246  template<typename T>
1247  inline
1249  {
1250  return typename Array<T>::reverse_iterator_range(this->end(range));
1251  }
1252 
1253  template<typename T>
1254  inline
1257  {
1258  return typename Array<T>::reverse_iterator_range(this->begin(range));
1259  }
1260 
1261  template<typename T>
1262  inline
1265  {
1266  return typename Array<T>::const_reverse_iterator_range(this->end(range));
1267  }
1268 
1269  template<typename T>
1270  inline
1272  Array<T>::rend(const slip::Range<int>& range) const
1273  {
1274  return typename Array<T>::const_reverse_iterator_range(this->begin(range));
1275  }
1276 
1277 
1279  /* @{ */
1280  template <typename T>
1281  inline
1282  std::ostream& operator<<(std::ostream & out,
1283  const Array<T>& a)
1284  {
1285  if(a.data_ != 0)
1286  {
1287  out<<"(";
1288  for(std::size_t n = 0; n < a.size_ - 1; ++n)
1289  {
1290  out<<a.data_[n]<<",";
1291  }
1292  out<<a.data_[a.size_-1];
1293  out<<")";
1294  }
1295  else
1296  {
1297  out<<"()";
1298  }
1299  return out;
1300  }
1301  /* @} */
1302 
1303  template <typename T>
1304  inline
1305  typename Array<T>::reference Array<T>::operator[](typename Array<T>::size_type i)
1306  {
1307  assert(this->data_ != 0);
1308  assert(i < this->size_);
1309  return *(this->data_ + i);
1310  }
1311 
1312  template <typename T>
1313  inline
1314  typename Array<T>::const_reference Array<T>::operator[](typename Array<T>::size_type i) const
1315  {
1316  assert(this->data_ != 0);
1317  assert(i < this->size_);
1318  return *(this->data_ + i);
1319  }
1320 
1321  template <typename T>
1322  inline
1323  typename Array<T>::reference Array<T>::operator()(typename Array<T>::size_type i)
1324  {
1325  assert(this->data_ != 0);
1326  assert(i < this->size_);
1327  return *(this->data_ + i);
1328  }
1329 
1330  template <typename T>
1331  inline
1332  typename Array<T>::const_reference Array<T>::operator()(typename Array<T>::size_type i) const
1333  {
1334  assert(this->data_ != 0);
1335  assert(i < this->size_);
1336  return *(this->data_ + i);
1337  }
1338 
1339  template <typename T>
1340  inline
1341  typename Array<T>::reference
1342  Array<T>::operator()(const slip::Point1d<typename Array<T>::size_type>& p)
1343  {
1344  assert(this->data_ != 0);
1345  assert(p[0] < this->size_);
1346  return *(this->data_ + p[0]);
1347  }
1348 
1349  template <typename T>
1350  inline
1351  typename Array<T>::const_reference
1352  Array<T>::operator()(const slip::Point1d<typename Array<T>::size_type>& p) const
1353  {
1354  assert(this->data_ != 0);
1355  assert(p[0] < this->size_);
1356  return *(this->data_ + p[0]);
1357  }
1358 
1359  template<typename T>
1360  inline
1362  {
1363  assert(this->data_ != 0);
1364  assert(range.is_valid());
1365  assert(range.start() < (int)this->size_);
1366  assert(range.stop() < (int)this->size_);
1367 
1368  std::size_t dim = range.iterations() + 1;
1369 
1370  return Array<T>(dim,this->begin(range),this->end(range));
1371  }
1372 
1373  template<typename T>
1374  inline
1375  std::string
1376  Array<T>::name() const {return "Array";}
1377 
1378 
1379  template <typename T>
1380  inline
1381  typename Array<T>::size_type Array<T>::size() const {return this->size_;}
1382 
1383  template <typename T>
1384  inline
1386  {
1387  return typename Array<T>::size_type(-1)/sizeof(T);
1388  }
1389 
1390  template<typename T>
1391  inline
1392  bool Array<T>::empty()const {return this->size_ == 0;}
1393 
1394  template<typename T>
1395  inline
1397  {
1398  assert(this->size_ == M.size_);
1399  std::swap_ranges(this->begin(),this->end(),M.begin());
1400  }
1401 
1402 
1403 
1404 
1405 template<typename T>
1406  inline
1407  void Array<T>::allocate()
1408  {
1409  if(this->size_ != 0)
1410  {
1411  this->data_ = new T[this->size_];
1412  }
1413  else
1414  {
1415  this->data_ = 0;
1416  }
1417  }
1418 
1419  template<typename T>
1420  inline
1421  void Array<T>::desallocate()
1422  {
1423  if (this->data_ != 0)
1424  delete[] (this->data_);
1425  }
1426 
1427  template<typename T>
1428  inline
1429  void Array<T>::copy_attributes(const Array<T>& rhs)
1430  {
1431  this->size_ = rhs.size_;
1432  }
1433 
1435  /* @{ */
1436 
1437 template<typename T>
1438 inline
1439 bool operator==(const Array<T>& x,
1440  const Array<T>& y)
1441 {
1442  return ( x.size() == y.size()
1443  && std::equal(x.begin(),x.end(),y.begin()));
1444 }
1445 
1446 template<typename T>
1447 inline
1448 bool operator!=(const Array<T>& x,
1449  const Array<T>& y)
1450 {
1451  return !(x == y);
1452 }
1453 
1454 /* @} */
1455 
1457  /* @{ */
1458 template<typename T>
1459 inline
1460 bool operator<(const Array<T>& x,
1461  const Array<T>& y)
1462 {
1463  return std::lexicographical_compare(x.begin(), x.end(),
1464  y.begin(), y.end());
1465 }
1466 
1467 template<typename T>
1468 inline
1469 bool operator>(const Array<T>& x,
1470  const Array<T>& y)
1471 {
1472  return (y < x);
1473 }
1474 
1475 template<typename T>
1476 inline
1477 bool operator<=(const Array<T>& x,
1478  const Array<T>& y)
1479 {
1480  return !(y < x);
1481 }
1482 
1483 template<typename T>
1484 inline
1485 bool operator>=(const Array<T>& x,
1486  const Array<T>& y)
1487 {
1488  return !(x < y);
1489 }
1490 
1491 /* @} */
1492 
1493 }//slip::
1494 #endif //SLIP_ARRAY_HPP
const value_type & const_reference
Definition: Array.hpp:153
reference operator()(const size_type n)
Subscript access to the data contained in the Array.
self & operator=(const self &rhs)
Assigns a Array in rhs.
Definition: Array.hpp:1038
bool empty() const
Returns true if the Array is empty. (Thus size() == 0)
Definition: Array.hpp:1392
bool operator!=(const Array< T > &x, const Array< T > &y)
Definition: Array.hpp:1448
std::size_t iterations() const
Rerturns the number of iterations of the range.
Definition: Range.hpp:305
self & operator=(const T &value)
Assign all the elements of the Array by value.
Definition: Array.hpp:690
slip::Array< short > Array_s
short alias
Definition: Array.hpp:967
reverse_iterator rend()
Returns a read/write reverse iterator that points to one before the first element in the Array...
Definition: Array.hpp:1195
std::string name() const
Returns the name of the class.
Definition: Array.hpp:1376
const_iterator const_default_iterator
Definition: Array.hpp:172
void resize(const size_type size, const T &val=T())
Resizes a Array.
Definition: Array.hpp:1059
Array(const size_type n, InputIterator first, InputIterator last)
Constructs a Array from a range.
Definition: Array.hpp:221
iterator begin()
Returns a read/write iterator that points to the first element in the Array. Iteration is done in ord...
Definition: Array.hpp:1077
size_type max_size() const
Returns the maximal size (number of elements) in the Array.
Definition: Array.hpp:1385
slip::stride_iterator< const_pointer > const_iterator_range
Definition: Array.hpp:162
ptrdiff_t difference_type
Definition: Array.hpp:155
void fill(const T *value)
Fills the container range [begin(),begin()+N) with a copy of the value array.
Definition: Array.hpp:710
slip::stride_iterator< pointer > iterator_range
Definition: Array.hpp:161
const Array< T > const_self
Definition: Array.hpp:148
Array()
Constructs a Array.
Definition: Array.hpp:986
bool operator>(const Array< T > &x, const Array< T > &y)
Definition: Array.hpp:1469
std::reverse_iterator< iterator > reverse_iterator
Definition: Array.hpp:164
void fill(const T &value)
Fills the container range [begin(),begin()+N) with copies of value.
Definition: Array.hpp:700
slip::Array< char > Array_c
char alias
Definition: Array.hpp:975
slip::Array< unsigned char > Array_uc
unsigned char alias
Definition: Array.hpp:977
This is a point1d class, a specialized version of Point<CoordType,DIM> with DIM = 1...
Definition: Point1d.hpp:101
pointer iterator
Definition: Array.hpp:158
value_type * pointer
Definition: Array.hpp:150
iterator end()
Returns a read/write iterator that points one past the last element in the Array. Iteration is done i...
Definition: Array.hpp:1084
std::reverse_iterator< iterator_range > reverse_iterator_range
Definition: Array.hpp:167
This is a Box1d class, a specialized version of slip::Box<CoordType,DIM> with DIM = 1...
Definition: Box1d.hpp:110
void fill(InputIterator first, InputIterator last)
Fills the container range [begin(),begin()+N) with a copy of the range [first,last) ...
Definition: Array.hpp:724
CoordType length() const
compute the length of the Box1d.
Definition: Box1d.hpp:311
void copy(_II first, _II last, _OI output_first)
Copy algorithm optimized for slip iterators.
Definition: copy_ext.hpp:177
bool is_valid() const
Returns true if the range is valid :
Definition: Range.hpp:322
SubType start() const
Accessor of the start subscript of the Range.
Definition: Range.hpp:284
iterator default_iterator
Definition: Array.hpp:171
void upper_left(const Point< CoordType, 1 > &p1)
Accessor/Mutator of the upper_left point (p1) of Box1d.
Definition: Box1d.hpp:270
std::reverse_iterator< const_iterator_range > const_reverse_iterator_range
Definition: Array.hpp:168
slip::Array< long > Array_l
long alias
Definition: Array.hpp:963
T value_type
Definition: Array.hpp:146
bool is_consistent() const
verify if the window is consistent, that is to say if the first point p1 has the smaller coordinates ...
slip::Array< int > Array_i
int alias
Definition: Array.hpp:971
~Array()
Destructor of the Array.
Definition: Array.hpp:1031
slip::Array< unsigned long > Array_ul
unsigned long alias
Definition: Array.hpp:965
const value_type * const_pointer
Definition: Array.hpp:151
void swap(self &rhs)
Swaps data with another Array.
Definition: Array.hpp:1396
reference operator[](const size_type n)
Subscript access to the data contained in the Array.
slip::Array< unsigned int > Array_ui
unsigned int alias
Definition: Array.hpp:973
std::ostream & operator<<(std::ostream &out, const Array< T > &a)
Definition: Array.hpp:1282
const_pointer const_iterator
Definition: Array.hpp:159
slip::Array< unsigned short > Array_us
unsigned long alias
Definition: Array.hpp:969
slip::Array< double > Array_d
double alias
Definition: Array.hpp:959
int stride() const
Accessor of the stride of the Range.
Definition: Range.hpp:298
size_type size() const
Returns the number of elements in the Array.
Definition: Array.hpp:1381
static const std::size_t DIM
Definition: Array.hpp:174
Provides a class to iterate a 1d range according to a step.
std::reverse_iterator< const_iterator > const_reverse_iterator
Definition: Array.hpp:165
bool operator==(const Array< T > &x, const Array< T > &y)
Definition: Array.hpp:1439
This is a linear (one-dimensional) dynamic template container. This container statisfies the RandomAc...
Definition: Array.hpp:94
reverse_iterator rbegin()
Returns a read/write reverse iterator that points to the last element in the Array. Iteration is done in reverse element order.
Definition: Array.hpp:1188
slip::Array< float > Array_f
float alias
Definition: Array.hpp:961
Provides a class to manipulate Ranges.
value_type & reference
Definition: Array.hpp:152
std::size_t size_type
Definition: Array.hpp:156
Provides a class to manipulate 1d box.
SubType stop() const
Accessor of the stop subscript of the Range.
Definition: Range.hpp:291
bool operator>=(const Array< T > &x, const Array< T > &y)
Definition: Array.hpp:1485