Trait sprs::DenseVector[][src]

pub trait DenseVector: Sealed {
    type Owned;
    type Scalar;
    fn dim(&self) -> usize;
fn index(&self, idx: usize) -> &Self::Scalar;
fn zeros(dim: usize) -> Self::Owned;
fn to_owned(&self) -> Self::Owned; }

A trait for types representing dense vectors, useful for expressing algorithms such as sparse-dense dot product, or linear solves.

This trait is sealed, and cannot be implemented outside of the sprs crate.

Associated Types

Loading content...

Required methods

fn dim(&self) -> usize[src]

The dimension of the vector

fn index(&self, idx: usize) -> &Self::Scalar[src]

Random access to an element in the vector.

Panics

If the index is out of bounds

fn zeros(dim: usize) -> Self::Owned[src]

Create an owned version of this dense vector type, filled with zeros

fn to_owned(&self) -> Self::Owned[src]

Copies this vector into an owned version

Loading content...

Implementations on Foreign Types

impl<N: Zero + Clone> DenseVector for [N][src]

type Owned = Vec<N>

type Scalar = N

impl<'a, N: 'a + Zero + Clone> DenseVector for &'a [N][src]

type Owned = Vec<N>

type Scalar = N

impl<'a, N: 'a + Zero + Clone> DenseVector for &'a mut [N][src]

type Owned = Vec<N>

type Scalar = N

impl<N: Zero + Clone> DenseVector for Vec<N>[src]

type Owned = Vec<N>

type Scalar = N

impl<'a, N: 'a + Zero + Clone> DenseVector for &'a Vec<N>[src]

type Owned = Vec<N>

type Scalar = N

impl<'a, N: 'a + Zero + Clone> DenseVector for &'a mut Vec<N>[src]

type Owned = Vec<N>

type Scalar = N

impl<N, S> DenseVector for ArrayBase<S, Ix1> where
    S: Data<Elem = N>,
    N: Zero + Clone
[src]

type Owned = Array<N, Ix1>

type Scalar = N

impl<'a, N, S> DenseVector for &'a ArrayBase<S, Ix1> where
    S: Data<Elem = N>,
    N: 'a + Zero + Clone
[src]

type Owned = Array<N, Ix1>

type Scalar = N

impl<'a, N, S> DenseVector for &'a mut ArrayBase<S, Ix1> where
    S: Data<Elem = N>,
    N: 'a + Zero + Clone
[src]

type Owned = Array<N, Ix1>

type Scalar = N

Loading content...

Implementors

Loading content...