39 template <
class T,
int N>
125 template <
class T,
int N>
128 return data_ptr_[cord_to_indx(pos)];
130 template <
class T,
int N>
133 return data_ptr_[cord_to_indx(pos)];
137 template <
class T,
int N>
140 if(!(pos < elm_count_))
141 throw std::out_of_range(
"posistion out of range");
142 return data_ptr_[pos];
145 template <
class T,
int N>
148 if(!(pos < elm_count_))
149 throw std::out_of_range(
"posistion out of range");
150 return data_ptr_[pos];
154 template <
class T,
int N>
156 dims_(dims),cum_dims_(0)
163 for(
int j = 0; j<
rank_;++j)
168 unsigned int tmp_prod = 1;
169 for(
int k = 0;k<(j);++k)
184 template <
class T,
int N>
190 template <
class T,
int N>
195 for(
int j = 0; j<rank_;++j)
199 if (tmp>dims_ptr_[j])
200 throw std::out_of_range(
"cord out of dimensions");
201 indx +=tmp*cum_dims_ptr_[j];
206 template <
class T,
int N>
209 if(!(indx<elm_count_))
210 throw std::out_of_range(
"Index out of range");
213 for(
int j = 0;j<N;++j)
214 cord[j] = (indx/cum_dims_ptr_[j])%dims_ptr_[j];
220 template <
class T,
int N>
223 int max = dims_.prod();
224 for(
int j= 0; j<max;++j)
230 template <
class T,
int N>
239 cout<<
"plane "<<plane<<endl;
240 int offset = cord_to_indx(plane);
241 for(
int j = 0;j<dims_[0];++j)
243 for(
int k = 0;k<dims_[1];++k)
245 cout<<data_ptr_[offset + j + cum_dims_[1]*k]<<
'\t';
252 while(increment_cord(plane));
257 template <
class T,
int N>
261 for(
int j = rank_-1;j>1;--j)
263 if(cord[j]+1 < dims_ptr_[j])