Trait backtrack::problem::CheckInc [−][src]
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
type Accumulator: Debug
[src]
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]
&self,
accu: Option<&Self::Accumulator>,
x: &T,
index: usize
) -> bool
Check if next value is valid against accumulated checks from fold_acc
Arguments
accu
: accumulated checks before valuex
x
: new valueindex
: index ofx
, 0 is the first element, at index 0accu
is alsoNone
Implementors
impl CheckInc<usize> for TotalSum
[src]
type Accumulator = SumReached
fn fold_acc(
&self,
accu: Option<&Self::Accumulator>,
x: &usize
) -> Self::Accumulator
[src]
&self,
accu: Option<&Self::Accumulator>,
x: &usize
) -> Self::Accumulator
fn accu_sat(
&self,
accu: Option<&Self::Accumulator>,
x: &usize,
index: usize
) -> bool
[src]
&self,
accu: Option<&Self::Accumulator>,
x: &usize,
index: usize
) -> bool