Trait ndarray_rblas::AsBlas
[−]
[src]
pub trait AsBlas<A, S, D> { fn blas_checked(&mut self) -> Result<BlasArrayViewMut<A, D>, ShapeError>
where
S: DataOwned + DataMut,
A: Clone; fn blas_view_checked(&self) -> Result<BlasArrayView<A, D>, ShapeError>
where
S: Data; fn blas_view_mut_checked(
&mut self
) -> Result<BlasArrayViewMut<A, D>, ShapeError>
where
S: DataMut; fn blas(&mut self) -> BlasArrayViewMut<A, D>
where
S: DataOwned<Elem = A> + DataMut,
A: Clone, { ... } fn bv(&self) -> BlasArrayView<A, D>
where
S: Data, { ... } fn bvm(&mut self) -> BlasArrayViewMut<A, D>
where
S: DataMut, { ... } }
Convert an array into a blas friendly wrapper.
Note that blas
suppors four different element types: f32
, f64
,
Complex<f32>
, and Complex<f64>
.
Requires crate feature "rblas"
Required Methods
fn blas_checked(&mut self) -> Result<BlasArrayViewMut<A, D>, ShapeError> where
S: DataOwned + DataMut,
A: Clone,
S: DataOwned + DataMut,
A: Clone,
Return an array view implementing Vector (1D) or Matrix (2D) traits.
Elements are copied if needed to produce a contiguous matrix.
The result is always mutable, due to the requirement of having write
access to update the layout either way. Breaks sharing if the array is
an RcArray
.
Errors if any dimension is larger than c_int::MAX
.
fn blas_view_checked(&self) -> Result<BlasArrayView<A, D>, ShapeError> where
S: Data,
S: Data,
Return a read-only array view implementing Vector (1D) or Matrix (2D) traits.
The array must already be in a blas compatible layout: its innermost dimension must be contiguous.
Errors if any dimension is larger than c_int::MAX
.
Errors if the inner dimension is not c-contiguous.
Layout requirements may be loosened in the future.
fn blas_view_mut_checked(
&mut self
) -> Result<BlasArrayViewMut<A, D>, ShapeError> where
S: DataMut,
&mut self
) -> Result<BlasArrayViewMut<A, D>, ShapeError> where
S: DataMut,
Return a read-write array view implementing Vector (1D) or Matrix (2D) traits.
The array must already be in a blas compatible layout: its innermost dimension must be contiguous.
Errors if any dimension is larger than c_int::MAX
.
Errors if the inner dimension is not c-contiguous.
Layout requirements may be loosened in the future.
Provided Methods
fn blas(&mut self) -> BlasArrayViewMut<A, D> where
S: DataOwned<Elem = A> + DataMut,
A: Clone,
S: DataOwned<Elem = A> + DataMut,
A: Clone,
Equivalent to .blas_checked().unwrap()
Panics if there was a an error in .blas_checked()
.
fn bv(&self) -> BlasArrayView<A, D> where
S: Data,
S: Data,
bv
stands for blas view.
Equivalent to .blas_view_checked().unwrap()
Panics if there was a an error in .blas_view_checked()
.
fn bvm(&mut self) -> BlasArrayViewMut<A, D> where
S: DataMut,
S: DataMut,
bvm
stands for blas view mut.
Equivalent to .blas_view_mut_checked().unwrap()
Panics if there was a an error in .blas_view_mut_checked()
.