75 #ifndef SLIP_ARRAY3D_HPP
76 #define SLIP_ARRAY3D_HPP
90 #include <boost/serialization/access.hpp>
91 #include <boost/serialization/split_member.hpp>
92 #include <boost/serialization/string.hpp>
93 #include <boost/serialization/complex.hpp>
94 #include <boost/serialization/version.hpp>
100 class stride_iterator;
103 class iterator2d_box;
106 class const_iterator2d_box;
108 template <
typename T>
111 template <
typename T>
124 bool operator<(const slip::Array3d<T>& x,
132 bool operator<=(const slip::Array3d<T>& x,
161 template <
typename T>
212 #ifdef ALL_PLANE_ITERATOR3D
217 typedef std::reverse_iterator<iterator1d> reverse_iterator1d;
218 typedef std::reverse_iterator<const_iterator1d> const_reverse_iterator1d;
219 #endif //ALL_PLANE_ITERATOR3D
243 static const std::size_t
DIM = 3;
264 const std::size_t d2,
265 const std::size_t d3);
275 const std::size_t d2,
276 const std::size_t d3,
286 const std::size_t d2,
287 const std::size_t d3,
302 template<
typename InputIterator>
308 d1_(d1),d2_(d2),d3_(d3),size_(d1 * d2 * d3), slice_size_(d2 * d3)
311 std::fill_n(this->
begin(),this->size_,T());
338 void resize(std::size_t d1,
1717 #ifdef ALL_PLANE_ITERATOR3D
2188 #endif //ALL_PLANE_ITERATOR3D
3171 friend std::ostream& operator<< <>(std::ostream & out,
3209 std::fill_n(this->
begin(),this->size_,value);
3231 template<
typename InputIterator>
3251 friend bool operator== <>(
const Array3d<T>& x,
3260 friend bool operator!= <>(
const Array3d<T>& x,
3269 friend bool operator< <>(
const Array3d<T>& x,
3278 friend bool operator> <>(
const Array3d<T>& x,
3287 friend bool operator<= <>(
const Array3d<T>& x,
3296 friend bool operator>= <>(
const Array3d<T>& x,
3352 std::string
name()
const;
3451 void copy_attributes(
const self& rhs);
3454 template<
class Archive>
3455 void save(Archive & ar,
const unsigned int version)
const
3457 ar & this->d1_ & this->d2_ & this->d3_ & this->size_ & this->slice_size_;
3458 for (
size_t i = 0; i < this->size_; ++i)
3463 template<
class Archive>
3464 void load(Archive & ar,
const unsigned int version)
3466 ar & this->d1_ & this->d2_ & this->d3_ & this->size_ & this->slice_size_;
3469 for (
size_t i = 0; i < this->size_; ++i)
3474 BOOST_SERIALIZATION_SPLIT_MEMBER();
3507 template<
typename T>
3510 d1_(0),d2_(0),d3_(0),size_(0),slice_size_(0),data_(0)
3514 template<
typename T>
3519 d1_(d1),d2_(d2),d3_(d3),size_(d1 * d2 * d3),slice_size_(d2*d3)
3522 std::fill_n(this->data_[0][0],this->size_,T());
3525 template<
typename T>
3531 d1_(d1),d2_(d2),d3_(d3),size_(d1 * d2 * d3),slice_size_(d2*d3)
3534 std::fill_n(this->data_[0][0],this->size_,val);
3537 template<
typename T>
3543 d1_(d1),d2_(d2),d3_(d3),size_(d1 * d2 * d3),slice_size_(d2*d3)
3546 std::copy(val,val + this->size_, this->data_[0][0]);
3549 template<
typename T>
3552 d1_(rhs.d1_),d2_(rhs.d2_),d3_(rhs.d3_),size_(rhs.size_),slice_size_(rhs.slice_size_)
3555 if(this->size_ != 0)
3557 std::copy(rhs.data_[0][0],rhs.data_[0][0] + this->size_,this->data_[0][0]);
3561 template<
typename T>
3565 this->desallocate();
3574 template<
typename T>
3580 if( this->d1_ != rhs.d1_ || this->d2_ != rhs.d2_ || this->d3_ != rhs.d3_)
3582 this->desallocate();
3583 this->copy_attributes(rhs);
3588 std::copy(rhs.data_[0][0],rhs.data_[0][0] + this->size_,this->data_[0][0]);
3594 template<
typename T>
3604 template<
typename T>
3611 if( this->d1_ != d1 || this->d2_ != d2 || this->d3_ != d3)
3613 this->desallocate();
3617 this->size_ = d1 * d2 * d3;
3618 this->slice_size_ = d2 * d3;
3621 if( this->d1_ != 0 && this->d2_ != 0 && this->d3_ != 0)
3623 std::fill_n(this->data_[0][0],this->size_,val);
3642 template<
typename T>
3646 return this->data_[0][0];
3649 template<
typename T>
3653 return this->data_[0][0] + this->size_;
3656 template<
typename T>
3660 return this->data_[0][0];
3663 template<
typename T>
3667 return this->data_[0][0] + this->size_;
3670 template<
typename T>
3677 template<
typename T>
3684 template<
typename T>
3692 template<
typename T>
3701 template<
typename T>
3707 assert(row < this->d2_);
3708 assert(col < this->d3_);
3712 template<
typename T>
3714 typename Array3d<T>::const_slice_iterator
3716 const typename Array3d<T>::size_type col)
const
3718 assert(row < this->d2_);
3719 assert(col < this->d3_);
3723 template<
typename T>
3725 typename Array3d<T>::slice_iterator
3727 const typename Array3d<T>::size_type col)
3729 assert(row < this->d2_);
3730 assert(col < this->d3_);
3731 return (this->slice_begin(row,col) + this->d1_);
3734 template<
typename T>
3736 typename Array3d<T>::const_slice_iterator
3738 const typename Array3d<T>::size_type col)
const
3740 assert(row < this->d2_);
3741 assert(col < this->d3_);
3743 return (tp->slice_begin(row,col) + this->d1_);
3746 template<
typename T>
3748 typename Array3d<T>::reverse_slice_iterator
3750 const typename Array3d<T>::size_type col)
3752 assert(row < this->d2_);
3753 assert(col < this->d3_);
3757 template<
typename T>
3759 typename Array3d<T>::const_reverse_slice_iterator
3761 const typename Array3d<T>::size_type col)
const
3763 assert(row < this->d2_);
3764 assert(col < this->d3_);
3768 template<
typename T>
3770 typename Array3d<T>::reverse_slice_iterator
3772 const typename Array3d<T>::size_type col)
3774 assert(row < this->d2_);
3775 assert(col < this->d3_);
3779 template<
typename T>
3781 typename Array3d<T>::const_reverse_slice_iterator
3783 const typename Array3d<T>::size_type col)
const
3785 assert(row < this->d2_);
3786 assert(col < this->d3_);
3792 template<
typename T>
3794 typename Array3d<T>::row_iterator
3796 const typename Array3d<T>::size_type row)
3798 assert(slice < this->d1_);
3799 assert(row < this->d2_);
3800 return this->data_[slice][row];
3803 template<
typename T>
3805 typename Array3d<T>::const_row_iterator
3807 const typename Array3d<T>::size_type row)
const
3809 assert(slice < this->d1_);
3810 assert(row < this->d2_);
3811 return this->data_[slice][row];
3814 template<
typename T>
3816 typename Array3d<T>::row_iterator
3818 const typename Array3d<T>::size_type row)
3820 assert(slice < this->d1_);
3821 assert(row < this->d2_);
3822 return this->data_[slice][row] + this->d3_;
3825 template<
typename T>
3827 typename Array3d<T>::const_row_iterator
3829 const typename Array3d<T>::size_type row)
const
3831 assert(slice < this->d1_);
3832 assert(row < this->d2_);
3833 return this->data_[slice][row] + this->d3_;
3837 template<
typename T>
3839 typename Array3d<T>::reverse_row_iterator
3841 const typename Array3d<T>::size_type row)
3843 assert(slice < this->d1_);
3844 assert(row < this->d2_);
3848 template<
typename T>
3850 typename Array3d<T>::const_reverse_row_iterator
3852 const typename Array3d<T>::size_type row)
const
3854 assert(slice < this->d1_);
3855 assert(row < this->d2_);
3860 template<
typename T>
3862 typename Array3d<T>::reverse_row_iterator
3864 const typename Array3d<T>::size_type row)
3866 assert(slice < this->d1_);
3867 assert(row < this->d2_);
3871 template<
typename T>
3873 typename Array3d<T>::const_reverse_row_iterator
3875 const typename Array3d<T>::size_type row)
const
3877 assert(slice < this->d1_);
3878 assert(row < this->d2_);
3884 template<
typename T>
3886 typename Array3d<T>::col_iterator
3888 const typename Array3d<T>::size_type col)
3890 assert(slice < this->d1_);
3891 assert(col < this->d3_);
3895 template<
typename T>
3897 typename Array3d<T>::const_col_iterator
3899 const typename Array3d<T>::size_type col)
const
3901 assert(slice < this->d1_);
3902 assert(col < this->d3_);
3907 template<
typename T>
3909 typename Array3d<T>::col_iterator
3911 const typename Array3d<T>::size_type col)
3913 assert(slice < this->d1_);
3914 assert(col < this->d3_);
3918 template<
typename T>
3920 typename Array3d<T>::const_col_iterator
3922 const typename Array3d<T>::size_type col)
const
3924 assert(slice < this->d1_);
3925 assert(col < this->d3_);
3930 template<
typename T>
3932 typename Array3d<T>::reverse_col_iterator
3934 const typename Array3d<T>::size_type col)
3936 assert(slice < this->d1_);
3937 assert(col < this->d3_);
3941 template<
typename T>
3943 typename Array3d<T>::const_reverse_col_iterator
3945 const typename Array3d<T>::size_type col)
const
3947 assert(slice < this->d1_);
3948 assert(col < this->d3_);
3953 template<
typename T>
3955 typename Array3d<T>::reverse_col_iterator
3957 const typename Array3d<T>::size_type col)
3959 assert(slice < this->d1_);
3960 assert(col < this->d3_);
3964 template<
typename T>
3966 typename Array3d<T>::const_reverse_col_iterator
3968 const typename Array3d<T>::size_type col)
const
3970 assert(slice < this->d1_);
3971 assert(col < this->d3_);
3978 template<
typename T>
3980 typename Array3d<T>::slice_range_iterator
3984 assert(row < this->d2_);
3985 assert(col < this->d3_);
3987 assert(range.
start() >= 0);
3988 assert(range.
stop() >= 0);
3989 assert(range.
start() < (int)this->d1_);
3990 assert(range.
stop() < (int)this->d1_);
3994 template<
typename T>
3996 typename Array3d<T>::const_slice_range_iterator
4000 assert(row < this->d2_);
4001 assert(col < this->d3_);
4003 assert(range.
start() >= 0);
4004 assert(range.
stop() >= 0);
4005 assert(range.
start() < (int)this->d1_);
4006 assert(range.
stop() < (int)this->d1_);
4010 template<
typename T>
4012 typename Array3d<T>::slice_range_iterator
4013 Array3d<T>::slice_end(
const typename Array3d<T>::size_type row,
const typename Array3d<T>::size_type col,
4016 assert(row < this->d2_);
4017 assert(col < this->d3_);
4018 assert(range.
start() < (int)this->d1_);
4019 assert(range.
stop() < (int)this->d1_);
4023 template<
typename T>
4025 typename Array3d<T>::const_slice_range_iterator
4026 Array3d<T>::slice_end(
const typename Array3d<T>::size_type row,
const typename Array3d<T>::size_type col,
4029 assert(row < this->d2_);
4030 assert(col < this->d3_);
4031 assert(range.
start() < (int)this->d1_);
4032 assert(range.
stop() < (int)this->d1_);
4036 template<
typename T>
4038 typename Array3d<T>::reverse_slice_range_iterator
4042 assert(row < this->d2_);
4043 assert(col < this->d3_);
4044 assert(range.
start() < (int)this->d1_);
4048 template<
typename T>
4050 typename Array3d<T>::const_reverse_slice_range_iterator
4054 assert(row < this->d2_);
4055 assert(col < this->d3_);
4056 assert(range.
start() < (int)this->d1_);
4060 template<
typename T>
4062 typename Array3d<T>::reverse_slice_range_iterator
4063 Array3d<T>::slice_rend(
const typename Array3d<T>::size_type row,
const typename Array3d<T>::size_type col,
4066 assert(row < this->d2_);
4067 assert(col < this->d3_);
4068 assert(range.
start() < (int)this->d1_);
4072 template<
typename T>
4074 typename Array3d<T>::const_reverse_slice_range_iterator
4075 Array3d<T>::slice_rend(
const typename Array3d<T>::size_type row,
const typename Array3d<T>::size_type col,
4078 assert(row < this->d2_);
4079 assert(col < this->d3_);
4080 assert(range.
start() < (int)this->d1_);
4086 template<
typename T>
4088 typename Array3d<T>::row_range_iterator
4091 assert(row < this->d2_);
4093 assert(range.
start() >= 0);
4094 assert(range.
stop() >= 0);
4095 assert(range.
start() < (int)this->d3_);
4096 assert(range.
stop() < (int)this->d3_);
4100 template<
typename T>
4102 typename Array3d<T>::const_row_range_iterator
4103 Array3d<T>::row_begin(
const typename Array3d<T>::size_type slice,
const typename Array3d<T>::size_type row,
4106 assert(row < this->d2_);
4108 assert(range.
start() >= 0);
4109 assert(range.
stop() >= 0);
4110 assert(range.
start() < (int)this->d3_);
4111 assert(range.
stop() < (int)this->d3_);
4115 template<
typename T>
4117 typename Array3d<T>::row_range_iterator
4118 Array3d<T>::row_end(
const typename Array3d<T>::size_type slice,
const typename Array3d<T>::size_type row,
4121 assert(row < this->d2_);
4122 assert(range.
start() < (int)this->d3_);
4123 assert(range.
stop() < (int)this->d3_);
4127 template<
typename T>
4129 typename Array3d<T>::const_row_range_iterator
4130 Array3d<T>::row_end(
const typename Array3d<T>::size_type slice,
const typename Array3d<T>::size_type row,
4133 assert(row < this->d2_);
4134 assert(range.
start() < (int)this->d3_);
4135 assert(range.
stop() < (int)this->d3_);
4139 template<
typename T>
4141 typename Array3d<T>::reverse_row_range_iterator
4142 Array3d<T>::row_rbegin(
const typename Array3d<T>::size_type slice,
const typename Array3d<T>::size_type row,
4145 assert(row < this->d2_);
4146 assert(range.
start() < (int)this->d3_);
4150 template<
typename T>
4152 typename Array3d<T>::const_reverse_row_range_iterator
4153 Array3d<T>::row_rbegin(
const typename Array3d<T>::size_type slice,
const typename Array3d<T>::size_type row,
4156 assert(row < this->d2_);
4157 assert(range.
start() < (int)this->d3_);
4161 template<
typename T>
4163 typename Array3d<T>::reverse_row_range_iterator
4164 Array3d<T>::row_rend(
const typename Array3d<T>::size_type slice,
const typename Array3d<T>::size_type row,
4167 assert(row < this->d2_);
4168 assert(range.
start() < (int)this->d3_);
4172 template<
typename T>
4174 typename Array3d<T>::const_reverse_row_range_iterator
4175 Array3d<T>::row_rend(
const typename Array3d<T>::size_type slice,
const typename Array3d<T>::size_type row,
4178 assert(row < this->d2_);
4179 assert(range.
start() < (int)this->d3_);
4185 template<
typename T>
4187 typename Array3d<T>::col_range_iterator
4188 Array3d<T>::col_begin(
const typename Array3d<T>::size_type slice,
const typename Array3d<T>::size_type col,
4191 assert(col < this->d3_);
4193 assert(range.
start() >= 0);
4194 assert(range.
stop() >= 0);
4195 assert(range.
start() < (int)this->d2_);
4196 assert(range.
stop() < (int)this->d2_);
4200 template<
typename T>
4202 typename Array3d<T>::const_col_range_iterator
4203 Array3d<T>::col_begin(
const typename Array3d<T>::size_type slice,
const typename Array3d<T>::size_type col,
4206 assert(col < this->d3_);
4208 assert(range.
start() >= 0);
4209 assert(range.
stop() >= 0);
4210 assert(range.
start() < (int)this->d2_);
4211 assert(range.
stop() < (int)this->d2_);
4215 template<
typename T>
4217 typename Array3d<T>::col_range_iterator
4218 Array3d<T>::col_end(
const typename Array3d<T>::size_type slice,
const typename Array3d<T>::size_type col,
4221 assert(col < this->d3_);
4222 assert(range.
start() < (int)this->d2_);
4223 assert(range.
stop() < (int)this->d2_);
4227 template<
typename T>
4229 typename Array3d<T>::const_col_range_iterator
4230 Array3d<T>::col_end(
const typename Array3d<T>::size_type slice,
const typename Array3d<T>::size_type col,
4233 assert(col < this->d3_);
4234 assert(range.
start() < (int)this->d2_);
4235 assert(range.
stop() < (int)this->d2_);
4239 template<
typename T>
4241 typename Array3d<T>::reverse_col_range_iterator
4242 Array3d<T>::col_rbegin(
const typename Array3d<T>::size_type slice,
const typename Array3d<T>::size_type col,
4245 assert(col < this->d3_);
4246 assert(range.
start() < (int)this->d2_);
4250 template<
typename T>
4252 typename Array3d<T>::const_reverse_col_range_iterator
4253 Array3d<T>::col_rbegin(
const typename Array3d<T>::size_type slice,
const typename Array3d<T>::size_type col,
4256 assert(col < this->d3_);
4257 assert(range.
start() < (int)this->d2_);
4261 template<
typename T>
4263 typename Array3d<T>::reverse_col_range_iterator
4264 Array3d<T>::col_rend(
const typename Array3d<T>::size_type slice,
const typename Array3d<T>::size_type col,
4267 assert(col < this->d3_);
4268 assert(range.
start() < (int)this->d2_);
4272 template<
typename T>
4274 typename Array3d<T>::const_reverse_col_range_iterator
4275 Array3d<T>::col_rend(
const typename Array3d<T>::size_type slice,
const typename Array3d<T>::size_type col,
4278 assert(col < this->d3_);
4279 assert(range.
start() < (int)this->d2_);
4285 template<
typename T>
4287 typename Array3d<T>::iterator
4290 return this->data_[slice][0];
4293 template<
typename T>
4295 typename Array3d<T>::const_iterator
4298 return this->data_[slice][0];
4301 template<
typename T>
4303 typename Array3d<T>::iterator
4306 return this->data_[slice][0] + this->slice_size_;
4309 template<
typename T>
4311 typename Array3d<T>::const_iterator
4314 return this->data_[slice][0] + this->slice_size_;
4317 template<
typename T>
4319 typename Array3d<T>::reverse_iterator
4325 template<
typename T>
4327 typename Array3d<T>::const_reverse_iterator
4333 template<
typename T>
4335 typename Array3d<T>::reverse_iterator
4341 template<
typename T>
4343 typename Array3d<T>::const_reverse_iterator
4349 #ifdef ALL_PLANE_ITERATOR3D
4353 template<
typename T>
4355 typename Array3d<T>::iterator1d
4356 Array3d<T>::plane_row_begin(
PLANE_ORIENTATION P,
const typename Array3d<T>::size_type plane_coordinate,
4357 const typename Array3d<T>::size_type row)
4360 return typename Array3d<T>::iterator1d (this->data_[plane_coordinate][row],1);
4362 return typename Array3d<T>::iterator1d (this->data_[row][plane_coordinate],1);
4363 return typename Array3d<T>::iterator1d (this->data_[row][0] + plane_coordinate,this->d3_);
4366 template<
typename T>
4368 typename Array3d<T>::const_iterator1d
4369 Array3d<T>::plane_row_begin(
PLANE_ORIENTATION P,
const typename Array3d<T>::size_type plane_coordinate,
4370 const typename Array3d<T>::size_type row)
const
4373 return typename Array3d<T>::const_iterator1d (this->data_[plane_coordinate][row],1);
4375 return typename Array3d<T>::const_iterator1d (this->data_[row][plane_coordinate],1);
4376 return typename Array3d<T>::const_iterator1d (this->data_[row][0] + plane_coordinate,this->d3_);
4379 template<
typename T>
4381 typename Array3d<T>::iterator1d
4382 Array3d<T>::plane_row_end(
PLANE_ORIENTATION P,
const typename Array3d<T>::size_type plane_coordinate,
4383 const typename Array3d<T>::size_type row)
4386 return this->plane_row_begin(P,plane_coordinate,row) + this->d2_;
4387 return this->plane_row_begin(P,plane_coordinate,row) + this->d3_;
4390 template<
typename T>
4392 typename Array3d<T>::const_iterator1d
4393 Array3d<T>::plane_row_end(
PLANE_ORIENTATION P,
const typename Array3d<T>::size_type plane_coordinate,
4394 const typename Array3d<T>::size_type row)
const
4397 return this->plane_row_begin(P,plane_coordinate,row) + this->d2_;
4398 return this->plane_row_begin(P,plane_coordinate,row) + this->d3_;
4401 template<
typename T>
4403 typename Array3d<T>::reverse_iterator1d
4404 Array3d<T>::plane_row_rbegin(
PLANE_ORIENTATION P,
const typename Array3d<T>::size_type plane_coordinate,
4405 const typename Array3d<T>::size_type row)
4407 return typename Array3d<T>::reverse_iterator1d(this->plane_row_end(P,plane_coordinate,row));
4410 template<
typename T>
4412 typename Array3d<T>::const_reverse_iterator1d
4413 Array3d<T>::plane_row_rbegin(
PLANE_ORIENTATION P,
const typename Array3d<T>::size_type plane_coordinate,
4414 const typename Array3d<T>::size_type row)
const
4416 return typename Array3d<T>::const_reverse_iterator1d(this->plane_row_end(P,plane_coordinate,row));
4419 template<
typename T>
4421 typename Array3d<T>::reverse_iterator1d
4422 Array3d<T>::plane_row_rend(
PLANE_ORIENTATION P,
const typename Array3d<T>::size_type plane_coordinate,
4423 const typename Array3d<T>::size_type row)
4425 return typename Array3d<T>::reverse_iterator1d(this->plane_row_begin(P,plane_coordinate,row));
4428 template<
typename T>
4430 typename Array3d<T>::const_reverse_iterator1d
4431 Array3d<T>::plane_row_rend(
PLANE_ORIENTATION P,
const typename Array3d<T>::size_type plane_coordinate,
4432 const typename Array3d<T>::size_type row)
const
4434 return typename Array3d<T>::const_reverse_iterator1d(this->plane_row_begin(P,plane_coordinate,row));
4437 template<
typename T>
4439 typename Array3d<T>::iterator1d
4440 Array3d<T>::plane_col_begin(
PLANE_ORIENTATION P,
const typename Array3d<T>::size_type plane_coordinate,
4441 const typename Array3d<T>::size_type col)
4444 return typename Array3d<T>::iterator1d (this->data_[plane_coordinate][0] + col,this->d3_);
4446 return typename Array3d<T>::iterator1d (this->data_[0][plane_coordinate] + col,this->d2_ * this->d3_);
4447 return typename Array3d<T>::iterator1d (this->data_[0][col] + plane_coordinate,this->d2_ * this->d3_);
4450 template<
typename T>
4452 typename Array3d<T>::const_iterator1d
4453 Array3d<T>::plane_col_begin(
PLANE_ORIENTATION P,
const typename Array3d<T>::size_type plane_coordinate,
4454 const typename Array3d<T>::size_type col)
const
4458 return typename Array3d<T>::const_iterator1d (this->data_[plane_coordinate][0] + col,this->d3_);
4460 return typename Array3d<T>::const_iterator1d (this->data_[0][plane_coordinate] + col,this->d2_ * this->d3_);
4461 return typename Array3d<T>::const_iterator1d (this->data_[0][col] + plane_coordinate,this->d2_ * this->d3_);
4464 template<
typename T>
4466 typename Array3d<T>::iterator1d
4467 Array3d<T>::plane_col_end(
PLANE_ORIENTATION P,
const typename Array3d<T>::size_type plane_coordinate,
4468 const typename Array3d<T>::size_type col)
4471 return this->Array3d::plane_col_begin(P,plane_coordinate,col) + this->d2_;
4472 return this->Array3d::plane_col_begin(P,plane_coordinate,col) + this->d1_;
4475 template<
typename T>
4477 typename Array3d<T>::const_iterator1d
4478 Array3d<T>::plane_col_end(
PLANE_ORIENTATION P,
const typename Array3d<T>::size_type plane_coordinate,
4479 const typename Array3d<T>::size_type col)
const
4482 return this->Array3d::plane_col_begin(P,plane_coordinate,col) + this->d2_;
4483 return this->Array3d::plane_col_begin(P,plane_coordinate,col) + this->d1_;
4486 template<
typename T>
4488 typename Array3d<T>::reverse_iterator1d
4489 Array3d<T>::plane_col_rbegin(
PLANE_ORIENTATION P,
const typename Array3d<T>::size_type plane_coordinate,
4490 const typename Array3d<T>::size_type col)
4492 return typename Array3d<T>::reverse_iterator1d(this->plane_col_end(P,plane_coordinate,col));
4495 template<
typename T>
4497 typename Array3d<T>::const_reverse_iterator1d
4498 Array3d<T>::plane_col_rbegin(
PLANE_ORIENTATION P,
const typename Array3d<T>::size_type plane_coordinate,
4499 const typename Array3d<T>::size_type col)
const
4501 return typename Array3d<T>::const_reverse_iterator1d(this->plane_col_end(P,plane_coordinate,col));
4504 template<
typename T>
4506 typename Array3d<T>::reverse_iterator1d
4507 Array3d<T>::plane_col_rend(
PLANE_ORIENTATION P,
const typename Array3d<T>::size_type plane_coordinate,
4508 const typename Array3d<T>::size_type col)
4510 return typename Array3d<T>::reverse_iterator1d(this->plane_col_begin(P,plane_coordinate,col));
4513 template<
typename T>
4515 typename Array3d<T>::const_reverse_iterator1d
4516 Array3d<T>::plane_col_rend(
PLANE_ORIENTATION P,
const typename Array3d<T>::size_type plane_coordinate,
4517 const typename Array3d<T>::size_type col)
const
4519 return typename Array3d<T>::const_reverse_iterator1d(this->plane_col_begin(P,plane_coordinate,col));
4524 template<
typename T>
4526 typename Array3d<T>::const_iterator1d
4527 Array3d<T>::plane_row_begin(
PLANE_ORIENTATION P,
const typename Array3d<T>::size_type plane_coordinate,
4528 const size_type row,
const Box2d<int> & b)
const
4531 return typename Array3d<T>::const_iterator1d (this->data_[plane_coordinate][b.upper_left()[0] + row] + b.upper_left()[1],1);
4533 return typename Array3d<T>::const_iterator1d (this->data_[b.upper_left()[0] + row][plane_coordinate] + b.upper_left()[1],1);
4534 return typename Array3d<T>::const_iterator1d (this->data_[b.upper_left()[0] + row][b.upper_left()[1]] + plane_coordinate,this->d3_);
4537 template<
typename T>
4539 typename Array3d<T>::iterator1d
4540 Array3d<T>::plane_row_begin(
PLANE_ORIENTATION P,
const typename Array3d<T>::size_type plane_coordinate,
4541 const size_type row,
const Box2d<int> & b)
4544 return typename Array3d<T>::iterator1d (this->data_[plane_coordinate][b.upper_left()[0] + row] + b.upper_left()[1],1);
4546 return typename Array3d<T>::iterator1d (this->data_[b.upper_left()[0] + row][plane_coordinate] + b.upper_left()[1],1);
4547 return typename Array3d<T>::iterator1d (this->data_[b.upper_left()[0] + row][b.upper_left()[1]] + plane_coordinate,this->d3_);
4550 template<
typename T>
4552 typename Array3d<T>::iterator1d
4553 Array3d<T>:: plane_row_end(
PLANE_ORIENTATION P,
const typename Array3d<T>::size_type plane_coordinate,
4554 const size_type row,
const Box2d<int> & b)
4556 return this->plane_row_begin(P,plane_coordinate,row,b) + b.width();
4559 template<
typename T>
4561 typename Array3d<T>::const_iterator1d
4562 Array3d<T>::plane_row_end(
PLANE_ORIENTATION P,
const typename Array3d<T>::size_type plane_coordinate,
4563 const size_type row,
const Box2d<int> & b)
const
4565 return this->plane_row_begin(P,plane_coordinate,row,b) + b.width();
4568 template<
typename T>
4570 typename Array3d<T>::reverse_iterator1d
4571 Array3d<T>::plane_row_rbegin(
PLANE_ORIENTATION P,
const typename Array3d<T>::size_type plane_coordinate,
4572 const size_type row,
const Box2d<int> & b)
4574 return typename Array3d<T>::reverse_iterator1d(this->plane_row_end(P,plane_coordinate,row,b));
4577 template<
typename T>
4579 typename Array3d<T>::const_reverse_iterator1d
4580 Array3d<T>::plane_row_rbegin(
PLANE_ORIENTATION P,
const typename Array3d<T>::size_type plane_coordinate,
4581 const size_type row,
const Box2d<int> & b)
const
4583 return typename Array3d<T>::const_reverse_iterator1d(this->plane_row_end(P,plane_coordinate,row,b));
4586 template<
typename T>
4588 typename Array3d<T>::reverse_iterator1d
4589 Array3d<T>::plane_row_rend(
PLANE_ORIENTATION P,
const typename Array3d<T>::size_type plane_coordinate,
4590 const size_type row,
const Box2d<int> & b)
4592 return typename Array3d<T>::reverse_iterator1d(this->plane_row_begin(P,plane_coordinate,row,b));
4595 template<
typename T>
4597 typename Array3d<T>::const_reverse_iterator1d
4598 Array3d<T>::plane_row_rend(
PLANE_ORIENTATION P,
const typename Array3d<T>::size_type plane_coordinate,
4599 const size_type row,
const Box2d<int> & b)
const
4601 return typename Array3d<T>::const_reverse_iterator1d(this->plane_row_begin(P,plane_coordinate,row,b));
4604 template<
typename T>
4606 typename Array3d<T>::iterator1d
4607 Array3d<T>::plane_col_begin(
PLANE_ORIENTATION P,
const typename Array3d<T>::size_type plane_coordinate,
4608 const size_type col,
const Box2d<int> & b)
4611 return typename Array3d<T>::iterator1d (this->data_[plane_coordinate][b.upper_left()[0]] + b.upper_left()[1] + col,this->d3_);
4613 return typename Array3d<T>::iterator1d (this->data_[b.upper_left()[0]][plane_coordinate] + b.upper_left()[1] + col,this->d2_ * this->d3_);
4614 return typename Array3d<T>::iterator1d (this->data_[b.upper_left()[0]][b.upper_left()[1] + col] + plane_coordinate,this->d2_ * this->d3_);
4617 template<
typename T>
4619 typename Array3d<T>::const_iterator1d
4620 Array3d<T>::plane_col_begin(
PLANE_ORIENTATION P,
const typename Array3d<T>::size_type plane_coordinate,
4621 const size_type col,
const Box2d<int> & b)
const
4624 return typename Array3d<T>::const_iterator1d (this->data_[plane_coordinate][b.upper_left()[0]] + b.upper_left()[1] + col,this->d3_);
4626 return typename Array3d<T>::const_iterator1d (this->data_[b.upper_left()[0]][plane_coordinate] + b.upper_left()[1] + col,this->d2_ * this->d3_);
4627 return typename Array3d<T>::const_iterator1d (this->data_[b.upper_left()[0]][b.upper_left()[1] + col] + plane_coordinate,this->d2_ * this->d3_);
4630 template<
typename T>
4632 typename Array3d<T>::iterator1d
4633 Array3d<T>::plane_col_end(
PLANE_ORIENTATION P,
const typename Array3d<T>::size_type plane_coordinate,
4634 const size_type col,
const Box2d<int> & b)
4636 return this->Array3d::plane_col_begin(P,plane_coordinate,col,b) + b.height();
4639 template<
typename T>
4641 typename Array3d<T>::const_iterator1d
4642 Array3d<T>::plane_col_end(
PLANE_ORIENTATION P,
const typename Array3d<T>::size_type plane_coordinate,
4643 const size_type col,
const Box2d<int> & b)
const
4645 return this->Array3d::plane_col_begin(P,plane_coordinate,col,b) + b.height();
4648 template<
typename T>
4650 typename Array3d<T>::reverse_iterator1d
4651 Array3d<T>::plane_col_rbegin(
PLANE_ORIENTATION P,
const typename Array3d<T>::size_type plane_coordinate,
4652 const size_type col,
const Box2d<int> & b)
4654 return typename Array3d<T>::reverse_iterator1d(this->plane_col_end(P,plane_coordinate,col,b));
4657 template<
typename T>
4659 typename Array3d<T>::const_reverse_iterator1d
4660 Array3d<T>::plane_col_rbegin(
PLANE_ORIENTATION P,
const typename Array3d<T>::size_type plane_coordinate,
4661 const size_type col,
const Box2d<int> & b)
const
4663 return typename Array3d<T>::const_reverse_iterator1d(this->plane_col_end(P,plane_coordinate,col,b));
4666 template<
typename T>
4668 typename Array3d<T>::reverse_iterator1d
4669 Array3d<T>::plane_col_rend(
PLANE_ORIENTATION P,
const typename Array3d<T>::size_type plane_coordinate,
4670 const size_type col,
const Box2d<int> & b)
4672 return typename Array3d<T>::reverse_iterator1d(this->plane_col_begin(P,plane_coordinate,col,b));
4675 template<
typename T>
4677 typename Array3d<T>::const_reverse_iterator1d
4678 Array3d<T>::plane_col_rend(
PLANE_ORIENTATION P,
const typename Array3d<T>::size_type plane_coordinate,
4679 const size_type col,
const Box2d<int> & b)
const
4681 return typename Array3d<T>::const_reverse_iterator1d(this->plane_col_begin(P,plane_coordinate,col,b));
4684 #endif //ALL_PLANE_ITERATOR3D
4690 template<
typename T>
4692 typename Array3d<T>::iterator2d
4697 Box3d<int> b(plane_coordinate,0,0,plane_coordinate,this->d2_-1,this->d3_-1);
4702 Box3d<int> b(0,plane_coordinate,0,this->d1_-1,plane_coordinate,this->d3_-1);
4705 Box3d<int> b(0,0,plane_coordinate,this->d1_-1,this->d2_-1,plane_coordinate);
4709 template<
typename T>
4711 typename Array3d<T>::iterator2d
4714 typename Array3d<T>::iterator2d it = this->plane_upper_left(P,plane_coordinate);
4717 DPoint2d<int> dp(this->d2_,this->d3_);
4722 DPoint2d<int> dp(this->d1_,this->d3_);
4725 DPoint2d<int> dp(this->d1_,this->d2_);
4729 template<
typename T>
4731 typename Array3d<T>::const_iterator2d
4736 Box3d<int> b(plane_coordinate,0,0,plane_coordinate,this->d2_-1,this->d3_-1);
4741 Box3d<int> b(0,plane_coordinate,0,this->d1_-1,plane_coordinate,this->d3_-1);
4744 Box3d<int> b(0,0,plane_coordinate,this->d1_-1,this->d2_-1,plane_coordinate);
4748 template<
typename T>
4750 typename Array3d<T>::const_iterator2d
4753 typename Array3d<T>::const_iterator2d it = this->plane_upper_left(P,plane_coordinate);
4756 DPoint2d<int> dp(this->d2_,this->d3_);
4761 DPoint2d<int> dp(this->d1_,this->d3_);
4764 DPoint2d<int> dp(this->d1_,this->d2_);
4768 template<
typename T>
4770 typename Array3d<T>::reverse_iterator2d
4773 DPoint2d<int> dp(1,0);
4777 template<
typename T>
4779 typename Array3d<T>::reverse_iterator2d
4785 template<
typename T>
4787 typename Array3d<T>::const_reverse_iterator2d
4790 DPoint2d<int> dp(1,0);
4794 template<
typename T>
4796 typename Array3d<T>::const_reverse_iterator2d
4804 template<
typename T>
4806 typename Array3d<T>::iterator2d
4812 template<
typename T>
4814 typename Array3d<T>::iterator2d
4817 DPoint2d<int> dp(b.height(),b.width());
4818 typename Array3d<T>::iterator2d it = this->plane_upper_left(P,plane_coordinate,b);
4822 template<
typename T>
4824 typename Array3d<T>::const_iterator2d
4830 template<
typename T>
4832 typename Array3d<T>::const_iterator2d
4835 DPoint2d<int> dp(b.height(),b.width());
4836 typename Array3d<T>::const_iterator2d it = this->plane_upper_left(P,plane_coordinate,b);
4840 template<
typename T>
4842 typename Array3d<T>::reverse_iterator2d
4845 DPoint2d<int> dp(1,0);
4849 template<
typename T>
4851 typename Array3d<T>::reverse_iterator2d
4857 template<
typename T>
4859 typename Array3d<T>::const_reverse_iterator2d
4862 DPoint2d<int> dp(1,0);
4866 template<
typename T>
4868 typename Array3d<T>::const_reverse_iterator2d
4880 template<
typename T>
4887 template<
typename T>
4895 template<
typename T>
4904 template<
typename T>
4913 template<
typename T>
4921 template<
typename T>
4929 template<
typename T>
4938 template<
typename T>
4949 template<
typename T>
4956 template<
typename T>
4964 template<
typename T>
4974 template<
typename T>
4984 template<
typename T>
4992 template<
typename T>
5000 template<
typename T>
5009 template<
typename T>
5020 template<
typename T>
5029 template<
typename T>
5040 template<
typename T>
5050 template<
typename T>
5060 template<
typename T>
5070 template<
typename T>
5080 template<
typename T>
5089 template<
typename T>
5107 template <
typename T>
5109 std::ostream& operator<<(std::ostream & out, const Array3d<T>& a)
5111 for(std::size_t i = 0; i < a.d1_; ++i)
5113 for(std::size_t j = 0; j < a.d2_; ++j)
5115 for(std::size_t k = 0; k < a.d3_; ++k)
5117 out<<a.data_[i][j][k]<<
" ";
5133 template<
typename T>
5137 assert(this->data_ != 0);
5138 assert(k < this->d1_);
5139 return this->data_[k];
5142 template<
typename T>
5146 assert(this->data_ != 0);
5147 assert(k < this->d1_);
5148 return this->data_[k];
5153 template<
typename T>
5155 typename Array3d<T>::reference
5157 const typename Array3d<T>::size_type i,
5158 const typename Array3d<T>::size_type j)
5160 assert(this->data_ != 0);
5161 assert(k < this->d1_);
5162 assert(i < this->d2_);
5163 assert(j < this->d3_);
5164 return this->data_[k][i][j];
5167 template<
typename T>
5169 typename Array3d<T>::const_reference
5171 const typename Array3d<T>::size_type i,
5172 const typename Array3d<T>::size_type j)
const
5174 assert(this->data_ != 0);
5175 assert(k < this->d1_);
5176 assert(i < this->d2_);
5177 assert(j < this->d3_);
5178 return this->data_[k][i][j];
5182 template<
typename T>
5188 template<
typename T>
5193 template<
typename T>
5198 template<
typename T>
5203 template<
typename T>
5208 template<
typename T>
5213 template<
typename T>
5218 template<
typename T>
5224 template<
typename T>
5229 template<
typename T>
5237 template<
typename T>
5243 template<
typename T>
5247 template<
typename T>
5251 assert(this->d1_ == M.d1_);
5252 assert(this->d2_ == M.d2_);
5253 assert(this->d3_ == M.d3_);
5254 std::swap_ranges(this->begin(),this->end(),M.
begin());
5263 template<
typename T>
5272 template<
typename T>
5282 template<
typename T>
5284 bool operator<(const Array3d<T>& x,
5287 return std::lexicographical_compare(x.begin(), x.end(),
5288 y.begin(), y.end());
5292 template<
typename T>
5300 template<
typename T>
5302 bool operator<=(const Array3d<T>& x,
5308 template<
typename T>
5324 template<
typename T>
5326 void Array3d<T>::allocate()
5328 if( this->d1_ != 0 && this->d2_ != 0 && this->d3_ != 0)
5330 this->data_ =
new T**[this->d1_];
5331 this->data_[0] =
new T*[this->d1_ * this->d2_];
5332 this->data_[0][0] =
new T[this->d1_ * this->d2_ * this->d3_];
5334 for(std::size_t j = 1; j < this->d2_; ++j)
5336 this->data_[0][j] = this->data_[0][j-1] + this->d3_;
5338 for(std::size_t i = 1; i < this->d1_; ++i)
5340 this->data_[i] = this->data_[i-1] + this->d2_;
5341 this->data_[i][0] = this->data_[i-1][0] + this->d2_*this->d3_;
5342 for(std::size_t j = 1; j < this->d2_; ++j)
5344 this->data_[i][j] = this->data_[i][j-1] + this->d3_;
5354 template<
typename T>
5356 void Array3d<T>::desallocate()
5358 if(this->data_ != 0)
5360 delete[] (this->data_[0][0]);
5361 delete[] (this->data_[0]);
5362 delete[] (this->data_);
5366 template<
typename T>
5368 void Array3d<T>::copy_attributes(
const Array3d<T>& rhs)
5370 this->d1_ = rhs.d1_;
5371 this->d2_ = rhs.d2_;
5372 this->d3_ = rhs.d3_;
5373 this->size_ = rhs.size_;
5374 this->slice_size_ = rhs.slice_size_;
5382 #endif //SLIP_ARRAY3D_HH
size_type max_size() const
Returns the maximal size (number of elements) in the Array3d.
slip::stride_iterator< const_col_iterator > const_col_range_iterator
value_type const & const_reference
bool operator!=(const Array< T > &x, const Array< T > &y)
const Array3d< T > const_self
std::size_t iterations() const
Rerturns the number of iterations of the range.
void fill(const T *value)
Fills the container range [begin(),begin()+size()) with a copy of the value array.
This is some iterator to iterate a 3d container into a plane area defined by the subscripts of the 3d...
iterator2d plane_bottom_right(PLANE_ORIENTATION P, const size_type plane_coordinate)
Returns a read/write iterator that points to the last element of the plane in the Array3d...
Provides a class to modelize 3d points.
CoordType width() const
compute the width of the Box3d.
iterator3d front_upper_left()
Returns a read/write iterator3d that points to the first element of the Array3d. It points to the fro...
std::reverse_iterator< slice_iterator > reverse_slice_iterator
Difference of Point3D class, specialization of DPoint<CoordType,DIM> with DIM = 3.
slice_iterator slice_end(const size_type row, const size_type col)
Returns a read/write iterator that points to the one past the end element of the line (row...
reverse_iterator3d rback_bottom_right()
Returns a read/write reverse iterator3d. It points to past the front upper left element of the Array3...
size_type dim1() const
Returns the number of slices (first dimension size) in the Array3d.
This is some iterator to iterate a 3d container into two Range defined by the indices and strides of ...
This is a three-dimensional dynamic and generic container. This container statisfies the Bidirectionn...
std::reverse_iterator< const_iterator2d > const_reverse_iterator2d
const_iterator begin() const
Returns a read-only (constant) iterator that points to the first element in the Array3d. Iteration is done in ordinary element order.
std::reverse_iterator< const_slice_iterator > const_reverse_slice_iterator
size_type columns() const
Returns the number of columns (third dimension size) in the Array3d.
std::reverse_iterator< const_slice_range_iterator > const_reverse_slice_range_iterator
slip::Array3d< unsigned char > Array3d_uc
unsigned char alias
self & operator=(const Array3d< T > &rhs)
Assign a Array3d.
std::reverse_iterator< const_col_iterator > const_reverse_col_iterator
std::reverse_iterator< const_iterator3d > const_reverse_iterator3d
slip::Array3d< float > Array3d_f
float alias
T ** operator[](const size_type k)
slip::iterator3d_plane< self > iterator2d
Provides a class to modelize the difference of slip::Point3d.
size_type cols() const
Returns the number of columns (third dimension size) in the Array3d.
size_type slices() const
Returns the number of slices (first dimension size) in the Array3d.
iterator3d default_iterator
slip::const_iterator3d_range< const_self > const_iterator3d_range
std::reverse_iterator< iterator3d > reverse_iterator3d
std::reverse_iterator< iterator > reverse_iterator
row_iterator row_begin(const size_type slice, const size_type row)
Returns a read/write iterator that points to the first element of the row row of the slice slice in t...
slip::stride_iterator< const_pointer > const_col_iterator
slip::stride_iterator< slice_iterator > slice_range_iterator
row_iterator row_end(const size_type slice, const size_type row)
Returns a read/write iterator that points to the past-the-end element of the row row of the slice sli...
stride_iterator< pointer > slice_iterator
reverse_row_iterator row_rbegin(const size_type slice, const size_type row)
Returns a read/write reverse iterator that points to the last element of the row row of the slice sli...
reverse_slice_iterator slice_rbegin(const size_type row, const size_type col)
Returns a read/write iterator that points to the last element of the line (row,col) threw the slices ...
stride_iterator< const_pointer > const_slice_iterator
PLANE_ORIENTATION
Choose between different plane orientations.
reverse_iterator plane_rbegin(const size_type slice)
Returns a read/write reverse iterator that points to the last element in the slice plane of the Array...
bool operator>(const Array< T > &x, const Array< T > &y)
Provides a class to manipulate iterator3d within a slip::Range. It is used to iterate throw 3d contai...
const_iterator3d const_default_iterator
slip::Array3d< char > Array3d_c
char alias
slip::Array3d< double > Array3d_d
double alias
std::string name() const
Returns the name of the class.
std::reverse_iterator< col_iterator > reverse_col_iterator
slip::stride_iterator< pointer > row_range_iterator
size_type rows() const
Returns the number of rows (second dimension size) in the Array3d.
std::reverse_iterator< row_range_iterator > reverse_row_range_iterator
iterator end()
Returns a read/write iterator that points one past the last element in the Array3d. Iteration is done in ordinary element order.
reverse_iterator2d plane_rupper_left(PLANE_ORIENTATION P, const size_type plane_coordinate)
Returns a read/write reverse_iterator that points to the bottom right element of the plane in the Arr...
std::reverse_iterator< slice_range_iterator > reverse_slice_range_iterator
std::reverse_iterator< const_row_range_iterator > const_reverse_row_range_iterator
reverse_iterator3d rfront_upper_left()
Returns a read/write reverse iterator3d. It points to the back bottom right element of the Array3d...
slip::Array3d< short > Array3d_s
short alias
void swap(Array3d &M)
Swaps data with another Array3d.
size_type dim2() const
Returns the number of rows (second dimension size) in the Array3d.
std::reverse_iterator< col_range_iterator > reverse_col_range_iterator
Array3d()
Constructs a Array3d.
slip::iterator3d_range< self > iterator3d_range
std::reverse_iterator< iterator2d > reverse_iterator2d
Provides a class to manipulate 3d box.
reverse_slice_iterator slice_rend(const size_type row, const size_type col)
Returns a read/write iterator that points to the one before the first element of the line (row...
~Array3d()
Destructor of the Array3d.
std::reverse_iterator< const_iterator > const_reverse_row_iterator
ptrdiff_t difference_type
void copy(_II first, _II last, _OI output_first)
Copy algorithm optimized for slip iterators.
bool is_valid() const
Returns true if the range is valid :
SubType start() const
Accessor of the start subscript of the Range.
Provides a class to manipulate iterator2d within a slip::Box3d. It is used to iterate throw 3d contai...
size_type slice_size() const
Returns the number of elements in a slice of the Array3d.
slip::Array3d< unsigned long > Array3d_ul
unsigned long alias
col_iterator col_end(const size_type slice, const size_type col)
Returns a read/write iterator that points to the past-the-end element of the column column of the sli...
slip::stride_iterator< pointer > col_iterator
reverse_iterator rend()
Returns a read/write reverse iterator that points to one before the first element in the Array3d...
slip::Array3d< long > Array3d_l
long alias
reverse_col_iterator col_rbegin(const size_type slice, const size_type col)
Returns a read/write reverse iterator that points to the last element of the column column of the sli...
static const std::size_t DIM
reverse_iterator2d plane_rbottom_right(PLANE_ORIENTATION P, const size_type plane_coordinate)
Returns a read/write reverse_iterator that points to the upper left element of the plane in the Array...
value_type const * const_pointer
slip::iterator3d_box< self > iterator3d
std::reverse_iterator< const_col_range_iterator > const_reverse_col_range_iterator
CoordType depth() const
compute the depth of the Box3d.
slip::Array3d< unsigned int > Array3d_ui
unsigned int alias
Provides a class to iterate 3d containers throw a planes.
slip::Array3d< int > Array3d_i
int alias
This is some iterator to iterate a 3d container into a Box area defined by the subscripts of the 3d c...
col_iterator col_begin(const size_type slice, const size_type col)
Returns a read/write iterator that points to the first element of the column column of the slice slic...
reverse_iterator rbegin()
Returns a read/write reverse iterator that points to the last element in the Array3d. Iteration is done in reverse element order.
slip::stride_iterator< const_pointer > const_row_range_iterator
iterator plane_end(const size_type slice)
Returns a read/write iterator that points one past the last element in the slice plane of the Array3d...
iterator2d plane_upper_left(PLANE_ORIENTATION P, const size_type plane_coordinate)
Returns a read/write iterator that points to the first element of the plane in the Array3d...
std::ostream & operator<<(std::ostream &out, const Array< T > &a)
std::reverse_iterator< iterator3d_range > reverse_iterator3d_range
iterator3d back_bottom_right()
Returns a read/write iterator3d that points to the past the end element of the Array3d. It points to past the end element of the back bottom right element of the Array3d.
size_type dim3() const
Returns the number of columns (third dimension size) in the Array3d.
void fill(InputIterator first, InputIterator last)
Fills the container range [begin(),begin()+size()) with a copy of the range [first,last)
reverse_iterator plane_rend(const size_type slice)
Returns a read/write reverse iterator that points to one before the first element in the slice plane ...
std::reverse_iterator< iterator > reverse_row_iterator
Array3d(const size_type d1, const size_type d2, const size_type d3, InputIterator first, InputIterator last)
Contructs a Array3d from a range.
This is some iterator to iterate a 3d container into two Range defined by the indices and strides of ...
slice_iterator slice_begin(const size_type row, const size_type col)
Returns a read/write iterator that points to the first element of the line (row,col) threw the slices...
reference operator()(const size_type k, const size_type i, const size_type j)
Subscript access to the data contained in the Array3d.
slip::const_iterator3d_plane< const_self > const_iterator2d
reverse_row_iterator row_rend(const size_type slice, const size_type row)
Returns a read/write reverse iterator that points to the first element of the row row of the slice sl...
int stride() const
Accessor of the stride of the Range.
void resize(std::size_t d1, std::size_t d2, std::size_t d3, const T &val=T())
Resizes a Array3d.
const_pointer const_row_iterator
This is some iterator to iterate a 3d container into a plane area defined by the subscripts of the 3d...
size_type size() const
Returns the number of elements in the Array3d.
slip::stride_iterator< col_iterator > col_range_iterator
bool empty() const
Returns true if the Array3d is empty. (Thus size() == 0)
Provides a class to iterate a 1d range according to a step.
slip::const_iterator3d_box< const_self > const_iterator3d
friend class boost::serialization::access
slip::stride_iterator< const_slice_iterator > const_slice_range_iterator
bool operator==(const Array< T > &x, const Array< T > &y)
slip::Array3d< unsigned short > Array3d_us
unsigned long alias
reverse_col_iterator col_rend(const size_type slice, const size_type col)
Returns a read/write reverse iterator that points to the first element of the column column of the sl...
iterator plane_begin(const size_type slice)
Returns a read/write iterator that points to the first element in the in the slice plane of the Array...
std::reverse_iterator< const_iterator > const_reverse_iterator
CoordType height() const
compute the height of the Box3d.
value_type const * const_iterator
SubType stop() const
Accessor of the stop subscript of the Range.
void fill(const T &value)
Fills the container range [begin(),begin()+size()) with copies of value.
bool operator>=(const Array< T > &x, const Array< T > &y)
std::reverse_iterator< const_iterator3d_range > const_reverse_iterator3d_range
This is some iterator to iterate a 3d container into a Box area defined by the subscripts of the 3d c...