pub trait MatVec<V> {
// Required method
fn matvec(&self, x: &V) -> V;
}Expand description
Matrix-vector product y = A x.
§Contract
- Caller must: pass
xwhose length equalsself.ncols(). Backends panic on shape mismatch. - Implementor must: return a freshly allocated
Vof lengthself.nrows(), withy[i] = Σⱼ A[i, j] · x[j]. The op is a pure function of(self, x).
§Backends
Implemented on every backend’s dense matrix type:
DenseMatrix (with V = Vec<f64>, always
available), nalgebra::DMatrix<f64> (V = DVector<f64>),
faer::Mat<f64> (V = faer::Col<f64>), and ndarray::Array2<f64>
(V = Array1<f64>), each behind its backend feature where
applicable.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl<F: Scalar> MatVec<ArrayBase<OwnedRepr<F>, Dim<[usize; 1]>>> for Array2<F>
Available on crate feature ndarray only.
impl<F: Scalar> MatVec<ArrayBase<OwnedRepr<F>, Dim<[usize; 1]>>> for Array2<F>
Available on crate feature
ndarray only.Source§impl<F> MatVec<Col<Own<F>>> for Mat<F>where
F: Scalar + ComplexField,
Available on crate feature faer only.
impl<F> MatVec<Col<Own<F>>> for Mat<F>where
F: Scalar + ComplexField,
Available on crate feature
faer only.Source§impl<F> MatVec<Col<Own<F>>> for SparseColMat<usize, F>where
F: Scalar + ComplexField,
Available on crate feature faer only.
impl<F> MatVec<Col<Own<F>>> for SparseColMat<usize, F>where
F: Scalar + ComplexField,
Available on crate feature
faer only.Source§impl<F> MatVec<Matrix<F, Dyn, Const<1>, VecStorage<F, Dyn, Const<1>>>> for CscMatrix<F>
Available on crate feature nalgebra only.
impl<F> MatVec<Matrix<F, Dyn, Const<1>, VecStorage<F, Dyn, Const<1>>>> for CscMatrix<F>
Available on crate feature
nalgebra only.Source§impl<F> MatVec<Matrix<F, Dyn, Const<1>, VecStorage<F, Dyn, Const<1>>>> for DMatrix<F>
Available on crate feature nalgebra only.
impl<F> MatVec<Matrix<F, Dyn, Const<1>, VecStorage<F, Dyn, Const<1>>>> for DMatrix<F>
Available on crate feature
nalgebra only.