mmcfilters
Public API documentation
Loading...
Searching...
No Matches
mmcfilters::attributes::computers::TreeTopologyComputer Class Reference

Computes structural descriptors that depend only on the tree topology. More...

#include <TreeTopologyComputer.hpp>

Static Public Member Functions

template<std::floating_point Real>
static void compute (const AttributeComputeContext< Real > &context)
 Computes the requested topology descriptors.
template<std::floating_point Real>
static void computeUnitRows (const UnitAttributeComputeContext< Real > &context)
 Materializes topology descriptors for one-pixel unit supports.

Static Public Attributes

static constexpr std::string_view familyName = "tree-topology"
 Family name used in dependency-plan diagnostics.
static constexpr AttributeComputerFamily family = AttributeComputerFamily::TreeTopology
 Stable family id used by the scheduler.
static constexpr AttributeComputerDomain domain = AttributeComputerDomain::Topology
 Execution domain required by the computer.
static constexpr std::array< Attribute, 11 > producedAttributes
 Canonical list of topology-derived descriptors produced by this computer.

Detailed Description

Computes structural descriptors that depend only on the tree topology.

This computer ignores the image-domain geometry and uses only the parent / child relationships encoded in the hierarchy. The descriptors cover:

  • depth and height;
  • leaf/root indicators;
  • number of children, siblings, descendants, and leaf descendants;
  • aggregated descriptors such as leaf ratio, subtree balance, and average child height.

Some of these descriptors depend on intermediate quantities that are also public outputs, such as subtree height or number of descendants. To avoid forcing callers to request those attributes explicitly, the implementation allocates temporary scratch buffers whenever an intermediate quantity is needed internally but is not part of the requested output set.

The computation is incremental:

  • node-local quantities such as depth, root/leaf flags, and child counts are initialised on entry;
  • bottom-up aggregation then propagates heights and descendant counts;
  • a final visit converts the accumulated values into the derived ratios and balance measures.

Definition at line 226 of file TreeTopologyComputer.hpp.

Member Function Documentation

◆ compute()

template<std::floating_point Real>
void mmcfilters::attributes::computers::TreeTopologyComputer::compute ( const AttributeComputeContext< Real > & context)
inlinestatic

Computes the requested topology descriptors.

The computation is topology-only and ignores altitude/dependencies. All output rows are indexed by dense internal node id. Intermediate quantities such as height, depth, and descendant counts are kept in scratch storage when they are needed to derive a requested descriptor but are not themselves requested as public columns.

Parameters
contextOperation context or diagnostic label.

Definition at line 256 of file TreeTopologyComputer.hpp.

◆ computeUnitRows()

template<std::floating_point Real>
void mmcfilters::attributes::computers::TreeTopologyComputer::computeUnitRows ( const UnitAttributeComputeContext< Real > & context)
inlinestatic

Materializes topology descriptors for one-pixel unit supports.

A unit proper part is represented as a degenerate one-node tree: root and leaf flags are true, depths/heights/child counts are zero, and leaf ratio is one.

Parameters
contextOperation context or diagnostic label.

Definition at line 272 of file TreeTopologyComputer.hpp.

Member Data Documentation

◆ domain

AttributeComputerDomain mmcfilters::attributes::computers::TreeTopologyComputer::domain = AttributeComputerDomain::Topology
staticconstexpr

Execution domain required by the computer.

Definition at line 235 of file TreeTopologyComputer.hpp.

◆ family

AttributeComputerFamily mmcfilters::attributes::computers::TreeTopologyComputer::family = AttributeComputerFamily::TreeTopology
staticconstexpr

Stable family id used by the scheduler.

Definition at line 232 of file TreeTopologyComputer.hpp.

◆ familyName

std::string_view mmcfilters::attributes::computers::TreeTopologyComputer::familyName = "tree-topology"
staticconstexpr

Family name used in dependency-plan diagnostics.

Definition at line 229 of file TreeTopologyComputer.hpp.

◆ producedAttributes

std::array<Attribute, 11> mmcfilters::attributes::computers::TreeTopologyComputer::producedAttributes
inlinestaticconstexpr
Initial value:
{SubtreeHeight, DepthNode, IsLeafNode, IsRootNode,
NumChildrenNode, NumSiblingsNode, NumDescendantsNode, NumLeafDescendantsNode,
LeafRatioNode, BalanceNode, AvgChildHeightNode}

Canonical list of topology-derived descriptors produced by this computer.

Definition at line 240 of file TreeTopologyComputer.hpp.


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