Struct MinCount

Source
pub struct MinCount<T, U>(/* private fields */);
Expand description

最小値とその個数の総和

Implementations§

Source§

impl<T, U> MinCount<T, U>

Source

pub fn new() -> Self

MinCount<T, U>を返す。

Trait Implementations§

Source§

impl<T, U, A> Act<MinCount<T, U>> for AddMinCount<A>
where A: Monoid<Element = T> + Additive, MinCount<T, U>: Monoid<Element = (Option<T>, U)>,

Source§

type Monoid = A

作用させるモノイド
Source§

type Element = <A as Set>::Element

モノイドの元
Source§

fn monoid(&self) -> &Self::Monoid

作用させるモノイドへの参照を返す。
Source§

fn act( &self, _m: &MinCount<T, U>, val: (Option<T>, U), a: T, _len: usize, ) -> (Option<T>, U)

$val$をn個の値からなる列をモノイド$(\circ, e)$で畳み込んだ値であるとしたとき、 列の各値に$a$を作用させて畳み込んだ値を求める。 Read more
Source§

fn act_one(&self, m: &M, val: M::Element, a: Self::Element) -> M::Element

self.act(m, val, a, 1)
Source§

fn op(&self, a: Self::Element, b: Self::Element) -> Self::Element

二項演算
Source§

fn id(&self) -> Self::Element

単位元
Source§

impl<T: Ord, U: Add<Output = U>> BinaryOp for MinCount<T, U>

Source§

fn op(&self, a: Self::Element, b: Self::Element) -> Self::Element

二項演算
Source§

fn op_assign_r(&self, a: &mut Self::Element, b: Self::Element)
where Self::Element: Clone,

二項演算$\circ$で(右側から)代入操作($a \leftarrow a \circ b$)をする。
Source§

fn op_assign_l(&self, a: &mut Self::Element, b: Self::Element)
where Self::Element: Clone,

二項演算$\circ$で(左側から)代入操作($a \leftarrow b \circ a$)をする。
Source§

impl<T: Clone, U: Clone> Clone for MinCount<T, U>

Source§

fn clone(&self) -> MinCount<T, U>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: Debug, U: Debug> Debug for MinCount<T, U>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: Default, U: Default> Default for MinCount<T, U>

Source§

fn default() -> MinCount<T, U>

Returns the “default value” for a type. Read more
Source§

impl<T: Hash, U: Hash> Hash for MinCount<T, U>

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<T, U: Zero + PartialEq> Identity for MinCount<T, U>

Source§

fn id(&self) -> Self::Element

単位元
Source§

fn is_id(&self, a: &Self::Element) -> bool
where Self::Element: PartialEq,

単位元の判定
Source§

impl<T: PartialEq, U: PartialEq> PartialEq for MinCount<T, U>

Source§

fn eq(&self, other: &MinCount<T, U>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T, U> Set for MinCount<T, U>

Source§

type Element = (Option<T>, U)

集合の元
Source§

impl<T, U> Associative for MinCount<T, U>

Source§

impl<T, U> Commutative for MinCount<T, U>

Source§

impl<T: Copy, U: Copy> Copy for MinCount<T, U>

Source§

impl<T: Eq, U: Eq> Eq for MinCount<T, U>

Source§

impl<T, U> StructuralPartialEq for MinCount<T, U>

Auto Trait Implementations§

§

impl<T, U> Freeze for MinCount<T, U>

§

impl<T, U> RefUnwindSafe for MinCount<T, U>

§

impl<T, U> Send for MinCount<T, U>
where T: Send, U: Send,

§

impl<T, U> Sync for MinCount<T, U>
where T: Sync, U: Sync,

§

impl<T, U> Unpin for MinCount<T, U>
where T: Unpin, U: Unpin,

§

impl<T, U> UnwindSafe for MinCount<T, U>
where T: UnwindSafe, U: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Monoid for T
where T: Semigroup + Identity,

Source§

fn fold_m<I>(&self, iter: I) -> Self::Element
where I: IntoIterator<Item = Self::Element>,

iterが空のとき、モノイドの単位元を返す。 そうでないとき、iterの中身を二項演算で畳み込んで返す。
Source§

fn times(&self, a: Self::Element, n: u64) -> Self::Element
where Self::Element: Clone,

$\underbrace{a \circ a \circ \dots \circ a \circ a}_{n}$を計算する。
Source§

impl<T> Semigroup for T
where T: BinaryOp + Associative,

Source§

fn reduce<I>(&self, iter: I) -> Option<Self::Element>
where I: IntoIterator<Item = Self::Element>,

iterが空のとき、Noneを返す。 そうでないとき、iterの中身を二項演算で畳み込んでSomeで返す。
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> AbelianMonoid for T
where T: Monoid + Commutative,