32 #include "NamespaceHeader.H" 37 #define CH_assert(cond) assert(cond) 39 #define D_DECL6(a,b,c,d,e,f) a,b 40 #define D_TERM6(a,b,c,d,e,f) a b 46 const int i3,
const int i4,
const int i5))
49 vec[3] = i3;, vec[4] = i4;, vec[5] = i5;)
89 m_ub[1] - m_lb[1] + 1,
90 m_ub[2] - m_lb[2] + 1,
91 m_ub[3] - m_lb[3] + 1,
92 m_ub[4] - m_lb[4] + 1,
93 m_ub[5] - m_lb[5] + 1));
102 # define D_DEFIV D_DECL6(DimT(iv[Indexer::ixIV(0)]), \ 103 DimT(iv[Indexer::ixIV(1)]), \ 104 DimT(iv[Indexer::ixIV(2)]), \ 105 DimT(iv[Indexer::ixIV(3)]), \ 106 DimT(iv[Indexer::ixIV(4)]), \ 107 DimT(iv[Indexer::ixIV(5)])) 110 # define D_DEFBOX D_DECL6(DimT(box.smallEnd(Indexer::ixIV(0)), \ 111 box.bigEnd(Indexer::ixIV(0))), \ 112 DimT(box.smallEnd(Indexer::ixIV(1)), \ 113 box.bigEnd(Indexer::ixIV(1))), \ 114 DimT(box.smallEnd(Indexer::ixIV(2)), \ 115 box.bigEnd(Indexer::ixIV(2))), \ 116 DimT(box.smallEnd(Indexer::ixIV(3)), \ 117 box.bigEnd(Indexer::ixIV(3))), \ 118 DimT(box.smallEnd(Indexer::ixIV(4)), \ 119 box.bigEnd(Indexer::ixIV(4))), \ 120 DimT(box.smallEnd(Indexer::ixIV(5)), \ 121 box.bigEnd(Indexer::ixIV(5)))) 125 # define D_IXIV D_DECL6(iv[Indexer::ixIV(0)], \ 126 iv[Indexer::ixIV(1)], \ 127 iv[Indexer::ixIV(2)], \ 128 iv[Indexer::ixIV(3)], \ 129 iv[Indexer::ixIV(4)], \ 130 iv[Indexer::ixIV(5)]) 165 : dimB(0), dimE(a_dimE - 1)
170 : dimB(a_dimB), dimE(a_dimE)
188 template <
typename T>
236 template <
typename T>
245 template <
typename C>
static One test(
int C::*);
246 template <
typename C>
static Two test(...);
260 template <typename T, bool IsClass = TypeTr<T>::IsClass>
264 template <
typename T>
269 return new(addr) T[size];
274 template <
typename T>
279 return static_cast<T*
>(addr);
290 template <typename T, bool IsClass = TypeTr<T>::IsClass>
294 template <
typename T>
299 while (size--) p++->~T();
304 template <
typename T>
336 template <
typename T>
350 : m_allocBy(AllocUndefined)
355 T *
const p =
new(std::nothrow) T[size];
357 m_allocBy = AllocNew;
363 m_allocBy = AllocRaw;
394 template <
unsigned Rank,
typename DimT>
412 return (((
USz_t)i) < size/m_ixStride);
425 template <
unsigned Rank>
430 : m_ixStride(0), m_ixIB(0)
433 : m_ixStride(stride), m_ixIB(dim.dimB)
445 return (i >= m_ixIB && i < m_ixIB + (
IIx_t)(size/m_ixStride));
449 return m_ixIB*m_ixStride;
460 template <
typename DimT>
476 return (((
USz_t)i) < size);
510 return (i >= m_ixIB && i < m_ixIB + (
IIx_t)size);
537 template <
unsigned Rank,
typename DimT>
543 : IxData(), m_ixNext()
547 const DimT &dim6,
const DimT &dim5,
const DimT &dim4,
548 const DimT &dim3,
const DimT &dim2,
const DimT &dim1,
550 : IxData(dim5*dim4*dim3*dim2*dim1*dim0, dim6),
551 m_ixNext(offset - IxData::ixDimOffset(),
552 dim5, dim4, dim3, dim2, dim1, dim0)
555 const DimT &dim5,
const DimT &dim4,
const DimT &dim3,
556 const DimT &dim2,
const DimT &dim1,
const DimT &dim0)
557 : IxData(dim4*dim3*dim2*dim1*dim0, dim5),
558 m_ixNext(offset - IxData::ixDimOffset(), dim4, dim3, dim2, dim1, dim0)
561 const DimT &dim4,
const DimT &dim3,
const DimT &dim2,
562 const DimT &dim1,
const DimT &dim0)
563 : IxData(dim3*dim2*dim1*dim0, dim4),
564 m_ixNext(offset - IxData::ixDimOffset(), dim3, dim2, dim1, dim0)
567 const DimT &dim3,
const DimT &dim2,
const DimT &dim1,
569 : IxData(dim2*dim1*dim0, dim3),
570 m_ixNext(offset - IxData::ixDimOffset(), dim2, dim1, dim0)
573 const DimT &dim2,
const DimT &dim1,
const DimT &dim0)
574 : IxData(dim1*dim0, dim2),
575 m_ixNext(offset - IxData::ixDimOffset(), dim1, dim0)
578 const DimT &dim1,
const DimT &dim0)
580 m_ixNext(offset - IxData::ixDimOffset(), dim0)
584 const DimT &dim6,
const DimT &dim5,
const DimT &dim4,
585 const DimT &dim3,
const DimT &dim2,
const DimT &dim1,
588 IxData::m_ixStride = dim5*dim4*dim3*dim2*dim1*dim0;
589 IxData::ixDefineLowerBound(dim6);
590 m_ixNext.ixDefine(offset - IxData::ixDimOffset(),
591 dim5, dim4, dim3, dim2, dim1, dim0);
594 const DimT &dim5,
const DimT &dim4,
const DimT &dim3,
595 const DimT &dim2,
const DimT &dim1,
const DimT &dim0)
597 IxData::m_ixStride = dim4*dim3*dim2*dim1*dim0;
598 IxData::ixDefineLowerBound(dim5);
599 m_ixNext.ixDefine(offset - IxData::ixDimOffset(),
600 dim4, dim3, dim2, dim1, dim0);
603 const DimT &dim4,
const DimT &dim3,
const DimT &dim2,
604 const DimT &dim1,
const DimT &dim0)
606 IxData::m_ixStride = dim3*dim2*dim1*dim0;
607 IxData::ixDefineLowerBound(dim4);
608 m_ixNext.ixDefine(offset - IxData::ixDimOffset(), dim3, dim2, dim1, dim0);
611 const DimT &dim3,
const DimT &dim2,
const DimT &dim1,
614 IxData::m_ixStride = dim2*dim1*dim0;
615 IxData::ixDefineLowerBound(dim3);
616 m_ixNext.ixDefine(offset - IxData::ixDimOffset(), dim2, dim1, dim0);
619 const DimT &dim2,
const DimT &dim1,
const DimT &dim0)
621 IxData::m_ixStride = dim1*dim0;
622 IxData::ixDefineLowerBound(dim2);
623 m_ixNext.ixDefine(offset - IxData::ixDimOffset(), dim1, dim0);
626 const DimT &dim1,
const DimT &dim0)
629 IxData::ixDefineLowerBound(dim1);
630 m_ixNext.ixDefine(offset - IxData::ixDimOffset(), dim0);
636 const IIx_t i0)
const 638 CH_assert((IxData::ixValidBounds(i6, size)));
639 return IxData::m_ixStride*i6 +
640 m_ixNext.ixIndex1D(IxData::m_ixStride, i5, i4, i3, i2, i1, i0);
646 CH_assert((IxData::ixValidBounds(i5, size)));
647 return IxData::m_ixStride*i5 +
648 m_ixNext.ixIndex1D(IxData::m_ixStride, i4, i3, i2, i1, i0);
654 CH_assert((IxData::ixValidBounds(i4, size)));
655 return IxData::m_ixStride*i4 +
656 m_ixNext.ixIndex1D(IxData::m_ixStride, i3, i2, i1, i0);
660 const IIx_t i0)
const 662 CH_assert((IxData::ixValidBounds(i3, size)));
663 return IxData::m_ixStride*i3 +
664 m_ixNext.ixIndex1D(IxData::m_ixStride, i2, i1, i0);
669 CH_assert((IxData::ixValidBounds(i2, size)));
670 return IxData::m_ixStride*i2 +
671 m_ixNext.ixIndex1D(IxData::m_ixStride, i1, i0);
676 CH_assert((IxData::ixValidBounds(i1, size)));
677 return IxData::m_ixStride*i1 +
678 m_ixNext.ixIndex1D(IxData::m_ixStride, i0);
683 return (dim == Rank) ?
684 size/IxData::m_ixStride :
685 m_ixNext.ixDimSize(IxData::m_ixStride, dim);
689 return (dim == Rank) ?
690 IxData::ixLowerBound() :
691 m_ixNext.ixLowerBound(dim);
695 return (dim == Rank) ?
696 IxData::ixLowerBound() + size/IxData::m_ixStride - 1 :
697 m_ixNext.ixUpperBound(IxData::m_ixStride, dim);
700 unsigned ixIV(
const unsigned i)
const 713 template <
typename DimT>
726 IxData::ixDefineTotalOffset(offset - IxData::ixLowerBound());
732 IxData::ixDefineLowerBound(dim0);
733 IxData::ixDefineTotalOffset(offset - IxData::ixLowerBound());
737 const IIx_t i0)
const 739 CH_assert((IxData::ixValidBounds(i0, size)));
740 return i0 + IxData::ixTotalOffset();
749 return IxData::ixLowerBound();
753 return IxData::ixLowerBound() + size - 1;
756 unsigned ixIV(
const unsigned i)
const 785 IxData::m_ixStride = dim0;
791 CH_assert((IxData::ixValidBounds(i1, size)));
793 return IxData::m_ixStride*i1 + i0;
798 return (dim == 2) ? size/IxData::m_ixStride :
807 return ixDimSize(size, dim) - 1;
810 unsigned ixIV(
const unsigned i)
const 827 template <
unsigned Rank,
typename DimT>
833 : IxData(), m_ixNext()
837 const DimT &dim0,
const DimT &dim1,
const DimT &dim2,
838 const DimT &dim3,
const DimT &dim4,
const DimT &dim5,
840 : IxData(dim0*dim1*dim2*dim3*dim4*dim5, dim6),
841 m_ixNext(offset - IxData::ixDimOffset(),
842 dim0, dim1, dim2, dim3, dim4, dim5)
845 const DimT &dim0,
const DimT &dim1,
const DimT &dim2,
846 const DimT &dim3,
const DimT &dim4,
const DimT &dim5)
847 : IxData(dim0*dim1*dim2*dim3*dim4, dim5),
848 m_ixNext(offset - IxData::ixDimOffset(), dim0, dim1, dim2, dim3, dim4)
851 const DimT &dim0,
const DimT &dim1,
const DimT &dim2,
852 const DimT &dim3,
const DimT &dim4)
853 : IxData(dim0*dim1*dim2*dim3, dim4),
854 m_ixNext(offset - IxData::ixDimOffset(), dim0, dim1, dim2, dim3)
857 const DimT &dim0,
const DimT &dim1,
const DimT &dim2,
859 : IxData(dim0*dim1*dim2, dim3),
860 m_ixNext(offset - IxData::ixDimOffset(), dim0, dim1, dim2)
863 const DimT &dim0,
const DimT &dim1,
const DimT &dim2)
864 : IxData(dim0*dim1, dim2),
865 m_ixNext(offset - IxData::ixDimOffset(), dim0, dim1)
868 const DimT &dim0,
const DimT &dim1)
870 m_ixNext(offset - IxData::ixDimOffset(), dim0)
874 const DimT &dim0,
const DimT &dim1,
const DimT &dim2,
875 const DimT &dim3,
const DimT &dim4,
const DimT &dim5,
878 IxData::m_ixStride = dim0*dim1*dim2*dim3*dim4*dim5;
879 IxData::ixDefineLowerBound(dim6);
880 m_ixNext.ixDefine(offset - IxData::ixDimOffset(),
881 dim0, dim1, dim2, dim3, dim4, dim5);
884 const DimT &dim0,
const DimT &dim1,
const DimT &dim2,
885 const DimT &dim3,
const DimT &dim4,
const DimT &dim5)
887 IxData::m_ixStride = dim0*dim1*dim2*dim3*dim4;
888 IxData::ixDefineLowerBound(dim5);
889 m_ixNext.ixDefine(offset - IxData::ixDimOffset(),
890 dim0, dim1, dim2, dim3, dim4);
893 const DimT &dim0,
const DimT &dim1,
const DimT &dim2,
894 const DimT &dim3,
const DimT &dim4)
896 IxData::m_ixStride = dim0*dim1*dim2*dim3;
897 IxData::ixDefineLowerBound(dim4);
898 m_ixNext.ixDefine(offset - IxData::ixDimOffset(), dim0, dim1, dim2, dim3);
901 const DimT &dim0,
const DimT &dim1,
const DimT &dim2,
904 IxData::m_ixStride = dim0*dim1*dim2;
905 IxData::ixDefineLowerBound(dim3);
906 m_ixNext.ixDefine(offset - IxData::ixDimOffset(), dim0, dim1, dim2);
909 const DimT &dim0,
const DimT &dim1,
const DimT &dim2)
911 IxData::m_ixStride = dim0*dim1;
912 IxData::ixDefineLowerBound(dim2);
913 m_ixNext.ixDefine(offset - IxData::ixDimOffset(), dim0, dim1);
916 const DimT &dim0,
const DimT &dim1)
919 IxData::ixDefineLowerBound(dim1);
920 m_ixNext.ixDefine(offset - IxData::ixDimOffset(), dim0);
926 const IIx_t i6)
const 928 CH_assert((IxData::ixValidBounds(i6, size)));
929 return IxData::m_ixStride*i6 +
930 m_ixNext.ixIndex1D(IxData::m_ixStride, i0, i1, i2, i3, i4, i5);
936 CH_assert((IxData::ixValidBounds(i5, size)));
937 return IxData::m_ixStride*i5 +
938 m_ixNext.ixIndex1D(IxData::m_ixStride, i0, i1, i2, i3, i4);
944 CH_assert((IxData::ixValidBounds(i4, size)));
945 return IxData::m_ixStride*i4 +
946 m_ixNext.ixIndex1D(IxData::m_ixStride, i0, i1, i2, i3);
950 const IIx_t i3)
const 952 CH_assert((IxData::ixValidBounds(i3, size)));
953 return IxData::m_ixStride*i3 +
954 m_ixNext.ixIndex1D(IxData::m_ixStride, i0, i1, i2);
959 CH_assert((IxData::ixValidBounds(i2, size)));
960 return IxData::m_ixStride*i2 +
961 m_ixNext.ixIndex1D(IxData::m_ixStride, i0, i1);
966 CH_assert((IxData::ixValidBounds(i1, size)));
967 return IxData::m_ixStride*i1 +
968 m_ixNext.ixIndex1D(IxData::m_ixStride, i0);
973 return (dim == Rank) ?
974 size/IxData::m_ixStride :
975 m_ixNext.ixDimSize(IxData::m_ixStride, dim);
979 return (dim == Rank) ?
980 IxData::ixLowerBound() :
981 m_ixNext.ixLowerBound(dim);
985 return (dim == Rank) ?
986 IxData::ixLowerBound() + size/IxData::m_ixStride - 1 :
987 m_ixNext.ixUpperBound(IxData::m_ixStride, dim);
990 unsigned ixIV(
const unsigned i)
const 1003 template <
typename DimT>
1016 IxData::ixDefineTotalOffset(offset - IxData::ixLowerBound());
1021 IxData::ixDefineLowerBound(dim0);
1022 IxData::ixDefineTotalOffset(offset - IxData::ixLowerBound());
1026 const IIx_t i0)
const 1028 CH_assert((IxData::ixValidBounds(i0, size)));
1029 return i0 + IxData::ixTotalOffset();
1038 return IxData::ixLowerBound();
1042 return IxData::ixLowerBound() + size - 1;
1045 unsigned ixIV(
const unsigned i)
const 1068 : IxData(dim0, dim1)
1074 IxData::m_ixStride = dim0;
1080 CH_assert((IxData::ixValidBounds(i1, size)));
1082 return IxData::m_ixStride*i1 + i0;
1087 return (dim == 2) ? size/IxData::m_ixStride :
1096 return ixDimSize(size, dim) - 1;
1099 unsigned ixIV(
const unsigned i)
const 1112 template <
unsigned Rank,
int ArConf>
1114 template <
unsigned Rank>
1120 template <
unsigned Rank>
1126 template <
unsigned Rank>
1133 template <
unsigned Rank>
1272 template <
typename T,
1284 : Indexer(), m_arrayImpl()
1288 CHArray(
const DimT &dim6,
const DimT &dim5,
const DimT &dim4,
1289 const DimT &dim3,
const DimT &dim2,
const DimT &dim1,
1291 : Indexer(0, dim6, dim5, dim4, dim3, dim2, dim1, dim0),
1292 m_arrayImpl(dim6*dim5*dim4*dim3*dim2*dim1*dim0)
1294 CHArray(
const DimT &dim5,
const DimT &dim4,
const DimT &dim3,
1295 const DimT &dim2,
const DimT &dim1,
const DimT &dim0)
1296 : Indexer(0, dim5, dim4, dim3, dim2, dim1, dim0),
1297 m_arrayImpl(dim5*dim4*dim3*dim2*dim1*dim0)
1299 CHArray(
const DimT &dim4,
const DimT &dim3,
const DimT &dim2,
1300 const DimT &dim1,
const DimT &dim0)
1301 : Indexer(0, dim4, dim3, dim2, dim1, dim0),
1302 m_arrayImpl(dim4*dim3*dim2*dim1*dim0)
1304 CHArray(
const DimT &dim3,
const DimT &dim2,
const DimT &dim1,
1306 : Indexer(0, dim3, dim2, dim1, dim0), m_arrayImpl(dim3*dim2*dim1*dim0)
1308 CHArray(
const DimT &dim2,
const DimT &dim1,
const DimT &dim0)
1309 : Indexer(0, dim2, dim1, dim0), m_arrayImpl(dim2*dim1*dim0)
1312 : Indexer(0, dim1, dim0), m_arrayImpl(dim1*dim0)
1319 : Indexer(0,
D_DEFIV, dimc1, dimc0), m_arrayImpl(iv.
product()*dimc1*dimc0)
1325 : Indexer(0, dimc1, dimc0,
D_DEFIV), m_arrayImpl(dimc1*dimc0*iv.
product())
1332 : Indexer(0,
D_DEFBOX, dimc1, dimc0),
1333 m_arrayImpl(box.size().
product()*dimc1*dimc0)
1340 : Indexer(0,
D_DEFBOX, dimc0), m_arrayImpl(box.size().
product()*dimc0)
1347 : Indexer(0, dimc1, dimc0,
D_DEFBOX),
1348 m_arrayImpl(dimc1*dimc0*box.size().
product())
1355 : Indexer(0, dimc0,
D_DEFBOX), m_arrayImpl(dimc0*box.size().
product())
1363 void define(
const DimT &dim6,
const DimT &dim5,
const DimT &dim4,
1364 const DimT &dim3,
const DimT &dim2,
const DimT &dim1,
1367 Indexer::ixDefine(0, dim6, dim5, dim4, dim3, dim2, dim1, dim0);
1368 m_arrayImpl.define(dim6*dim5*dim4*dim3*dim2*dim1*dim0);
1370 void define(
const DimT &dim5,
const DimT &dim4,
const DimT &dim3,
1371 const DimT &dim2,
const DimT &dim1,
const DimT &dim0)
1373 Indexer::ixDefine(0, dim5, dim4, dim3, dim2, dim1, dim0);
1374 m_arrayImpl.define(dim5*dim4*dim3*dim2*dim1*dim0);
1376 void define(
const DimT &dim4,
const DimT &dim3,
const DimT &dim2,
1377 const DimT &dim1,
const DimT &dim0)
1379 Indexer::ixDefine(0, dim4, dim3, dim2, dim1, dim0);
1380 m_arrayImpl.define(dim4*dim3*dim2*dim1*dim0);
1382 void define(
const DimT &dim3,
const DimT &dim2,
const DimT &dim1,
1385 Indexer::ixDefine(0, dim3, dim2, dim1, dim0);
1386 m_arrayImpl.define(dim3*dim2*dim1*dim0);
1388 void define(
const DimT &dim2,
const DimT &dim1,
const DimT &dim0)
1390 Indexer::ixDefine(0, dim2, dim1, dim0);
1391 m_arrayImpl.define(dim2*dim1*dim0);
1393 void define(
const DimT &dim1,
const DimT &dim0)
1395 Indexer::ixDefine(0, dim1, dim0);
1396 m_arrayImpl.define(dim1*dim0);
1400 Indexer::ixDefine(0, dim0);
1406 Indexer::ixDefine(0,
D_DEFIV, dimc1, dimc0);
1407 m_arrayImpl.define(iv.
product()*dimc1*dimc0);
1411 Indexer::ixDefine(0,
D_DEFIV, dimc0);
1412 m_arrayImpl.define(iv.
product()*dimc0);
1416 Indexer::ixDefine(0, dimc1, dimc0,
D_DEFIV);
1417 m_arrayImpl.define(dimc1*dimc0*iv.
product());
1421 Indexer::ixDefine(0, dimc0,
D_DEFIV);
1422 m_arrayImpl.define(dimc0*iv.
product());
1430 Indexer::ixDefine(0,
D_DEFBOX, dimc1, dimc0);
1431 m_arrayImpl.define(box.
size().
product()*dimc1*dimc0);
1438 Indexer::ixDefine(0,
D_DEFBOX, dimc0);
1446 Indexer::ixDefine(0, dimc1, dimc0,
D_DEFBOX);
1447 m_arrayImpl.define(dimc1*dimc0*box.
size().
product());
1454 Indexer::ixDefine(0, dimc0,
D_DEFBOX);
1460 const DimT &dim6,
const DimT &dim5,
const DimT &dim4,
1461 const DimT &dim3,
const DimT &dim2,
const DimT &dim1,
1464 Indexer::ixDefine(0, dim6, dim5, dim4, dim3, dim2, dim1, dim0);
1465 m_arrayImpl.define(addr, dim6*dim5*dim4*dim3*dim2*dim1*dim0);
1468 const DimT &dim5,
const DimT &dim4,
const DimT &dim3,
1469 const DimT &dim2,
const DimT &dim1,
const DimT &dim0)
1471 Indexer::ixDefine(0, dim5, dim4, dim3, dim2, dim1, dim0);
1472 m_arrayImpl.define(addr, dim5*dim4*dim3*dim2*dim1*dim0);
1475 const DimT &dim4,
const DimT &dim3,
const DimT &dim2,
1476 const DimT &dim1,
const DimT &dim0)
1478 Indexer::ixDefine(0, dim4, dim3, dim2, dim1, dim0);
1479 m_arrayImpl.define(addr, dim4*dim3*dim2*dim1*dim0);
1482 const DimT &dim3,
const DimT &dim2,
const DimT &dim1,
1485 Indexer::ixDefine(0, dim3, dim2, dim1, dim0);
1486 m_arrayImpl.define(addr, dim3*dim2*dim1*dim0);
1489 const DimT &dim2,
const DimT &dim1,
const DimT &dim0)
1491 Indexer::ixDefine(0, dim2, dim1, dim0);
1492 m_arrayImpl.define(addr, dim2*dim1*dim0);
1495 const DimT &dim1,
const DimT &dim0)
1497 Indexer::ixDefine(0, dim1, dim0);
1498 m_arrayImpl.define(addr, dim1*dim0);
1503 Indexer::ixDefine(0, dim0);
1508 const DimT &dimc1,
const DimT &dimc0)
1510 Indexer::ixDefine(0,
D_DEFIV, dimc1, dimc0);
1511 m_arrayImpl.define(addr, iv.
product()*dimc1*dimc0);
1515 Indexer::ixDefine(0,
D_DEFIV, dimc0);
1516 m_arrayImpl.define(addr, iv.
product()*dimc0);
1518 void define(
void *
const addr,
const DimT &dimc1,
const DimT &dimc0,
1521 Indexer::ixDefine(0, dimc1, dimc0,
D_DEFIV);
1522 m_arrayImpl.define(addr, dimc1*dimc0*iv.
product());
1526 Indexer::ixDefine(0, dimc0,
D_DEFIV);
1527 m_arrayImpl.define(addr, dimc0*iv.
product());
1531 const DimT &dimc1,
const DimT &dimc0)
1536 Indexer::ixDefine(0,
D_DEFBOX, dimc1, dimc0);
1537 m_arrayImpl.define(addr, box.
size().
product()*dimc1*dimc0);
1544 Indexer::ixDefine(0,
D_DEFBOX, dimc0);
1545 m_arrayImpl.define(addr, box.
size().
product()*dimc0);
1547 void define(
void *
const addr,
const DimT &dimc1,
const DimT &dimc0,
1553 Indexer::ixDefine(0, dimc1, dimc0,
D_DEFBOX);
1554 m_arrayImpl.define(addr, dimc1*dimc0*box.
size().
product());
1561 Indexer::ixDefine(0, dimc0,
D_DEFBOX);
1562 m_arrayImpl.define(addr, dimc0*box.
size().
product());
1569 m_arrayImpl.undefine();
1573 template <
typename T2>
1578 const T *
const pEnd = end();
1579 for (T *
p = begin();
p != pEnd;) *
p++ = Tval;
1590 return m_arrayImpl.data[
1591 Indexer::ixIndex1D(size(), i6, i5, i4, i3, i2, i1, i0)];
1598 return m_arrayImpl.data[
1599 Indexer::ixIndex1D(size(), i5, i4, i3, i2, i1, i0)];
1606 return m_arrayImpl.data[Indexer::ixIndex1D(size(), i4, i3, i2, i1, i0)];
1612 return m_arrayImpl.data[Indexer::ixIndex1D(size(), i3, i2, i1, i0)];
1618 return m_arrayImpl.data[Indexer::ixIndex1D(size(), i2, i1, i0)];
1623 return m_arrayImpl.data[Indexer::ixIndex1D(size(), i1, i0)];
1628 return m_arrayImpl.data[Indexer::ixIndex1D(size(), i0)];
1633 return m_arrayImpl.data[Indexer::ixIndex1D(size(),
D_IXIV, c1, c0)];
1638 return m_arrayImpl.data[Indexer::ixIndex1D(size(),
D_IXIV, c0)];
1643 return m_arrayImpl.data[Indexer::ixIndex1D(size(), c1, c0,
D_IXIV)];
1648 return m_arrayImpl.data[Indexer::ixIndex1D(size(), c0,
D_IXIV)];
1658 return m_arrayImpl.data[
1659 Indexer::ixIndex1D(size(), i6, i5, i4, i3, i2, i1, i0)];
1666 return m_arrayImpl.data[
1667 Indexer::ixIndex1D(size(), i5, i4, i3, i2, i1, i0)];
1674 return m_arrayImpl.data[Indexer::ixIndex1D(size(), i4, i3, i2, i1, i0)];
1680 return m_arrayImpl.data[Indexer::ixIndex1D(size(), i3, i2, i1, i0)];
1686 return m_arrayImpl.data[Indexer::ixIndex1D(size(), i2, i1, i0)];
1691 return m_arrayImpl.data[Indexer::ixIndex1D(size(), i1, i0)];
1696 return m_arrayImpl.data[Indexer::ixIndex1D(size(), i0)];
1702 return m_arrayImpl.data[Indexer::ixIndex1D(size(),
D_IXIV, c1, c0)];
1707 return m_arrayImpl.data[Indexer::ixIndex1D(size(),
D_IXIV, c0)];
1713 return m_arrayImpl.data[Indexer::ixIndex1D(size(), c1, c0,
D_IXIV)];
1718 return m_arrayImpl.data[Indexer::ixIndex1D(size(), c0,
D_IXIV)];
1724 return *
static_cast<Alloc*
>(&m_arrayImpl);
1730 return m_arrayImpl.data;
1734 return m_arrayImpl.data;
1738 return m_arrayImpl.data + size();
1742 return m_arrayImpl.data + size();
1748 return m_arrayImpl.size;
1756 return Indexer::ixDimSize(size(), dim+1);
1764 return Indexer::ixLowerBound(dim+1);
1772 return Indexer::ixUpperBound(size(), dim+1);
1778 return (m_arrayImpl.data != 0);
1784 return isAllocated() && size() > 0;
1798 : size(a_size), data(0)
1800 data = Alloc::allocate(size);
1804 if (data != 0) undefine();
1808 if (data != 0) undefine();
1810 data = Alloc::allocate(size);
1814 if (data != 0) undefine();
1816 data = Alloc::allocate(addr, size);
1820 Alloc::deallocate(data, size);
1838 template<
typename T,
unsigned Rank,
int ArConf,
typename Alloc>
1844 const T *
const pEnd = A.
end();
1845 if (p != pEnd) os << *p++;
1846 while (p != pEnd) os <<
' ' << *p++;
1852 inline std::ostream &
operator<<(std::ostream &os,
const CHMatrix &M)
1856 os.setf(std::ios_base::scientific, std::ios_base::floatfield);
1864 os << std::setw(prec+7) << M(i, 0);
1867 os <<
' ' << std::setw(prec+7) << M(i, j);
1872 os.setf(std::ios_base::fmtflags(0), std::ios_base::floatfield);
1890 template <
typename T>
1896 T *
const p =
new(std::nothrow) T[size];
1938 CHMatrix *
const M =
new(std::nothrow) CHMatrix[size];
1940 const USz_t stride = m*n;
1941 matrixData =
new(std::nothrow)
Real[size*stride];
1943 for (
USz_t i = 0; i != size; ++i)
1945 M[i].
define(matrixData + i*stride, m, n);
1952 delete[] matrixData;
1998 #include "NamespaceFooter.H" Multidimensional array class.
Definition: CHArray.H:1276
CHArray(const Box &box, const DimT &dimc0)
Definition: CHArray.H:1339
#define D_DECL6(a, b, c, d, e, f)
Definition: CHArray.H:39
bool isAllocated() const
Memory has been allocated.
Definition: CHArray.H:1776
IIx_t m_ixIB
Lower bound for this dimension.
Definition: CHArray.H:521
void define(void *const addr, const IntVect &iv, const DimT &dimc0)
Definition: CHArray.H:1513
Rank > 2 for zero-based subscripts and > 1 for subscript ranges.
Definition: CHArray.H:828
const T & operator()(const IntVect &iv, const ArSp::IIx_t c1, const ArSp::IIx_t c0) const
Definition: CHArray.H:1698
CHArray(const DimT &dim3, const DimT &dim2, const DimT &dim1, const DimT &dim0)
Definition: CHArray.H:1304
Allocator for an array of matrices contiguous in memory.
Definition: CHArray.H:1923
ArSp::IIx_t dimB
Definition: CHArray.H:174
#define D_DEFIV
Definition: CHArray.H:102
void define(const DimT &dimc1, const DimT &dimc0, const IntVect &iv)
Definition: CHArray.H:1414
Definition: CHArray.H:342
USz_t m_ixStride
Stride for this dimension.
Definition: CHArray.H:451
void ixDefine(const IIx_t offset, const DimT &dim6, const DimT &dim5, const DimT &dim4, const DimT &dim3, const DimT &dim2, const DimT &dim1, const DimT &dim0)
Definition: CHArray.H:583
USz_t ixIndex1D(const USz_t size, const IIx_t i4, const IIx_t i3, const IIx_t i2, const IIx_t i1, const IIx_t i0) const
Definition: CHArray.H:650
T & operator()(const ArSp::IIx_t i2, const ArSp::IIx_t i1, const ArSp::IIx_t i0)
Definition: CHArray.H:1614
#define D_DEFBOX
Definition: CHArray.H:110
int vec[SpaceDim]
Definition: CHArray.H:70
IIx_t ixLowerBound() const
Definition: CHArray.H:406
void define(void *const addr, const DimT &dim4, const DimT &dim3, const DimT &dim2, const DimT &dim1, const DimT &dim0)
Definition: CHArray.H:1474
Rank 1 and a zero-based subscript (no data)
Definition: CHArray.H:461
T & operator()(const ArSp::IIx_t c0, const IntVect &iv)
Definition: CHArray.H:1645
USz_t ixIndex1D(const USz_t size, const IIx_t i3, const IIx_t i2, const IIx_t i1, const IIx_t i0) const
Definition: CHArray.H:658
IntVect size() const
Definition: CHArray.H:86
const T & operator()(const ArSp::IIx_t i1, const ArSp::IIx_t i0) const
Definition: CHArray.H:1688
IIx_t ixLowerBound(const unsigned dim) const
Definition: CHArray.H:687
IIx_t ixUpperBound(const USz_t size, const unsigned dim) const
Definition: CHArray.H:1040
Allocator that only permits allocation by new.
Definition: CHArray.H:1891
USz_t ixDimSize(const USz_t size, const unsigned dim) const
Definition: CHArray.H:796
#define D_TERM6(a, b, c, d, e, f)
Definition: CHArray.H:40
static void eval(T *p, USz_t size)
Definition: CHArray.H:307
void ixDefine(const IIx_t offset, const DimT &dim0, const DimT &dim1, const DimT &dim2, const DimT &dim3, const DimT &dim4, const DimT &dim5, const DimT &dim6)
Definition: CHArray.H:873
#define CH_assert(cond)
Definition: CHArray.H:37
void define(void *const addr, const DimT &dim1, const DimT &dim0)
Definition: CHArray.H:1494
void define(const DimT &dim2, const DimT &dim1, const DimT &dim0)
Definition: CHArray.H:1388
unsigned ixIV(const unsigned i) const
Definition: CHArray.H:1099
IndexerData< 1, DimT > IxData
Definition: CHArray.H:1006
void ixDefineTotalOffset(const IIx_t offset)
Definition: CHArray.H:478
Array_impl()
Definition: CHArray.H:1794
#define SpaceDim
Definition: CHArray.H:38
CSIndexer(const IIx_t offset, const DimT &dim0, const DimT &dim1, const DimT &dim2, const DimT &dim3)
Definition: CHArray.H:856
const T * begin() const
Definition: CHArray.H:1732
IIx_t ixDimOffset() const
Definition: CHArray.H:414
Test for class type.
Definition: CHArray.H:237
USz_t ixIndex1D(const USz_t size, const IIx_t i1, const IIx_t i0) const
Definition: CHArray.H:788
IIx_t ixUpperBound(const USz_t size, const unsigned dim) const
Definition: CHArray.H:693
IntVect operator*(const IntVect &p) const
Definition: IntVect.H:1009
CHArray(const Box &box, const DimT &dimc1, const DimT &dimc0)
Definition: CHArray.H:1331
Definition: CHArray.H:132
T * allocate(void *const addr, const USz_t size)
Definition: CHArray.H:361
IIx_t ixUpperBound(const USz_t size, const unsigned dim) const
Definition: CHArray.H:983
const T & operator()(const ArSp::IIx_t c0, const IntVect &iv) const
Definition: CHArray.H:1715
const T * end() const
Definition: CHArray.H:1740
bool defined
Definition: CHArray.H:1958
CHArray< Real, 2, ArZeroCol, ArSp::DefaultArrayAlloc< Real > > CHMatrix
Matrix defined with column-ordered storage.
Definition: CHArray.H:1835
USz_t ixIndex1D(const USz_t size, const IIx_t i0) const
Definition: CHArray.H:736
const T & operator()(const IntVect &iv, const ArSp::IIx_t c0) const
Definition: CHArray.H:1704
void ixDefine(const IIx_t offset, const DimT &dim3, const DimT &dim2, const DimT &dim1, const DimT &dim0)
Definition: CHArray.H:610
USz_t ixIndex1D(const USz_t size, const IIx_t i0, const IIx_t i1, const IIx_t i2) const
Definition: CHArray.H:956
T & operator()(const ArSp::IIx_t c1, const ArSp::IIx_t c0, const IntVect &iv)
Definition: CHArray.H:1640
IndexerData< 1, DimT > IxData
Definition: CHArray.H:716
CSIndexer(const IIx_t offset, const DimT &dim0, const DimT &dim1, const DimT &dim2)
Definition: CHArray.H:862
IIx_t ixLowerBound() const
Definition: CHArray.H:470
IntVect(const IntVect &iv)
Definition: CHArray.H:51
bool isUsable() const
Memory has been allocated and size is > 0.
Definition: CHArray.H:1782
void ixDefine(const IIx_t offset, const USz_t dim0, const USz_t dim1)
Definition: CHArray.H:1071
void deallocate(CHMatrix *p, const USz_t size)
Definition: CHArray.H:1949
void define(const DimT &dimc0, const Box &box)
Definition: CHArray.H:1449
T & operator()(const IntVect &iv, const ArSp::IIx_t c0)
Definition: CHArray.H:1635
void define(void *const addr, const Box &box, const DimT &dimc1, const DimT &dimc0)
Definition: CHArray.H:1530
unsigned ixIV(const unsigned i) const
Definition: CHArray.H:756
void define(void *const addr, const DimT &dim2, const DimT &dim1, const DimT &dim0)
Definition: CHArray.H:1488
Range of subscripts and row-storage.
Definition: CHArray_fwd.H:37
AllocBy m_allocBy
Definition: CHArray.H:346
void ixDefineLowerBound(const DimT &dim)
Definition: CHArray.H:404
int BoxAllowed
Definition: CHArray.H:1138
void define(void *const addr, const DimT &dim3, const DimT &dim2, const DimT &dim1, const DimT &dim0)
Definition: CHArray.H:1481
double Real
Definition: CHArray.H:41
USz_t ixIndex1D(const USz_t size, const IIx_t i0, const IIx_t i1, const IIx_t i2, const IIx_t i3, const IIx_t i4, const IIx_t i5) const
Definition: CHArray.H:932
CHArray & operator=(const T2 &val)
Assign a constant to the array.
Definition: CHArray.H:1574
CHArray(const DimT &dim0)
Definition: CHArray.H:1314
IIx_t ixLowerBound() const
Definition: CHArray.H:504
RSIndexer(const IIx_t offset, const USz_t &dim1, const USz_t &dim0)
Definition: CHArray.H:777
T & operator()(const IntVect &iv, const ArSp::IIx_t c1, const ArSp::IIx_t c0)
Definition: CHArray.H:1630
CHRange(const ArSp::IIx_t a_dimE)
Definition: CHArray.H:164
CSIndexer< Rank-1, DimT > m_ixNext
Next lower rank.
Definition: CHArray.H:996
Array_impl(const ArSp::USz_t a_size)
Definition: CHArray.H:1797
USz_t ixIndex1D(const USz_t size, const IIx_t i1, const IIx_t i0) const
Definition: CHArray.H:673
USz_t ixIndex1D(const USz_t size, const IIx_t i6, const IIx_t i5, const IIx_t i4, const IIx_t i3, const IIx_t i2, const IIx_t i1, const IIx_t i0) const
Definition: CHArray.H:633
RSIndexer(const IIx_t offset, const DimT &dim2, const DimT &dim1, const DimT &dim0)
Definition: CHArray.H:572
void undefine()
Definition: CHArray.H:1818
void ixDefine(const IIx_t offset, const DimT &dim1, const DimT &dim0)
Definition: CHArray.H:625
RSIndexer()
Definition: CHArray.H:773
IndexerData< Rank, DimT > IxData
Definition: CHArray.H:830
void ixDefineLowerBound(const CHRange &dim)
Definition: CHArray.H:435
RSIndexer(const IIx_t offset, const DimT &dim0)
Definition: CHArray.H:722
int IIx_t
Definition: CHArray.H:139
void define(const DimT &dim4, const DimT &dim3, const DimT &dim2, const DimT &dim1, const DimT &dim0)
Definition: CHArray.H:1376
IIx_t ixLowerBound(const unsigned dim) const
Definition: CHArray.H:747
ArSp::USz_t size(const unsigned dim) const
Size of a dimension (0 is dimension with contiguous storage)
Definition: CHArray.H:1752
ArSp::USz_t size
Overall size of the array.
Definition: CHArray.H:1824
void ixDefine(const IIx_t offset, const DimT &dim0, const DimT &dim1, const DimT &dim2)
Definition: CHArray.H:908
ArSp::ArTr< Rank, ArConf >::DimT DimT
Definition: CHArray.H:1278
USz_t ixIndex1D(const USz_t size, const IIx_t i0, const IIx_t i1, const IIx_t i2, const IIx_t i3) const
Definition: CHArray.H:948
CHArray(const DimT &dim1, const DimT &dim0)
Definition: CHArray.H:1311
void ixDefineLowerBound(const DimT &dim)
Definition: CHArray.H:468
IIx_t ixTotalOffset() const
Definition: CHArray.H:480
Alloc & getAllocator()
Get the allocator.
Definition: CHArray.H:1722
const int & operator[](const int i) const
Definition: CHArray.H:60
void define(void *const addr, const DimT &dimc0, const Box &box)
Definition: CHArray.H:1556
void define(const DimT &dim0)
Definition: CHArray.H:1398
Any rank and a zero-based subscript.
Definition: CHArray.H:395
ArSp::RSIndexer< Rank, DimT > IndexerT
Definition: CHArray.H:1130
AllocBy
Definition: CHArray.H:340
ArSp::IIx_t upperBound(const unsigned dim) const
Upper bound of a dimension (0 is dimension with contiguous storage)
Definition: CHArray.H:1768
USz_t m
Definition: CHArray.H:1956
void ixDefineLowerBound(const CHRange &dim)
Definition: CHArray.H:500
CSIndexer()
Definition: CHArray.H:1062
void define(const DimT &dimc1, const DimT &dimc0, const Box &box)
Definition: CHArray.H:1441
const T & operator()(const ArSp::IIx_t i4, const ArSp::IIx_t i3, const ArSp::IIx_t i2, const ArSp::IIx_t i1, const ArSp::IIx_t i0) const
Definition: CHArray.H:1669
Definition: EBInterface.H:45
unsigned USz_t
Type of unsigned int for a size.
Definition: CHArray.H:141
RSIndexer(const IIx_t offset, const DimT &dim6, const DimT &dim5, const DimT &dim4, const DimT &dim3, const DimT &dim2, const DimT &dim1, const DimT &dim0)
Definition: CHArray.H:546
CHArray(const IntVect &iv, const DimT &dimc0)
Definition: CHArray.H:1321
IndexerData(const USz_t stride, const DimT &dim)
Definition: CHArray.H:401
T & operator()(const ArSp::IIx_t i3, const ArSp::IIx_t i2, const ArSp::IIx_t i1, const ArSp::IIx_t i0)
Definition: CHArray.H:1608
void ixDefine(const IIx_t offset, const DimT &dim2, const DimT &dim1, const DimT &dim0)
Definition: CHArray.H:618
RSIndexer(const IIx_t offset, const DimT &dim4, const DimT &dim3, const DimT &dim2, const DimT &dim1, const DimT &dim0)
Definition: CHArray.H:560
IndexerData()
Definition: CHArray.H:429
USz_t ixIndex1D(const USz_t size, const IIx_t i0) const
Definition: CHArray.H:1025
T & operator()(const ArSp::IIx_t i1, const ArSp::IIx_t i0)
Definition: CHArray.H:1620
bool ixValidBounds(const IIx_t i, const USz_t size) const
Definition: CHArray.H:508
IIx_t ixTotalOffset() const
Definition: CHArray.H:516
CHRange(const ArSp::IIx_t a_dimB, const ArSp::IIx_t a_dimE)
Definition: CHArray.H:169
T * end()
Definition: CHArray.H:1736
IntVect m_lb
Definition: CHArray.H:95
ArSp::USz_t DimT
Definition: CHArray.H:1123
Box(const IntVect &lb, const IntVect &ub)
Definition: CHArray.H:75
CSIndexer()
Definition: CHArray.H:832
USz_t sizeOfDim< CHRange >(const CHRange &dim)
Definition: CHArray.H:196
ArSp::ArTr< Rank, ArConf >::IndexerT Indexer
Definition: CHArray.H:1279
int bigEnd(const int dir) const
Definition: CHArray.H:82
IntVect(D_DECL6(const int i0, const int i1, const int i2, const int i3, const int i4, const int i5))
Definition: CHArray.H:45
USz_t ixIndex1D(const USz_t size, const IIx_t i2, const IIx_t i1, const IIx_t i0) const
Definition: CHArray.H:666
void define(const USz_t a_m, const USz_t a_n)
Definition: CHArray.H:1929
bool ixValidBounds(const IIx_t i, const USz_t size) const
Definition: CHArray.H:474
IIx_t m_ixIB
Lower bound for this dimension.
Definition: CHArray.H:453
Definition: CHArray.H:1792
T * data
Data for the array.
Definition: CHArray.H:1825
RSIndexer(const IIx_t offset, const DimT &dim5, const DimT &dim4, const DimT &dim3, const DimT &dim2, const DimT &dim1, const DimT &dim0)
Definition: CHArray.H:554
Real * matrixData
Definition: CHArray.H:1955
IndexerData(const CHRange &dim)
Definition: CHArray.H:497
IndexerData< 2, USz_t > IxData
Definition: CHArray.H:771
const T & operator()(const ArSp::IIx_t i2, const ArSp::IIx_t i1, const ArSp::IIx_t i0) const
Definition: CHArray.H:1682
const T & operator()(const ArSp::IIx_t c1, const ArSp::IIx_t c0, const IntVect &iv) const
Definition: CHArray.H:1709
int smallEnd(const int dir) const
Definition: CHArray.H:78
~Array_impl()
Definition: CHArray.H:1802
RSIndexer()
Definition: CHArray.H:542
Array_impl m_arrayImpl
Data + allocation/deallocation.
Definition: CHArray.H:1828
DefaultArrayAlloc()
Definition: CHArray.H:349
void define(const ArSp::USz_t a_size)
Definition: CHArray.H:1806
USz_t ixIndex1D(const USz_t size, const IIx_t i0, const IIx_t i1) const
Definition: CHArray.H:963
IIx_t ixDimOffset() const
Definition: CHArray.H:447
void ixDefine(const IIx_t offset, const DimT &dim0, const DimT &dim1, const DimT &dim2, const DimT &dim3)
Definition: CHArray.H:900
IndexerData< Rank, DimT > IxData
Definition: CHArray.H:540
friend std::ostream & operator<<(std::ostream &os, const IntVect &iv)
void define(void *const addr, const DimT &dimc0, const IntVect &iv)
Definition: CHArray.H:1524
T & operator()(const ArSp::IIx_t i4, const ArSp::IIx_t i3, const ArSp::IIx_t i2, const ArSp::IIx_t i1, const ArSp::IIx_t i0)
Definition: CHArray.H:1601
USz_t ixDimSize(const USz_t size, const unsigned dim) const
Definition: CHArray.H:743
Forward declarations for class CHArray.
void define(const IntVect &iv, const DimT &dimc1, const DimT &dimc0)
Definition: CHArray.H:1404
RSIndexer< Rank-1, DimT > m_ixNext
Next lower rank.
Definition: CHArray.H:706
IIx_t ixLowerBound() const
Definition: CHArray.H:439
double Real
Definition: REAL.H:33
const T & operator()(const ArSp::IIx_t i6, const ArSp::IIx_t i5, const ArSp::IIx_t i4, const ArSp::IIx_t i3, const ArSp::IIx_t i2, const ArSp::IIx_t i1, const ArSp::IIx_t i0) const
Constant access to an element.
Definition: CHArray.H:1652
IndexerData(const USz_t stride, const CHRange &dim)
Definition: CHArray.H:432
void ixDefine(const IIx_t offset, const DimT &dim0)
Definition: CHArray.H:729
IntVect & operator=(const IntVect &rhs)
Definition: IntVect.H:709
T * allocate(const USz_t size)
Definition: CHArray.H:1894
Definition: CHArray.H:241
Definition: CHArray.H:291
IntVect m_ub
Definition: CHArray.H:96
RSIndexer()
Definition: CHArray.H:718
USz_t m_ixStride
Stride for this dimension.
Definition: CHArray.H:418
void ixDefine(const IIx_t offset, const DimT &dim0, const DimT &dim1, const DimT &dim2, const DimT &dim3, const DimT &dim4, const DimT &dim5)
Definition: CHArray.H:883
USz_t ixIndex1D(const USz_t size, const IIx_t i0, const IIx_t i1, const IIx_t i2, const IIx_t i3, const IIx_t i4, const IIx_t i5, const IIx_t i6) const
Definition: CHArray.H:923
int & operator[](const int i)
Definition: CHArray.H:56
bool ixValidBounds(const IIx_t i, const USz_t size) const
Definition: CHArray.H:410
CHArray(const DimT &dim4, const DimT &dim3, const DimT &dim2, const DimT &dim1, const DimT &dim0)
Definition: CHArray.H:1299
IIx_t ixUpperBound(const USz_t size, const unsigned dim) const
Definition: CHArray.H:1094
void define(const IntVect &iv, const DimT &dimc0)
Definition: CHArray.H:1409
void define(void *const addr, const DimT &dim6, const DimT &dim5, const DimT &dim4, const DimT &dim3, const DimT &dim2, const DimT &dim1, const DimT &dim0)
Define the dimensions and allocate on 'addr'.
Definition: CHArray.H:1459
CSIndexer(const IIx_t offset, const DimT &dim0, const DimT &dim1, const DimT &dim2, const DimT &dim3, const DimT &dim4, const DimT &dim5, const DimT &dim6)
Definition: CHArray.H:836
ArSp::USz_t size() const
Overall size of the array.
Definition: CHArray.H:1746
ArSp::RSIndexer< Rank, DimT > IndexerT
Definition: CHArray.H:1118
CHMatrix * allocate(const USz_t size)
Definition: CHArray.H:1935
void ixDefine(const IIx_t offset, const DimT &dim0)
Definition: CHArray.H:1019
IIx_t ixUpperBound(const USz_t size, const unsigned dim) const
Definition: CHArray.H:805
int BoxAllowed
Definition: CHArray.H:1131
void ixDefine(const IIx_t offset, const DimT &dim0, const DimT &dim1)
Definition: CHArray.H:915
void deallocate(T *p, const USz_t size)
Definition: CHArray.H:367
CSIndexer(const IIx_t offset, const DimT &dim0, const DimT &dim1, const DimT &dim2, const DimT &dim3, const DimT &dim4, const DimT &dim5)
Definition: CHArray.H:844
USz_t ixDimSize(const USz_t size, const unsigned dim) const
Definition: CHArray.H:1032
USz_t ixIndex1D(const USz_t size, const IIx_t i0, const IIx_t i1, const IIx_t i2, const IIx_t i3, const IIx_t i4) const
Definition: CHArray.H:940
USz_t ixDimSize(const USz_t size, const unsigned dim) const
Definition: CHArray.H:681
IIx_t ixLowerBound(const unsigned dim) const
Definition: CHArray.H:801
CHArray(const DimT &dimc0, const IntVect &iv)
Definition: CHArray.H:1327
unsigned ixIV(const unsigned i) const
Definition: CHArray.H:990
CHArray(const DimT &dimc1, const DimT &dimc0, const IntVect &iv)
Definition: CHArray.H:1324
void ixDefine(const IIx_t offset, const DimT &dim5, const DimT &dim4, const DimT &dim3, const DimT &dim2, const DimT &dim1, const DimT &dim0)
Definition: CHArray.H:593
void define(void *const addr, const DimT &dim0)
Definition: CHArray.H:1500
T * begin()
Access extents of the memory allocated for the array.
Definition: CHArray.H:1728
Definition: CHArray.H:343
ArSp::CSIndexer< Rank, DimT > IndexerT
Definition: CHArray.H:1137
void define(const Box &box, const DimT &dimc1, const DimT &dimc0)
Definition: CHArray.H:1425
void define(void *const addr, const DimT &dimc1, const DimT &dimc0, const IntVect &iv)
Definition: CHArray.H:1518
ArrayOfMatrixAlloc()
Definition: CHArray.H:1926
A Rectangular Domain on an Integer Lattice.
Definition: Box.H:465
int product() const
Definition: CHArray.H:64
USz_t ixIndex1D(const USz_t size, const IIx_t i0, const IIx_t i1) const
Definition: CHArray.H:1077
CHArray()
Default constructor.
Definition: CHArray.H:1283
void define(const DimT &dim1, const DimT &dim0)
Definition: CHArray.H:1393
T & operator()(const ArSp::IIx_t i6, const ArSp::IIx_t i5, const ArSp::IIx_t i4, const ArSp::IIx_t i3, const ArSp::IIx_t i2, const ArSp::IIx_t i1, const ArSp::IIx_t i0)
Access an element.
Definition: CHArray.H:1584
void define(const DimT &dimc0, const IntVect &iv)
Definition: CHArray.H:1419
ArSp::IIx_t lowerBound(const unsigned dim) const
Lower bound of a dimension (0 is dimension with contiguous storage)
Definition: CHArray.H:1760
void ixDefine(const IIx_t offset, const DimT &dim4, const DimT &dim3, const DimT &dim2, const DimT &dim1, const DimT &dim0)
Definition: CHArray.H:602
CSIndexer()
Definition: CHArray.H:1008
CSIndexer(const IIx_t offset, const DimT &dim0)
Definition: CHArray.H:1012
Definition: CHArray.H:261
static void eval(T *p, USz_t size)
Definition: CHArray.H:297
const T & operator()(const ArSp::IIx_t i0) const
Definition: CHArray.H:1693
const T & operator()(const ArSp::IIx_t i3, const ArSp::IIx_t i2, const ArSp::IIx_t i1, const ArSp::IIx_t i0) const
Definition: CHArray.H:1676
IIx_t ixUpperBound(const USz_t size, const unsigned dim) const
Definition: CHArray.H:751
An integer Vector in SpaceDim-dimensional space.
Definition: CHArray.H:42
void define(const DimT &dim5, const DimT &dim4, const DimT &dim3, const DimT &dim2, const DimT &dim1, const DimT &dim0)
Definition: CHArray.H:1370
Zero lower bound and row-storage.
Definition: CHArray_fwd.H:35
IndexerData(const DimT &dim)
Definition: CHArray.H:466
CHArray(const DimT &dim2, const DimT &dim1, const DimT &dim0)
Definition: CHArray.H:1308
unsigned ixIV(const unsigned i) const
Definition: CHArray.H:810
IIx_t ixDimSize(const USz_t size, const unsigned dim) const
Definition: CHArray.H:1085
char One
Definition: CHArray.H:240
void ixDefine(const IIx_t offset, const DimT &dim0, const DimT &dim1, const DimT &dim2, const DimT &dim3, const DimT &dim4)
Definition: CHArray.H:892
CHArray< Real, 1, ArZeroCol, ArSp::DefaultArrayAlloc< Real > > CHVector
Vector definition.
Definition: CHArray.H:1832
void define(const Box &box, const DimT &dimc0)
Definition: CHArray.H:1433
IndexerData< 2, USz_t > IxData
Definition: CHArray.H:1060
IIx_t m_ixOffset
Definition: CHArray.H:522
T & operator()(const ArSp::IIx_t i5, const ArSp::IIx_t i4, const ArSp::IIx_t i3, const ArSp::IIx_t i2, const ArSp::IIx_t i1, const ArSp::IIx_t i0)
Definition: CHArray.H:1593
RSIndexer(const IIx_t offset, const DimT &dim1, const DimT &dim0)
Definition: CHArray.H:577
T & operator()(const ArSp::IIx_t i0)
Definition: CHArray.H:1625
IndexerData()
Definition: CHArray.H:494
CHArray(const DimT &dimc0, const Box &box)
Definition: CHArray.H:1354
Definition: CHArray_fwd.H:38
ArSp::IIx_t dimE
Definition: CHArray.H:175
Default allocator.
Definition: CHArray.H:337
IIx_t ixLowerBound(const unsigned dim) const
Definition: CHArray.H:1090
unsigned ixIV(const unsigned i) const
Definition: CHArray.H:700
RSIndexer(const IIx_t offset, const DimT &dim3, const DimT &dim2, const DimT &dim1, const DimT &dim0)
Definition: CHArray.H:566
void ixDefineTotalOffset(const IIx_t offset)
Definition: CHArray.H:512
const T & operator()(const ArSp::IIx_t i5, const ArSp::IIx_t i4, const ArSp::IIx_t i3, const ArSp::IIx_t i2, const ArSp::IIx_t i1, const ArSp::IIx_t i0) const
Definition: CHArray.H:1661
void ixDefine(const IIx_t offset, const USz_t &dim1, const USz_t &dim0)
Definition: CHArray.H:782
ArSp::USz_t DimT
Definition: CHArray.H:1117
void deallocate(T *p, const USz_t size)
Definition: CHArray.H:1901
void define(void *const addr, const ArSp::USz_t a_size)
Definition: CHArray.H:1812
CSIndexer(const IIx_t offset, const DimT &dim0, const DimT &dim1)
Definition: CHArray.H:867
IIx_t ixLowerBound(const unsigned dim) const
Definition: CHArray.H:977
void define(void *const addr, const IntVect &iv, const DimT &dimc1, const DimT &dimc0)
Definition: CHArray.H:1507
ArSp::CSIndexer< Rank, DimT > IndexerT
Definition: CHArray.H:1124
Definition: CHArray.H:1113
static T * eval(void *const addr, const USz_t size)
Definition: CHArray.H:277
CSIndexer(const IIx_t offset, const USz_t dim0, const USz_t dim1)
Definition: CHArray.H:1066
int dim
Definition: EBInterface.H:146
USz_t ixIndex1D(const USz_t size, const IIx_t i5, const IIx_t i4, const IIx_t i3, const IIx_t i2, const IIx_t i1, const IIx_t i0) const
Definition: CHArray.H:642
void undefine()
Deallocate the array.
Definition: CHArray.H:1566
void define(const DimT &dim6, const DimT &dim5, const DimT &dim4, const DimT &dim3, const DimT &dim2, const DimT &dim1, const DimT &dim0)
Define the dimensions.
Definition: CHArray.H:1363
USz_t ixDimSize(const USz_t size, const unsigned dim) const
Definition: CHArray.H:971
#define D_IXIV
Definition: CHArray.H:125
USz_t sizeOfDim(const T &dim)
Get the size of a dimension.
Definition: CHArray.H:189
Zero lower bound and column-storage.
Definition: CHArray_fwd.H:36
IndexerData()
Definition: CHArray.H:398
CHArray(const IntVect &iv, const DimT &dimc1, const DimT &dimc0)
Definition: CHArray.H:1318
CHArray(const DimT &dimc1, const DimT &dimc0, const Box &box)
Definition: CHArray.H:1346
CSIndexer(const IIx_t offset, const DimT &dim0, const DimT &dim1, const DimT &dim2, const DimT &dim3, const DimT &dim4)
Definition: CHArray.H:850
CHArray(const DimT &dim6, const DimT &dim5, const DimT &dim4, const DimT &dim3, const DimT &dim2, const DimT &dim1, const DimT &dim0)
Construct with dimensions.
Definition: CHArray.H:1288
void define(void *const addr, const DimT &dim5, const DimT &dim4, const DimT &dim3, const DimT &dim2, const DimT &dim1, const DimT &dim0)
Definition: CHArray.H:1467
T * allocate(const USz_t size)
Definition: CHArray.H:353
unsigned ixIV(const unsigned i) const
Definition: CHArray.H:1045
CHRange DimT
Definition: CHArray.H:1129
IndexerData()
Definition: CHArray.H:464
static T * eval(void *const addr, const USz_t size)
Definition: CHArray.H:267
Defines a range of subscripts.
Definition: CHArray.H:162
void define(const DimT &dim3, const DimT &dim2, const DimT &dim1, const DimT &dim0)
Definition: CHArray.H:1382
CHRange DimT
Definition: CHArray.H:1136
Rank > 2 for zero-based subscripts and > 1 for subscript ranges.
Definition: CHArray.H:538
void define(void *const addr, const DimT &dimc1, const DimT &dimc0, const Box &box)
Definition: CHArray.H:1547
CHArray(const DimT &dim5, const DimT &dim4, const DimT &dim3, const DimT &dim2, const DimT &dim1, const DimT &dim0)
Definition: CHArray.H:1294
IntVect()
Definition: IntVect.H:58
IIx_t ixLowerBound(const unsigned dim) const
Definition: CHArray.H:1036
void define(void *const addr, const Box &box, const DimT &dimc0)
Definition: CHArray.H:1539
USz_t n
Definition: CHArray.H:1957
bool ixValidBounds(const IIx_t i, const USz_t size) const
Definition: CHArray.H:443