Struct ConstMatrix

Source
pub struct ConstMatrix<S: Semiring, const R: usize, const C: usize> { /* private fields */ }
Expand description

$R \times C$の行列

Implementations§

Source§

impl<S: Semiring, const R: usize, const C: usize> ConstMatrix<S, R, C>
where S::Element: Copy,

Source

pub fn zero(semiring: S) -> Self

ゼロ行列を返す。

Source§

impl<S: Semiring, const N: usize> ConstMatrix<S, N, N>
where S::Element: Copy,

Source

pub fn unit(semiring: S) -> Self

単位行列を返す。

Source§

impl<S: Semiring, const R: usize, const C: usize> ConstMatrix<S, R, C>

Source

pub fn get(&self, i: usize, j: usize) -> Option<&S::Element>

ij列の要素への参照を返す。

Source

pub fn get_mut(&mut self, i: usize, j: usize) -> Option<&mut S::Element>

ij列の要素への可変参照を返す。

Trait Implementations§

Source§

impl<S: Semiring, const R: usize, const C: usize> Add for ConstMatrix<S, R, C>
where S::Element: Copy,

Source§

type Output = ConstMatrix<S, R, C>

The resulting type after applying the + operator.
Source§

fn add(self, other: Self) -> Self

Performs the + operation. Read more
Source§

impl<S: Clone + Semiring, const R: usize, const C: usize> Clone for ConstMatrix<S, R, C>
where S::Element: Clone,

Source§

fn clone(&self) -> ConstMatrix<S, R, C>

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<S: Debug + Semiring, const R: usize, const C: usize> Debug for ConstMatrix<S, R, C>
where S::Element: Debug,

Source§

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

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

impl<S: Semiring, const R: usize, const C: usize> Matrix for ConstMatrix<S, R, C>

Source§

fn width(&self) -> usize

行列の列数を返す。
Source§

fn height(&self) -> usize

行列の行数を返す。
Source§

fn size(&self) -> (usize, usize)

行数の行数と列数のペアを返す。
Source§

fn is_square(&self) -> bool

行列が正方であるかどうかを判定する。
Source§

impl<S: Semiring, const R: usize, const C: usize> MatrixTranspose for ConstMatrix<S, R, C>
where S::Element: Copy,

Source§

type Output = ConstMatrix<S, C, R>

転置行列の型
Source§

fn transpose(self) -> Self::Output

転置した行列を返す。
Source§

impl<S: Semiring + Clone, const R: usize, const C: usize, const C2: usize> Mul<ConstMatrix<S, C, C2>> for ConstMatrix<S, R, C>
where S::Element: Copy,

Source§

type Output = ConstMatrix<S, R, C2>

The resulting type after applying the * operator.
Source§

fn mul(self, other: ConstMatrix<S, C, C2>) -> Self::Output

Performs the * operation. Read more
Source§

impl<S: Ring, const R: usize, const C: usize> Neg for ConstMatrix<S, R, C>
where S::Element: Copy,

Source§

type Output = ConstMatrix<S, R, C>

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self

Performs the unary - operation. Read more
Source§

impl<S: PartialEq + Semiring, const R: usize, const C: usize> PartialEq for ConstMatrix<S, R, C>
where S::Element: PartialEq,

Source§

fn eq(&self, other: &ConstMatrix<S, R, C>) -> 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<S: Ring, const R: usize, const C: usize> Sub for ConstMatrix<S, R, C>
where S::Element: Copy,

Source§

type Output = ConstMatrix<S, R, C>

The resulting type after applying the - operator.
Source§

fn sub(self, other: Self) -> Self

Performs the - operation. Read more
Source§

impl<S: Eq + Semiring, const R: usize, const C: usize> Eq for ConstMatrix<S, R, C>
where S::Element: Eq,

Source§

impl<S: Semiring, const R: usize, const C: usize> StructuralPartialEq for ConstMatrix<S, R, C>

Auto Trait Implementations§

§

impl<S, const R: usize, const C: usize> Freeze for ConstMatrix<S, R, C>
where S: Freeze, <S as Semiring>::Element: Freeze,

§

impl<S, const R: usize, const C: usize> RefUnwindSafe for ConstMatrix<S, R, C>

§

impl<S, const R: usize, const C: usize> Send for ConstMatrix<S, R, C>
where S: Send, <S as Semiring>::Element: Send,

§

impl<S, const R: usize, const C: usize> Sync for ConstMatrix<S, R, C>
where S: Sync, <S as Semiring>::Element: Sync,

§

impl<S, const R: usize, const C: usize> Unpin for ConstMatrix<S, R, C>
where S: Unpin, <S as Semiring>::Element: Unpin,

§

impl<S, const R: usize, const C: usize> UnwindSafe for ConstMatrix<S, R, C>

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.