|
MorphologicalAttributeFilters
Public API documentation
|
Non-owning view pairing a topology with an external altitude span. More...
#include <WeightedTreeView.hpp>
Public Types | |
| using | altitude_type = T |
| Altitude scalar type borrowed by this view. | |
Public Member Functions | |
| WeightedTreeView (const MorphologicalTree &topology, AltitudeSpan< T > altitude) | |
| Builds a view over caller-owned topology and altitude storage. | |
| WeightedTreeView (const MorphologicalTree &topology, const AltitudeBuffer< T > &altitude) | |
| Builds a view over a caller-owned altitude buffer. | |
| WeightedTreeView (const MorphologicalTree &, AltitudeBuffer< T > &&)=delete | |
| Rejects temporary altitude buffers that would leave a dangling span. | |
| const MorphologicalTree & | topology () const noexcept |
| Returns the borrowed tree topology. | |
| AltitudeSpan< T > | altitude () const noexcept |
Returns the borrowed altitude span indexed by internal NodeId. | |
| void | requireTopologyUnchanged (const char *context) const |
| Throws if the borrowed topology changed since view construction. | |
| T | getAltitude (NodeId nodeId) const |
| Returns the altitude associated with an internal node id. | |
| AltitudeDiff< T > | getNodeResidue (NodeId nodeId) const |
| Returns the altitude difference between a live node and its parent. | |
Non-owning view pairing a topology with an external altitude span.
WeightedTreeView is the lightweight C++ representation of the Higra-like model used by generic-altitude kernels: topology ownership stays elsewhere, and altitude is borrowed as a contiguous read-only span indexed by the dense internal NodeId domain. The caller must keep both the topology and the altitude storage alive for the lifetime of the view. The view intentionally carries no ownership or canonical-tree identity; operations that need owned weighted state must receive a WeightedMorphologicalTree<T> instead.
Definition at line 24 of file WeightedTreeView.hpp.
| using mmcfilters::WeightedTreeView< T >::altitude_type = T |
Altitude scalar type borrowed by this view.
Definition at line 41 of file WeightedTreeView.hpp.
|
inlineexplicit |
Builds a view over caller-owned topology and altitude storage.
The span must be indexed by the dense internal NodeId domain and remain alive for the full lifetime of the view.
Definition at line 49 of file WeightedTreeView.hpp.
|
inlineexplicit |
Builds a view over a caller-owned altitude buffer.
This overload is equivalent to passing std::span<const T>(altitude) and exists so WeightedTreeView(tree, buffer) deduces the altitude type.
Definition at line 60 of file WeightedTreeView.hpp.
|
inlinenoexcept |
Returns the borrowed altitude span indexed by internal NodeId.
Definition at line 80 of file WeightedTreeView.hpp.
|
inline |
Returns the altitude associated with an internal node id.
Definition at line 94 of file WeightedTreeView.hpp.
|
inline |
Returns the altitude difference between a live node and its parent.
Root-like nodes, whose parent is invalid or themselves, use their own altitude as residue.
Definition at line 107 of file WeightedTreeView.hpp.
|
inline |
Throws if the borrowed topology changed since view construction.
Definition at line 87 of file WeightedTreeView.hpp.
|
inlinenoexcept |
Returns the borrowed tree topology.
Definition at line 73 of file WeightedTreeView.hpp.