Skip to main content

reduction

Attribute Macro reduction 

Source
#[reduction]
Expand description

Attribute macro for automatic reduction registration.

Parses a ReduceTo impl block and generates the corresponding inventory::submit! call. Variant fields are derived from Problem::variant().

Type generics are not supported — all ReduceTo impls must use concrete types. If you need a reduction for a generic problem, write separate impls for each concrete type combination.

§Attributes

  • overhead = { expr } — overhead specification

§New syntax (preferred):

#[reduction(overhead = {
    num_vars = "num_vertices^2",
    num_constraints = "num_edges",
})]

§Legacy syntax (still supported):

#[reduction(overhead = { ReductionOverhead::new(vec![...]) })]