pub struct Matrix<M, S> { /* private fields */ }

Implementations§

source§

impl<T, M> Matrix<M, Dim0>
where T: Num, M: Memory<Item = T>,

source

pub fn scalar(scalar: T) -> Self
where M: Owned<Item = T>,

source

pub fn get_value(&self) -> T

source

pub fn set_value(&mut self, value: T)
where M: ViewMut<Item = T>,

source§

impl<M, S> Matrix<M, S>

source

pub fn new(memory: M, shape: S, stride: S) -> Self

source

pub fn into_dyn_dim(self) -> Matrix<M, DimDyn>
where M: Memory, S: DimTrait,

Trait Implementations§

source§

impl<'a, 'b, D1, D2, T> Add<Matrix<ViewMem<'a, T>, D1>> for Matrix<ViewMem<'b, T>, D2>
where D1: DimTrait, D2: DimTrait, T: Num,

§

type Output = Matrix<OwnedMem<T>, D2>

The resulting type after applying the + operator.
source§

fn add(self, rhs: Matrix<ViewMem<'_, T>, D1>) -> Self::Output

Performs the + operation. Read more
source§

impl<'a, D, T> Add<T> for Matrix<ViewMem<'a, T>, D>
where D: DimTrait, T: Num,

§

type Output = Matrix<OwnedMem<T>, D>

The resulting type after applying the + operator.
source§

fn add(self, rhs: T) -> Self::Output

Performs the + operation. Read more
source§

impl<M: ViewMut, S: DimTrait> AsMutPtr for Matrix<M, S>

source§

fn as_mut_ptr(&mut self) -> *mut Self::Item

source§

impl<M: Memory, S: DimTrait> AsPtr for Matrix<M, S>

source§

fn as_ptr(&self) -> *const Self::Item

source§

impl<T, M, D> Asum<T> for Matrix<M, D>
where T: Num, M: ToViewMemory<Item = T>, D: DimTrait,

source§

fn asum(self) -> M::Item

source§

impl<T: Num, M: Memory<Item = T>, D: DimTrait> BlasMatrix for Matrix<M, D>

§

type Blas = <M as Memory>::Blas

source§

impl<'a, T: Num> Broadcast<T> for Matrix<ViewMutMem<'a, T>, DimDyn>

source§

fn broadcast(&mut self, source: &Matrix<ViewMem<'_, T>, DimDyn>)

source§

impl<M: Clone, S: Clone> Clone for Matrix<M, S>

source§

fn clone(&self) -> Matrix<M, S>

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, VM> CopyFrom<Matrix<V, DimDyn>> for Matrix<VM, DimDyn>
where T: Num, VM: ViewMut<Item = T>, V: View<Item = T>,

source§

fn copy_from(&mut self, rhs: &Matrix<V, DimDyn>)

source§

impl<A, S, D: DimTrait> Debug for Matrix<S, D>
where A: Num + Debug, S: Memory<Item = A> + ToViewMemory,

Format the array using Debug and apply the formatting parameters used to each element.

The array is shown in multiline style.

source§

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

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

impl<A, S, D: DimTrait> Display for Matrix<S, D>
where A: Num + Display, S: Memory<Item = A> + ToViewMemory,

Format the array using Display and apply the formatting parameters used to each element.

The array is shown in multiline style.

source§

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

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

impl<'a, 'b, 'c, T, D1, D2, D3> Gemm<Matrix<ViewMem<'a, T>, D1>, Matrix<ViewMem<'b, T>, D2>> for Matrix<ViewMutMem<'c, T>, D3>
where T: Num, D1: DimTrait, D2: DimTrait, D3: DimTrait,

source§

fn gemm(self, rhs: Matrix<ViewMem<'_, T>, D1>, lhs: Matrix<ViewMem<'_, T>, D2>)

source§

impl<I: IndexAxisTrait, M: ToViewMemory, D: DimTrait + LessDimTrait> IndexAxis<I> for Matrix<M, D>
where <D as LessDimTrait>::LessDim: DimTrait,

§

type Output<'a> = Matrix<<M as ToViewMemory>::View<'a>, <D as LessDimTrait>::LessDim> where Self: 'a

source§

fn index_axis(&self, index: I) -> Self::Output<'_>

source§

impl<I: IndexAxisTrait, M: ToViewMemory, D: DimTrait> IndexAxisDyn<I> for Matrix<M, D>

§

type Output<'a> = Matrix<<M as ToViewMemory>::View<'a>, DimDyn> where Self: 'a

source§

fn index_axis_dyn(&self, index: I) -> Self::Output<'_>

source§

impl<I: IndexAxisTrait, M: ToViewMutMemory, D: DimTrait + LessDimTrait> IndexAxisMut<I> for Matrix<M, D>
where <D as LessDimTrait>::LessDim: DimTrait,

§

type Output<'a> = Matrix<<M as ToViewMutMemory>::ViewMut<'a>, <D as LessDimTrait>::LessDim> where Self: 'a

source§

fn index_axis_mut(&mut self, index: I) -> Self::Output<'_>

source§

impl<I: IndexAxisTrait, M: ToViewMutMemory, D: DimTrait> IndexAxisMutDyn<I> for Matrix<M, D>

§

type Output<'a> = Matrix<<M as ToViewMutMemory>::ViewMut<'a>, DimDyn> where Self: 'a

source§

fn index_axis_mut_dyn(&mut self, index: I) -> Self::Output<'_>

source§

impl<D: DimTrait, M: Memory> IndexItem for Matrix<M, D>

source§

fn index_item<I: Into<D>>(&self, index: I) -> Self::Item

source§

impl<T: Num, D: DimTrait, VM: ViewMut + Memory<Item = T>> IndexItemAsign for Matrix<VM, D>

source§

fn index_item_asign<I: Into<Self::Dim>>(&mut self, index: I, value: Self::Item)

source§

impl<'a, 'b, T, D> MatrixAdd<Matrix<ViewMem<'a, T>, D>, T> for Matrix<ViewMutMem<'b, T>, D>
where T: Num, D: DimTrait,

source§

fn add(self, lhs: Matrix<ViewMem<'_, T>, D>, rhs: T)

source§

impl<'a, 'b, 'c, T, D1, D2> MatrixAdd<Matrix<ViewMem<'a, T>, D1>, Matrix<ViewMem<'b, T>, D2>> for Matrix<ViewMutMem<'c, T>, D1>
where T: Num, D1: DimTrait, D2: DimTrait,

source§

fn add(self, lhs: Matrix<ViewMem<'_, T>, D1>, rhs: Matrix<ViewMem<'_, T>, D2>)

source§

impl<'a, 'b, T, D1, D2> MatrixAddAssign<Matrix<ViewMem<'a, T>, D1>> for Matrix<ViewMutMem<'b, T>, D2>
where T: Num, D1: DimTrait, D2: DimTrait,

source§

fn add_assign(self, rhs: Matrix<ViewMem<'_, T>, D1>)

source§

impl<'a, T, D> MatrixAddAssign<T> for Matrix<ViewMutMem<'a, T>, D>
where T: Num, D: DimTrait,

source§

fn add_assign(self, rhs: T)

source§

impl<T: Num, M: Memory<Item = T>, S: DimTrait> MatrixBase for Matrix<M, S>

§

type Dim = S

§

type Item = T

source§

fn shape_stride(&self) -> ShapeStride<Self::Dim>

source§

fn is_default_stride(&self) -> bool

source§

fn shape(&self) -> Self::Dim

source§

fn stride(&self) -> Self::Dim

source§

fn is_transposed_default_stride(&self) -> bool

source§

impl<T, RM, SM, D> MatrixMul<Matrix<RM, D>, T> for Matrix<SM, D>
where T: Num, RM: View<Item = T>, SM: ViewMut<Item = T>, D: DimTrait,

source§

fn mul(self, lhs: Matrix<RM, D>, rhs: T)

source§

impl<'a, 'b, 'c, T, DS, DR> MatrixMul<Matrix<ViewMem<'a, T>, DS>, Matrix<ViewMem<'b, T>, DR>> for Matrix<ViewMutMem<'c, T>, DS>
where T: Num, DS: DimTrait, DR: DimTrait,

source§

fn mul(self, lhs: Matrix<ViewMem<'_, T>, DS>, rhs: Matrix<ViewMem<'_, T>, DR>)

source§

impl<M: ToViewMemory, D: DimTrait, S: SliceTrait<Dim = D>> MatrixSlice<S> for Matrix<M, D>

§

type Output<'a> = Matrix<<M as ToViewMemory>::View<'a>, D> where Self: 'a

source§

fn slice(&self, index: S) -> Self::Output<'_>

source§

impl<T, M, D> MatrixSliceDyn for Matrix<M, D>
where T: Num, M: Memory<Item = T> + ToViewMemory, D: DimTrait,

§

type Output<'a> = Matrix<<M as ToViewMemory>::View<'a>, DimDyn> where Self: 'a

source§

fn slice_dyn(&self, index: Slice) -> Self::Output<'_>

source§

impl<M: ToViewMutMemory, D: DimTrait, S: SliceTrait<Dim = D>> MatrixSliceMut<S> for Matrix<M, D>

§

type Output<'a> = Matrix<<M as ToViewMutMemory>::ViewMut<'a>, D> where Self: 'a

source§

fn slice_mut(&mut self, index: S) -> Self::Output<'_>

source§

impl<'a, 'b, 'c, T, D1, D2, D3> MatrixSub<Matrix<ViewMem<'a, T>, D1>, Matrix<ViewMem<'b, T>, D2>> for Matrix<ViewMutMem<'c, T>, D3>
where D1: DimTrait, D2: DimTrait, D3: DimTrait, T: Num,

source§

fn sub(self, lhs: Matrix<ViewMem<'_, T>, D1>, rhs: Matrix<ViewMem<'_, T>, D2>)

source§

impl<'a, 'b, T, D1, D2> MatrixSub<Matrix<ViewMem<'a, T>, D1>, T> for Matrix<ViewMutMem<'b, T>, D2>
where D1: DimTrait, D2: DimTrait, T: Num,

source§

fn sub(self, lhs: Matrix<ViewMem<'_, T>, D1>, rhs: T)

source§

impl<'a, 'b, T, D1, D2> MatrixSubAssign<Matrix<ViewMem<'a, T>, D1>> for Matrix<ViewMutMem<'b, T>, D2>
where D1: DimTrait, D2: DimTrait, T: Num,

source§

fn sub_assign(self, rhs: Matrix<ViewMem<'_, T>, D1>)

source§

impl<'a, T, D> MatrixSubAssign<T> for Matrix<ViewMutMem<'a, T>, D>
where D: DimTrait, T: Num,

source§

fn sub_assign(self, rhs: T)

source§

impl<'a, T: Num, D: DimTrait> MatrixSum for Matrix<ViewMem<'a, T>, D>

§

type Output = Matrix<OwnedMem<T>, DimDyn>

source§

fn sum(self, axis: usize) -> Self::Output

source§

impl<'a, T, D> MaxIdx<D> for Matrix<ViewMem<'a, T>, D>
where T: Num, D: DimTrait,

source§

impl<'a, 'b, D1, D2, T> Mul<Matrix<ViewMem<'a, T>, D1>> for Matrix<ViewMem<'b, T>, D2>
where D1: DimTrait, D2: DimTrait, T: Num,

§

type Output = Matrix<OwnedMem<T>, D2>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Matrix<ViewMem<'_, T>, D1>) -> Self::Output

Performs the * operation. Read more
source§

impl<M, D, T> Mul<T> for Matrix<M, D>
where M: View<Item = T>, D: DimTrait, T: Num,

§

type Output = Matrix<<M as ToOwnedMemory>::Owned, D>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: T) -> Self::Output

Performs the * operation. Read more
source§

impl<M: Owned, S: DimTrait> OwnedMatrix for Matrix<M, S>

source§

fn from_vec<I: Into<Self::Dim>>(vec: Vec<Self::Item>, dim: I) -> Self

source§

impl<'a, T: Num> Relu<T> for Matrix<ViewMutMem<'a, T>, DimDyn>

source§

fn relu(&mut self, source: Matrix<ViewMem<'_, T>, DimDyn>)

source§

fn relu_backward_mask(&mut self, source: Matrix<ViewMem<'_, T>, DimDyn>)

source§

impl<'a, 'b, D1, D2, T> Sub<Matrix<ViewMem<'a, T>, D1>> for Matrix<ViewMem<'b, T>, D2>
where D1: DimTrait, D2: DimTrait, T: Num,

§

type Output = Matrix<OwnedMem<T>, D2>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: Matrix<ViewMem<'_, T>, D1>) -> Self::Output

Performs the - operation. Read more
source§

impl<'a, D1, T> Sub<T> for Matrix<ViewMem<'a, T>, D1>
where D1: DimTrait, T: Num,

§

type Output = Matrix<OwnedMem<T>, D1>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: T) -> Self::Output

Performs the - operation. Read more
source§

impl<T> ToDefaultStride<T> for Matrix<OwnedMem<T>, DimDyn>
where T: Num,

source§

fn to_default_stride<SD>(source: Matrix<ViewMem<'_, T>, SD>) -> Self
where SD: DimTrait,

source§

impl<M: ToOwnedMemory, S: DimTrait> ToOwnedMatrix for Matrix<M, S>

§

type Owned = Matrix<<M as ToOwnedMemory>::Owned, S>

source§

fn to_owned(&self) -> Self::Owned

source§

impl<M: ToViewMemory, S: DimTrait> ToViewMatrix for Matrix<M, S>

§

type View<'a> = Matrix<<M as ToViewMemory>::View<'a>, S> where Self: 'a

source§

fn to_view(&self) -> Self::View<'_>

source§

impl<M: ToViewMutMemory, S: DimTrait> ToViewMutMatrix for Matrix<M, S>

§

type ViewMut<'a> = Matrix<<M as ToViewMutMemory>::ViewMut<'a>, S> where Self: 'a

source§

fn to_view_mut(&mut self) -> Self::ViewMut<'_>

source§

impl<T: Num, M: Memory<Item = T>> Transpose for Matrix<M, Dim2>

source§

fn transpose(&mut self)

source§

impl<T: Num, M: Memory<Item = T>> Transpose for Matrix<M, Dim3>

source§

fn transpose(&mut self)

source§

impl<T: Num, M: Memory<Item = T>> Transpose for Matrix<M, Dim4>

source§

fn transpose(&mut self)

source§

impl<T: Num, M: Memory<Item = T>> Transpose for Matrix<M, DimDyn>

source§

fn transpose(&mut self)

source§

impl<M: View, S: DimTrait> ViewMatrix for Matrix<M, S>

source§

impl<M: ViewMut, S: DimTrait> ViewMutMatix for Matrix<M, S>

Auto Trait Implementations§

§

impl<M, S> RefUnwindSafe for Matrix<M, S>

§

impl<M, S> Send for Matrix<M, S>
where M: Send, S: Send,

§

impl<M, S> Sync for Matrix<M, S>
where M: Sync, S: Sync,

§

impl<M, S> Unpin for Matrix<M, S>
where M: Unpin, S: Unpin,

§

impl<M, S> UnwindSafe for Matrix<M, S>
where M: UnwindSafe, S: 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, S, O> Dot<O, T> for S
where S: ViewMatrix<Dim = Dim1, Item = T> + MatrixBase, O: ViewMatrix<Dim = Dim1, Item = T> + MatrixBase, T: Num,

source§

fn dot(self, other: O) -> T

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<D, T, OM> Ones for OM
where D: DimTrait, T: Num, OM: OwnedMatrix<Dim = D, Item = T> + MatrixBase,

source§

fn ones<I>(dim: I) -> OM
where I: Into<D>,

source§

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

§

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> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

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

§

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

§

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, D, OM> Zeros for OM
where T: Num, D: DimTrait, OM: OwnedMatrix<Dim = D, Item = T> + MatrixBase,

source§

fn zeros<I>(dim: I) -> OM
where I: Into<<OM as MatrixBase>::Dim>,