|
IBAMR
IBAMR version 0.19.
|
Performs computations based for row-major arrays. More...
#include <MDA_Access.h>

Public Types | |
| enum | { MDA_Reduced_DIM = (MDA_DIM > 1 ? MDA_DIM-1 : 1) } |
| Quantity of (MDA_DIM-1), used only if MDA_DIM > 1. Otherwise defined to 1 to avoid out-of-range subscripts. More... | |
| typedef int | index_t |
| typedef MDA_IndexRange< MDA_DIM > | range_t |
| typedef range_t::dim_t | dim_t |
| typedef MDA_OrderRowMajor< MDA_Reduced_DIM > | reduced_order_t |
Public Member Functions | |
| MDA_OrderRowMajor (const size_t *sz=((size_t *) 0), const index_t *st=((index_t *) 0)) | |
| Similar to MDA_IndexRange constructor. More... | |
| MDA_OrderRowMajor (const index_t *si, const index_t *sf) | |
| Similar to MDA_IndexRange constructor. More... | |
| MDA_OrderRowMajor (const range_t &r) | |
| Constructor for specifying index range object. More... | |
Access to index range | |
| const range_t & | range () const |
| Const access to the index range object. More... | |
| const MDA_OrderRowMajor & | setSizeAndStart (const size_t *sz=((size_t *) 0), const index_t *st=((index_t *) 0)) |
| Similar to MDA_IndexRange::setSizeAndStart(). More... | |
| const MDA_OrderRowMajor & | setInclusiveRange (const index_t first[MDA_DIM], const index_t final[MDA_DIM]) |
| Similar to MDA_IndexRange::setInclusiveRange(). More... | |
| const MDA_OrderRowMajor & | adjustDim (dim_t d, index_t first, index_t final) |
| Similar to MDA_IndexRange::adjustDim(). More... | |
Logical comparisons | |
| bool | operator== (const MDA_OrderRowMajor &r) const |
| Equivalence comparison. More... | |
| bool | operator!= (const MDA_OrderRowMajor &r) const |
| Inequivalence comparison. More... | |
Protected Types | |
| enum | { D0 = range_t::D0, D1 = range_t::D1, D2 = range_t::D2, D3 = range_t::D3 } |
Private Types | |
| enum | { D0 = 0, D1 = (MDA_DIM > 1 ? 1 : 0), D2 = (MDA_DIM > 2 ? 2 : 0), D3 = (MDA_DIM > 3 ? 3 : 0), D4 = (MDA_DIM > 4 ? 4 : 0) } |
| Dimension number (to avoid compiler warnings, set to zero when unused). More... | |
Private Member Functions | |
| bool | operator== (const MDA_IndexRange &r) const |
| Equivalence comparison. More... | |
| bool | operator!= (const MDA_IndexRange &r) const |
| Inequivalence comparison. More... | |
| std::ostream & | streamPut (std::ostream &os) const |
| Output to ostream. More... | |
| std::istream & | streamGet (std::istream &is) |
| Input from istream. More... | |
| const index_t & | beg (size_t i) const |
| Give starting index of a given dimension. More... | |
| const index_t & | end (size_t i) const |
| Give ending index (one more than the last valid index) of a given dimension. More... | |
| const size_t & | size (size_t i) const |
| Give size along a given dimension. More... | |
| size_t | totalSize () const |
| Give size for all dimensions. More... | |
| bool | has (index_t i0) const |
| Check if indices are in range. More... | |
| bool | has (index_t i0, index_t i1) const |
| Check if indices are in range. More... | |
| bool | has (index_t i0, index_t i1, index_t i2) const |
| Check if indices are in range. More... | |
| bool | has (index_t i0, index_t i1, index_t i2, index_t i3) const |
| Check if indices are in range. More... | |
| void | setDependentData () |
| Set dependent data. More... | |
Private Attributes | |
| index_t | d_start [MDA_DIM >0?MDA_DIM:1] |
| Array of starting indices. More... | |
| index_t | d_stop [MDA_DIM >0?MDA_DIM:1] |
| Array of stopping indices. More... | |
| size_t | d_size [MDA_DIM >0?MDA_DIM:1] |
| Array of sizes. More... | |
Functions to compute offsets | |
| size_t | d_total_size [MDA_DIM >0?MDA_DIM:1] |
| Total sizes of sub-dimensional arrays. More... | |
| index_t | d_fixed_offset |
| The fixed portions of offset calculations. More... | |
| index_t | offset (const index_t i[MDA_DIM]) const |
Compute offsets for arbitrary MDA_DIM. More... | |
| index_t | offset (index_t i0) const |
| index_t | offset (index_t i0, index_t i1) const |
| index_t | offset (index_t i0, index_t i1, index_t i2) const |
| index_t | offset (index_t i0, index_t i1, index_t i2, index_t i3) const |
| index_t | fixedOffset () const |
| size_t | totalSize (unsigned short d) const |
| Return the total size of subarray starting with dimension d. More... | |
| size_t | reduce (index_t i, reduced_order_t &new_order) const |
| Computes the order object and offset for reducing the slowest dimension. More... | |
| void | computeSizeDependentData () |
| Recompute the total sizes array, which is dependent on sizes. More... | |
This class computes things that are dependent on element order in memory, in this case, for the row-major order.
| typedef int MDA_OrderRowMajor< MDA_DIM >::index_t |
| typedef MDA_IndexRange<MDA_DIM> MDA_OrderRowMajor< MDA_DIM >::range_t |
| typedef range_t::dim_t MDA_OrderRowMajor< MDA_DIM >::dim_t |
| typedef MDA_OrderRowMajor<MDA_Reduced_DIM> MDA_OrderRowMajor< MDA_DIM >::reduced_order_t |
|
inline |
| sz | Array sizes |
| st | Array starting indices |
|
inline |
| si | Array of initial indices |
| sf | Array of final indices |
|
inline |
| r | Array index object |
|
inline |
The index range cannot be modified through this reference. To modify the index range, use other member functions.
|
inline |
|
inline |
|
inline |
|
inline |
Only independent data is compared, not dependent (redundant) data.
|
inline |
Only independent data is compared, not dependent (redundant) data.
|
inline |
This is flexible but not efficient! You should use dimension-specific offset computations whenever possible.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
A reduced array is the subarray resulting from fixing the slowest (first) index. The reduced array has one fewer dimension, a different ordering object and its data starts at a different point in memory. The change in starting point is the returned offset value, and the new order object is returned in the referenced argument.
|
inlineprivate |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
| i | index of dimension |
|
inlineinherited |
| i | index of dimension |
|
inlineinherited |
| i | index of dimension |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineprivateinherited |
|
private |
d_total_size[i] is the size of the sub-matrix contained in the last (fast) i dimensions of the array. Incidentally, the stride size of dimension i is d_total_size[i+1] (and the stride size for dimension MDA_DIM-1 is 1.
d_total_size[i] is really equal to \( \prod_{j=i}^{MDA_DIM-1} size_j \)
This member simply caches size-dependent data.
|
private |
Offsets can be separated into a fixed part (dependent only on range) and a variable part (dependent on dereferencing indices). To prevent repeated computation of the fixed part, it is saved in this variable. Note that a good optimizing compiler should already do this, so doing it in the code may not really be needed.
This member simply caches size-dependent data.
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
1.8.17