Struct SparsePolynomial

Source
pub struct SparsePolynomial<const P: u32> { /* private fields */ }
Expand description

疎な多項式

Implementations§

Source§

impl<const P: u32> SparsePolynomial<P>

Source

pub fn zero() -> Self

零多項式を得る。

Source

pub fn constant(a: ConstModInt<P>) -> Self

定数項のみをもつ多項式を生成する。

Source

pub fn add(&mut self, i: usize, x: ConstModInt<P>)

Source

pub fn from_vec(a: Vec<(usize, ConstModInt<P>)>) -> Self

Source

pub fn coeff_of(&self, i: usize) -> ConstModInt<P>

$x^i$の係数を得る。

Source

pub fn differential(&mut self)

多項式を微分する。

Source

pub fn integral(&mut self)

多項式を積分する。

Source

pub fn scale(&mut self, k: ConstModInt<P>)

多項式をk倍する。

Source

pub fn shift_lower(&mut self, k: usize)

係数をk次だけ低次側にずらす。ただし、負の次数の項は無視する。

Source

pub fn shift_higher(&mut self, k: usize)

係数をk次だけ高次側にずらす。

Trait Implementations§

Source§

impl<const P: u32> Clone for SparsePolynomial<P>

Source§

fn clone(&self) -> SparsePolynomial<P>

Returns a copy 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<const P: u32> Debug for SparsePolynomial<P>

Source§

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

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

impl<const P: u32> Default for SparsePolynomial<P>

Source§

fn default() -> SparsePolynomial<P>

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

impl<const P: u32> FpsExpSparse for SparsePolynomial<P>

Source§

fn fps_exp_sparse(self, n: usize) -> Result<Self::Output, &'static str>

Time complexity $O(nk)$

Source§

type Output = Polynomial<P>

戻り値の型
Source§

impl<const P: u32> FpsInvSparse for SparsePolynomial<P>

Source§

fn fps_inv_sparse(self, n: usize) -> Result<Self::Output, &'static str>

Time complexity $O(nk)$

Source§

type Output = Polynomial<P>

戻り値の型
Source§

impl<const P: u32> FpsLogSparse for SparsePolynomial<P>

Source§

fn fps_log_sparse(self, n: usize) -> Result<Self::Output, &'static str>

Time complexity $O(nk)$

Source§

type Output = Polynomial<P>

戻り値の型
Source§

impl<const P: u32> FpsPowSparse for SparsePolynomial<P>

Source§

fn fps_pow_sparse(self, m: u64, n: usize) -> Result<Self::Output, &'static str>

Time complexity $O(nk)$

Source§

type Output = Polynomial<P>

戻り値の型
Source§

impl<const P: u32> FpsSqrtSparse for SparsePolynomial<P>

Source§

fn fps_sqrt_sparse(self, n: usize) -> Result<Self::Output, &'static str>

Time complexity $O(nk)$

Source§

type Output = Polynomial<P>

戻り値の型

Auto Trait Implementations§

§

impl<const P: u32> Freeze for SparsePolynomial<P>

§

impl<const P: u32> RefUnwindSafe for SparsePolynomial<P>

§

impl<const P: u32> Send for SparsePolynomial<P>

§

impl<const P: u32> Sync for SparsePolynomial<P>

§

impl<const P: u32> Unpin for SparsePolynomial<P>

§

impl<const P: u32> UnwindSafe for SparsePolynomial<P>

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> 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.