einsums::compute_graph::LoopNode#

Note

Generated from the C++ headers by apiary --emit-cpp-docs-json.

Defined in header Einsums/ComputeGraph/Pipeline.hpp.

class LoopNode#

An iterative subgraph with convergence-based early exit.

Contains a Graph (the loop body) that is executed repeatedly until either:

  • The LoopCondition returns false (convergence)

  • max_iterations is reached (safety limit)

The condition is evaluated AFTER each iteration, so the body always runs at least once.

See also

Pipeline::add_loop()

Graph body#

The subgraph to execute each iteration

size_t max_iterations#

Maximum number of iterations (safety limit)

LoopCondition condition#

Predicate: return false to stop, true to continue

size_t last_iteration_count#

Set after execution: the actual number of iterations that ran.