43#ifndef DOMI_MDARRAYRCP_HPP
44#define DOMI_MDARRAYRCP_HPP
50#include "Teuchos_ArrayRCPDecl.hpp"
53#include "Domi_ConfigDefs.hpp"
54#include "Domi_Utils.hpp"
55#include "Domi_MDArrayView.hpp"
63template<
typename T >
class MDArrayRCP;
105template<
typename T >
113template<
typename T >
122template<
typename T >
131template<
typename T >
140template<
typename T >
153template<
typename T >
206 const Teuchos::ArrayView< dim_type > & dims,
207 Layout
layout = DEFAULT_ORDER);
227 Layout
layout = DEFAULT_ORDER);
267 const Teuchos::ArrayView< size_type > &
strides,
269 Layout
layout = DEFAULT_ORDER);
305 inline const Teuchos::Array< dim_type > &
dimensions()
const;
320 inline const Teuchos::Array< size_type > &
strides()
const;
324 inline const Teuchos::ArrayRCP< T > &
arrayRCP()
const;
555 inline T &
operator()(dim_type i, dim_type j, dim_type k, dim_type m);
573 inline T &
operator()(dim_type i, dim_type j, dim_type k, dim_type m,
597 inline T &
operator()(dim_type i, dim_type j, dim_type k, dim_type m,
598 dim_type n, dim_type p, ...);
634 inline const T &
operator()(dim_type i, dim_type j, dim_type k)
const;
650 inline const T &
operator()(dim_type i, dim_type j, dim_type k,
669 inline const T &
operator()(dim_type i, dim_type j, dim_type k,
670 dim_type m, dim_type n)
const;
693 inline const T &
operator()(dim_type i, dim_type j, dim_type k,
694 dim_type m, dim_type n, dim_type p, ...)
const;
754 void resize(
const Teuchos::ArrayView< dim_type > & dims);
786 template<
typename T2 >
792 template<
typename T2 >
798 template<
typename T2 >
804 template<
typename T2 >
810 template<
typename T2 >
816 template<
typename T2 >
822 template<
typename T2 >
828 template<
typename T2 >
834 template<
typename T2 >
840 template<
typename T2 >
846 template<
typename T2 >
853 Teuchos::Array< dim_type > _dimensions;
854 Teuchos::Array< size_type > _strides;
855 Teuchos::ArrayRCP< T > _array;
860 void assertAxis(
int axis)
const;
863 void assertIndex(dim_type i,
int axis)
const;
872template<
typename T >
874 _dimensions(Teuchos::tuple< dim_type >(0)),
875 _strides(Teuchos::tuple< size_type >(1)),
877 _layout(DEFAULT_ORDER),
884template<
typename T >
886 const Teuchos::ArrayView< dim_type > & dims,
889 _strides(computeStrides< size_type, dim_type >(dims, layout)),
890 _array(array.getRawPtr(), 0, array.size(), false),
892 _ptr(_array.getRawPtr())
894 TEUCHOS_TEST_FOR_EXCEPTION(array.size() < computeSize(dims),
896 "Teuchos::ArrayView size too small for "
902template<
typename T >
907 _strides(computeStrides< size_type, dim_type >(dims, layout)),
908 _array(computeSize(dims), val),
910 _ptr(_array.getRawPtr())
916template<
typename T >
920 _strides(computeStrides< size_type, dim_type >(dims, layout)),
921 _array(computeSize(dims)),
923 _ptr(_array.getRawPtr())
929template<
typename T >
931 const Teuchos::ArrayView< size_type > & strides,
936 _array(data, 0, computeSize(dims, strides), false),
944template<
typename T >
946 _dimensions(r_ptr._dimensions),
947 _strides(r_ptr._strides),
948 _array(r_ptr._array),
949 _layout(r_ptr._layout),
950 _ptr(_array.getRawPtr())
956template<
typename T >
958 _dimensions(source.dimensions()),
959 _strides(computeStrides< size_type, dim_type >(source.dimensions(),
961 _array(computeSize(source.dimensions())),
962 _layout(source.layout()),
963 _ptr(_array.getRawPtr())
968 for ( ; srcit != source.
cend(); ++thisit, ++srcit)
976template<
typename T >
983template<
typename T >
987 _dimensions = r_ptr._dimensions;
988 _strides = r_ptr._strides;
989 _array = r_ptr._array;
990 _layout = r_ptr._layout;
997template<
typename T >
1001 return _dimensions.size();
1006template<
typename T >
1007const Teuchos::Array< dim_type > &
1015template<
typename T >
1019#ifdef HAVE_DOMI_ARRAY_BOUNDSCHECK
1022 return _dimensions[axis];
1027template<
typename T >
1031 return _array.size();
1036template<
typename T >
1037const Teuchos::Array< size_type > &
1045template<
typename T >
1046const Teuchos::ArrayRCP< T > &
1054template<
typename T >
1063template<
typename T >
1072template<
typename T >
1082template<
typename T >
1091template<
typename T >
1101template<
typename T >
1110template<
typename T >
1120template<
typename T >
1129template<
typename T >
1139template<
typename T >
1148template<
typename T >
1158template<
typename T >
1162 return _array.is_null();
1167template<
typename T >
1171 return _array.operator->();
1176template<
typename T >
1180 return _array.operator*();
1185template<
typename T >
1189 return _array.get();
1194template<
typename T >
1203template<
typename T >
1207 Teuchos::Array< dim_type > dims(_dimensions);
1213template<
typename T >
1222template<
typename T >
1231template<
typename T >
1234 return mdArrayView();
1239template<
typename T >
1242 return mdArrayViewConst();
1247template<
typename T >
1253 return mdArrayView()[i];
1258template<
typename T >
1264 return mdArrayView()[i];
1269template<
typename T >
1274 return mdArrayView()[s];
1279template<
typename T >
1284 return mdArrayView()[s];
1289template<
typename T >
1293 return mdArrayView();
1298template<
typename T >
1302 return mdArrayView();
1307template<
typename T >
1311#ifdef HAVE_DOMI_ARRAY_BOUNDSCHECK
1312 TEUCHOS_TEST_FOR_EXCEPTION(
1314 "Attempt to access " << _dimensions.size() <<
"D array with 1 index"
1318 return _ptr[i * _strides[0]];
1323template<
typename T >
1328#ifdef HAVE_DOMI_ARRAY_BOUNDSCHECK
1329 TEUCHOS_TEST_FOR_EXCEPTION(
1331 "Attempt to access " << _dimensions.size() <<
"D array with 2 indexes"
1336 return _ptr[i * _strides[0] + j * _strides[1]];
1341template<
typename T >
1347#ifdef HAVE_DOMI_ARRAY_BOUNDSCHECK
1348 TEUCHOS_TEST_FOR_EXCEPTION(
1350 "Attempt to access " << _dimensions.size() <<
"D array with 3 indexes"
1356 return _ptr[i * _strides[0] + j * _strides[1] + k * _strides[2]];
1361template<
typename T >
1368#ifdef HAVE_DOMI_ARRAY_BOUNDSCHECK
1369 TEUCHOS_TEST_FOR_EXCEPTION(
1371 "Attempt to access " << _dimensions.size() <<
"D array with 4 indexes"
1378 return _ptr[i * _strides[0] + j * _strides[1] + k * _strides[2] +
1384template<
typename T >
1392#ifdef HAVE_DOMI_ARRAY_BOUNDSCHECK
1393 TEUCHOS_TEST_FOR_EXCEPTION(
1395 "Attempt to access " << _dimensions.size() <<
"D array with 5 indexes"
1403 return _ptr[i * _strides[0] + j * _strides[1] + k * _strides[2] +
1404 m * _strides[3] + n * _strides[4]];
1409template<
typename T >
1419#ifdef HAVE_DOMI_ARRAY_BOUNDSCHECK
1420 TEUCHOS_TEST_FOR_EXCEPTION(
1422 "Attempt to access " << _dimensions.size() <<
"D array with too many indexes"
1432 size_type offset = i * _strides[0] + j * _strides[1] + k * _strides[2] +
1433 m * _strides[3] + n * _strides[4] + p * _strides[5];
1434 va_start(indexes, p);
1435 for (
int axis = 6; axis < _dimensions.size(); axis++)
1437 dim_type q = va_arg(indexes, dim_type);
1438#ifdef HAVE_DOMI_ARRAY_BOUNDSCHECK
1439 assertIndex(q, axis);
1441 offset += q * _strides[axis];
1444 return _ptr[offset];
1449template<
typename T >
1453#ifdef HAVE_DOMI_ARRAY_BOUNDSCHECK
1454 TEUCHOS_TEST_FOR_EXCEPTION(
1456 "Attempt to access " << _dimensions.size() <<
"D array with 1 index"
1460 return _ptr[i * _strides[0]];
1465template<
typename T >
1470#ifdef HAVE_DOMI_ARRAY_BOUNDSCHECK
1471 TEUCHOS_TEST_FOR_EXCEPTION(
1473 "Attempt to access " << _dimensions.size() <<
"D array with 2 indexes"
1478 return _ptr[i * _strides[0] + j * _strides[1]];
1483template<
typename T >
1489#ifdef HAVE_DOMI_ARRAY_BOUNDSCHECK
1490 TEUCHOS_TEST_FOR_EXCEPTION(
1492 "Attempt to access " << _dimensions.size() <<
"D array with 3 indexes"
1498 return _ptr[i * _strides[0] + j * _strides[1] + k * _strides[2]];
1503template<
typename T >
1510#ifdef HAVE_DOMI_ARRAY_BOUNDSCHECK
1511 TEUCHOS_TEST_FOR_EXCEPTION(
1513 "Attempt to access " << _dimensions.size() <<
"D array with 4 indexes"
1520 return _ptr[i * _strides[0] + j * _strides[1] + k * _strides[2] +
1526template<
typename T >
1534#ifdef HAVE_DOMI_ARRAY_BOUNDSCHECK
1535 TEUCHOS_TEST_FOR_EXCEPTION(
1537 "Attempt to access " << _dimensions.size() <<
"D array with 5 indexes"
1545 return _ptr[i * _strides[0] + j * _strides[1] + k * _strides[2] +
1546 m * _strides[3] + n * _strides[4]];
1551template<
typename T >
1561#ifdef HAVE_DOMI_ARRAY_BOUNDSCHECK
1562 TEUCHOS_TEST_FOR_EXCEPTION(
1564 "Attempt to access " << _dimensions.size() <<
"D array with too many indexes"
1574 size_type offset = i * _strides[0] + j * _strides[1] + k * _strides[2] +
1575 m * _strides[3] + n * _strides[4] + p * _strides[5];
1576 va_start(indexes, p);
1577 for (
int axis = 6; axis < _dimensions.size(); axis++)
1579 dim_type q = va_arg(indexes, dim_type);
1580#ifdef HAVE_DOMI_ARRAY_BOUNDSCHECK
1581 assertIndex(q, axis);
1583 offset += q * _strides[axis];
1586 return _ptr[offset];
1591template<
typename T >
1595 for (
iterator it = begin(); it != end(); ++it)
1601template<
typename T >
1607 size_type offset = i * _strides[0];
1608 va_start(indexes, i);
1609 for (
int axis = 1; axis < _dimensions.size(); axis++)
1611 dim_type j = va_arg(indexes, dim_type);
1612 assertIndex(j, axis);
1613 offset += j * _strides[axis];
1616 return _array[offset];
1621template<
typename T >
1627 size_type offset = i * _strides[0];
1628 va_start(indexes, i);
1629 for (
int axis = 1; axis < _dimensions.size(); axis++)
1631 dim_type j = va_arg(indexes, dim_type);
1632 assertIndex(j, axis);
1633 offset += j * _strides[axis];
1636 return _array[offset];
1641template<
typename T >
1645 return _array.capacity();
1650template<
typename T >
1654 _dimensions.resize(1);
1659 _ptr = _array.getRawPtr();
1664template<
typename T >
1668 return (_array.size() == 0);
1673template<
typename T >
1677 return _array.max_size();
1682template<
typename T >
1686 _dimensions.assign(dims.begin(), dims.end());
1687 _strides = computeStrides< size_type, dim_type >(dims, _layout);
1688 _array.resize(computeSize(dims));
1689 _ptr = _array.getRawPtr();
1694template<
typename T >
1698#ifdef HAVE_DOMI_ARRAY_BOUNDSCHECK
1707template<
typename T >
1711 return mdArrayView().toString();
1716template<
typename T >
1720 return _array.getRawPtr();
1725template<
typename T >
1729 return _array.getRawPtr();
1734template<
typename T >
1738 return (a1() == a2());
1743template<
typename T >
1747 return (a1() == a2());
1752template<
typename T >
1756 return (a1() == a2());
1761template<
typename T >
1765 return (a1 == a2());
1770template<
typename T >
1774 return (a1() == a2);
1779template<
typename T >
1783 return not (a1 == a2);
1788template<
typename T >
1791 return (a1() != a2());
1796template<
typename T >
1799 return (a1() != a2());
1804template<
typename T >
1808 return (a1 != a2());
1813template<
typename T >
1817 return (a1() != a2);
1822template<
typename T >
1823std::ostream & operator<<(std::ostream & os,
1834template<
typename T >
1836MDArrayRCP< T >::assertAxis(
int axis)
const
1838 TEUCHOS_TEST_FOR_EXCEPTION(
1839 !(0 <= axis && axis < _dimensions.size()),
1841 "MDArrayRCP<T>::assertAxis(axis=" << axis <<
"): out of "
1842 <<
"range axis in [0, " << _dimensions.size() <<
")"
1848template<
typename T >
1850MDArrayRCP< T >::assertIndex(dim_type i,
int axis)
const
1852 TEUCHOS_TEST_FOR_EXCEPTION(
1853 !(0 <= i && i < _dimensions[axis]), RangeError,
1854 "MDArrayRCP<T>::assertIndex(i=" << i <<
",axis=" << axis <<
"): out of "
1855 <<
"range i in [0, " << _dimensions[axis] <<
")"
Memory-safe templated multi-dimensional array class.
Definition: Domi_MDArray.hpp:287
Memory-safe, reference-counted, templated, multi-dimensional array class.
Definition: Domi_MDArrayRCP.hpp:155
MDArrayRCP(const Teuchos::ArrayView< T > &array, const Teuchos::ArrayView< dim_type > &dims, Layout layout=DEFAULT_ORDER)
Constructor with Teuchos::ArrayView source, dimensions, and optional storage order flag.
Definition: Domi_MDArrayRCP.hpp:885
void assign(const_reference value)
Assign a value to all elements of the MDArrayRCP
Definition: Domi_MDArrayRCP.hpp:1593
friend bool operator==(const MDArray< T2 > &a1, const MDArrayRCP< T2 > &a2)
MDArray/MDArrayRCP equality operator.
const MDArrayView< const T > mdArrayViewConst() const
Perform an explicit conversion to a const MDArrayView<const T>
Definition: Domi_MDArrayRCP.hpp:1224
MDArrayRCP(const MDArrayView< T > &source)
Deep copy constructor.
Definition: Domi_MDArrayRCP.hpp:957
const Layout layout() const
Return the storage order.
Definition: Domi_MDArrayRCP.hpp:1056
reverse_iterator rbegin()
Return the beginning reverse_iterator.
Definition: Domi_MDArrayRCP.hpp:1122
friend bool operator!=(const MDArrayRCP< T2 > &a1, const MDArray< T2 > &a2)
MDArrayRCP/MDArray inequality operator.
pointer getRawPtr()
Return a raw pointer to the beginning of the MDArrayRCP or NULL if unsized.
Definition: Domi_MDArrayRCP.hpp:1727
iterator end()
Return the ending iterator.
Definition: Domi_MDArrayRCP.hpp:1074
T & operator()(dim_type i, dim_type j)
Non-const 2D element access operator.
Definition: Domi_MDArrayRCP.hpp:1325
friend bool operator!=(const MDArrayRCP< T2 > &a1, const MDArrayView< T2 > &a2)
MDArrayRCP/MDArrayView inequality operator.
const Teuchos::Array< dim_type > & dimensions() const
Return the array of dimensions.
Definition: Domi_MDArrayRCP.hpp:1008
friend bool operator!=(const MDArray< T2 > &a1, const MDArrayRCP< T2 > &a2)
MDArray/MDArrayRCP inequality operator.
friend bool operator==(const MDArrayRCP< T2 > &a1, const MDArray< T2 > &a2)
MDArrayRCP/MDArray equality operator.
bool operator==(const MDArray< T > &a1, const MDArrayRCP< T > &a2)
MDArray/MDArrayRCP equality operator.
Definition: Domi_MDArrayRCP.hpp:1744
const_iterator cend() const
Return the ending const_iterator.
Definition: Domi_MDArrayRCP.hpp:1112
MDArrayView< T > operator()()
Conversion to MDArrayView
Definition: Domi_MDArrayRCP.hpp:1291
MDArrayView< T > mdArrayView()
Perform an explicit conversion to a non-const MDArrayView<T>
Definition: Domi_MDArrayRCP.hpp:1196
const T & operator()(dim_type i, dim_type j, dim_type k, dim_type m, dim_type n) const
Const 5D element access operator.
Definition: Domi_MDArrayRCP.hpp:1528
friend bool operator==(const MDArrayView< T2 > &a1, const MDArrayRCP< T2 > &a2)
MDArrayView/MDArrayRCP equality operator.
const T & operator()(dim_type i, dim_type j, dim_type k) const
Const 3D element access operator.
Definition: Domi_MDArrayRCP.hpp:1485
pointer operator->() const
Pointer -> access to members of underlying data buffer.
Definition: Domi_MDArrayRCP.hpp:1169
size_type capacity() const
Return the capacity of the underlying Teuchos::ArrayRCP
Definition: Domi_MDArrayRCP.hpp:1643
MDArrayRCP(const MDArrayRCP< T > &r_ptr)
Shallow copy constructor.
Definition: Domi_MDArrayRCP.hpp:945
bool operator!=(const MDArray< T > &a1, const MDArrayRCP< T > &a2)
MDArray/MDArrayRCP inequality operator.
Definition: Domi_MDArrayRCP.hpp:1789
int numDims() const
Return the number of dimensions.
Definition: Domi_MDArrayRCP.hpp:999
const MDArrayView< T > mdArrayView() const
Perform an explicit conversion to a const MDArrayView<T>
Definition: Domi_MDArrayRCP.hpp:1205
bool operator!=(const MDArrayRCP< T > &a1, const MDArrayRCP< T > &a2)
Inequality operator.
Definition: Domi_MDArrayRCP.hpp:1780
friend bool operator==(const MDArrayRCP< T2 > &a1, const MDArrayView< T2 > &a2)
MDArrayRCP/MDArrayView equality operator.
const_reverse_iterator crend() const
Return the ending const_reverse_iterator.
Definition: Domi_MDArrayRCP.hpp:1150
T & operator()(dim_type i, dim_type j, dim_type k, dim_type m, dim_type n, dim_type p,...)
Non-const 6D and higher element access operator.
Definition: Domi_MDArrayRCP.hpp:1411
const_reverse_iterator crbegin() const
Return the beginning const_reverse_iterator.
Definition: Domi_MDArrayRCP.hpp:1141
const MDArrayView< T > operator()() const
Conversion to const MDArrayView
Definition: Domi_MDArrayRCP.hpp:1300
bool operator!=(const MDArrayView< T > &a1, const MDArrayRCP< T > &a2)
MDArrayView/MDArrayRCP inequality operator.
Definition: Domi_MDArrayRCP.hpp:1805
const T & operator()(dim_type i, dim_type j, dim_type k, dim_type m, dim_type n, dim_type p,...) const
Const 6D and higher element access operator.
Definition: Domi_MDArrayRCP.hpp:1553
friend bool operator!=(const MDArrayRCP< T2 > &a1, const MDArrayRCP< T2 > &a2)
Inequality operator.
iterator begin()
Return the beginning iterator.
Definition: Domi_MDArrayRCP.hpp:1065
bool operator==(const MDArrayView< T > &a1, const MDArrayRCP< T > &a2)
MDArrayView/MDArrayRCP equality operator.
Definition: Domi_MDArrayRCP.hpp:1762
bool operator==(const MDArrayRCP< T > &a1, const MDArrayView< T > &a2)
MDArrayRCP/MDArrayView equality operator.
Definition: Domi_MDArrayRCP.hpp:1771
const T & operator()(dim_type i) const
Const 1D element access operator.
Definition: Domi_MDArrayRCP.hpp:1451
T & operator()(dim_type i)
Non-const 1D element access operator.
Definition: Domi_MDArrayRCP.hpp:1309
MDArrayView< T > operator[](dim_type i)
Sub-array access operator. The returned MDArrayView object will have one fewer dimensions than the ca...
Definition: Domi_MDArrayRCP.hpp:1249
friend bool operator!=(const MDArrayView< T2 > &a1, const MDArrayRCP< T2 > &a2)
MDArrayView/MDArrayRCP inequality operator.
const MDArrayView< T > operator[](dim_type i) const
Sub-array const access operator. The returned MDArrayView object will have one fewer dimensions than ...
Definition: Domi_MDArrayRCP.hpp:1260
T value_type
Value type.
Definition: Domi_MDArrayRCP.hpp:162
T & operator()(dim_type i, dim_type j, dim_type k, dim_type m, dim_type n)
Non-const 5D element access operator.
Definition: Domi_MDArrayRCP.hpp:1386
T * pointer
Pointer type.
Definition: Domi_MDArrayRCP.hpp:165
const Teuchos::Array< size_type > & strides() const
Return the indexing strides.
Definition: Domi_MDArrayRCP.hpp:1038
friend bool operator==(const MDArrayRCP< T2 > &a1, const MDArrayRCP< T2 > &a2)
Equality operator.
bool is_null() const
Return true if the underlying pointer is null.
Definition: Domi_MDArrayRCP.hpp:1160
MDArrayRCP(const Teuchos::ArrayView< dim_type > &dims, Layout layout)
Constructor with dimensions and storage order flag.
Definition: Domi_MDArrayRCP.hpp:917
friend std::ostream & operator<<(std::ostream &os, const MDArrayRCP< T2 > &a)
Stream output operator.
MDArrayRCP(const Teuchos::ArrayView< dim_type > &dims, const_reference val=T(), Layout layout=DEFAULT_ORDER)
Constructor with dimensions, default value and optional storage order flag.
Definition: Domi_MDArrayRCP.hpp:903
MDArrayRCP(Teuchos::ENull null_arg=Teuchos::null)
Default constructor.
Definition: Domi_MDArrayRCP.hpp:873
reference at(dim_type i,...)
Non-const single element access method with bounds checking.
Definition: Domi_MDArrayRCP.hpp:1603
T & reference
Reference type.
Definition: Domi_MDArrayRCP.hpp:171
const_pointer getRawPtr() const
Return a const raw pointer to the beginning of the MDArrayRCP or NULL if unsized.
Definition: Domi_MDArrayRCP.hpp:1718
const T * const_pointer
Const pointer type.
Definition: Domi_MDArrayRCP.hpp:168
static bool hasBoundsChecking()
Return true if MDArrayRCP has been compiled with bounds checking on.
Definition: Domi_MDArrayRCP.hpp:1696
reference operator*()
Dereference the underlying data buffer.
Definition: Domi_MDArrayRCP.hpp:1178
std::string toString() const
Convert the MDArrayRCP to a string representation.
Definition: Domi_MDArrayRCP.hpp:1709
pointer get() const
Get the raw C++ pointer to the underlying data buffer.
Definition: Domi_MDArrayRCP.hpp:1187
const_reference at(dim_type i,...) const
Const single element access method with bounds checking.
Definition: Domi_MDArrayRCP.hpp:1623
void clear()
Clear the MDArrayRCP
Definition: Domi_MDArrayRCP.hpp:1652
bool operator==(const MDArrayRCP< T > &a1, const MDArrayRCP< T > &a2)
Equality operator.
Definition: Domi_MDArrayRCP.hpp:1735
const T & const_reference
Const reference type.
Definition: Domi_MDArrayRCP.hpp:174
T & operator()(dim_type i, dim_type j, dim_type k)
Non-const 3D element access operator.
Definition: Domi_MDArrayRCP.hpp:1343
const T & operator()(dim_type i, dim_type j) const
Const 2D element access operator.
Definition: Domi_MDArrayRCP.hpp:1467
T & operator()(dim_type i, dim_type j, dim_type k, dim_type m)
Non-const 4D element access operator.
Definition: Domi_MDArrayRCP.hpp:1363
MDArrayView< T > operator[](Slice s)
Sub-array access operator. The returned MDArrayView object will have the same number of dimensions as...
Definition: Domi_MDArrayRCP.hpp:1281
bool empty() const
Return whether the MDArrayRCP is empty.
Definition: Domi_MDArrayRCP.hpp:1666
const_iterator end() const
Return the ending const_iterator.
Definition: Domi_MDArrayRCP.hpp:1093
const_iterator cbegin() const
Return the beginning const_iterator.
Definition: Domi_MDArrayRCP.hpp:1103
void resize(const Teuchos::ArrayView< dim_type > &dims)
Resize the MDArrayRCP based on the given dimensions.
Definition: Domi_MDArrayRCP.hpp:1684
MDArrayRCP(const Teuchos::ArrayView< dim_type > &dims, const Teuchos::ArrayView< size_type > &strides, T *data, Layout layout=DEFAULT_ORDER)
Low-level view constructor.
Definition: Domi_MDArrayRCP.hpp:930
size_type max_size() const
Return the maximum allowable size for the MDArrayRCP
Definition: Domi_MDArrayRCP.hpp:1675
bool operator==(const MDArrayRCP< T > &a1, const MDArray< T > &a2)
MDArrayRCP/MDArray equality operator.
Definition: Domi_MDArrayRCP.hpp:1753
const_iterator begin() const
Return the beginning const_iterator.
Definition: Domi_MDArrayRCP.hpp:1084
const Teuchos::ArrayRCP< T > & arrayRCP() const
Return the underlying Teuchos::ArrayRCP
Definition: Domi_MDArrayRCP.hpp:1047
~MDArrayRCP()
Destructor.
Definition: Domi_MDArrayRCP.hpp:977
reverse_iterator rend()
Return the ending reverse_iterator.
Definition: Domi_MDArrayRCP.hpp:1131
MDArrayView< const T > mdArrayViewConst()
Perform an explicit conversion to a non-const MDArrayView<const T>
Definition: Domi_MDArrayRCP.hpp:1215
const T & operator()(dim_type i, dim_type j, dim_type k, dim_type m) const
Const 4D element access operator.
Definition: Domi_MDArrayRCP.hpp:1505
dim_type dimension(int axis) const
Return the dimension of the given axis.
Definition: Domi_MDArrayRCP.hpp:1017
size_type size() const
Return the total size of the MDArrayRCP
Definition: Domi_MDArrayRCP.hpp:1029
const MDArrayView< T > operator[](Slice s) const
Sub-array const access operator. The returned MDArrayView object will have the same number of dimensi...
Definition: Domi_MDArrayRCP.hpp:1271
bool operator!=(const MDArrayRCP< T > &a1, const MDArrayView< T > &a2)
MDArrayRCP/MDArrayView inequality operator.
Definition: Domi_MDArrayRCP.hpp:1814
MDArrayRCP< T > & operator=(const MDArrayRCP< T > &r_ptr)
Assignment operator.
Definition: Domi_MDArrayRCP.hpp:985
Memory-safe templated multi-dimensional array view class.
Definition: Domi_MDArrayView.hpp:115
const_iterator cend() const
Return the ending const_iterator.
Definition: Domi_MDArrayView.hpp:1007
const_iterator cbegin() const
Return the beginning const_iterator.
Definition: Domi_MDArrayView.hpp:998
Iterator class suitable for multi-dimensional arrays.
Definition: Domi_MDIterator.hpp:102
Reverse iterator class suitable for multi-dimensional arrays.
Definition: Domi_MDRevIterator.hpp:100
Range Error exception type.
Definition: Domi_Exceptions.hpp:66
A Slice contains a start, stop, and step index, describing a subset of an ordered container.
Definition: Domi_Slice.hpp:138