Struct rustfst::semirings::ProductWeight
source · pub struct ProductWeight<W1, W2>{ /* private fields */ }
Expand description
Product semiring: W1 * W2.
Implementations§
source§impl<W1, W2> ProductWeight<W1, W2>
impl<W1, W2> ProductWeight<W1, W2>
pub fn value1(&self) -> &W1
pub fn value2(&self) -> &W2
pub fn set_value1(&mut self, new_weight: W1)
pub fn set_value2(&mut self, new_weight: W2)
Trait Implementations§
source§impl<W1, W2> AsRef<ProductWeight<W1, W2>> for ProductWeight<W1, W2>
impl<W1, W2> AsRef<ProductWeight<W1, W2>> for ProductWeight<W1, W2>
source§fn as_ref(&self) -> &ProductWeight<W1, W2>
fn as_ref(&self) -> &ProductWeight<W1, W2>
Converts this type into a shared reference of the (usually inferred) input type.
source§impl<W1, W2> Clone for ProductWeight<W1, W2>
impl<W1, W2> Clone for ProductWeight<W1, W2>
source§fn clone(&self) -> ProductWeight<W1, W2>
fn clone(&self) -> ProductWeight<W1, W2>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<W1, W2> Debug for ProductWeight<W1, W2>
impl<W1, W2> Debug for ProductWeight<W1, W2>
source§impl<W1, W2> Default for ProductWeight<W1, W2>
impl<W1, W2> Default for ProductWeight<W1, W2>
source§fn default() -> ProductWeight<W1, W2>
fn default() -> ProductWeight<W1, W2>
Returns the “default value” for a type. Read more
source§impl<W1, W2> Display for ProductWeight<W1, W2>where
W1: SerializableSemiring,
W2: SerializableSemiring,
impl<W1, W2> Display for ProductWeight<W1, W2>where
W1: SerializableSemiring,
W2: SerializableSemiring,
source§impl<W1, W2> From<(W1, W2)> for ProductWeight<W1, W2>
impl<W1, W2> From<(W1, W2)> for ProductWeight<W1, W2>
source§impl<W1, W2> Hash for ProductWeight<W1, W2>
impl<W1, W2> Hash for ProductWeight<W1, W2>
source§impl<W1, W2> PartialEq for ProductWeight<W1, W2>
impl<W1, W2> PartialEq for ProductWeight<W1, W2>
source§fn eq(&self, other: &ProductWeight<W1, W2>) -> bool
fn eq(&self, other: &ProductWeight<W1, W2>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<W1, W2> PartialOrd for ProductWeight<W1, W2>
impl<W1, W2> PartialOrd for ProductWeight<W1, W2>
source§fn partial_cmp(&self, other: &ProductWeight<W1, W2>) -> Option<Ordering>
fn partial_cmp(&self, other: &ProductWeight<W1, W2>) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl<W1: Semiring, W2: Semiring> ReverseBack<ProductWeight<W1, W2>> for <ProductWeight<W1, W2> as Semiring>::ReverseWeight
impl<W1: Semiring, W2: Semiring> ReverseBack<ProductWeight<W1, W2>> for <ProductWeight<W1, W2> as Semiring>::ReverseWeight
fn reverse_back(&self) -> Result<ProductWeight<W1, W2>>
source§impl<W1, W2> Semiring for ProductWeight<W1, W2>
impl<W1, W2> Semiring for ProductWeight<W1, W2>
type Type = (W1, W2)
type ReverseWeight = ProductWeight<<W1 as Semiring>::ReverseWeight, <W2 as Semiring>::ReverseWeight>
fn zero() -> Self
fn one() -> Self
fn new(weight: <Self as Semiring>::Type) -> Self
fn plus_assign<P: Borrow<Self>>(&mut self, rhs: P) -> Result<()>
fn times_assign<P: Borrow<Self>>(&mut self, rhs: P) -> Result<()>
fn approx_equal<P: Borrow<Self>>(&self, rhs: P, delta: f32) -> bool
source§fn take_value(self) -> <Self as Semiring>::Type
fn take_value(self) -> <Self as Semiring>::Type
Move underneath value.
fn set_value(&mut self, value: <Self as Semiring>::Type)
fn reverse(&self) -> Result<Self::ReverseWeight>
fn properties() -> SemiringProperties
fn plus<P: Borrow<Self>>(&self, rhs: P) -> Result<Self>
fn times<P: Borrow<Self>>(&self, rhs: P) -> Result<Self>
fn is_one(&self) -> bool
fn is_zero(&self) -> bool
source§impl<W1, W2> SerializableSemiring for ProductWeight<W1, W2>where
W1: SerializableSemiring,
W2: SerializableSemiring,
impl<W1, W2> SerializableSemiring for ProductWeight<W1, W2>where
W1: SerializableSemiring,
W2: SerializableSemiring,
source§impl<W1, W2> WeaklyDivisibleSemiring for ProductWeight<W1, W2>where
W1: WeaklyDivisibleSemiring,
W2: WeaklyDivisibleSemiring,
impl<W1, W2> WeaklyDivisibleSemiring for ProductWeight<W1, W2>where
W1: WeaklyDivisibleSemiring,
W2: WeaklyDivisibleSemiring,
fn divide_assign(&mut self, rhs: &Self, divide_type: DivideType) -> Result<()>
fn divide(&self, rhs: &Self, divide_type: DivideType) -> Result<Self>
source§impl<W1, W2> WeightQuantize for ProductWeight<W1, W2>where
W1: WeightQuantize,
W2: WeightQuantize,
impl<W1, W2> WeightQuantize for ProductWeight<W1, W2>where
W1: WeightQuantize,
W2: WeightQuantize,
impl<W1, W2> Eq for ProductWeight<W1, W2>
impl<W1, W2> StructuralPartialEq for ProductWeight<W1, W2>
Auto Trait Implementations§
impl<W1, W2> Freeze for ProductWeight<W1, W2>
impl<W1, W2> RefUnwindSafe for ProductWeight<W1, W2>where
W1: RefUnwindSafe,
W2: RefUnwindSafe,
impl<W1, W2> Send for ProductWeight<W1, W2>
impl<W1, W2> Sync for ProductWeight<W1, W2>
impl<W1, W2> Unpin for ProductWeight<W1, W2>
impl<W1, W2> UnwindSafe for ProductWeight<W1, W2>where
W1: UnwindSafe,
W2: 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