Proto
Proto::BoxData< T, C, MEMTYPE, D, E > Class Template Reference

Multidimensional Rectangular Array. More...

#include <Proto_BoxData.H>

Public Member Functions

Data Movement
template<BoxDataOp >
void operatorT (const BoxData< T, C, MEMTYPE, D, E > &a_src)
 
template<BoxDataOp >
void operatorT (const T a_scale)
 
BoxDataoperator= (BoxData< T, C, MEMTYPE, D, E > &&a_src)
 Move Assignment Operator. More...
 
void copyTo (BoxData< T, C, MEMTYPE, D, E > &a_dest) const
 Copy on Intersection. More...
 
void copyTo (BoxData< T, C, MEMTYPE, D, E > &a_dest, const Box &a_srcBox, const Point &a_destShift=Point::Zeros()) const
 Copy Region. More...
 
void copyTo (BoxData< T, C, MEMTYPE, D, E > &a_dest, const Box &a_srcBox, const Box &a_destBox) const
 Copy with src and dest boxes. More...
 
template<unsigned int Cdest, unsigned char Ddest, unsigned char Edest>
void copyTo (BoxData< T, Cdest, MEMTYPE, Ddest, Edest > &a_dest, const Box &a_srcBox, CInterval a_srcComps, const Point &a_destShift, CInterval a_destComps) const
 General Copy. More...
 
template<unsigned int Csrc>
void copy (const BoxData< T, Csrc, MEMTYPE, D, E > &a_dsrc, const Box &a_srcBox, unsigned int a_srcComp, const Box &a_destBox, unsigned int a_destComp, unsigned int a_numcomp)
 General Copy From. More...
 
Accessors
CUDA_DECORATION T & operator() (const Point &a_pt, unsigned int a_c=0, unsigned char a_d=0, unsigned char a_e=0) const
 Read Only Data Accessor. More...
 
T * operator[] (unsigned int a_index)
 Index Accessor (Non-Const) More...
 
const T * operator[] (unsigned int a_index) const
 Index Accessor (Const) More...
 
const T * data (const Point &a_p, unsigned int a_c=0, unsigned int a_d=0, unsigned int a_e=0) const
 Read-Write Accessor (Const) More...
 
T * data ()
 Buffer Accessor (Non-Const) More...
 
const T * data () const
 Buffer Accessor (Const) More...
 
T * data (const Point &a_p, unsigned int a_c=0, unsigned int a_d=0, unsigned int a_e=0)
 Read-Write Accessor (Non-Const) More...
 
const T * dataPtr (unsigned int a_c=0, unsigned int a_d=0, unsigned int a_e=0) const
 Read-Write Accessor (Const) More...
 
T * dataPtr (unsigned int a_c=0, unsigned int a_d=0, unsigned int a_e=0)
 Read-Write Accessor (Non-Const) More...
 
shared_ptr< T > getData () const
 Access Shared Pointer. More...
 
CUDA_DECORATION size_t index (const Point a_pt, unsigned int a_c=0, unsigned int a_d=0, unsigned int a_e=0) const
 Compute Index. More...
 
Box box () const
 
std::size_t size () const
 
bool defined () const
 Defined Query. More...
 
Var< T, C, MEMTYPE, D, E > var (const Point &a_pt)
 Create Pointwise Access Variable (Non-Const) More...
 
Var< T, C, MEMTYPE, D, E > var (const Point &a_pt) const
 Create Pointwise Access Variable (Const) More...
 
Algebraic Operations
BoxData< T, C, MEMTYPE, D, E > & operator+= (const BoxData< T, C, MEMTYPE, D, E > &a_rhs)
 Pointwise Addition on Intersection. More...
 
BoxData< T, C, MEMTYPE, D, E > & operator-= (const BoxData< T, C, MEMTYPE, D, E > &a_rhs)
 Pointwise Subtraction on Intersection. More...
 
BoxData< T, C, MEMTYPE, D, E > & operator*= (const BoxData< T, C, MEMTYPE, D, E > &a_rhs)
 Pointwise Multiplication on Intersection. More...
 
BoxData< T, C, MEMTYPE, D, E > & operator/= (const BoxData< T, C, MEMTYPE, D, E > &a_rhs)
 Pointwise Division on Intersection. More...
 
BoxData< T, C, MEMTYPE, D, E > & operator+= (T a_scale)
 Pointwise Addition by Scalar. More...
 
BoxData< T, C, MEMTYPE, D, E > & operator-= (T scale)
 Pointwise Subtraction by Scalar. More...
 
BoxData< T, C, MEMTYPE, D, E > & operator*= (T scale)
 Pointwise Multiplication by Scalar. More...
 
BoxData< T, C, MEMTYPE, D, E > & operator/= (T scale)
 Pointwise Division by Scalar. More...
 
Utility
void setVal (const T &a_val)
 Initialize All Values. More...
 
void setVal (const T &a_val, const Box &a_box)
 Set All Values in Box. More...
 
void setVal (const T &a_val, const Box &a_box, int a_c, int a_d=0, int a_e=0)
 Set All Values of Component in Box. More...
 
void absMax (Reduction< T, Abs > &a_Rxn) const
 Absolute Maximum Value (Global) More...
 
absMax () const
 Absolute Maximum Value (Global) More...
 
absMax (int a_c, int a_d=0, int a_e=0) const
 Absolute Maximum Value (Componentwise) More...
 
min () const
 Minimum Value (Global) More...
 
min (int a_c, int a_d=0, int a_e=0) const
 Minimum Value (Componentwise) More...
 
max () const
 Maximum Value (Global) More...
 
max (int a_c, int a_d=0, int a_e=0) const
 Maximum Value (Componentwise) More...
 
sum () const
 Sum (Global) More...
 
sum (int a_c, int a_d=0, int a_e=0) const
 sum (Componentwise) More...
 
void shift (const Point a_pt)
 Shift Domain. More...
 
void linearOut (void *a_buf, const Box &a_box, CInterval a_comps) const
 Buffer Write. More...
 
void linearOut (void *a_buf, const ::Proto::Box &a_bx, unsigned int a_startcomp, unsigned int a_numcomps) const
 
void linearIn (void *a_buf, const Box &a_box, CInterval a_comps)
 Buffer Read. More...
 
void linearIn (void *a_buf, const ::Proto::Box &a_bx, unsigned int a_startcomp, unsigned int a_numcomps)
 
bool contains (CInterval a_interval) const
 Contains CInterval. More...
 
template<unsigned int CC, unsigned char DD, unsigned char EE>
bool isAlias (const BoxData< T, CC, MEMTYPE, DD, EE > &a_src) const
 Check Aliasing. More...
 
void print () const
 Print. More...
 
void printData (int a_prec=2) const
 Print Data. More...
 
void printData (const Box &a_box, int a_prec=2) const
 Print Data in Box. More...
 
void printData (const Box &a_box, int a_c, int a_d, int a_e, int a_prec=2) const
 Print Component Data in Box. More...
 

Constructors and Define

 BoxData (const BoxData< T, C, MEMTYPE, D, E > &a_src)=delete
 Copy constructor/assignment forbidden for all the usual reasons.
 
BoxDataoperator= (const BoxData< T, C, MEMTYPE, D, E > &a_src)=delete
 
 BoxData ()
 Default Constructor. More...
 
 BoxData (const Box &a_box, bool a_stackAllocation=DEFAULT_USE_STACK)
 Box Constructor. More...
 
 BoxData (const Box &a_box, T a_init)
 Box Constructor With Initialization. More...
 
 BoxData (BoxData< T, C, MEMTYPE, D, E > &&a_src)
 Move constructor. More...
 
void define (const Box &a_box, bool a_stackAllocation=DEFAULT_USE_STACK)
 Box Define. More...
 
 BoxData (const T *a_ptr, const Box &a_box, int a_ncomp=C)
 Raw Pointer Constructor. More...
 
void define (const T *a_ptr, const Box &a_box, int a_ncomp=C)
 Raw Pointer Define. More...
 
 ~BoxData ()
 Destructor.
 

Detailed Description

template<class T = double, unsigned int C = 1, MemType MEMTYPE = MEMTYPE_DEFAULT, unsigned char D = 1, unsigned char E = 1>
class Proto::BoxData< T, C, MEMTYPE, D, E >

Multidimensional Rectangular Array.

BoxData is the main dataholder class of Proto. It contains an array of data of type T on a domain defined by a Box. Each data point is associated with a Point in the Box. C, D, and E define the tensor structure of the data: C,D,E = 1: Data is scalar (default) C = N, D,E = 1: Data is vector valued with N components C = M, D = N, E = 1: Data is MxN matrix valued

Template Parameters
TType of data in array (bool, int, double, etc.)
C(Optional) Size of first component axis. Defaults to 1.
D(Optional) Size of second component axis. Defaults to 1.
E(Optional) Size of third component axis. Defaults to 1.
MEMTYPE(Optional) Where memory is allocated (device or host). Defaults to host.

The documentation for this class was generated from the following file: