orx_v::matrices

Struct V1Matrix

Source
pub struct V1Matrix<T, V, L>
where V: NVec<D1, T>, L: V1MatrixLayout,
{ /* private fields */ }
Expand description

A matrix represented by a flat one-dimensional vector V1.

Trait Implementations§

Source§

impl<T: Clone, V, L> Clone for V1Matrix<T, V, L>
where V: NVec<D1, T> + Clone, L: V1MatrixLayout + Clone,

Source§

fn clone(&self) -> V1Matrix<T, V, L>

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<T, V, L> Matrix<T> for V1Matrix<T, V, L>
where V: NVec<D1, T>, L: V1MatrixLayout,

Source§

fn num_rows(&self) -> usize

Number of rows.
Source§

fn num_cols(&self) -> usize

Number of columns.
Source§

fn at(&self, idx: impl IntoIdx<D2>) -> T

Returns the element at the given idx of the matrix. Read more
Source§

fn all(&self) -> impl Iterator<Item = T>

Returns an iterator of all elements of the matrix. The direction of iteration depends on whether the matrix is row-major or column-major. Read more
Source§

fn in_bounds(&self, idx: impl Into<<D2 as Dim>::LeqIdx>) -> bool

Returns true if the given idx is in bounds of the matrix.
Source§

fn try_at(&self, idx: impl IntoIdx<D2>) -> Option<T>

Returns the element at the given idx if it is in_bounds; returns None otherwise.
Source§

fn equality(&self, other: &impl Matrix<T>) -> Equality<D2>
where T: PartialEq,

Returns the equality result of comparing this matrix to the other.
Source§

impl<T, V> MatrixColMajor<T> for V1Matrix<T, V, V1LayoutColMajor>
where V: NVec<D1, T>,

Source§

fn col(&self, i: usize) -> impl NVec<D1, T>

Returns the j-th column of the matrix which is a D1 vector.
Source§

fn cols(&self) -> impl Iterator<Item = impl NVec<D1, T>>

Returns an iterator over the columns of the matrix.
Source§

impl<T, V> MatrixColMajorMut<T> for V1Matrix<T, V, V1LayoutColMajor>
where V: NVecMut<D1, T>,

Source§

fn col_mut(&mut self, i: usize) -> impl NVecMut<D1, T>

Returns a mutable reference to the j-th column of the matrix which is a D1 vector.
Source§

impl<T, V, L> MatrixMut<T> for V1Matrix<T, V, L>
where V: NVecMut<D1, T>, L: V1MatrixLayout,

Source§

fn at_mut<Idx: IntoIdx<D2>>(&mut self, idx: Idx) -> &mut T

Returns a mutable reference to the element at the given idx of the matrix. Read more
Source§

fn mut_all<F>(&mut self, f: F)
where F: FnMut(&mut T),

Applies the mutating function f over all elements of the matrix.
Source§

fn reset_all(&mut self, value: T)
where T: PartialEq + Copy,

Sets all elements of the matrix to the given value. This method is often used at initialization stage of algorithms. Read more
Source§

fn set<Idx: IntoIdx<D2>>(&mut self, idx: Idx, value: T)

Sets the element at the given idx of the matrix to the value. Read more
Source§

fn try_at_mut(&mut self, idx: impl IntoIdx<D2>) -> Option<&mut T>

Returns a mutable reference to the element at the idx-th position of the matrix if the index is in_bounds; returns None otherwise.
Source§

impl<T, V> MatrixRowMajor<T> for V1Matrix<T, V, V1LayoutRowMajor>
where V: NVec<D1, T>,

Source§

fn row(&self, i: usize) -> impl NVec<D1, T>

Returns the i-th row of the matrix which is a D1 vector.
Source§

fn rows(&self) -> impl Iterator<Item = impl NVec<D1, T>>

Returns an iterator over the rows of the matrix.
Source§

impl<T, V> MatrixRowMajorMut<T> for V1Matrix<T, V, V1LayoutRowMajor>
where V: NVecMut<D1, T>,

Source§

fn row_mut(&mut self, i: usize) -> impl NVecMut<D1, T>

Returns a mutable reference to the i-th row of the matrix which is a D1 vector.

Auto Trait Implementations§

§

impl<T, V, L> Freeze for V1Matrix<T, V, L>
where L: Freeze, V: Freeze,

§

impl<T, V, L> RefUnwindSafe for V1Matrix<T, V, L>

§

impl<T, V, L> Send for V1Matrix<T, V, L>
where L: Send, V: Send, T: Send,

§

impl<T, V, L> Sync for V1Matrix<T, V, L>
where L: Sync, V: Sync, T: Sync,

§

impl<T, V, L> Unpin for V1Matrix<T, V, L>
where L: Unpin, V: Unpin, T: Unpin,

§

impl<T, V, L> UnwindSafe for V1Matrix<T, V, L>
where L: UnwindSafe, V: UnwindSafe, T: 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, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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.