MADNESS 0.10.1
|
Iterator class for lazy generation of surface points. More...
Public Types | |
using | difference_type = std::ptrdiff_t |
using | iterator_category = std::input_iterator_tag |
using | pointer = const Point * |
using | reference = const Point & |
enum | Type { Begin , End } |
using | value_type = Point |
Public Member Functions | |
Iterator (const BoxSurfaceDisplacementRange *p, Type type) | |
Constructs an iterator. | |
reference | operator* () const |
Dereferences the iterator. | |
Iterator & | operator++ () |
Pre-increment operator. | |
Iterator | operator++ (int) |
Post-increment operator. | |
pointer | operator-> () const |
Arrow operator for member access. | |
Private Member Functions | |
void | advance () |
Advances the iterator to the next surface point. | |
void | advance_till_valid () |
const std::optional< Displacement > & | displacement () const |
bool | next_surface_layer () |
void | reset_along_dim (size_t dim) |
Private Attributes | |
Box | box |
updated box bounds in each dimension, used to avoid duplicate displacements by excluding the surface displacements for each processed fixed dim | |
std::optional< Displacement > | disp |
Memoized displacement from parent->center_ to point, computed by displacement(), reset by advance() | |
bool | done |
Flag indicating iteration completion. | |
size_t | fixed_dim |
Current fixed dimension (i.e. faces perpendicular to this axis are being iterated over) | |
const BoxSurfaceDisplacementRange * | parent |
Pointer to parent box. | |
Point | point |
Current point. | |
Friends | |
bool | operator!= (const Iterator &a, const Iterator &b) |
Inequality comparison operator. | |
bool | operator== (const Iterator &a, const Iterator &b) |
Equality comparison operator. | |
Iterator class for lazy generation of surface points.
This iterator generates surface points on-demand by tracking the current fixed dimension and positions in each dimension. It implements the InputIterator concept.
using madness::BoxSurfaceDisplacementRange< NDIM >::Iterator::difference_type = std::ptrdiff_t |
using madness::BoxSurfaceDisplacementRange< NDIM >::Iterator::iterator_category = std::input_iterator_tag |
using madness::BoxSurfaceDisplacementRange< NDIM >::Iterator::pointer = const Point* |
using madness::BoxSurfaceDisplacementRange< NDIM >::Iterator::reference = const Point& |
using madness::BoxSurfaceDisplacementRange< NDIM >::Iterator::value_type = Point |
enum madness::BoxSurfaceDisplacementRange::Iterator::Type |
|
inline |
Constructs an iterator.
p | Pointer to the parent BoxSurfaceDisplacementRange |
type | the type of iterator (Begin or End) |
References madness::BoxSurfaceDisplacementRange< NDIM >::Iterator::advance_till_valid(), madness::BoxSurfaceDisplacementRange< NDIM >::Iterator::box, madness::BoxSurfaceDisplacementRange< NDIM >::box_, madness::BoxSurfaceDisplacementRange< NDIM >::box_radius_, d, madness::BoxSurfaceDisplacementRange< NDIM >::Iterator::End, NDIM, madness::BoxSurfaceDisplacementRange< NDIM >::Iterator::parent, madness::BoxSurfaceDisplacementRange< NDIM >::Iterator::reset_along_dim(), madness::BoxSurfaceDisplacementRange< NDIM >::surface_thickness_, and madness::type().
|
inlineprivate |
Advances the iterator to the next surface point.
This function implements the logic for traversing the box surface by:
References madness::BoxSurfaceDisplacementRange< NDIM >::Iterator::box, madness::BoxSurfaceDisplacementRange< NDIM >::box_, madness::BoxSurfaceDisplacementRange< NDIM >::box_radius_, madness::BoxSurfaceDisplacementRange< NDIM >::Iterator::disp, madness::BoxSurfaceDisplacementRange< NDIM >::Iterator::done, madness::BoxSurfaceDisplacementRange< NDIM >::filter_, madness::BoxSurfaceDisplacementRange< NDIM >::Iterator::fixed_dim, madness::BoxSurfaceDisplacementRange< NDIM >::hollowness_, MADNESS_ASSERT, NDIM, madness::BoxSurfaceDisplacementRange< NDIM >::Iterator::next_surface_layer(), madness::BoxSurfaceDisplacementRange< NDIM >::Iterator::parent, madness::BoxSurfaceDisplacementRange< NDIM >::Iterator::point, madness::BoxSurfaceDisplacementRange< NDIM >::Iterator::reset_along_dim(), and madness::BoxSurfaceDisplacementRange< NDIM >::surface_thickness_.
Referenced by madness::BoxSurfaceDisplacementRange< NDIM >::Iterator::advance_till_valid().
|
inlineprivate |
References madness::BoxSurfaceDisplacementRange< NDIM >::Iterator::advance(), madness::BoxSurfaceDisplacementRange< NDIM >::Iterator::disp, madness::BoxSurfaceDisplacementRange< NDIM >::Iterator::displacement(), madness::BoxSurfaceDisplacementRange< NDIM >::Iterator::done, madness::BoxSurfaceDisplacementRange< NDIM >::filter_, madness::BoxSurfaceDisplacementRange< NDIM >::Iterator::parent, and madness::BoxSurfaceDisplacementRange< NDIM >::Iterator::point.
Referenced by madness::BoxSurfaceDisplacementRange< NDIM >::Iterator::Iterator(), and madness::BoxSurfaceDisplacementRange< NDIM >::Iterator::operator++().
|
inlineprivate |
References madness::BoxSurfaceDisplacementRange< NDIM >::center_, madness::BoxSurfaceDisplacementRange< NDIM >::Iterator::disp, madness::displacement(), madness::BoxSurfaceDisplacementRange< NDIM >::Iterator::parent, and madness::BoxSurfaceDisplacementRange< NDIM >::Iterator::point.
Referenced by madness::BoxSurfaceDisplacementRange< NDIM >::Iterator::advance_till_valid(), and madness::BoxSurfaceDisplacementRange< NDIM >::Iterator::operator*().
|
inlineprivate |
References madness::BoxSurfaceDisplacementRange< NDIM >::box_, madness::BoxSurfaceDisplacementRange< NDIM >::Iterator::fixed_dim, madness::BoxSurfaceDisplacementRange< NDIM >::hollowness_, madness::BoxSurfaceDisplacementRange< NDIM >::Iterator::parent, madness::BoxSurfaceDisplacementRange< NDIM >::Iterator::point, and madness::BoxSurfaceDisplacementRange< NDIM >::surface_thickness_.
Referenced by madness::BoxSurfaceDisplacementRange< NDIM >::Iterator::advance(), and madness::BoxSurfaceDisplacementRange< NDIM >::Iterator::reset_along_dim().
|
inline |
Dereferences the iterator.
References madness::BoxSurfaceDisplacementRange< NDIM >::Iterator::displacement().
|
inline |
Pre-increment operator.
References madness::BoxSurfaceDisplacementRange< NDIM >::Iterator::advance_till_valid().
|
inline |
Post-increment operator.
|
inline |
Arrow operator for member access.
|
inlineprivate |
References madness::BoxSurfaceDisplacementRange< NDIM >::Iterator::box, madness::BoxSurfaceDisplacementRange< NDIM >::box_, madness::BoxSurfaceDisplacementRange< NDIM >::center_, madness::BoxSurfaceDisplacementRange< NDIM >::filter_, madness::BoxSurfaceDisplacementRange< NDIM >::Iterator::fixed_dim, madness::BoxSurfaceDisplacementRange< NDIM >::hollowness_, madness::BoxSurfaceDisplacementRange< NDIM >::is_periodic_, MADNESS_ASSERT, madness::BoxSurfaceDisplacementRange< NDIM >::Iterator::next_surface_layer(), madness::BoxSurfaceDisplacementRange< NDIM >::Iterator::parent, madness::BoxSurfaceDisplacementRange< NDIM >::Iterator::point, and madness::BoxSurfaceDisplacementRange< NDIM >::surface_thickness_.
Referenced by madness::BoxSurfaceDisplacementRange< NDIM >::Iterator::Iterator(), and madness::BoxSurfaceDisplacementRange< NDIM >::Iterator::advance().
Inequality comparison operator.
a | First iterator |
b | Second iterator |
Equality comparison operator.
a | First iterator |
b | Second iterator |
|
private |
updated box bounds in each dimension, used to avoid duplicate displacements by excluding the surface displacements for each processed fixed dim
Referenced by madness::BoxSurfaceDisplacementRange< NDIM >::Iterator::Iterator(), madness::BoxSurfaceDisplacementRange< NDIM >::Iterator::advance(), and madness::BoxSurfaceDisplacementRange< NDIM >::Iterator::reset_along_dim().
|
mutableprivate |
Memoized displacement from parent->center_ to point, computed by displacement(), reset by advance()
Referenced by madness::BoxSurfaceDisplacementRange< NDIM >::Iterator::advance(), madness::BoxSurfaceDisplacementRange< NDIM >::Iterator::advance_till_valid(), and madness::BoxSurfaceDisplacementRange< NDIM >::Iterator::displacement().
|
private |
Flag indicating iteration completion.
Referenced by madness::BoxSurfaceDisplacementRange< NDIM >::Iterator::advance(), and madness::BoxSurfaceDisplacementRange< NDIM >::Iterator::advance_till_valid().
|
private |
Current fixed dimension (i.e. faces perpendicular to this axis are being iterated over)
Referenced by madness::BoxSurfaceDisplacementRange< NDIM >::Iterator::advance(), madness::BoxSurfaceDisplacementRange< NDIM >::Iterator::next_surface_layer(), and madness::BoxSurfaceDisplacementRange< NDIM >::Iterator::reset_along_dim().
|
private |
Pointer to parent box.
Referenced by madness::BoxSurfaceDisplacementRange< NDIM >::Iterator::Iterator(), madness::BoxSurfaceDisplacementRange< NDIM >::Iterator::advance(), madness::BoxSurfaceDisplacementRange< NDIM >::Iterator::advance_till_valid(), madness::BoxSurfaceDisplacementRange< NDIM >::Iterator::displacement(), madness::BoxSurfaceDisplacementRange< NDIM >::Iterator::next_surface_layer(), and madness::BoxSurfaceDisplacementRange< NDIM >::Iterator::reset_along_dim().
|
private |
Current point.
Referenced by madness::BoxSurfaceDisplacementRange< NDIM >::Iterator::advance(), madness::BoxSurfaceDisplacementRange< NDIM >::Iterator::advance_till_valid(), madness::BoxSurfaceDisplacementRange< NDIM >::Iterator::displacement(), madness::BoxSurfaceDisplacementRange< NDIM >::Iterator::next_surface_layer(), and madness::BoxSurfaceDisplacementRange< NDIM >::Iterator::reset_along_dim().