Skip to main content

WcojVariableOrderingModel

Trait WcojVariableOrderingModel 

Source
pub trait WcojVariableOrderingModel {
    // Required methods
    fn pick_triangle_leader(
        &self,
        rel_ids: [RelId; 3],
        stats: &StatsManager,
        config: &CompilerConfig,
    ) -> Option<u8>;
    fn pick_4cycle_leader(
        &self,
        rel_ids: [RelId; 4],
        stats: &StatsManager,
        config: &CompilerConfig,
    ) -> Option<u8>;
}
Expand description

Trait that picks a leader slot for triangle / 4-cycle WCOJ.

Implementations look at relation cardinalities (or other stats) and decide whether a non-default leader is worth selecting. They return None to mean “leave default leader” and preserve the no-reorder behavior.

Required Methods§

Source

fn pick_triangle_leader( &self, rel_ids: [RelId; 3], stats: &StatsManager, config: &CompilerConfig, ) -> Option<u8>

Pick a leader for the triangle WCOJ shape.

rel_ids are in promoter canonical order: [e_xy, e_yz, e_xz]. Returns leader index in [0, 3) or None if the model declines to override the default.

Source

fn pick_4cycle_leader( &self, rel_ids: [RelId; 4], stats: &StatsManager, config: &CompilerConfig, ) -> Option<u8>

Pick a leader for the 4-cycle WCOJ shape.

rel_ids are in promoter canonical order: [e_wx, e_xy, e_yz, e_zw]. Returns leader index in [0, 4) or None if the model declines to override the default.

Implementors§