TagBox Struct ReferenceΒΆ

adc_cpp: pops::TagBox Struct Reference
adc_cpp 0.3.0
Model-free C++23 core for coupled hyperbolic-elliptic systems on adaptive (AMR) meshes, with MPI and GPU (Kokkos) backends

Dense grid of 0/1 markers over a box, input to Berger-Rigoutsos clustering. More...

#include <tag_box.hpp>

+ Collaboration diagram for pops::TagBox:

Public Member Functions

 TagBox ()=default
 
 TagBox (const Box2D &b)
 Build a TagBox covering b, all markers at 0 (buffer sized on b.num_cells()).
 
char & operator() (int i, int j)
 Write access to marker (i, j); (i, j) MUST be in box (no bound check).
 
char operator() (int i, int j) const
 Read access to marker (i, j); (i, j) MUST be in box (no bound check).
 
bool tagged (int i, int j) const
 true if (i, j) is in box AND tagged; safe (bound check included, unlike operator()).
 
std::int64_t count () const
 Number of tagged cells (sum of markers).
 

Public Attributes

Box2D box {}
 
std::vector< char > t {}
 

Detailed Description

Dense grid of 0/1 markers over a box, input to Berger-Rigoutsos clustering.

Usage: filled by tagging (tag_cells), optionally dilated (grow_tags) then merged (tag_union), finally clustered (berger_rigoutsos). Contract: accesses (i, j) are in the index space of box (lo/hi corners INCLUSIVE). Invariants: t has exactly box.num_cells() entries (0 if the box is empty), rows i-fast.

Constructor & Destructor Documentation

◆ TagBox() [1/2]

pops::TagBox::TagBox ( )
default

◆ TagBox() [2/2]

pops::TagBox::TagBox ( const Box2D b)
inlineexplicit

Build a TagBox covering b, all markers at 0 (buffer sized on b.num_cells()).

Member Function Documentation

◆ count()

std::int64_t pops::TagBox::count ( ) const
inline

Number of tagged cells (sum of markers).

◆ operator()() [1/2]

char & pops::TagBox::operator() ( int  i,
int  j 
)
inline

Write access to marker (i, j); (i, j) MUST be in box (no bound check).

◆ operator()() [2/2]

char pops::TagBox::operator() ( int  i,
int  j 
) const
inline

Read access to marker (i, j); (i, j) MUST be in box (no bound check).

◆ tagged()

bool pops::TagBox::tagged ( int  i,
int  j 
) const
inline

true if (i, j) is in box AND tagged; safe (bound check included, unlike operator()).

+ Here is the call graph for this function:

Member Data Documentation

◆ box

Box2D pops::TagBox::box {}

◆ t

std::vector<char> pops::TagBox::t {}

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