Proto  3.2
Public Member Functions | Private Attributes | List of all members
Proto::CInterval Class Reference

Component-Space Interval. More...

#include <Proto_CInterval.H>

Public Member Functions

 CInterval (unsigned int a_c0, unsigned int a_c1, unsigned int a_d0=0, unsigned int a_d1=0, unsigned int a_e0=0, unsigned int a_e1=0)
 Bounds Constructor. More...
 
 CInterval (std::initializer_list< std::initializer_list< unsigned int >> a_lst)
 List Constructor. More...
 
bool operator== (CInterval &a_rhs)
 Equality. More...
 
unsigned int low (unsigned int a_comp) const
 Lower Bound. More...
 
unsigned int high (unsigned int a_comp) const
 Upper Bound. More...
 
bool contains (unsigned int a_index, unsigned int a_comp) const
 Contains Query. More...
 
unsigned int size (unsigned int a_comp) const
 Size Query. More...
 
void print () const
 Print. More...
 

Private Attributes

unsigned int m_comps [3][2]
 bounds of the interval More...
 

Detailed Description

Component-Space Interval.

Defines a subspace of tensor components. Used chiefly for copying and and linearized buffer IO. Usually the user will not need to explicitly create a CInterval. See the documentation for BoxData::copyTo for an example.

Constructor & Destructor Documentation

◆ CInterval() [1/2]

Proto::CInterval::CInterval ( unsigned int  a_c0,
unsigned int  a_c1,
unsigned int  a_d0 = 0,
unsigned int  a_d1 = 0,
unsigned int  a_e0 = 0,
unsigned int  a_e1 = 0 
)
inline

Bounds Constructor.

Builds the interval: {{a_c0, a_c1},{a_d0, a_d1},{a_e0, a_e1}}

◆ CInterval() [2/2]

Proto::CInterval::CInterval ( std::initializer_list< std::initializer_list< unsigned int >>  a_lst)
inline

List Constructor.

Build a CInterval using initializer list syntax.

Example:

CInterval I0{{c0, c1},{d0, d1},{e0, e1}};
// OR
CInterval I1({{c0, c1},{d0, d1},{e0, e1}});
// Or, for a single component index:
CInterval I2{c0, c1};
// OR
CInterval I3({c0, c1});

Member Function Documentation

◆ operator==()

bool Proto::CInterval::operator== ( CInterval a_rhs)
inline

Equality.

◆ low()

unsigned int Proto::CInterval::low ( unsigned int  a_comp) const
inline

Lower Bound.

Retrieve the lower bound along the given component axis

Parameters
a_compA component axis in [0,3)

◆ high()

unsigned int Proto::CInterval::high ( unsigned int  a_comp) const
inline

Upper Bound.

Retrieve the upper bound component for component axis a_comp

Parameters
a_compA component axis in [0,3)

◆ contains()

bool Proto::CInterval::contains ( unsigned int  a_index,
unsigned int  a_comp 
) const
inline

Contains Query.

Query if *this contains index of component comp

Parameters
a_indexAn index
a_compA component axis in [0,3)

◆ size()

unsigned int Proto::CInterval::size ( unsigned int  a_comp) const
inline

Size Query.

Returns the number of components in *this along the component axis a_comp

Parameters
a_compA component axis in [0,3)

◆ print()

void Proto::CInterval::print ( ) const
inline

Print.

Member Data Documentation

◆ m_comps

unsigned int Proto::CInterval::m_comps[3][2]
private

bounds of the interval


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