oineus.diff.TopologyOptimizer

class oineus.diff.TopologyOptimizer(fil, *, with_crit_sets=True, dims_to_restore_elz=None, n_threads=1, u_strategy=None)[source]

Bases: object

Thin Python wrapper that picks the right C++ TopologyOptimizer instantiation for the filtration’s cell type and forwards calls to it. The under_fil (the C++ filtration) is exposed via self.under_fil for callers that need it directly.

The optimizer is built for one autograd backward; the reduction recipe is fixed at construction time:

with_crit_sets=False  -> R only (parallel + clearing).
with_crit_sets=True   -> R + V + restore_ELZ in the given dims.
                          U is recovered on demand via
                          ensure_has_u_hom / ensure_has_u_coh,
                          unless u_strategy=LegacyInBand, in
                          which case U is built in-band
                          (serial, clearing off).
Parameters:
  • with_crit_sets (bool)

  • dims_to_restore_elz (List[int] | None)

  • n_threads (int)