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 MatVec<Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>> for CscMatrix<f64>
Available on crate feature nalgebra only.
impl MatVec<Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>> for CscMatrix<f64>
Available on crate feature
nalgebra only.Source§impl MatVec<Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>> for DMatrix<f64>
Available on crate feature nalgebra only.
impl MatVec<Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>> for DMatrix<f64>
Available on crate feature
nalgebra only.Source§impl MatVec<ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>> for Array2<f64>
Available on crate feature ndarray only.
impl MatVec<ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>> for Array2<f64>
Available on crate feature
ndarray only.