#include <Array.h>

Classes | |
| class | Deleter |
Public Types | |
| typedef FUN | function_table |
| using | scalarAllocator_t = typename std::allocator_traits< Allocator >::template rebind_alloc< TYPE > |
| typedef TYPE | value_type |
Public Member Functions | |
| void | addSubset (const std::vector< Range< size_t > > &index, const Array &subset) |
| void | addSubset (const std::vector< size_t > &index, const Array &subset) |
| Array () | |
| Array (Array &&rhs) | |
| Array (const Array &rhs) | |
| Array (const ArraySize &N, const TYPE *data=nullptr) | |
| template<typename U = TYPE, typename = typename std::enable_if<std::is_same_v<U, TYPE>>::type> | |
| Array (const Range< U > &range) | |
| Array (size_t N) | |
| Array (size_t N1, size_t N2, size_t N3) | |
| Array (size_t N1, size_t N2, size_t N3, size_t N4) | |
| Array (size_t N1, size_t N2, size_t N3, size_t N4, size_t N5) | |
| Array (size_t N_rows, size_t N_columns) | |
| Array (std::initializer_list< std::initializer_list< TYPE > > data) | |
| Array (std::initializer_list< TYPE > data) | |
| Array (std::string range) | |
| void | axpby (const TYPE &alpha, const Array &x, const TYPE &beta) |
| ARRAY_INLINE TYPE * | begin () |
| Get iterator to beginning of data. | |
| ARRAY_INLINE const TYPE * | begin () const |
| Get iterator to beginning of data. | |
| void | cat (const Array &x, int dim=0) |
| Concatenates a given array with the current array. | |
| void | clear () |
| Clear the data in the array. | |
| template<class TYPE2 > | |
| auto | cloneTo () const |
| Array | coarsen (const Array &filter) const |
| Coarsen an array using the given filter. | |
| Array | coarsen (const ArraySize &ratio, std::function< TYPE(const Array &)> filter) const |
| Coarsen an array using the given filter. | |
| template<class TYPE2 , class FUN2 , class Allocator2 > | |
| void | copy (const Array< TYPE2, FUN2, Allocator2 > &array) |
| template<class TYPE2 > | |
| void | copy (const TYPE2 *data) |
| void | copySubset (const std::vector< Range< size_t > > &index, const Array &subset) |
| void | copySubset (const std::vector< size_t > &index, const Array &subset) |
| template<class TYPE2 > | |
| void | copyTo (TYPE2 *data) const |
| ARRAY_INLINE TYPE * | data () |
| Return the pointer to the raw data. | |
| ARRAY_INLINE const TYPE * | data () const |
| Return the pointer to the raw data. | |
| ARRAY_INLINE bool | empty () const |
| Return true if the Array is empty. | |
| ARRAY_INLINE TYPE * | end () |
| Get iterator to beginning of data. | |
| ARRAY_INLINE const TYPE * | end () const |
| Get iterator to beginning of data. | |
| bool | equals (const Array &rhs, const TYPE &tol=0.000001) const |
| Determine if two Arrays are equal using an absolute tolerance. | |
| ARRAY_INLINE void | fill (const TYPE &y) |
| std::vector< size_t > | find (const TYPE &value, std::function< bool(const TYPE &, const TYPE &)> compare) const |
| Find all elements that match the operator. | |
| int64_t | findFirst (const TYPE &value, std::function< bool(const TYPE &, const TYPE &)> compare) const |
| Find all elements that match the operator (if element is not found return -1) | |
| int64_t | findLast (const TYPE &value, std::function< bool(const TYPE &, const TYPE &)> compare) const |
| Find all elements that match the operator (if element is not found return -1) | |
| std::shared_ptr< TYPE > | getPtr () |
| Return the pointer to the raw data. | |
| std::shared_ptr< const TYPE > | getPtr () const |
| Return the pointer to the raw data. | |
| TYPE | interp (const double *x) const |
| TYPE | interp (const std::vector< double > &x) const |
| ARRAY_INLINE bool | isCopyable () const |
| Is copyable? | |
| ARRAY_INLINE bool | isFixedSize () const |
| Is fixed size? | |
| ARRAY_INLINE size_t | length () const |
| Return the size of the Array. | |
| TYPE | max () const |
| Return the largest value. | |
| TYPE | max (const std::vector< Range< size_t > > &index) const |
| Return the largest value. | |
| TYPE | max (const std::vector< size_t > &index) const |
| Return the largest value. | |
| Array | max (int dir) const |
| Return the max of all elements in a given direction. | |
| TYPE | mean () const |
| Return the mean of all elements. | |
| TYPE | mean (const std::vector< Range< size_t > > &index) const |
| Return the mean of all elements. | |
| TYPE | mean (const std::vector< size_t > &index) const |
| Return the mean of all elements. | |
| TYPE | min () const |
| Return the smallest value. | |
| TYPE | min (const std::vector< Range< size_t > > &index) const |
| Return the smallest value. | |
| TYPE | min (const std::vector< size_t > &index) const |
| Return the smallest value. | |
| Array | min (int dir) const |
| Return the min of all elements in a given direction. | |
| bool | NaNs () const |
| Return true if NaNs are present. | |
| ARRAY_INLINE int | ndim () const |
| Return the size of the Array. | |
| ARRAY_INLINE | operator bool () const |
| Return true if the Array is not empty. | |
| bool | operator!= (const Array &rhs) const |
| Check if two matrices are not equal. | |
| ARRAY_INLINE TYPE & | operator() (size_t i) |
| ARRAY_INLINE const TYPE & | operator() (size_t i) const |
| ARRAY_INLINE TYPE & | operator() (size_t i, size_t j) |
| ARRAY_INLINE const TYPE & | operator() (size_t i, size_t j) const |
| ARRAY_INLINE TYPE & | operator() (size_t i, size_t j, size_t k) |
| ARRAY_INLINE const TYPE & | operator() (size_t i, size_t j, size_t k) const |
| ARRAY_INLINE TYPE & | operator() (size_t i1, size_t i2, size_t i3, size_t i4) |
| ARRAY_INLINE const TYPE & | operator() (size_t i1, size_t i2, size_t i3, size_t i4) const |
| ARRAY_INLINE TYPE & | operator() (size_t i1, size_t i2, size_t i3, size_t i4, size_t i5) |
| ARRAY_INLINE const TYPE & | operator() (size_t i1, size_t i2, size_t i3, size_t i4, size_t i5) const |
| Array & | operator+= (const Array &rhs) |
| Add another array. | |
| Array & | operator+= (const TYPE &rhs) |
| Add a scalar. | |
| Array & | operator-= (const Array &rhs) |
| Subtract another array. | |
| Array & | operator-= (const TYPE &rhs) |
| Subtract a scalar. | |
| Array & | operator= (Array &&rhs) |
| Array & | operator= (const Array &rhs) |
| Array & | operator= (const std::vector< TYPE > &rhs) |
| bool | operator== (const Array &rhs) const |
| Check if two matrices are equal. | |
| ARRAY_INLINE TYPE & | operator[] (size_t i) |
| ARRAY_INLINE const TYPE & | operator[] (size_t i) const |
| size_t | pack (std::byte *) const |
| Pack the data to a buffer. | |
| size_t | packSize () const |
| Return the number of bytes required to pack the data. | |
| void | pow (const Array &base, const TYPE &exp) |
| void | print (std::ostream &os, const std::string &name="A", const std::string &prefix="") const |
| Print an array. | |
| ARRAY_INLINE TYPE * | ptr (size_t i) |
| ARRAY_INLINE const TYPE * | ptr (size_t i) const |
| void | rand () |
| Initialize the array with random values (defined from the function table) | |
| template<class TYPE2 > | |
| auto | reinterpretArray () const |
| Array | repmat (const ArraySize &N) const |
| Replicate an array a given number of times in each direction. | |
| void | reshape (const ArraySize &N) |
| void | resize (const ArraySize &N) |
| void | resize (size_t N) |
| void | resize (size_t N1, size_t N2, size_t N3) |
| void | resize (size_t N_row, size_t N_col) |
| void | resizeDim (int dim, size_t N, const TYPE &value) |
| Array | reverseDim () const |
| Transpose an array. | |
| void | scale (const TYPE &y) |
| ARRAY_INLINE void | setCopyable (bool flag) |
| Set is copyable. | |
| ARRAY_INLINE void | setFixedSize (bool flag) |
| Set is copyable. | |
| ARRAY_INLINE void | setNdim (int ndim) |
| ARRAY_INLINE const ArraySize & | size () const |
| Return the size of the Array. | |
| ARRAY_INLINE size_t | size (int d) const |
| Return the size of the Array. | |
| Array | subset (const std::vector< Range< size_t > > &index) const |
| Array | subset (const std::vector< size_t > &index) const |
| TYPE | sum () const |
| Return the sum of all elements. | |
| TYPE | sum (const std::vector< Range< size_t > > &index) const |
| Return the sum of all elements. | |
| TYPE | sum (const std::vector< size_t > &index) const |
| Return the sum of all elements. | |
| Array | sum (int dir) const |
| Return the sum of all elements in a given direction. | |
| void | swap (Array &other) |
| size_t | unpack (const std::byte *) |
| Unpack the data from a buffer. | |
| Array< TYPE, FUN, Allocator > | view () |
| void | view2 (Array &src) |
| void | view2 (const ArraySize &N, std::shared_ptr< TYPE > data) |
| void | viewRaw (const ArraySize &N, TYPE *data, bool isCopyable=true, bool isFixedSize=true) |
| void | viewRaw (int ndim, const size_t *dims, TYPE *data, bool isCopyable=true, bool isFixedSize=true) |
| ~Array () | |
| Destructor. | |
Static Public Member Functions | |
| static Array | cat (const std::initializer_list< Array > &x, int dim=0) |
| Concatenates the arrays along the dimension dim. | |
| static Array | cat (const std::vector< Array > &x, int dim=0) |
| Concatenates the arrays along the dimension dim. | |
| static Array | cat (size_t N_array, const Array *x, int dim) |
| Concatenates the arrays along the dimension dim. | |
| static std::unique_ptr< const Array > | constView (const ArraySize &N, const std::shared_ptr< const TYPE > &data) |
| template<class TYPE2 > | |
| static auto | convert (std::shared_ptr< Array< TYPE, FUN, Allocator > > array) |
| template<class TYPE2 > | |
| static auto | convert (std::shared_ptr< const Array< TYPE, FUN, Allocator > > array) |
| static Array | staticView (const ArraySize &N, TYPE *data) |
| static Array | transform (std::function< TYPE(const TYPE &)> fun, const Array &x) |
| static Array | transform (std::function< TYPE(const TYPE &, const TYPE &)> fun, const Array &x, const Array &y) |
| static std::unique_ptr< Array > | view (const ArraySize &N, std::shared_ptr< TYPE > data) |
Private Member Functions | |
| void | allocate (const ArraySize &N) |
| void | checkSubsetIndex (const std::vector< Range< size_t > > &range) const |
| std::vector< Range< size_t > > | convert (const std::vector< size_t > &index) const |
Static Private Member Functions | |
| static void | getSubsetArrays (const std::vector< Range< size_t > > &range, std::array< size_t, 5 > &first, std::array< size_t, 5 > &last, std::array< size_t, 5 > &inc, std::array< size_t, 5 > &N) |
Private Attributes | |
| scalarAllocator_t | d_alloc |
| TYPE * | d_data |
| bool | d_isCopyable |
| bool | d_isFixedSize |
| std::shared_ptr< TYPE > | d_ptr |
| ArraySize | d_size |
Class Array is a multi-dimensional array class written by Mark Berrill
| typedef FUN AMP::Array< TYPE, FUN, Allocator >::function_table |
| using AMP::Array< TYPE, FUN, Allocator >::scalarAllocator_t = typename std::allocator_traits<Allocator>::template rebind_alloc<TYPE> |
| typedef TYPE AMP::Array< TYPE, FUN, Allocator >::value_type |
| AMP::Array< TYPE, FUN, Allocator >::Array | ( | ) |
Create a new empty Array
|
explicit |
Create an Array with the given size
| N | Size of the array |
| data | Optional raw array to copy the src data |
|
explicit |
Create a new 1D Array with the given number of elements
| N | Number of elements in the array |
|
explicit |
Create a new 2D Array with the given number of rows and columns
| N_rows | Number of rows |
| N_columns | Number of columns |
|
explicit |
Create a new 3D Array with the given number of rows and columns
| N1 | Number of rows |
| N2 | Number of columns |
| N3 | Number of elements in the third dimension |
|
explicit |
Create a new 4D Array with the given number of rows and columns
| N1 | Number of elements in the first dimension |
| N2 | Number of elements in the second dimension |
| N3 | Number of elements in the third dimension |
| N4 | Number of elements in the fourth dimension |
|
explicit |
Create a new 4D Array with the given number of rows and columns
| N1 | Number of elements in the first dimension |
| N2 | Number of elements in the second dimension |
| N3 | Number of elements in the third dimension |
| N4 | Number of elements in the fourth dimension |
| N5 | Number of elements in the fifth dimension |
|
explicit |
|
explicit |
| AMP::Array< TYPE, FUN, Allocator >::Array | ( | std::initializer_list< TYPE > | data | ) |
Create a 1D Array with the given initializer list
| data | Input data |
| AMP::Array< TYPE, FUN, Allocator >::Array | ( | std::initializer_list< std::initializer_list< TYPE > > | data | ) |
Create a 2D Array with the given initializer lists
| data | Input data |
| AMP::Array< TYPE, FUN, Allocator >::Array | ( | const Array< TYPE, FUN, Allocator > & | rhs | ) |
Copy constructor
| rhs | Array to copy |
| AMP::Array< TYPE, FUN, Allocator >::Array | ( | Array< TYPE, FUN, Allocator > && | rhs | ) |
Move constructor
| rhs | Array to copy |
| AMP::Array< TYPE, FUN, Allocator >::~Array | ( | ) |
Destructor.
| void AMP::Array< TYPE, FUN, Allocator >::addSubset | ( | const std::vector< Range< size_t > > & | index, |
| const Array< TYPE, FUN, Allocator > & | subset | ||
| ) |
Add data from an array into a subset of this array
| index | Index of the subset |
| subset | The subset array to add from |
| void AMP::Array< TYPE, FUN, Allocator >::addSubset | ( | const std::vector< size_t > & | index, |
| const Array< TYPE, FUN, Allocator > & | subset | ||
| ) |
Add data from an array into a subset of this array
| index | Index of the subset (imin,imax,jmin,jmax,kmin,kmax,...) |
| subset | The subset array to add from |
|
private |
| void AMP::Array< TYPE, FUN, Allocator >::axpby | ( | const TYPE & | alpha, |
| const Array< TYPE, FUN, Allocator > & | x, | ||
| const TYPE & | beta | ||
| ) |
axpby operation: this = alpha*x + beta*this
| [in] | alpha | alpha |
| [in] | x | x |
| [in] | beta | beta |
|
inline |
Get iterator to beginning of data.
Definition at line 628 of file Array.h.
References AMP::Array< TYPE, FUN, Allocator >::d_data.
|
inline |
Get iterator to beginning of data.
Definition at line 631 of file Array.h.
References AMP::Array< TYPE, FUN, Allocator >::d_data.
| void AMP::Array< TYPE, FUN, Allocator >::cat | ( | const Array< TYPE, FUN, Allocator > & | x, |
| int | dim = 0 |
||
| ) |
Concatenates a given array with the current array.
|
static |
Concatenates the arrays along the dimension dim.
|
static |
Concatenates the arrays along the dimension dim.
|
static |
Concatenates the arrays along the dimension dim.
|
inlineprivate |
| void AMP::Array< TYPE, FUN, Allocator >::clear | ( | ) |
Clear the data in the array.
|
inline |
Copy and convert data from this array to a new array
Definition at line 317 of file Array.h.
References AMP::Array< TYPE, FUN, Allocator >::copyTo(), AMP::Array< TYPE, FUN, Allocator >::data(), and AMP::Array< TYPE, FUN, Allocator >::size().
| Array AMP::Array< TYPE, FUN, Allocator >::coarsen | ( | const Array< TYPE, FUN, Allocator > & | filter | ) | const |
Coarsen an array using the given filter.
| Array AMP::Array< TYPE, FUN, Allocator >::coarsen | ( | const ArraySize & | ratio, |
| std::function< TYPE(const Array< TYPE, FUN, Allocator > &)> | filter | ||
| ) | const |
Coarsen an array using the given filter.
|
static |
Create a multi-dimensional Array view to a raw block of data
| N | Number of elements in each dimension |
| data | Pointer to the data |
|
inlineprivate |
|
inlinestatic |
|
inlinestatic |
|
inline |
Copy and convert data from another array to this array
| array | Source array |
Definition at line 292 of file Array.h.
References AMP::Array< TYPE, FUN, Allocator >::copy(), AMP::Array< TYPE, FUN, Allocator >::data(), AMP::Array< TYPE, FUN, Allocator >::resize(), and AMP::Array< TYPE, FUN, Allocator >::size().
Referenced by AMP::Array< TYPE, FUN, Allocator >::copy().
|
inline |
| void AMP::Array< TYPE, FUN, Allocator >::copySubset | ( | const std::vector< Range< size_t > > & | index, |
| const Array< TYPE, FUN, Allocator > & | subset | ||
| ) |
Copy data from an array into a subset of this array
| index | Index of the subset |
| subset | The subset array to copy from |
| void AMP::Array< TYPE, FUN, Allocator >::copySubset | ( | const std::vector< size_t > & | index, |
| const Array< TYPE, FUN, Allocator > & | subset | ||
| ) |
Copy data from an array into a subset of this array
| index | Index of the subset (imin,imax,jmin,jmax,kmin,kmax,...) |
| subset | The subset array to copy from |
|
inline |
Copy and convert data from this array to a raw vector.
| data | Source data |
Definition at line 946 of file Array.h.
Referenced by AMP::Array< TYPE, FUN, Allocator >::cloneTo().
|
inline |
Return the pointer to the raw data.
Definition at line 646 of file Array.h.
References AMP::Array< TYPE, FUN, Allocator >::d_data.
Referenced by AMP::Array< TYPE, FUN, Allocator >::cloneTo(), AMP::Array< TYPE, FUN, Allocator >::copy(), AMP::operator*(), AMP::operator*(), AMP::Array< TYPE, FUN, Allocator >::staticView(), AMP::Array< TYPE, FUN, Allocator >::viewRaw(), and AMP::Array< TYPE, FUN, Allocator >::viewRaw().
|
inline |
Return the pointer to the raw data.
Definition at line 649 of file Array.h.
References AMP::Array< TYPE, FUN, Allocator >::d_data.
|
inline |
Return true if the Array is empty.
Definition at line 393 of file Array.h.
References AMP::Array< TYPE, FUN, Allocator >::d_size, and AMP::ArraySize::length().
|
inline |
Get iterator to beginning of data.
Definition at line 634 of file Array.h.
References AMP::Array< TYPE, FUN, Allocator >::d_data, AMP::Array< TYPE, FUN, Allocator >::d_size, and AMP::ArraySize::length().
|
inline |
Get iterator to beginning of data.
Definition at line 637 of file Array.h.
References AMP::Array< TYPE, FUN, Allocator >::d_data, AMP::Array< TYPE, FUN, Allocator >::d_size, and AMP::ArraySize::length().
| AMP::Array< TYPE, FUN, Allocator >::equals | ( | const Array< TYPE, FUN, Allocator > & | rhs, |
| const TYPE & | tol = 0.000001 |
||
| ) | const |
Determine if two Arrays are equal using an absolute tolerance.
| [in] | rhs | Vector to compare to |
| [in] | tol | Tolerance of comparison |
|
inline |
Fill the array with the given value
| y | Value to fill |
Definition at line 351 of file Array.h.
Referenced by AMP::Materials::FunctionProperty< Args >::eval().
| std::vector< size_t > AMP::Array< TYPE, FUN, Allocator >::find | ( | const TYPE & | value, |
| std::function< bool(const TYPE &, const TYPE &)> | compare | ||
| ) | const |
Find all elements that match the operator.
| int64_t AMP::Array< TYPE, FUN, Allocator >::findFirst | ( | const TYPE & | value, |
| std::function< bool(const TYPE &, const TYPE &)> | compare | ||
| ) | const |
Find all elements that match the operator (if element is not found return -1)
| int64_t AMP::Array< TYPE, FUN, Allocator >::findLast | ( | const TYPE & | value, |
| std::function< bool(const TYPE &, const TYPE &)> | compare | ||
| ) | const |
Find all elements that match the operator (if element is not found return -1)
|
inline |
Return the pointer to the raw data.
Definition at line 640 of file Array.h.
References AMP::Array< TYPE, FUN, Allocator >::d_ptr.
|
inline |
Return the pointer to the raw data.
Definition at line 643 of file Array.h.
References AMP::Array< TYPE, FUN, Allocator >::d_ptr.
|
inlinestaticprivate |
| TYPE AMP::Array< TYPE, FUN, Allocator >::interp | ( | const double * | x | ) | const |
Linear interpolation
| [in] | x | Position as a decimal index |
|
inline |
Linear interpolation
| [in] | x | Position as a decimal index |
Definition at line 794 of file Array.h.
References AMP::Array< TYPE, FUN, Allocator >::interp().
Referenced by AMP::Array< TYPE, FUN, Allocator >::interp().
|
inline |
Is copyable?
Definition at line 147 of file Array.h.
References AMP::Array< TYPE, FUN, Allocator >::d_isCopyable.
Referenced by AMP::Array< TYPE, FUN, Allocator >::viewRaw(), and AMP::Array< TYPE, FUN, Allocator >::viewRaw().
|
inline |
Is fixed size?
Definition at line 153 of file Array.h.
References AMP::Array< TYPE, FUN, Allocator >::d_isFixedSize.
Referenced by AMP::Array< TYPE, FUN, Allocator >::viewRaw(), and AMP::Array< TYPE, FUN, Allocator >::viewRaw().
|
inline |
Return the size of the Array.
Definition at line 389 of file Array.h.
References AMP::Array< TYPE, FUN, Allocator >::d_size, and AMP::ArraySize::length().
Referenced by AMP::Materials::FunctionProperty< Args >::eval().
| TYPE AMP::Array< TYPE, FUN, Allocator >::max | ( | ) | const |
Return the largest value.
| TYPE AMP::Array< TYPE, FUN, Allocator >::max | ( | const std::vector< Range< size_t > > & | index | ) | const |
Return the largest value.
| TYPE AMP::Array< TYPE, FUN, Allocator >::max | ( | const std::vector< size_t > & | index | ) | const |
Return the largest value.
| Array AMP::Array< TYPE, FUN, Allocator >::max | ( | int | dir | ) | const |
Return the max of all elements in a given direction.
| TYPE AMP::Array< TYPE, FUN, Allocator >::mean | ( | ) | const |
Return the mean of all elements.
| TYPE AMP::Array< TYPE, FUN, Allocator >::mean | ( | const std::vector< Range< size_t > > & | index | ) | const |
Return the mean of all elements.
| TYPE AMP::Array< TYPE, FUN, Allocator >::mean | ( | const std::vector< size_t > & | index | ) | const |
Return the mean of all elements.
| TYPE AMP::Array< TYPE, FUN, Allocator >::min | ( | ) | const |
Return the smallest value.
| TYPE AMP::Array< TYPE, FUN, Allocator >::min | ( | const std::vector< Range< size_t > > & | index | ) | const |
Return the smallest value.
| TYPE AMP::Array< TYPE, FUN, Allocator >::min | ( | const std::vector< size_t > & | index | ) | const |
Return the smallest value.
| Array AMP::Array< TYPE, FUN, Allocator >::min | ( | int | dir | ) | const |
Return the min of all elements in a given direction.
| bool AMP::Array< TYPE, FUN, Allocator >::NaNs | ( | ) | const |
Return true if NaNs are present.
|
inline |
Return the size of the Array.
Definition at line 377 of file Array.h.
References AMP::Array< TYPE, FUN, Allocator >::d_size, and AMP::ArraySize::ndim().
Referenced by AMP::Array< TYPE, FUN, Allocator >::setNdim(), and AMP::Array< TYPE, FUN, Allocator >::viewRaw().
|
inline |
Return true if the Array is not empty.
Definition at line 397 of file Array.h.
References AMP::Array< TYPE, FUN, Allocator >::d_size, and AMP::ArraySize::length().
| bool AMP::Array< TYPE, FUN, Allocator >::operator!= | ( | const Array< TYPE, FUN, Allocator > & | rhs | ) | const |
Check if two matrices are not equal.
|
inline |
Access the desired element
| i | The row index |
Definition at line 501 of file Array.h.
References AMP::Array< TYPE, FUN, Allocator >::d_data, AMP::Array< TYPE, FUN, Allocator >::d_size, and AMP::ArraySize::index().
|
inline |
Access the desired element
| i | The row index |
Definition at line 507 of file Array.h.
References AMP::Array< TYPE, FUN, Allocator >::d_data, AMP::Array< TYPE, FUN, Allocator >::d_size, and AMP::ArraySize::index().
|
inline |
Access the desired element
| i | The row index |
| j | The column index |
Definition at line 514 of file Array.h.
References AMP::Array< TYPE, FUN, Allocator >::d_data, AMP::Array< TYPE, FUN, Allocator >::d_size, and AMP::ArraySize::index().
|
inline |
Access the desired element
| i | The row index |
| j | The column index |
Definition at line 521 of file Array.h.
References AMP::Array< TYPE, FUN, Allocator >::d_data, AMP::Array< TYPE, FUN, Allocator >::d_size, and AMP::ArraySize::index().
|
inline |
Access the desired element
| i | The row index |
| j | The column index |
| k | The third index |
Definition at line 532 of file Array.h.
References AMP::Array< TYPE, FUN, Allocator >::d_data, AMP::Array< TYPE, FUN, Allocator >::d_size, and AMP::ArraySize::index().
|
inline |
Access the desired element
| i | The row index |
| j | The column index |
| k | The third index |
Definition at line 543 of file Array.h.
References AMP::Array< TYPE, FUN, Allocator >::d_data, AMP::Array< TYPE, FUN, Allocator >::d_size, and AMP::ArraySize::index().
|
inline |
Access the desired element
| i1 | The first index |
| i2 | The second index |
| i3 | The third index |
| i4 | The fourth index |
Definition at line 555 of file Array.h.
References AMP::Array< TYPE, FUN, Allocator >::d_data, AMP::Array< TYPE, FUN, Allocator >::d_size, and AMP::ArraySize::index().
|
inline |
Access the desired element
| i1 | The first index |
| i2 | The second index |
| i3 | The third index |
| i4 | The fourth index |
Definition at line 567 of file Array.h.
References AMP::Array< TYPE, FUN, Allocator >::d_data, AMP::Array< TYPE, FUN, Allocator >::d_size, and AMP::ArraySize::index().
|
inline |
Access the desired element
| i1 | The first index |
| i2 | The second index |
| i3 | The third index |
| i4 | The fourth index |
| i5 | The fifth index |
Definition at line 580 of file Array.h.
References AMP::Array< TYPE, FUN, Allocator >::d_data, AMP::Array< TYPE, FUN, Allocator >::d_size, and AMP::ArraySize::index().
|
inline |
Access the desired element
| i1 | The first index |
| i2 | The second index |
| i3 | The third index |
| i4 | The fourth index |
| i5 | The fifth index |
Definition at line 594 of file Array.h.
References AMP::Array< TYPE, FUN, Allocator >::d_data, AMP::Array< TYPE, FUN, Allocator >::d_size, and AMP::ArraySize::index().
| Array & AMP::Array< TYPE, FUN, Allocator >::operator+= | ( | const Array< TYPE, FUN, Allocator > & | rhs | ) |
Add another array.
| Array & AMP::Array< TYPE, FUN, Allocator >::operator+= | ( | const TYPE & | rhs | ) |
Add a scalar.
| Array & AMP::Array< TYPE, FUN, Allocator >::operator-= | ( | const Array< TYPE, FUN, Allocator > & | rhs | ) |
Subtract another array.
| Array & AMP::Array< TYPE, FUN, Allocator >::operator-= | ( | const TYPE & | rhs | ) |
Subtract a scalar.
| Array & AMP::Array< TYPE, FUN, Allocator >::operator= | ( | Array< TYPE, FUN, Allocator > && | rhs | ) |
Move assignment operator
| rhs | Array to copy |
| Array & AMP::Array< TYPE, FUN, Allocator >::operator= | ( | const Array< TYPE, FUN, Allocator > & | rhs | ) |
Assignment operator
| rhs | Array to copy |
| Array & AMP::Array< TYPE, FUN, Allocator >::operator= | ( | const std::vector< TYPE > & | rhs | ) |
Assignment operator
| rhs | std::vector to copy |
| bool AMP::Array< TYPE, FUN, Allocator >::operator== | ( | const Array< TYPE, FUN, Allocator > & | rhs | ) | const |
Check if two matrices are equal.
|
inline |
Access the desired element
| i | The element index |
Definition at line 603 of file Array.h.
References AMP::Array< TYPE, FUN, Allocator >::d_data.
|
inline |
Access the desired element
| i | The element index |
Definition at line 609 of file Array.h.
References AMP::Array< TYPE, FUN, Allocator >::d_data.
| size_t AMP::Array< TYPE, FUN, Allocator >::pack | ( | std::byte * | ) | const |
Pack the data to a buffer.
| size_t AMP::Array< TYPE, FUN, Allocator >::packSize | ( | ) | const |
Return the number of bytes required to pack the data.
| void AMP::Array< TYPE, FUN, Allocator >::pow | ( | const Array< TYPE, FUN, Allocator > & | base, |
| const TYPE & | exp | ||
| ) |
Set the values of this array to pow(base, exp)
| base | Base array |
| exp | Exponent value |
| void AMP::Array< TYPE, FUN, Allocator >::print | ( | std::ostream & | os, |
| const std::string & | name = "A", |
||
| const std::string & | prefix = "" |
||
| ) | const |
Print an array.
|
inline |
Access the desired element as a raw pointer
| i | The global index |
Definition at line 616 of file Array.h.
References AMP::Array< TYPE, FUN, Allocator >::d_data, AMP::Array< TYPE, FUN, Allocator >::d_size, and AMP::ArraySize::length().
Referenced by AMP::Array< TYPE, FUN, Allocator >::reinterpretArray().
|
inline |
Access the desired element as a raw pointer
| i | The global index |
Definition at line 622 of file Array.h.
References AMP::Array< TYPE, FUN, Allocator >::d_data, AMP::Array< TYPE, FUN, Allocator >::d_size, and AMP::ArraySize::length().
| void AMP::Array< TYPE, FUN, Allocator >::rand | ( | ) |
Initialize the array with random values (defined from the function table)
|
inline |
Reinterpret the array as a new type (use with caution)
Definition at line 331 of file Array.h.
References AMP::Array< TYPE, FUN, Allocator >::d_ptr, AMP::Array< TYPE, FUN, Allocator >::d_size, AMP::Array< TYPE, FUN, Allocator >::ptr(), and AMP::Array< TYPE, FUN, Allocator >::view2().
| Array AMP::Array< TYPE, FUN, Allocator >::repmat | ( | const ArraySize & | N | ) | const |
Replicate an array a given number of times in each direction.
| void AMP::Array< TYPE, FUN, Allocator >::reshape | ( | const ArraySize & | N | ) |
Reshape the Array (total size of array will not change)
| N | Number of elements in each dimension |
| void AMP::Array< TYPE, FUN, Allocator >::resize | ( | const ArraySize & | N | ) |
Resize the Array
| N | Number of elements in each dimension |
| void AMP::Array< TYPE, FUN, Allocator >::resize | ( | size_t | N | ) |
Resize the Array
| N | Number of elements |
Referenced by AMP::Array< TYPE, FUN, Allocator >::copy().
| void AMP::Array< TYPE, FUN, Allocator >::resize | ( | size_t | N1, |
| size_t | N2, | ||
| size_t | N3 | ||
| ) |
Resize the Array
| N1 | Number of rows |
| N2 | Number of columns |
| N3 | Number of elements in the third dimension |
| void AMP::Array< TYPE, FUN, Allocator >::resize | ( | size_t | N_row, |
| size_t | N_col | ||
| ) |
Resize the Array
| N_row | Number of rows |
| N_col | Number of columns |
| void AMP::Array< TYPE, FUN, Allocator >::resizeDim | ( | int | dim, |
| size_t | N, | ||
| const TYPE & | value | ||
| ) |
Resize the given dimension of the array
| dim | The dimension to resize |
| N | Number of elements for the given dimension |
| value | Value to initialize new elements |
| Array AMP::Array< TYPE, FUN, Allocator >::reverseDim | ( | ) | const |
Transpose an array.
| void AMP::Array< TYPE, FUN, Allocator >::scale | ( | const TYPE & | y | ) |
Scale the array by the given value
| y | Value to scale by |
|
inline |
Set is copyable.
Definition at line 150 of file Array.h.
References AMP::Array< TYPE, FUN, Allocator >::d_isCopyable.
|
inline |
Set is copyable.
Definition at line 156 of file Array.h.
References AMP::Array< TYPE, FUN, Allocator >::d_isFixedSize.
|
inline |
Reshape the Array so that the number of dimensions is the max of ndim and the largest dim>1.
| ndim | Desired number of dimensions |
Definition at line 450 of file Array.h.
References AMP::Array< TYPE, FUN, Allocator >::d_size, AMP::Array< TYPE, FUN, Allocator >::ndim(), and AMP::ArraySize::setNdim().
|
inline |
Return the size of the Array.
Definition at line 381 of file Array.h.
References AMP::Array< TYPE, FUN, Allocator >::d_size.
Referenced by AMP::Array< TYPE, FUN, Allocator >::cloneTo(), AMP::DelaunayHelpers::convert(), AMP::Array< TYPE, FUN, Allocator >::copy(), AMP::operator*(), and AMP::operator*().
|
inline |
Return the size of the Array.
Definition at line 385 of file Array.h.
References AMP::Array< TYPE, FUN, Allocator >::d_size.
|
inlinestatic |
Create an array view of the given data (expert use only). Use view2( N, shared_ptr(data,[](TYPE*){}) ) instead. Note: this interface is not recommended as it does not protect from the src data being deleted while still being used by the Array. Additionally for maximum performance it does not set the internal shared_ptr so functions like getPtr and resize will not work correctly.
| N | Number of elements in each dimension |
| data | Pointer to the data |
Definition at line 248 of file Array.h.
References AMP::Array< TYPE, FUN, Allocator >::data(), and AMP::Array< TYPE, FUN, Allocator >::viewRaw().
| Array AMP::Array< TYPE, FUN, Allocator >::subset | ( | const std::vector< Range< size_t > > & | index | ) | const |
Subset the Array
| index | Index to subset (ix:kx:jx,iy:ky:jy,...) |
| Array AMP::Array< TYPE, FUN, Allocator >::subset | ( | const std::vector< size_t > & | index | ) | const |
Subset the Array
| index | Index to subset (imin,imax,jmin,jmax,kmin,kmax,...) |
| TYPE AMP::Array< TYPE, FUN, Allocator >::sum | ( | ) | const |
Return the sum of all elements.
| TYPE AMP::Array< TYPE, FUN, Allocator >::sum | ( | const std::vector< Range< size_t > > & | index | ) | const |
Return the sum of all elements.
| TYPE AMP::Array< TYPE, FUN, Allocator >::sum | ( | const std::vector< size_t > & | index | ) | const |
Return the sum of all elements.
| Array AMP::Array< TYPE, FUN, Allocator >::sum | ( | int | dir | ) | const |
Return the sum of all elements in a given direction.
| void AMP::Array< TYPE, FUN, Allocator >::swap | ( | Array< TYPE, FUN, Allocator > & | other | ) |
swap the raw data pointers for the Arrays after checking for compatibility
|
static |
Perform a element-wise operation y = f(x)
| [in] | fun | The function operation |
| [in] | x | The input array |
|
static |
Perform a element-wise operation z = f(x,y)
| [in] | fun | The function operation |
| [in] | x | The first array |
| [in] | y | The second array |
| size_t AMP::Array< TYPE, FUN, Allocator >::unpack | ( | const std::byte * | ) |
Unpack the data from a buffer.
| Array< TYPE, FUN, Allocator > AMP::Array< TYPE, FUN, Allocator >::view | ( | ) |
Create an Array view to this array
|
static |
Create a multi-dimensional Array view to a raw block of data
| N | Number of elements in each dimension |
| data | Pointer to the data |
| void AMP::Array< TYPE, FUN, Allocator >::view2 | ( | Array< TYPE, FUN, Allocator > & | src | ) |
Make this object a view of the src
| src | Source vector to take the view of |
Referenced by AMP::Array< TYPE, FUN, Allocator >::reinterpretArray().
| void AMP::Array< TYPE, FUN, Allocator >::view2 | ( | const ArraySize & | N, |
| std::shared_ptr< TYPE > | data | ||
| ) |
Make this object a view of the data
| N | Number of elements in each dimension |
| data | Pointer to the data |
|
inline |
Make this object a view of the raw data (expert use only). Use view2( N, shared_ptr(data,[](TYPE*){}) ) instead. Note: this interface is not recommended as it does not protect from the src data being deleted while still being used by the Array. Additionally for maximum performance it does not set the internal shared_ptr so functions like getPtr and resize will not work correctly.
| N | Number of elements in each dimension |
| data | Pointer to the data |
| isCopyable | Once the view is created, can the array be copied |
| isFixedSize | Once the view is created, is the array size fixed |
Definition at line 229 of file Array.h.
References AMP::Array< TYPE, FUN, Allocator >::d_data, AMP::Array< TYPE, FUN, Allocator >::d_isCopyable, AMP::Array< TYPE, FUN, Allocator >::d_isFixedSize, AMP::Array< TYPE, FUN, Allocator >::d_ptr, AMP::Array< TYPE, FUN, Allocator >::d_size, AMP::Array< TYPE, FUN, Allocator >::data(), AMP::Array< TYPE, FUN, Allocator >::isCopyable(), and AMP::Array< TYPE, FUN, Allocator >::isFixedSize().
|
inline |
Make this object a view of the raw data (expert use only). Use view2( N, shared_ptr(data,[](TYPE*){}) ) instead. Note: this interface is not recommended as it does not protect from the src data being deleted while still being used by the Array. Additionally for maximum performance it does not set the internal shared_ptr so functions like getPtr and resize will not work correctly.
| ndim | Number of dimensions |
| dims | Number of elements in each dimension |
| data | Pointer to the data |
| isCopyable | Once the view is created, can the array be copied |
| isFixedSize | Once the view is created, is the array size fixed |
Definition at line 211 of file Array.h.
References AMP::Array< TYPE, FUN, Allocator >::data(), AMP::Array< TYPE, FUN, Allocator >::isCopyable(), AMP::Array< TYPE, FUN, Allocator >::isFixedSize(), AMP::Array< TYPE, FUN, Allocator >::ndim(), and AMP::Array< TYPE, FUN, Allocator >::viewRaw().
Referenced by AMP::operator*(), AMP::Array< TYPE, FUN, Allocator >::staticView(), and AMP::Array< TYPE, FUN, Allocator >::viewRaw().
|
private |
|
private |
Definition at line 824 of file Array.h.
Referenced by AMP::Array< TYPE, FUN, Allocator >::begin(), AMP::Array< TYPE, FUN, Allocator >::begin(), AMP::Array< TYPE, FUN, Allocator >::data(), AMP::Array< TYPE, FUN, Allocator >::data(), AMP::Array< TYPE, FUN, Allocator >::end(), AMP::Array< TYPE, FUN, Allocator >::end(), AMP::Array< TYPE, FUN, Allocator >::operator()(), AMP::Array< TYPE, FUN, Allocator >::operator()(), AMP::Array< TYPE, FUN, Allocator >::operator()(), AMP::Array< TYPE, FUN, Allocator >::operator()(), AMP::Array< TYPE, FUN, Allocator >::operator()(), AMP::Array< TYPE, FUN, Allocator >::operator()(), AMP::Array< TYPE, FUN, Allocator >::operator()(), AMP::Array< TYPE, FUN, Allocator >::operator()(), AMP::Array< TYPE, FUN, Allocator >::operator()(), AMP::Array< TYPE, FUN, Allocator >::operator()(), AMP::Array< TYPE, FUN, Allocator >::operator[](), AMP::Array< TYPE, FUN, Allocator >::operator[](), AMP::Array< TYPE, FUN, Allocator >::ptr(), AMP::Array< TYPE, FUN, Allocator >::ptr(), and AMP::Array< TYPE, FUN, Allocator >::viewRaw().
|
private |
Definition at line 821 of file Array.h.
Referenced by AMP::Array< TYPE, FUN, Allocator >::isCopyable(), AMP::Array< TYPE, FUN, Allocator >::setCopyable(), and AMP::Array< TYPE, FUN, Allocator >::viewRaw().
|
private |
Definition at line 822 of file Array.h.
Referenced by AMP::Array< TYPE, FUN, Allocator >::isFixedSize(), AMP::Array< TYPE, FUN, Allocator >::setFixedSize(), and AMP::Array< TYPE, FUN, Allocator >::viewRaw().
|
private |
Definition at line 825 of file Array.h.
Referenced by AMP::Array< TYPE, FUN, Allocator >::getPtr(), AMP::Array< TYPE, FUN, Allocator >::getPtr(), AMP::Array< TYPE, FUN, Allocator >::reinterpretArray(), and AMP::Array< TYPE, FUN, Allocator >::viewRaw().
|
private |
Definition at line 823 of file Array.h.
Referenced by AMP::Array< TYPE, FUN, Allocator >::empty(), AMP::Array< TYPE, FUN, Allocator >::end(), AMP::Array< TYPE, FUN, Allocator >::end(), AMP::Array< TYPE, FUN, Allocator >::length(), AMP::Array< TYPE, FUN, Allocator >::ndim(), AMP::Array< TYPE, FUN, Allocator >::operator bool(), AMP::Array< TYPE, FUN, Allocator >::operator()(), AMP::Array< TYPE, FUN, Allocator >::operator()(), AMP::Array< TYPE, FUN, Allocator >::operator()(), AMP::Array< TYPE, FUN, Allocator >::operator()(), AMP::Array< TYPE, FUN, Allocator >::operator()(), AMP::Array< TYPE, FUN, Allocator >::operator()(), AMP::Array< TYPE, FUN, Allocator >::operator()(), AMP::Array< TYPE, FUN, Allocator >::operator()(), AMP::Array< TYPE, FUN, Allocator >::operator()(), AMP::Array< TYPE, FUN, Allocator >::operator()(), AMP::Array< TYPE, FUN, Allocator >::ptr(), AMP::Array< TYPE, FUN, Allocator >::ptr(), AMP::Array< TYPE, FUN, Allocator >::reinterpretArray(), AMP::Array< TYPE, FUN, Allocator >::setNdim(), AMP::Array< TYPE, FUN, Allocator >::size(), AMP::Array< TYPE, FUN, Allocator >::size(), and AMP::Array< TYPE, FUN, Allocator >::viewRaw().
|
Advanced Multi-Physics (AMP) Oak Ridge National Laboratory Idaho National Laboratory Los Alamos National Laboratory |
This page automatically produced from the source code by Last updated: Tue Mar 10 2026 13:06:42. Comments on this page |