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));
100 template <
typename T>
109 template <
typename C>
static One test(
int C::*);
110 template <
typename C>
static Two test(...);
122 # define D_DEFIV D_DECL6(DimT(iv[Indexer::ixIV(0)]), \ 123 DimT(iv[Indexer::ixIV(1)]), \ 124 DimT(iv[Indexer::ixIV(2)]), \ 125 DimT(iv[Indexer::ixIV(3)]), \ 126 DimT(iv[Indexer::ixIV(4)]), \ 127 DimT(iv[Indexer::ixIV(5)])) 130 # define D_DEFBOX D_DECL6(DimT(box.smallEnd(Indexer::ixIV(0)), \ 131 box.bigEnd(Indexer::ixIV(0))), \ 132 DimT(box.smallEnd(Indexer::ixIV(1)), \ 133 box.bigEnd(Indexer::ixIV(1))), \ 134 DimT(box.smallEnd(Indexer::ixIV(2)), \ 135 box.bigEnd(Indexer::ixIV(2))), \ 136 DimT(box.smallEnd(Indexer::ixIV(3)), \ 137 box.bigEnd(Indexer::ixIV(3))), \ 138 DimT(box.smallEnd(Indexer::ixIV(4)), \ 139 box.bigEnd(Indexer::ixIV(4))), \ 140 DimT(box.smallEnd(Indexer::ixIV(5)), \ 141 box.bigEnd(Indexer::ixIV(5)))) 145 # define D_IXIV D_DECL6(iv[Indexer::ixIV(0)], \ 146 iv[Indexer::ixIV(1)], \ 147 iv[Indexer::ixIV(2)], \ 148 iv[Indexer::ixIV(3)], \ 149 iv[Indexer::ixIV(4)], \ 150 iv[Indexer::ixIV(5)]) 163 typedef unsigned USz_t; ///< Type of unsigned int for a size
187 : dimB(0), dimE(a_dimE - 1)
192 : dimB(a_dimB), dimE(a_dimE)
209 template <
typename T>
250 template <typename T, bool IsClass = Misc::TypeTr<T>::IsClass>
254 template <
typename T>
259 return new(addr) T[size];
264 template <
typename T>
269 return static_cast<T*
>(addr);
279 template <typename T, bool IsClass = Misc::TypeTr<T>::IsClass>
283 template <
typename T>
288 while (size--) p++->~T();
293 template <
typename T>
324 template <
typename T>
338 : m_allocBy(AllocUndefined)
343 T *
const p =
new(std::nothrow) T[size];
345 m_allocBy = AllocNew;
351 m_allocBy = AllocRaw;
381 template <
unsigned Rank,
typename DimT>
399 return (((
USz_t)i) < size/m_ixStride);
412 template <
unsigned Rank>
417 : m_ixStride(0), m_ixIB(0)
420 : m_ixStride(stride), m_ixIB(dim.dimB)
432 return (i >= m_ixIB && i < m_ixIB + (
IIx_t)(size/m_ixStride));
436 return m_ixIB*m_ixStride;
447 template <
typename DimT>
463 return (((
USz_t)i) < size);
497 return (i >= m_ixIB && i < m_ixIB + (
IIx_t)size);
523 template <
unsigned Rank,
typename DimT>
529 : IxData(), m_ixNext()
533 const DimT &dim6,
const DimT &dim5,
const DimT &dim4,
534 const DimT &dim3,
const DimT &dim2,
const DimT &dim1,
536 : IxData(dim5*dim4*dim3*dim2*dim1*dim0, dim6),
537 m_ixNext(offset - IxData::ixDimOffset(),
538 dim5, dim4, dim3, dim2, dim1, dim0)
541 const DimT &dim5,
const DimT &dim4,
const DimT &dim3,
542 const DimT &dim2,
const DimT &dim1,
const DimT &dim0)
543 : IxData(dim4*dim3*dim2*dim1*dim0, dim5),
544 m_ixNext(offset - IxData::ixDimOffset(), dim4, dim3, dim2, dim1, dim0)
547 const DimT &dim4,
const DimT &dim3,
const DimT &dim2,
548 const DimT &dim1,
const DimT &dim0)
549 : IxData(dim3*dim2*dim1*dim0, dim4),
550 m_ixNext(offset - IxData::ixDimOffset(), dim3, dim2, dim1, dim0)
553 const DimT &dim3,
const DimT &dim2,
const DimT &dim1,
555 : IxData(dim2*dim1*dim0, dim3),
556 m_ixNext(offset - IxData::ixDimOffset(), dim2, dim1, dim0)
559 const DimT &dim2,
const DimT &dim1,
const DimT &dim0)
560 : IxData(dim1*dim0, dim2),
561 m_ixNext(offset - IxData::ixDimOffset(), dim1, dim0)
564 const DimT &dim1,
const DimT &dim0)
566 m_ixNext(offset - IxData::ixDimOffset(), dim0)
570 const DimT &dim6,
const DimT &dim5,
const DimT &dim4,
571 const DimT &dim3,
const DimT &dim2,
const DimT &dim1,
574 IxData::m_ixStride = dim5*dim4*dim3*dim2*dim1*dim0;
575 IxData::ixDefineLowerBound(dim6);
576 m_ixNext.ixDefine(offset - IxData::ixDimOffset(),
577 dim5, dim4, dim3, dim2, dim1, dim0);
580 const DimT &dim5,
const DimT &dim4,
const DimT &dim3,
581 const DimT &dim2,
const DimT &dim1,
const DimT &dim0)
583 IxData::m_ixStride = dim4*dim3*dim2*dim1*dim0;
584 IxData::ixDefineLowerBound(dim5);
585 m_ixNext.ixDefine(offset - IxData::ixDimOffset(),
586 dim4, dim3, dim2, dim1, dim0);
589 const DimT &dim4,
const DimT &dim3,
const DimT &dim2,
590 const DimT &dim1,
const DimT &dim0)
592 IxData::m_ixStride = dim3*dim2*dim1*dim0;
593 IxData::ixDefineLowerBound(dim4);
594 m_ixNext.ixDefine(offset - IxData::ixDimOffset(), dim3, dim2, dim1, dim0);
597 const DimT &dim3,
const DimT &dim2,
const DimT &dim1,
600 IxData::m_ixStride = dim2*dim1*dim0;
601 IxData::ixDefineLowerBound(dim3);
602 m_ixNext.ixDefine(offset - IxData::ixDimOffset(), dim2, dim1, dim0);
605 const DimT &dim2,
const DimT &dim1,
const DimT &dim0)
607 IxData::m_ixStride = dim1*dim0;
608 IxData::ixDefineLowerBound(dim2);
609 m_ixNext.ixDefine(offset - IxData::ixDimOffset(), dim1, dim0);
612 const DimT &dim1,
const DimT &dim0)
615 IxData::ixDefineLowerBound(dim1);
616 m_ixNext.ixDefine(offset - IxData::ixDimOffset(), dim0);
622 const IIx_t i0)
const 624 CH_assert((IxData::ixValidBounds(i6, size)));
625 return IxData::m_ixStride*i6 +
626 m_ixNext.ixIndex1D(IxData::m_ixStride, i5, i4, i3, i2, i1, i0);
632 CH_assert((IxData::ixValidBounds(i5, size)));
633 return IxData::m_ixStride*i5 +
634 m_ixNext.ixIndex1D(IxData::m_ixStride, i4, i3, i2, i1, i0);
640 CH_assert((IxData::ixValidBounds(i4, size)));
641 return IxData::m_ixStride*i4 +
642 m_ixNext.ixIndex1D(IxData::m_ixStride, i3, i2, i1, i0);
646 const IIx_t i0)
const 648 CH_assert((IxData::ixValidBounds(i3, size)));
649 return IxData::m_ixStride*i3 +
650 m_ixNext.ixIndex1D(IxData::m_ixStride, i2, i1, i0);
655 CH_assert((IxData::ixValidBounds(i2, size)));
656 return IxData::m_ixStride*i2 +
657 m_ixNext.ixIndex1D(IxData::m_ixStride, i1, i0);
662 CH_assert((IxData::ixValidBounds(i1, size)));
663 return IxData::m_ixStride*i1 +
664 m_ixNext.ixIndex1D(IxData::m_ixStride, i0);
669 return (dim == Rank) ?
670 size/IxData::m_ixStride :
671 m_ixNext.ixDimSize(IxData::m_ixStride, dim);
675 return (dim == Rank) ?
676 IxData::ixLowerBound() :
677 m_ixNext.ixLowerBound(dim);
681 return (dim == Rank) ?
682 IxData::ixLowerBound() + size/IxData::m_ixStride - 1 :
683 m_ixNext.ixUpperBound(IxData::m_ixStride, dim);
687 return m_ixNext.ixTotalOffset();
690 unsigned ixIV(
const unsigned i)
const 703 template <
typename DimT>
716 IxData::ixDefineTotalOffset(offset - IxData::ixLowerBound());
722 IxData::ixDefineLowerBound(dim0);
723 IxData::ixDefineTotalOffset(offset - IxData::ixLowerBound());
727 const IIx_t i0)
const 729 CH_assert((IxData::ixValidBounds(i0, size)));
730 return i0 + IxData::ixTotalOffset();
739 return IxData::ixLowerBound();
743 return IxData::ixLowerBound() + size - 1;
747 return IxData::ixTotalOffset();
750 unsigned ixIV(
const unsigned i)
const 779 IxData::m_ixStride = dim0;
785 CH_assert((IxData::ixValidBounds(i1, size)));
787 return IxData::m_ixStride*i1 + i0;
792 return (dim == 2) ? size/IxData::m_ixStride :
801 return ixDimSize(size, dim) - 1;
808 unsigned ixIV(
const unsigned i)
const 824 template <
unsigned Rank,
typename DimT>
830 : IxData(), m_ixNext()
834 const DimT &dim0,
const DimT &dim1,
const DimT &dim2,
835 const DimT &dim3,
const DimT &dim4,
const DimT &dim5,
837 : IxData(dim0*dim1*dim2*dim3*dim4*dim5, dim6),
838 m_ixNext(offset - IxData::ixDimOffset(),
839 dim0, dim1, dim2, dim3, dim4, dim5)
842 const DimT &dim0,
const DimT &dim1,
const DimT &dim2,
843 const DimT &dim3,
const DimT &dim4,
const DimT &dim5)
844 : IxData(dim0*dim1*dim2*dim3*dim4, dim5),
845 m_ixNext(offset - IxData::ixDimOffset(), dim0, dim1, dim2, dim3, dim4)
848 const DimT &dim0,
const DimT &dim1,
const DimT &dim2,
849 const DimT &dim3,
const DimT &dim4)
850 : IxData(dim0*dim1*dim2*dim3, dim4),
851 m_ixNext(offset - IxData::ixDimOffset(), dim0, dim1, dim2, dim3)
854 const DimT &dim0,
const DimT &dim1,
const DimT &dim2,
856 : IxData(dim0*dim1*dim2, dim3),
857 m_ixNext(offset - IxData::ixDimOffset(), dim0, dim1, dim2)
860 const DimT &dim0,
const DimT &dim1,
const DimT &dim2)
861 : IxData(dim0*dim1, dim2),
862 m_ixNext(offset - IxData::ixDimOffset(), dim0, dim1)
865 const DimT &dim0,
const DimT &dim1)
867 m_ixNext(offset - IxData::ixDimOffset(), dim0)
871 const DimT &dim0,
const DimT &dim1,
const DimT &dim2,
872 const DimT &dim3,
const DimT &dim4,
const DimT &dim5,
875 IxData::m_ixStride = dim0*dim1*dim2*dim3*dim4*dim5;
876 IxData::ixDefineLowerBound(dim6);
877 m_ixNext.ixDefine(offset - IxData::ixDimOffset(),
878 dim0, dim1, dim2, dim3, dim4, dim5);
881 const DimT &dim0,
const DimT &dim1,
const DimT &dim2,
882 const DimT &dim3,
const DimT &dim4,
const DimT &dim5)
884 IxData::m_ixStride = dim0*dim1*dim2*dim3*dim4;
885 IxData::ixDefineLowerBound(dim5);
886 m_ixNext.ixDefine(offset - IxData::ixDimOffset(),
887 dim0, dim1, dim2, dim3, dim4);
890 const DimT &dim0,
const DimT &dim1,
const DimT &dim2,
891 const DimT &dim3,
const DimT &dim4)
893 IxData::m_ixStride = dim0*dim1*dim2*dim3;
894 IxData::ixDefineLowerBound(dim4);
895 m_ixNext.ixDefine(offset - IxData::ixDimOffset(), dim0, dim1, dim2, dim3);
898 const DimT &dim0,
const DimT &dim1,
const DimT &dim2,
901 IxData::m_ixStride = dim0*dim1*dim2;
902 IxData::ixDefineLowerBound(dim3);
903 m_ixNext.ixDefine(offset - IxData::ixDimOffset(), dim0, dim1, dim2);
906 const DimT &dim0,
const DimT &dim1,
const DimT &dim2)
908 IxData::m_ixStride = dim0*dim1;
909 IxData::ixDefineLowerBound(dim2);
910 m_ixNext.ixDefine(offset - IxData::ixDimOffset(), dim0, dim1);
913 const DimT &dim0,
const DimT &dim1)
916 IxData::ixDefineLowerBound(dim1);
917 m_ixNext.ixDefine(offset - IxData::ixDimOffset(), dim0);
923 const IIx_t i6)
const 925 CH_assert((IxData::ixValidBounds(i6, size)));
926 return IxData::m_ixStride*i6 +
927 m_ixNext.ixIndex1D(IxData::m_ixStride, i0, i1, i2, i3, i4, i5);
933 CH_assert((IxData::ixValidBounds(i5, size)));
934 return IxData::m_ixStride*i5 +
935 m_ixNext.ixIndex1D(IxData::m_ixStride, i0, i1, i2, i3, i4);
941 CH_assert((IxData::ixValidBounds(i4, size)));
942 return IxData::m_ixStride*i4 +
943 m_ixNext.ixIndex1D(IxData::m_ixStride, i0, i1, i2, i3);
947 const IIx_t i3)
const 949 CH_assert((IxData::ixValidBounds(i3, size)));
950 return IxData::m_ixStride*i3 +
951 m_ixNext.ixIndex1D(IxData::m_ixStride, i0, i1, i2);
956 CH_assert((IxData::ixValidBounds(i2, size)));
957 return IxData::m_ixStride*i2 +
958 m_ixNext.ixIndex1D(IxData::m_ixStride, i0, i1);
963 CH_assert((IxData::ixValidBounds(i1, size)));
964 return IxData::m_ixStride*i1 +
965 m_ixNext.ixIndex1D(IxData::m_ixStride, i0);
970 return (dim == Rank) ?
971 size/IxData::m_ixStride :
972 m_ixNext.ixDimSize(IxData::m_ixStride, dim);
976 return (dim == Rank) ?
977 IxData::ixLowerBound() :
978 m_ixNext.ixLowerBound(dim);
982 return (dim == Rank) ?
983 IxData::ixLowerBound() + size/IxData::m_ixStride - 1 :
984 m_ixNext.ixUpperBound(IxData::m_ixStride, dim);
988 return m_ixNext.ixTotalOffset();
991 unsigned ixIV(
const unsigned i)
const 1004 template <
typename DimT>
1017 IxData::ixDefineTotalOffset(offset - IxData::ixLowerBound());
1022 IxData::ixDefineLowerBound(dim0);
1023 IxData::ixDefineTotalOffset(offset - IxData::ixLowerBound());
1027 const IIx_t i0)
const 1029 CH_assert((IxData::ixValidBounds(i0, size)));
1030 return i0 + IxData::ixTotalOffset();
1039 return IxData::ixLowerBound();
1043 return IxData::ixLowerBound() + size - 1;
1047 return IxData::ixTotalOffset();
1050 unsigned ixIV(
const unsigned i)
const 1073 : IxData(dim0, dim1)
1079 IxData::m_ixStride = dim0;
1085 CH_assert((IxData::ixValidBounds(i1, size)));
1087 return IxData::m_ixStride*i1 + i0;
1092 return (dim == 2) ? size/IxData::m_ixStride :
1101 return ixDimSize(size, dim) - 1;
1108 unsigned ixIV(
const unsigned i)
const 1120 template <
unsigned Rank,
int ArConf>
1122 template <
unsigned Rank>
1128 template <
unsigned Rank>
1134 template <
unsigned Rank>
1141 template <
unsigned Rank>
1279 template <
typename T,
1292 : Indexer(), m_arrayImpl()
1296 CHArray(
const DimT &dim6,
const DimT &dim5,
const DimT &dim4,
1297 const DimT &dim3,
const DimT &dim2,
const DimT &dim1,
1299 : Indexer(0, dim6, dim5, dim4, dim3, dim2, dim1, dim0),
1300 m_arrayImpl(dim6*dim5*dim4*dim3*dim2*dim1*dim0)
1302 CHArray(
const DimT &dim5,
const DimT &dim4,
const DimT &dim3,
1303 const DimT &dim2,
const DimT &dim1,
const DimT &dim0)
1304 : Indexer(0, dim5, dim4, dim3, dim2, dim1, dim0),
1305 m_arrayImpl(dim5*dim4*dim3*dim2*dim1*dim0)
1307 CHArray(
const DimT &dim4,
const DimT &dim3,
const DimT &dim2,
1308 const DimT &dim1,
const DimT &dim0)
1309 : Indexer(0, dim4, dim3, dim2, dim1, dim0),
1310 m_arrayImpl(dim4*dim3*dim2*dim1*dim0)
1312 CHArray(
const DimT &dim3,
const DimT &dim2,
const DimT &dim1,
1314 : Indexer(0, dim3, dim2, dim1, dim0), m_arrayImpl(dim3*dim2*dim1*dim0)
1316 CHArray(
const DimT &dim2,
const DimT &dim1,
const DimT &dim0)
1317 : Indexer(0, dim2, dim1, dim0), m_arrayImpl(dim2*dim1*dim0)
1320 : Indexer(0, dim1, dim0), m_arrayImpl(dim1*dim0)
1327 : Indexer(0,
D_DEFIV, dimc1, dimc0), m_arrayImpl(iv.
product()*dimc1*dimc0)
1333 : Indexer(0, dimc1, dimc0,
D_DEFIV), m_arrayImpl(dimc1*dimc0*iv.
product())
1340 : Indexer(0,
D_DEFBOX, dimc1, dimc0),
1341 m_arrayImpl(box.size().
product()*dimc1*dimc0)
1348 : Indexer(0,
D_DEFBOX, dimc0), m_arrayImpl(box.size().
product()*dimc0)
1355 : Indexer(0, dimc1, dimc0,
D_DEFBOX),
1356 m_arrayImpl(dimc1*dimc0*box.size().
product())
1363 : Indexer(0, dimc0,
D_DEFBOX), m_arrayImpl(dimc0*box.size().
product())
1371 void define(
const DimT &dim6,
const DimT &dim5,
const DimT &dim4,
1372 const DimT &dim3,
const DimT &dim2,
const DimT &dim1,
1375 Indexer::ixDefine(0, dim6, dim5, dim4, dim3, dim2, dim1, dim0);
1376 m_arrayImpl.define(dim6*dim5*dim4*dim3*dim2*dim1*dim0);
1378 void define(
const DimT &dim5,
const DimT &dim4,
const DimT &dim3,
1379 const DimT &dim2,
const DimT &dim1,
const DimT &dim0)
1381 Indexer::ixDefine(0, dim5, dim4, dim3, dim2, dim1, dim0);
1382 m_arrayImpl.define(dim5*dim4*dim3*dim2*dim1*dim0);
1384 void define(
const DimT &dim4,
const DimT &dim3,
const DimT &dim2,
1385 const DimT &dim1,
const DimT &dim0)
1387 Indexer::ixDefine(0, dim4, dim3, dim2, dim1, dim0);
1388 m_arrayImpl.define(dim4*dim3*dim2*dim1*dim0);
1390 void define(
const DimT &dim3,
const DimT &dim2,
const DimT &dim1,
1393 Indexer::ixDefine(0, dim3, dim2, dim1, dim0);
1394 m_arrayImpl.define(dim3*dim2*dim1*dim0);
1396 void define(
const DimT &dim2,
const DimT &dim1,
const DimT &dim0)
1398 Indexer::ixDefine(0, dim2, dim1, dim0);
1399 m_arrayImpl.define(dim2*dim1*dim0);
1401 void define(
const DimT &dim1,
const DimT &dim0)
1403 Indexer::ixDefine(0, dim1, dim0);
1404 m_arrayImpl.define(dim1*dim0);
1408 Indexer::ixDefine(0, dim0);
1414 Indexer::ixDefine(0,
D_DEFIV, dimc1, dimc0);
1415 m_arrayImpl.define(iv.
product()*dimc1*dimc0);
1419 Indexer::ixDefine(0,
D_DEFIV, dimc0);
1420 m_arrayImpl.define(iv.
product()*dimc0);
1424 Indexer::ixDefine(0, dimc1, dimc0,
D_DEFIV);
1425 m_arrayImpl.define(dimc1*dimc0*iv.
product());
1429 Indexer::ixDefine(0, dimc0,
D_DEFIV);
1430 m_arrayImpl.define(dimc0*iv.
product());
1438 Indexer::ixDefine(0,
D_DEFBOX, dimc1, dimc0);
1439 m_arrayImpl.define(box.
size().
product()*dimc1*dimc0);
1446 Indexer::ixDefine(0,
D_DEFBOX, dimc0);
1454 Indexer::ixDefine(0, dimc1, dimc0,
D_DEFBOX);
1455 m_arrayImpl.define(dimc1*dimc0*box.
size().
product());
1462 Indexer::ixDefine(0, dimc0,
D_DEFBOX);
1468 const DimT &dim6,
const DimT &dim5,
const DimT &dim4,
1469 const DimT &dim3,
const DimT &dim2,
const DimT &dim1,
1472 Indexer::ixDefine(0, dim6, dim5, dim4, dim3, dim2, dim1, dim0);
1473 m_arrayImpl.define(addr, dim6*dim5*dim4*dim3*dim2*dim1*dim0);
1476 const DimT &dim5,
const DimT &dim4,
const DimT &dim3,
1477 const DimT &dim2,
const DimT &dim1,
const DimT &dim0)
1479 Indexer::ixDefine(0, dim5, dim4, dim3, dim2, dim1, dim0);
1480 m_arrayImpl.define(addr, dim5*dim4*dim3*dim2*dim1*dim0);
1483 const DimT &dim4,
const DimT &dim3,
const DimT &dim2,
1484 const DimT &dim1,
const DimT &dim0)
1486 Indexer::ixDefine(0, dim4, dim3, dim2, dim1, dim0);
1487 m_arrayImpl.define(addr, dim4*dim3*dim2*dim1*dim0);
1490 const DimT &dim3,
const DimT &dim2,
const DimT &dim1,
1493 Indexer::ixDefine(0, dim3, dim2, dim1, dim0);
1494 m_arrayImpl.define(addr, dim3*dim2*dim1*dim0);
1497 const DimT &dim2,
const DimT &dim1,
const DimT &dim0)
1499 Indexer::ixDefine(0, dim2, dim1, dim0);
1500 m_arrayImpl.define(addr, dim2*dim1*dim0);
1503 const DimT &dim1,
const DimT &dim0)
1505 Indexer::ixDefine(0, dim1, dim0);
1506 m_arrayImpl.define(addr, dim1*dim0);
1511 Indexer::ixDefine(0, dim0);
1516 const DimT &dimc1,
const DimT &dimc0)
1518 Indexer::ixDefine(0,
D_DEFIV, dimc1, dimc0);
1519 m_arrayImpl.define(addr, iv.
product()*dimc1*dimc0);
1523 Indexer::ixDefine(0,
D_DEFIV, dimc0);
1524 m_arrayImpl.define(addr, iv.
product()*dimc0);
1526 void define(
void *
const addr,
const DimT &dimc1,
const DimT &dimc0,
1529 Indexer::ixDefine(0, dimc1, dimc0,
D_DEFIV);
1530 m_arrayImpl.define(addr, dimc1*dimc0*iv.
product());
1534 Indexer::ixDefine(0, dimc0,
D_DEFIV);
1535 m_arrayImpl.define(addr, dimc0*iv.
product());
1539 const DimT &dimc1,
const DimT &dimc0)
1544 Indexer::ixDefine(0,
D_DEFBOX, dimc1, dimc0);
1545 m_arrayImpl.define(addr, box.
size().
product()*dimc1*dimc0);
1552 Indexer::ixDefine(0,
D_DEFBOX, dimc0);
1553 m_arrayImpl.define(addr, box.
size().
product()*dimc0);
1555 void define(
void *
const addr,
const DimT &dimc1,
const DimT &dimc0,
1561 Indexer::ixDefine(0, dimc1, dimc0,
D_DEFBOX);
1562 m_arrayImpl.define(addr, dimc1*dimc0*box.
size().
product());
1569 Indexer::ixDefine(0, dimc0,
D_DEFBOX);
1570 m_arrayImpl.define(addr, dimc0*box.
size().
product());
1577 m_arrayImpl.undefine();
1581 template <
typename T2>
1586 const T *
const pEnd = end();
1587 for (T *
p = begin();
p != pEnd;) *
p++ = Tval;
1598 return m_arrayImpl.data[
1599 Indexer::ixIndex1D(size(), i6, i5, i4, i3, i2, i1, i0)];
1606 return m_arrayImpl.data[
1607 Indexer::ixIndex1D(size(), i5, i4, i3, i2, i1, i0)];
1614 return m_arrayImpl.data[Indexer::ixIndex1D(size(), i4, i3, i2, i1, i0)];
1620 return m_arrayImpl.data[Indexer::ixIndex1D(size(), i3, i2, i1, i0)];
1626 return m_arrayImpl.data[Indexer::ixIndex1D(size(), i2, i1, i0)];
1631 return m_arrayImpl.data[Indexer::ixIndex1D(size(), i1, i0)];
1636 return m_arrayImpl.data[Indexer::ixIndex1D(size(), i0)];
1641 return m_arrayImpl.data[Indexer::ixIndex1D(size(),
D_IXIV, c1, c0)];
1646 return m_arrayImpl.data[Indexer::ixIndex1D(size(),
D_IXIV, c0)];
1651 return m_arrayImpl.data[Indexer::ixIndex1D(size(), c1, c0,
D_IXIV)];
1656 return m_arrayImpl.data[Indexer::ixIndex1D(size(), c0,
D_IXIV)];
1666 return m_arrayImpl.data[
1667 Indexer::ixIndex1D(size(), i6, i5, i4, i3, i2, i1, i0)];
1674 return m_arrayImpl.data[
1675 Indexer::ixIndex1D(size(), i5, i4, i3, i2, i1, i0)];
1682 return m_arrayImpl.data[Indexer::ixIndex1D(size(), i4, i3, i2, i1, i0)];
1688 return m_arrayImpl.data[Indexer::ixIndex1D(size(), i3, i2, i1, i0)];
1694 return m_arrayImpl.data[Indexer::ixIndex1D(size(), i2, i1, i0)];
1699 return m_arrayImpl.data[Indexer::ixIndex1D(size(), i1, i0)];
1704 return m_arrayImpl.data[Indexer::ixIndex1D(size(), i0)];
1710 return m_arrayImpl.data[Indexer::ixIndex1D(size(),
D_IXIV, c1, c0)];
1715 return m_arrayImpl.data[Indexer::ixIndex1D(size(),
D_IXIV, c0)];
1721 return m_arrayImpl.data[Indexer::ixIndex1D(size(), c1, c0,
D_IXIV)];
1726 return m_arrayImpl.data[Indexer::ixIndex1D(size(), c0,
D_IXIV)];
1732 return *
static_cast<Alloc*
>(&m_arrayImpl);
1738 return m_arrayImpl.data;
1742 return m_arrayImpl.data;
1746 return m_arrayImpl.data + size();
1750 return m_arrayImpl.data + size();
1754 static constexpr
unsigned rank() noexcept
1762 return m_arrayImpl.size;
1770 return Indexer::ixDimSize(size(), dim+1);
1778 return Indexer::ixLowerBound(dim+1);
1786 return Indexer::ixUpperBound(size(), dim+1);
1793 return Indexer::ixTotalOffset();
1799 return (m_arrayImpl.data != 0);
1805 return isAllocated() && size() > 0;
1819 : size(a_size), data(0)
1821 data = Alloc::allocate(size);
1825 if (data != 0) undefine();
1829 if (data != 0) undefine();
1831 data = Alloc::allocate(size);
1835 if (data != 0) undefine();
1837 data = Alloc::allocate(addr, size);
1841 Alloc::deallocate(data, size);
1859 template<
typename T,
unsigned Rank,
int ArConf,
typename Alloc>
1865 const T *
const pEnd = A.
end();
1866 if (p != pEnd) os << *p++;
1867 while (p != pEnd) os <<
' ' << *p++;
1877 os.setf(std::ios_base::scientific, std::ios_base::floatfield);
1885 os << std::setw(prec+7) <<
M(i, 0);
1888 os <<
' ' << std::setw(prec+7) <<
M(i, j);
1893 os.setf(std::ios_base::fmtflags(0), std::ios_base::floatfield);
1911 template <
typename T>
1917 T *
const p =
new(std::nothrow) T[size];
1958 CHVector *
const V =
new(std::nothrow) CHVector[size];
1960 vectorData =
new(std::nothrow)
Real[size*n];
1962 for (
USz_t i = 0; i != size; ++i)
1964 V[i].
define(vectorData + i*n, n);
1971 delete[] vectorData;
2010 CHMatrix *
const M =
new(std::nothrow) CHMatrix[size];
2012 const USz_t stride = m*n;
2013 matrixData =
new(std::nothrow)
Real[size*stride];
2015 for (
USz_t i = 0; i != size; ++i)
2017 M[i].
define(matrixData + i*stride, m, n);
2024 delete[] matrixData;
2070 #include "NamespaceFooter.H" Multidimensional array class.
Definition: CHArray.H:1283
CHArray(const Box &box, const DimT &dimc0)
Definition: CHArray.H:1347
#define D_DECL6(a, b, c, d, e, f)
Definition: CHArray.H:39
bool isAllocated() const
Memory has been allocated.
Definition: CHArray.H:1797
IIx_t m_ixIB
Lower bound for this dimension.
Definition: CHArray.H:508
void define(void *const addr, const IntVect &iv, const DimT &dimc0)
Definition: CHArray.H:1521
Rank > 2 for zero-based subscripts and > 1 for subscript ranges.
Definition: CHArray.H:825
const T & operator()(const IntVect &iv, const ArSp::IIx_t c1, const ArSp::IIx_t c0) const
Definition: CHArray.H:1706
CHArray(const DimT &dim3, const DimT &dim2, const DimT &dim1, const DimT &dim0)
Definition: CHArray.H:1312
Allocator for an array of matrices contiguous in memory.
Definition: CHArray.H:1995
ArSp::IIx_t dimB
Definition: CHArray.H:196
#define D_DEFIV
Definition: CHArray.H:122
void define(const DimT &dimc1, const DimT &dimc0, const IntVect &iv)
Definition: CHArray.H:1422
Definition: CHArray.H:330
void deallocate(CHVector *p, const USz_t size)
Definition: CHArray.H:1968
USz_t m_ixStride
Stride for this dimension.
Definition: CHArray.H:438
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:569
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:636
T & operator()(const ArSp::IIx_t i2, const ArSp::IIx_t i1, const ArSp::IIx_t i0)
Definition: CHArray.H:1622
#define D_DEFBOX
Definition: CHArray.H:130
int vec[SpaceDim]
Definition: CHArray.H:70
IIx_t ixLowerBound() const
Definition: CHArray.H:393
void define(void *const addr, const DimT &dim4, const DimT &dim3, const DimT &dim2, const DimT &dim1, const DimT &dim0)
Definition: CHArray.H:1482
Rank 1 and a zero-based subscript (no data)
Definition: CHArray.H:448
T & operator()(const ArSp::IIx_t c0, const IntVect &iv)
Definition: CHArray.H:1653
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:644
IntVect size() const
Definition: CHArray.H:86
const T & operator()(const ArSp::IIx_t i1, const ArSp::IIx_t i0) const
Definition: CHArray.H:1696
IIx_t ixLowerBound(const unsigned dim) const
Definition: CHArray.H:673
IIx_t ixUpperBound(const USz_t size, const unsigned dim) const
Definition: CHArray.H:1041
Allocator that only permits allocation by new.
Definition: CHArray.H:1912
USz_t ixDimSize(const USz_t size, const unsigned dim) const
Definition: CHArray.H:790
#define D_TERM6(a, b, c, d, e, f)
Definition: CHArray.H:40
static void eval(T *p, USz_t size)
Definition: CHArray.H:296
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:870
#define CH_assert(cond)
Definition: CHArray.H:37
void define(void *const addr, const DimT &dim1, const DimT &dim0)
Definition: CHArray.H:1502
void define(const DimT &dim2, const DimT &dim1, const DimT &dim0)
Definition: CHArray.H:1396
unsigned ixIV(const unsigned i) const
Definition: CHArray.H:1108
IndexerData< 1, DimT > IxData
Definition: CHArray.H:1007
void ixDefineTotalOffset(const IIx_t offset)
Definition: CHArray.H:465
Array_impl()
Definition: CHArray.H:1815
#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:853
const T * begin() const
Definition: CHArray.H:1740
IIx_t ixDimOffset() const
Definition: CHArray.H:401
USz_t ixIndex1D(const USz_t size, const IIx_t i1, const IIx_t i0) const
Definition: CHArray.H:782
IIx_t ixTotalOffset() const
Definition: CHArray.H:1045
Definition: CHArray_fwd.H:37
IIx_t ixUpperBound(const USz_t size, const unsigned dim) const
Definition: CHArray.H:679
IntVect operator*(const IntVect &p) const
Definition: IntVect.H:1111
CHArray(const Box &box, const DimT &dimc1, const DimT &dimc0)
Definition: CHArray.H:1339
Definition: CHArray.H:205
T * allocate(void *const addr, const USz_t size)
Definition: CHArray.H:349
IIx_t ixUpperBound(const USz_t size, const unsigned dim) const
Definition: CHArray.H:980
const T & operator()(const ArSp::IIx_t c0, const IntVect &iv) const
Definition: CHArray.H:1723
const T * end() const
Definition: CHArray.H:1748
bool defined
Definition: CHArray.H:2030
static constexpr unsigned rank() noexcept
Rank of the array.
Definition: CHArray.H:1754
CHArray< Real, 2, ArZeroCol, ArSp::DefaultArrayAlloc< Real > > CHMatrix
Matrix defined with column-ordered storage.
Definition: CHArray.H:1856
USz_t ixIndex1D(const USz_t size, const IIx_t i0) const
Definition: CHArray.H:726
const T & operator()(const IntVect &iv, const ArSp::IIx_t c0) const
Definition: CHArray.H:1712
void ixDefine(const IIx_t offset, const DimT &dim3, const DimT &dim2, const DimT &dim1, const DimT &dim0)
Definition: CHArray.H:596
USz_t ixIndex1D(const USz_t size, const IIx_t i0, const IIx_t i1, const IIx_t i2) const
Definition: CHArray.H:953
T & operator()(const ArSp::IIx_t c1, const ArSp::IIx_t c0, const IntVect &iv)
Definition: CHArray.H:1648
IndexerData< 1, DimT > IxData
Definition: CHArray.H:706
CSIndexer(const IIx_t offset, const DimT &dim0, const DimT &dim1, const DimT &dim2)
Definition: CHArray.H:859
IIx_t ixLowerBound() const
Definition: CHArray.H:457
IntVect(const IntVect &iv)
Definition: CHArray.H:51
bool isUsable() const
Memory has been allocated and size is > 0.
Definition: CHArray.H:1803
void ixDefine(const IIx_t offset, const USz_t dim0, const USz_t dim1)
Definition: CHArray.H:1076
void deallocate(CHMatrix *p, const USz_t size)
Definition: CHArray.H:2021
void define(const DimT &dimc0, const Box &box)
Definition: CHArray.H:1457
T & operator()(const IntVect &iv, const ArSp::IIx_t c0)
Definition: CHArray.H:1643
void define(void *const addr, const Box &box, const DimT &dimc1, const DimT &dimc0)
Definition: CHArray.H:1538
unsigned ixIV(const unsigned i) const
Definition: CHArray.H:750
void define(void *const addr, const DimT &dim2, const DimT &dim1, const DimT &dim0)
Definition: CHArray.H:1496
IIx_t ixTotalOffset() const
Definition: CHArray.H:986
AllocBy m_allocBy
Definition: CHArray.H:334
void ixDefineLowerBound(const DimT &dim)
Definition: CHArray.H:391
int BoxAllowed
Definition: CHArray.H:1146
void define(void *const addr, const DimT &dim3, const DimT &dim2, const DimT &dim1, const DimT &dim0)
Definition: CHArray.H:1489
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:929
CHArray & operator=(const T2 &val)
Assign a constant to the array.
Definition: CHArray.H:1582
CHArray(const DimT &dim0)
Definition: CHArray.H:1322
IIx_t ixLowerBound() const
Definition: CHArray.H:491
RSIndexer(const IIx_t offset, const USz_t &dim1, const USz_t &dim0)
Definition: CHArray.H:771
T & operator()(const IntVect &iv, const ArSp::IIx_t c1, const ArSp::IIx_t c0)
Definition: CHArray.H:1638
CHRange(const ArSp::IIx_t a_dimE)
Definition: CHArray.H:186
CSIndexer< Rank-1, DimT > m_ixNext
Next lower rank.
Definition: CHArray.H:997
Array_impl(const ArSp::USz_t a_size)
Definition: CHArray.H:1818
USz_t ixIndex1D(const USz_t size, const IIx_t i1, const IIx_t i0) const
Definition: CHArray.H:659
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:619
RSIndexer(const IIx_t offset, const DimT &dim2, const DimT &dim1, const DimT &dim0)
Definition: CHArray.H:558
void undefine()
Definition: CHArray.H:1839
void ixDefine(const IIx_t offset, const DimT &dim1, const DimT &dim0)
Definition: CHArray.H:611
RSIndexer()
Definition: CHArray.H:767
IndexerData< Rank, DimT > IxData
Definition: CHArray.H:827
void ixDefineLowerBound(const CHRange &dim)
Definition: CHArray.H:422
RSIndexer(const IIx_t offset, const DimT &dim0)
Definition: CHArray.H:712
int IIx_t
Definition: CHArray_fwd.H:54
void define(const DimT &dim4, const DimT &dim3, const DimT &dim2, const DimT &dim1, const DimT &dim0)
Definition: CHArray.H:1384
IIx_t ixLowerBound(const unsigned dim) const
Definition: CHArray.H:737
ArSp::USz_t size(const unsigned dim) const
Size of a dimension (0 is dimension with contiguous storage)
Definition: CHArray.H:1766
ArSp::USz_t size
Overall size of the array.
Definition: CHArray.H:1845
void ixDefine(const IIx_t offset, const DimT &dim0, const DimT &dim1, const DimT &dim2)
Definition: CHArray.H:905
ArSp::ArTr< Rank, ArConf >::DimT DimT
Definition: CHArray.H:1285
IIx_t ixTotalOffset() const
Definition: CHArray.H:1103
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:945
CHArray(const DimT &dim1, const DimT &dim0)
Definition: CHArray.H:1319
void ixDefineLowerBound(const DimT &dim)
Definition: CHArray.H:455
IIx_t ixTotalOffset() const
Definition: CHArray.H:467
Alloc & getAllocator()
Get the allocator.
Definition: CHArray.H:1730
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:1564
void define(const DimT &dim0)
Definition: CHArray.H:1406
Any rank and a zero-based subscript.
Definition: CHArray.H:382
ArSp::IIx_t totalOffset() const
Offset from non-zero lower bound.
Definition: CHArray.H:1790
ArSp::RSIndexer< Rank, DimT > IndexerT
Definition: CHArray.H:1138
AllocBy
Definition: CHArray.H:328
ArSp::IIx_t upperBound(const unsigned dim) const
Upper bound of a dimension (0 is dimension with contiguous storage)
Definition: CHArray.H:1782
USz_t m
Definition: CHArray.H:2028
void ixDefineLowerBound(const CHRange &dim)
Definition: CHArray.H:487
CSIndexer()
Definition: CHArray.H:1067
void define(const DimT &dimc1, const DimT &dimc0, const Box &box)
Definition: CHArray.H:1449
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:1677
Definition: EBInterface.H:45
unsigned USz_t
Type of unsigned int for a size.
Definition: CHArray_fwd.H:57
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:532
void const char const int const int const int const Real const Real const int const Real const int const Real Real * C
Definition: Lapack.H:83
CHArray(const IntVect &iv, const DimT &dimc0)
Definition: CHArray.H:1329
IndexerData(const USz_t stride, const DimT &dim)
Definition: CHArray.H:388
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:1616
void ixDefine(const IIx_t offset, const DimT &dim2, const DimT &dim1, const DimT &dim0)
Definition: CHArray.H:604
RSIndexer(const IIx_t offset, const DimT &dim4, const DimT &dim3, const DimT &dim2, const DimT &dim1, const DimT &dim0)
Definition: CHArray.H:546
IndexerData()
Definition: CHArray.H:416
USz_t ixIndex1D(const USz_t size, const IIx_t i0) const
Definition: CHArray.H:1026
T & operator()(const ArSp::IIx_t i1, const ArSp::IIx_t i0)
Definition: CHArray.H:1628
bool ixValidBounds(const IIx_t i, const USz_t size) const
Definition: CHArray.H:495
IIx_t ixTotalOffset() const
Definition: CHArray.H:503
CHRange(const ArSp::IIx_t a_dimB, const ArSp::IIx_t a_dimE)
Definition: CHArray.H:191
T * end()
Definition: CHArray.H:1744
IntVect m_lb
Definition: CHArray.H:95
ArSp::USz_t DimT
Definition: CHArray.H:1131
void const char const int const int const int const Real const Real * A
Definition: Lapack.H:83
Box(const IntVect &lb, const IntVect &ub)
Definition: CHArray.H:75
CSIndexer()
Definition: CHArray.H:829
USz_t sizeOfDim< CHRange >(const CHRange &dim)
Definition: CHArray.H:217
ArSp::ArTr< Rank, ArConf >::IndexerT Indexer
Definition: CHArray.H:1286
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:652
void define(const USz_t a_m, const USz_t a_n)
Definition: CHArray.H:2001
bool ixValidBounds(const IIx_t i, const USz_t size) const
Definition: CHArray.H:461
IIx_t m_ixIB
Lower bound for this dimension.
Definition: CHArray.H:440
Definition: CHArray.H:1813
T * data
Data for the array.
Definition: CHArray.H:1846
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:540
Real * matrixData
Definition: CHArray.H:2027
IndexerData(const CHRange &dim)
Definition: CHArray.H:484
IndexerData< 2, USz_t > IxData
Definition: CHArray.H:765
const T & operator()(const ArSp::IIx_t i2, const ArSp::IIx_t i1, const ArSp::IIx_t i0) const
Definition: CHArray.H:1690
const T & operator()(const ArSp::IIx_t c1, const ArSp::IIx_t c0, const IntVect &iv) const
Definition: CHArray.H:1717
int smallEnd(const int dir) const
Definition: CHArray.H:78
~Array_impl()
Definition: CHArray.H:1823
RSIndexer()
Definition: CHArray.H:528
Array_impl m_arrayImpl
Data + allocation/deallocation.
Definition: CHArray.H:1849
DefaultArrayAlloc()
Definition: CHArray.H:337
void define(const ArSp::USz_t a_size)
Definition: CHArray.H:1827
USz_t ixIndex1D(const USz_t size, const IIx_t i0, const IIx_t i1) const
Definition: CHArray.H:960
IIx_t ixDimOffset() const
Definition: CHArray.H:434
void ixDefine(const IIx_t offset, const DimT &dim0, const DimT &dim1, const DimT &dim2, const DimT &dim3)
Definition: CHArray.H:897
IndexerData< Rank, DimT > IxData
Definition: CHArray.H:526
friend std::ostream & operator<<(std::ostream &os, const IntVect &iv)
void define(void *const addr, const DimT &dimc0, const IntVect &iv)
Definition: CHArray.H:1532
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:1609
USz_t ixDimSize(const USz_t size, const unsigned dim) const
Definition: CHArray.H:733
Forward declarations for class CHArray.
void define(const IntVect &iv, const DimT &dimc1, const DimT &dimc0)
Definition: CHArray.H:1412
RSIndexer< Rank-1, DimT > m_ixNext
Next lower rank.
Definition: CHArray.H:696
IIx_t ixLowerBound() const
Definition: CHArray.H:426
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:1660
IndexerData(const USz_t stride, const CHRange &dim)
Definition: CHArray.H:419
void ixDefine(const IIx_t offset, const DimT &dim0)
Definition: CHArray.H:719
T * allocate(const USz_t size)
Definition: CHArray.H:1915
Definition: CHArray.H:280
IntVect m_ub
Definition: CHArray.H:96
RSIndexer()
Definition: CHArray.H:708
USz_t m_ixStride
Stride for this dimension.
Definition: CHArray.H:405
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:880
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:920
Real * vectorData
Definition: CHArray.H:1974
int & operator[](const int i)
Definition: CHArray.H:56
bool ixValidBounds(const IIx_t i, const USz_t size) const
Definition: CHArray.H:397
CHArray(const DimT &dim4, const DimT &dim3, const DimT &dim2, const DimT &dim1, const DimT &dim0)
Definition: CHArray.H:1307
IIx_t ixUpperBound(const USz_t size, const unsigned dim) const
Definition: CHArray.H:1099
Range of subscripts and row-storage.
Definition: CHArray_fwd.H:36
void define(const IntVect &iv, const DimT &dimc0)
Definition: CHArray.H:1417
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:1467
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:833
ArSp::USz_t size() const
Overall size of the array.
Definition: CHArray.H:1760
ArSp::RSIndexer< Rank, DimT > IndexerT
Definition: CHArray.H:1126
CHMatrix * allocate(const USz_t size)
Definition: CHArray.H:2007
void ixDefine(const IIx_t offset, const DimT &dim0)
Definition: CHArray.H:1020
IIx_t ixUpperBound(const USz_t size, const unsigned dim) const
Definition: CHArray.H:799
int BoxAllowed
Definition: CHArray.H:1139
void ixDefine(const IIx_t offset, const DimT &dim0, const DimT &dim1)
Definition: CHArray.H:912
void deallocate(T *p, const USz_t size)
Definition: CHArray.H:355
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:841
USz_t ixDimSize(const USz_t size, const unsigned dim) const
Definition: CHArray.H:1033
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:937
USz_t ixDimSize(const USz_t size, const unsigned dim) const
Definition: CHArray.H:667
IIx_t ixLowerBound(const unsigned dim) const
Definition: CHArray.H:795
CHArray(const DimT &dimc0, const IntVect &iv)
Definition: CHArray.H:1335
unsigned ixIV(const unsigned i) const
Definition: CHArray.H:991
CHArray(const DimT &dimc1, const DimT &dimc0, const IntVect &iv)
Definition: CHArray.H:1332
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:579
void define(void *const addr, const DimT &dim0)
Definition: CHArray.H:1508
T * begin()
Access extents of the memory allocated for the array.
Definition: CHArray.H:1736
bool defined
Definition: CHArray.H:1976
Definition: CHArray.H:331
ArSp::CSIndexer< Rank, DimT > IndexerT
Definition: CHArray.H:1145
void define(const Box &box, const DimT &dimc1, const DimT &dimc0)
Definition: CHArray.H:1433
void define(void *const addr, const DimT &dimc1, const DimT &dimc0, const IntVect &iv)
Definition: CHArray.H:1526
ArrayOfMatrixAlloc()
Definition: CHArray.H:1998
T value_type
Type of element.
Definition: CHArray.H:1287
A Rectangular Domain on an Integer Lattice.
Definition: Box.H:469
IIx_t ixTotalOffset() const
Definition: CHArray.H:685
Test for class type.
Definition: Misc.H:136
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:1082
CHArray()
Default constructor.
Definition: CHArray.H:1291
void define(const DimT &dim1, const DimT &dim0)
Definition: CHArray.H:1401
void define(const USz_t a_n)
Definition: CHArray.H:1950
Zero lower bound and column-storage.
Definition: CHArray_fwd.H:35
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:1592
void define(const DimT &dimc0, const IntVect &iv)
Definition: CHArray.H:1427
ArSp::IIx_t lowerBound(const unsigned dim) const
Lower bound of a dimension (0 is dimension with contiguous storage)
Definition: CHArray.H:1774
void ixDefine(const IIx_t offset, const DimT &dim4, const DimT &dim3, const DimT &dim2, const DimT &dim1, const DimT &dim0)
Definition: CHArray.H:588
CSIndexer()
Definition: CHArray.H:1009
CSIndexer(const IIx_t offset, const DimT &dim0)
Definition: CHArray.H:1013
Definition: CHArray.H:251
static void eval(T *p, USz_t size)
Definition: CHArray.H:286
const T & operator()(const ArSp::IIx_t i0) const
Definition: CHArray.H:1701
IIx_t ixTotalOffset() const
Definition: CHArray.H:803
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:1684
IIx_t ixUpperBound(const USz_t size, const unsigned dim) const
Definition: CHArray.H:741
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:1378
IndexerData(const DimT &dim)
Definition: CHArray.H:453
CHArray(const DimT &dim2, const DimT &dim1, const DimT &dim0)
Definition: CHArray.H:1316
unsigned ixIV(const unsigned i) const
Definition: CHArray.H:808
IIx_t ixDimSize(const USz_t size, const unsigned dim) const
Definition: CHArray.H:1090
ArrayOfVectorAlloc()
Definition: CHArray.H:1947
void ixDefine(const IIx_t offset, const DimT &dim0, const DimT &dim1, const DimT &dim2, const DimT &dim3, const DimT &dim4)
Definition: CHArray.H:889
CHArray< Real, 1, ArZeroCol, ArSp::DefaultArrayAlloc< Real > > CHVector
Vector definition.
Definition: CHArray.H:1853
void define(const Box &box, const DimT &dimc0)
Definition: CHArray.H:1441
void const char const int * M
Definition: Lapack.H:83
IndexerData< 2, USz_t > IxData
Definition: CHArray.H:1065
Zero lower bound and row-storage.
Definition: CHArray_fwd.H:34
IIx_t m_ixOffset
Definition: CHArray.H:509
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:1601
RSIndexer(const IIx_t offset, const DimT &dim1, const DimT &dim0)
Definition: CHArray.H:563
T & operator()(const ArSp::IIx_t i0)
Definition: CHArray.H:1633
CHVector * allocate(const USz_t size)
Definition: CHArray.H:1955
IndexerData()
Definition: CHArray.H:481
CHArray(const DimT &dimc0, const Box &box)
Definition: CHArray.H:1362
ArSp::IIx_t dimE
Definition: CHArray.H:197
Default allocator.
Definition: CHArray.H:325
IIx_t ixLowerBound(const unsigned dim) const
Definition: CHArray.H:1095
unsigned ixIV(const unsigned i) const
Definition: CHArray.H:690
RSIndexer(const IIx_t offset, const DimT &dim3, const DimT &dim2, const DimT &dim1, const DimT &dim0)
Definition: CHArray.H:552
void ixDefineTotalOffset(const IIx_t offset)
Definition: CHArray.H:499
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:1669
void ixDefine(const IIx_t offset, const USz_t &dim1, const USz_t &dim0)
Definition: CHArray.H:776
ArSp::USz_t DimT
Definition: CHArray.H:1125
void deallocate(T *p, const USz_t size)
Definition: CHArray.H:1922
void define(void *const addr, const ArSp::USz_t a_size)
Definition: CHArray.H:1833
CSIndexer(const IIx_t offset, const DimT &dim0, const DimT &dim1)
Definition: CHArray.H:864
IIx_t ixLowerBound(const unsigned dim) const
Definition: CHArray.H:974
void define(void *const addr, const IntVect &iv, const DimT &dimc1, const DimT &dimc0)
Definition: CHArray.H:1515
IIx_t ixTotalOffset() const
Definition: CHArray.H:745
ArSp::CSIndexer< Rank, DimT > IndexerT
Definition: CHArray.H:1132
Definition: CHArray.H:1121
static T * eval(void *const addr, const USz_t size)
Definition: CHArray.H:267
CSIndexer(const IIx_t offset, const USz_t dim0, const USz_t dim1)
Definition: CHArray.H:1071
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:628
void undefine()
Deallocate the array.
Definition: CHArray.H:1574
USz_t n
Definition: CHArray.H:1975
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:1371
USz_t ixDimSize(const USz_t size, const unsigned dim) const
Definition: CHArray.H:968
#define D_IXIV
Definition: CHArray.H:145
char One
Definition: CHArray.H:104
USz_t sizeOfDim(const T &dim)
Get the size of a dimension.
Definition: CHArray.H:210
IndexerData()
Definition: CHArray.H:385
CHArray(const IntVect &iv, const DimT &dimc1, const DimT &dimc0)
Definition: CHArray.H:1326
CHArray(const DimT &dimc1, const DimT &dimc0, const Box &box)
Definition: CHArray.H:1354
CSIndexer(const IIx_t offset, const DimT &dim0, const DimT &dim1, const DimT &dim2, const DimT &dim3, const DimT &dim4)
Definition: CHArray.H:847
Allocator for an array of vectors contiguous in memory.
Definition: CHArray.H:1944
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:1296
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:1475
T * allocate(const USz_t size)
Definition: CHArray.H:341
unsigned ixIV(const unsigned i) const
Definition: CHArray.H:1050
CHRange DimT
Definition: CHArray.H:1137
IndexerData()
Definition: CHArray.H:451
static T * eval(void *const addr, const USz_t size)
Definition: CHArray.H:257
Defines a range of subscripts.
Definition: CHArray.H:184
void define(const DimT &dim3, const DimT &dim2, const DimT &dim1, const DimT &dim0)
Definition: CHArray.H:1390
CHRange DimT
Definition: CHArray.H:1144
Rank > 2 for zero-based subscripts and > 1 for subscript ranges.
Definition: CHArray.H:524
void define(void *const addr, const DimT &dimc1, const DimT &dimc0, const Box &box)
Definition: CHArray.H:1555
CHArray(const DimT &dim5, const DimT &dim4, const DimT &dim3, const DimT &dim2, const DimT &dim1, const DimT &dim0)
Definition: CHArray.H:1302
IntVect()
Definition: IntVect.H:67
IIx_t ixLowerBound(const unsigned dim) const
Definition: CHArray.H:1037
void define(void *const addr, const Box &box, const DimT &dimc0)
Definition: CHArray.H:1547
USz_t n
Definition: CHArray.H:2029
bool ixValidBounds(const IIx_t i, const USz_t size) const
Definition: CHArray.H:430