pub struct FuzzyResultSet {
pub solutions: Vec<FuzzySolution>,
}Expand description
A bag of degree-annotated solutions.
Fields§
§solutions: Vec<FuzzySolution>Implementations§
Source§impl FuzzyResultSet
impl FuzzyResultSet
pub fn new() -> Self
pub fn from_solutions(solutions: Vec<FuzzySolution>) -> Self
pub fn push(&mut self, sol: FuzzySolution)
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn order_by_degree_desc(self) -> Self
pub fn order_by_degree_desc(self) -> Self
Sort by degree, highest confidence first (stable).
Sourcepub fn negate(self, norm: DegreeNorm) -> Self
pub fn negate(self, norm: DegreeNorm) -> Self
Fuzzy negation: replace each degree with its complement under norm. (Used for
NOT/MINUS-style scoring of how un-matched a solution is.)
Sourcepub fn join(&self, other: &FuzzyResultSet, norm: DegreeNorm) -> FuzzyResultSet
pub fn join(&self, other: &FuzzyResultSet, norm: DegreeNorm) -> FuzzyResultSet
Conjunctive join (basic graph pattern / AND): every compatible pair of
solutions across the two sets yields a merged solution whose degree is the
t-norm of the two input degrees.
Sourcepub fn union(&self, other: &FuzzyResultSet, norm: DegreeNorm) -> FuzzyResultSet
pub fn union(&self, other: &FuzzyResultSet, norm: DegreeNorm) -> FuzzyResultSet
Union (UNION): solutions from both sets. Where the same row appears in
both, its degrees combine via the t-conorm (the most confident wins under
Gödel) rather than duplicating.
Sourcepub fn project(&self, vars: &[VariableId], norm: DegreeNorm) -> FuzzyResultSet
pub fn project(&self, vars: &[VariableId], norm: DegreeNorm) -> FuzzyResultSet
Projection onto vars (existential): drop all other variable bindings; rows
that become identical are merged, keeping the maximum degree (∃ over the
projected-away variables — the t-conorm under Gödel).
Trait Implementations§
Source§impl Clone for FuzzyResultSet
impl Clone for FuzzyResultSet
Source§fn clone(&self) -> FuzzyResultSet
fn clone(&self) -> FuzzyResultSet
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for FuzzyResultSet
impl Debug for FuzzyResultSet
Source§impl Default for FuzzyResultSet
impl Default for FuzzyResultSet
Source§fn default() -> FuzzyResultSet
fn default() -> FuzzyResultSet
Source§impl PartialEq for FuzzyResultSet
impl PartialEq for FuzzyResultSet
Source§fn eq(&self, other: &FuzzyResultSet) -> bool
fn eq(&self, other: &FuzzyResultSet) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for FuzzyResultSet
Auto Trait Implementations§
impl Freeze for FuzzyResultSet
impl RefUnwindSafe for FuzzyResultSet
impl Send for FuzzyResultSet
impl Sync for FuzzyResultSet
impl Unpin for FuzzyResultSet
impl UnsafeUnpin for FuzzyResultSet
impl UnwindSafe for FuzzyResultSet
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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