pub struct EstimateOverrideConstraint<C> {
pub constraint: C,
pub estimates: [Option<usize>; 128],
}Expand description
Constraint wrapper that overrides cardinality estimates for selected variables.
Fields§
§constraint: CThe underlying constraint whose estimates may be overridden.
estimates: [Option<usize>; 128]Per-variable estimate overrides; None falls through to the inner constraint.
Implementations§
Source§impl<C> EstimateOverrideConstraint<C>
impl<C> EstimateOverrideConstraint<C>
Sourcepub fn with_estimates(constraint: C, estimates: [Option<usize>; 128]) -> Self
pub fn with_estimates(constraint: C, estimates: [Option<usize>; 128]) -> Self
Creates a wrapper with the given estimate override array.
Sourcepub fn set_estimate(&mut self, variable: VariableId, estimate: usize)
pub fn set_estimate(&mut self, variable: VariableId, estimate: usize)
Overrides the cardinality estimate for variable.
Trait Implementations§
Source§impl<'a, C: Constraint<'a>> Constraint<'a> for EstimateOverrideConstraint<C>
impl<'a, C: Constraint<'a>> Constraint<'a> for EstimateOverrideConstraint<C>
Source§fn variables(&self) -> VariableSet
fn variables(&self) -> VariableSet
Returns the set of variables this constraint touches. Read more
Source§fn influence(&self, variable: VariableId) -> VariableSet
fn influence(&self, variable: VariableId) -> VariableSet
Returns the set of variables whose estimates may change when
variable is bound or unbound. Read moreAuto Trait Implementations§
impl<C> Freeze for EstimateOverrideConstraint<C>where
C: Freeze,
impl<C> RefUnwindSafe for EstimateOverrideConstraint<C>where
C: RefUnwindSafe,
impl<C> Send for EstimateOverrideConstraint<C>where
C: Send,
impl<C> Sync for EstimateOverrideConstraint<C>where
C: Sync,
impl<C> Unpin for EstimateOverrideConstraint<C>where
C: Unpin,
impl<C> UnsafeUnpin for EstimateOverrideConstraint<C>where
C: UnsafeUnpin,
impl<C> UnwindSafe for EstimateOverrideConstraint<C>where
C: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more