21 #ifndef SELDON_FILE_ARRAY_INLINE_CXX
33 template <
class T,
int N,
class Allocator>
49 template <
class T,
int N,
class Allocator>
52 return length_[dimension];
62 template <
class T,
int N,
class Allocator>
65 return offset_[N - 1];
76 template <
class T,
int N,
class Allocator>
79 return offset_[N - 1];
89 template <
class T,
int N,
class Allocator>
110 template <
class T,
int N,
class Allocator>
111 inline typename Array<T, N, Allocator>::reference
114 #ifdef SELDON_CHECK_BOUNDS
116 throw WrongDim(
"Array<T, N, Allocator>::operator(int, ...)",
117 "Array dimension should be 3.");
119 CheckBounds(i, j, k, length_[0], length_[1], length_[2],
"Array");
122 return data_[i * offset_[0] + j * offset_[1] + k];
134 template <
class T,
int N,
class Allocator>
135 inline typename Array<T, N, Allocator>::const_reference
138 #ifdef SELDON_CHECK_BOUNDS
140 throw WrongDim(
"Array<T, N, Allocator>::operator(int, ...)",
141 "Array dimension should be 3.");
143 CheckBounds(i, j, k, length_[0], length_[1], length_[2],
"Array");
146 return data_[i * offset_[0] + j * offset_[1] + k];
159 template <
class T,
int N,
class Allocator>
160 inline typename Array<T, N, Allocator>::reference
163 #ifdef SELDON_CHECK_BOUNDS
165 throw WrongDim(
"Array<T, N, Allocator>::operator(int, ...)",
166 "Array dimension should be 4.");
168 CheckBounds(i, j, k, l, length_[0], length_[1],
169 length_[2], length_[3],
"Array");
172 return data_[i * offset_[0] + j * offset_[1] + k * offset_[2] + l];
185 template <
class T,
int N,
class Allocator>
186 inline typename Array<T, N, Allocator>::const_reference
189 #ifdef SELDON_CHECK_BOUNDS
191 throw WrongDim(
"Array<T, N, Allocator>::operator(int, ...)",
192 "Array dimension should be 4.");
194 CheckBounds(i, j, k, l, length_[0], length_[1],
195 length_[2], length_[3],
"Array");
198 return data_[i * offset_[0] + j * offset_[1] + k * offset_[2] + l];
212 template <
class T,
int N,
class Allocator>
213 inline typename Array<T, N, Allocator>::reference
216 #ifdef SELDON_CHECK_BOUNDS
218 throw WrongDim(
"Array<T, N, Allocator>::operator(int, ...)",
219 "Array dimension should be 5.");
221 CheckBounds(i, j, k, l, m, length_[0], length_[1], length_[2],
222 length_[3], length_[4],
"Array");
225 return data_[i * offset_[0] + j * offset_[1] + k * offset_[2] +
240 template <
class T,
int N,
class Allocator>
241 inline typename Array<T, N, Allocator>::const_reference
244 #ifdef SELDON_CHECK_BOUNDS
246 throw WrongDim(
"Array<T, N, Allocator>::operator(int, ...)",
247 "Array dimension should be 5.");
249 CheckBounds(i, j, k, l, m, length_[0], length_[1], length_[2],
250 length_[3], length_[4],
"Array");
253 return data_[i * offset_[0] + j * offset_[1] + k * offset_[2] +
269 template <
class T,
int N,
class Allocator>
270 inline typename Array<T, N, Allocator>::reference
274 #ifdef SELDON_CHECK_BOUNDS
276 throw WrongDim(
"Array<T, N, Allocator>::operator(int, ...)",
277 "Array dimension should be 6.");
279 CheckBounds(i, j, k, l, m, n, length_[0], length_[1], length_[2],
280 length_[3], length_[4], length_[5],
"Array");
283 return data_[i * offset_[0] + j * offset_[1] + k * offset_[2] +
284 l * offset_[3] + m * offset_[4] + n];
299 template <
class T,
int N,
class Allocator>
300 inline typename Array<T, N, Allocator>::const_reference
304 #ifdef SELDON_CHECK_BOUNDS
306 throw WrongDim(
"Array<T, N, Allocator>::operator(int, ...)",
307 "Array dimension should be 6.");
309 CheckBounds(i, j, k, l, m, n, length_[0], length_[1], length_[2],
310 length_[3], length_[4], length_[5],
"Array");
313 return data_[i * offset_[0] + j * offset_[1] + k * offset_[2] +
314 l * offset_[3] + m * offset_[4] + n];
330 template <
class T,
int N,
class Allocator>
331 inline typename Array<T, N, Allocator>::reference
335 #ifdef SELDON_CHECK_BOUNDS
337 throw WrongDim(
"Array<T, N, Allocator>::operator(int, ...)",
338 "Array dimension should be 7.");
340 CheckBounds(i, j, k, l, m, n, o, length_[0], length_[1], length_[2],
341 length_[3], length_[4], length_[5], length_[6],
"Array");
344 return data_[i * offset_[0] + j * offset_[1] + k * offset_[2] +
345 l * offset_[3] + m * offset_[4] + n * offset_[5] + o];
361 template <
class T,
int N,
class Allocator>
362 inline typename Array<T, N, Allocator>::const_reference
366 #ifdef SELDON_CHECK_BOUNDS
368 throw WrongDim(
"Array<T, N, Allocator>::operator(int, ...)",
369 "Array dimension should be 7.");
371 CheckBounds(i, j, k, l, m, n, o, length_[0], length_[1], length_[2],
372 length_[3], length_[4], length_[5], length_[6],
"Array");
375 return data_[i * offset_[0] + j * offset_[1] + k * offset_[2] +
376 l * offset_[3] + m * offset_[4] + n * offset_[5] + o];
393 template <
class T,
int N,
class Allocator>
394 inline typename Array<T, N, Allocator>::reference
398 #ifdef SELDON_CHECK_BOUNDS
400 throw WrongDim(
"Array<T, N, Allocator>::operator(int, ...)",
401 "Array dimension should be 8.");
403 CheckBounds(i, j, k, l, m, n, o, p, length_[0], length_[1], length_[2],
404 length_[3], length_[4], length_[5], length_[6],
405 length_[7],
"Array");
408 return data_[i * offset_[0] + j * offset_[1] + k * offset_[2] +
409 l * offset_[3] + m * offset_[4] + n * offset_[5] +
427 template <
class T,
int N,
class Allocator>
428 inline typename Array<T, N, Allocator>::const_reference
430 ::operator() (
int i,
int j,
int k,
int l,
int m,
int n,
int o,
int p)
const
432 #ifdef SELDON_CHECK_BOUNDS
434 throw WrongDim(
"Array<T, N, Allocator>::operator(int, ...)",
435 "Array dimension should be 8.");
437 CheckBounds(i, j, k, l, m, n, o, p, length_[0], length_[1], length_[2],
438 length_[3], length_[4], length_[5], length_[6],
439 length_[7],
"Array");
442 return data_[i * offset_[0] + j * offset_[1] + k * offset_[2] +
443 l * offset_[3] + m * offset_[4] + n * offset_[5] +
462 template <
class T,
int N,
class Allocator>
463 inline typename Array<T, N, Allocator>::reference
465 int n,
int o,
int p,
int q)
467 #ifdef SELDON_CHECK_BOUNDS
469 throw WrongDim(
"Array<T, N, Allocator>::operator(int, ...)",
470 "Array dimension should be 9.");
472 CheckBounds(i, j, k, l, m, n, o, p, q, length_[0], length_[1], length_[2],
473 length_[3], length_[4], length_[5], length_[6],
474 length_[7], length_[8],
"Array");
477 return data_[i * offset_[0] + j * offset_[1] + k * offset_[2] +
478 l * offset_[3] + m * offset_[4] + n * offset_[5] +
479 o * offset_[6] + p * offset_[7] + q];
497 template <
class T,
int N,
class Allocator>
498 inline typename Array<T, N, Allocator>::const_reference
500 int n,
int o,
int p,
int q)
const
502 #ifdef SELDON_CHECK_BOUNDS
504 throw WrongDim(
"Array<T, N, Allocator>::operator(int, ...)",
505 "Array dimension should be 9.");
507 CheckBounds(i, j, k, l, m, n, o, p, q, length_[0], length_[1], length_[2],
508 length_[3], length_[4], length_[5], length_[6],
509 length_[7], length_[8],
"Array");
512 return data_[i * offset_[0] + j * offset_[1] + k * offset_[2] +
513 l * offset_[3] + m * offset_[4] + n * offset_[5] +
514 o * offset_[6] + p * offset_[7] + q];
524 template <
class T,
int N,
class Allocator>
535 #define SELDON_FILE_ARRAY_INLINE_CXX