Trait backtrack::problem::CheckInc[][src]

pub trait CheckInc<T = usize> {
    type Accumulator: Debug;
    fn fold_acc(
        &self,
        accu: Option<&Self::Accumulator>,
        x: &T
    ) -> Self::Accumulator;
fn accu_sat(
        &self,
        accu: Option<&Self::Accumulator>,
        x: &T,
        index: usize
    ) -> bool; }

Check if a new value is satisfactory against reduced combinations incrementally.

This definition is for problems that benefit from reducing prior checks. It also enables more efficient solvers.

Associated Types

Loading content...

Required methods

fn fold_acc(&self, accu: Option<&Self::Accumulator>, x: &T) -> Self::Accumulator[src]

Produce an Accumulator for quick-checking next candidates in accu_sat

fn accu_sat(
    &self,
    accu: Option<&Self::Accumulator>,
    x: &T,
    index: usize
) -> bool
[src]

Check if next value is valid against accumulated checks from fold_acc

Arguments

  • accu: accumulated checks before value x
  • x: new value
  • index: index of x, 0 is the first element, at index 0 accu is also None
Loading content...

Implementors

impl CheckInc<usize> for TotalSum[src]

type Accumulator = SumReached

Loading content...