pub struct Blas;Expand description
Binding to blas with cblas-sys as a slas backend.
Trait Implementations
sourceimpl Backend<Complex<f32>> for Blas
impl Backend<Complex<f32>> for Blas
fn dot<const LEN: usize>(
&self,
a: &impl StaticVec<T, LEN>,
b: &impl StaticVec<T, LEN>
) -> <Self as DotProduct<T>>::DotOutput where
Self: DotProduct<T>,
fn norm<const LEN: usize>(
&self,
a: &impl StaticVec<T, LEN>
) -> <Self as Normalize<T>>::NormOutput where
Self: Normalize<T>,
fn normalize<const LEN: usize>(
&self,
a: &mut impl StaticVec<T, LEN>
) -> <Self as Normalize<T>>::NormalizeOutput where
Self: Normalize<T>,
T: From<<Self as Normalize<T>>::NormOutput>,
fn matrix_mul<A: StaticVec<T, ALEN>, B: StaticVec<T, BLEN>, C: StaticVec<T, CLEN>, const ALEN: usize, const BLEN: usize, const CLEN: usize>(
&self,
a: &A,
b: &B,
buffer: &mut C,
m: usize,
n: usize,
k: usize,
lda: usize,
ldb: usize,
ldc: usize,
a_trans: bool,
b_trans: bool
) -> <Self as MatrixMul<T>>::MatrixMulOutput where
Self: MatrixMul<T>,
A: Sized,
B: Sized,
C: Sized,
T: Copy,
fn matrix_vector_mul<A: StaticVec<T, ALEN>, B: StaticVec<T, BLEN>, C: StaticVec<T, CLEN>, const ALEN: usize, const BLEN: usize, const CLEN: usize>(
&self,
a: &A,
b: &B,
buffer: &mut C,
m: usize,
n: usize,
lda: usize,
a_trans: bool
) -> <Self as MatrixMul<T>>::MatrixVectorMulOutput where
Self: MatrixMul<T>,
A: Sized,
B: Sized,
C: Sized,
T: Copy,
fn transpose_inplace<const LEN: usize>(
&self,
a: &mut impl StaticVec<T, LEN>,
columns: usize
) -> <Self as Transpose<T>>::TransposeInplaceOutput where
Self: Transpose<T>,
fn transpose<const LEN: usize>(
&self,
a: &impl StaticVec<T, LEN>,
buffer: &mut impl StaticVec<T, LEN>,
columns: usize
) -> <Self as Transpose<T>>::TransposeOutput where
Self: Transpose<T>,
fn add<const LEN: usize>(
&self,
a: &impl StaticVec<T, LEN>,
b: &impl StaticVec<T, LEN>,
c: &mut impl StaticVec<T, LEN>
) -> <Self as Addition<T>>::AddOutput where
Self: Addition<T>,
fn sub<const LEN: usize>(
&self,
a: &impl StaticVec<T, LEN>,
b: &impl StaticVec<T, LEN>,
c: &mut impl StaticVec<T, LEN>
) -> <Self as Subtraction<T>>::SubOutput where
Self: Subtraction<T>,
fn mul<const LEN: usize>(
&self,
a: &impl StaticVec<T, LEN>,
b: &impl StaticVec<T, LEN>,
c: &mut impl StaticVec<T, LEN>
) -> <Self as Multiplication<T>>::MulOutput where
Self: Multiplication<T>,
fn div<const LEN: usize>(
&self,
a: &impl StaticVec<T, LEN>,
b: &impl StaticVec<T, LEN>,
c: &mut impl StaticVec<T, LEN>
) -> <Self as Divition<T>>::DivOutput where
Self: Divition<T>,
sourceimpl Backend<Complex<f64>> for Blas
impl Backend<Complex<f64>> for Blas
fn dot<const LEN: usize>(
&self,
a: &impl StaticVec<T, LEN>,
b: &impl StaticVec<T, LEN>
) -> <Self as DotProduct<T>>::DotOutput where
Self: DotProduct<T>,
fn norm<const LEN: usize>(
&self,
a: &impl StaticVec<T, LEN>
) -> <Self as Normalize<T>>::NormOutput where
Self: Normalize<T>,
fn normalize<const LEN: usize>(
&self,
a: &mut impl StaticVec<T, LEN>
) -> <Self as Normalize<T>>::NormalizeOutput where
Self: Normalize<T>,
T: From<<Self as Normalize<T>>::NormOutput>,
fn matrix_mul<A: StaticVec<T, ALEN>, B: StaticVec<T, BLEN>, C: StaticVec<T, CLEN>, const ALEN: usize, const BLEN: usize, const CLEN: usize>(
&self,
a: &A,
b: &B,
buffer: &mut C,
m: usize,
n: usize,
k: usize,
lda: usize,
ldb: usize,
ldc: usize,
a_trans: bool,
b_trans: bool
) -> <Self as MatrixMul<T>>::MatrixMulOutput where
Self: MatrixMul<T>,
A: Sized,
B: Sized,
C: Sized,
T: Copy,
fn matrix_vector_mul<A: StaticVec<T, ALEN>, B: StaticVec<T, BLEN>, C: StaticVec<T, CLEN>, const ALEN: usize, const BLEN: usize, const CLEN: usize>(
&self,
a: &A,
b: &B,
buffer: &mut C,
m: usize,
n: usize,
lda: usize,
a_trans: bool
) -> <Self as MatrixMul<T>>::MatrixVectorMulOutput where
Self: MatrixMul<T>,
A: Sized,
B: Sized,
C: Sized,
T: Copy,
fn transpose_inplace<const LEN: usize>(
&self,
a: &mut impl StaticVec<T, LEN>,
columns: usize
) -> <Self as Transpose<T>>::TransposeInplaceOutput where
Self: Transpose<T>,
fn transpose<const LEN: usize>(
&self,
a: &impl StaticVec<T, LEN>,
buffer: &mut impl StaticVec<T, LEN>,
columns: usize
) -> <Self as Transpose<T>>::TransposeOutput where
Self: Transpose<T>,
fn add<const LEN: usize>(
&self,
a: &impl StaticVec<T, LEN>,
b: &impl StaticVec<T, LEN>,
c: &mut impl StaticVec<T, LEN>
) -> <Self as Addition<T>>::AddOutput where
Self: Addition<T>,
fn sub<const LEN: usize>(
&self,
a: &impl StaticVec<T, LEN>,
b: &impl StaticVec<T, LEN>,
c: &mut impl StaticVec<T, LEN>
) -> <Self as Subtraction<T>>::SubOutput where
Self: Subtraction<T>,
fn mul<const LEN: usize>(
&self,
a: &impl StaticVec<T, LEN>,
b: &impl StaticVec<T, LEN>,
c: &mut impl StaticVec<T, LEN>
) -> <Self as Multiplication<T>>::MulOutput where
Self: Multiplication<T>,
fn div<const LEN: usize>(
&self,
a: &impl StaticVec<T, LEN>,
b: &impl StaticVec<T, LEN>,
c: &mut impl StaticVec<T, LEN>
) -> <Self as Divition<T>>::DivOutput where
Self: Divition<T>,
sourceimpl Backend<f32> for Blas
impl Backend<f32> for Blas
fn dot<const LEN: usize>(
&self,
a: &impl StaticVec<T, LEN>,
b: &impl StaticVec<T, LEN>
) -> <Self as DotProduct<T>>::DotOutput where
Self: DotProduct<T>,
fn norm<const LEN: usize>(
&self,
a: &impl StaticVec<T, LEN>
) -> <Self as Normalize<T>>::NormOutput where
Self: Normalize<T>,
fn normalize<const LEN: usize>(
&self,
a: &mut impl StaticVec<T, LEN>
) -> <Self as Normalize<T>>::NormalizeOutput where
Self: Normalize<T>,
T: From<<Self as Normalize<T>>::NormOutput>,
fn matrix_mul<A: StaticVec<T, ALEN>, B: StaticVec<T, BLEN>, C: StaticVec<T, CLEN>, const ALEN: usize, const BLEN: usize, const CLEN: usize>(
&self,
a: &A,
b: &B,
buffer: &mut C,
m: usize,
n: usize,
k: usize,
lda: usize,
ldb: usize,
ldc: usize,
a_trans: bool,
b_trans: bool
) -> <Self as MatrixMul<T>>::MatrixMulOutput where
Self: MatrixMul<T>,
A: Sized,
B: Sized,
C: Sized,
T: Copy,
fn matrix_vector_mul<A: StaticVec<T, ALEN>, B: StaticVec<T, BLEN>, C: StaticVec<T, CLEN>, const ALEN: usize, const BLEN: usize, const CLEN: usize>(
&self,
a: &A,
b: &B,
buffer: &mut C,
m: usize,
n: usize,
lda: usize,
a_trans: bool
) -> <Self as MatrixMul<T>>::MatrixVectorMulOutput where
Self: MatrixMul<T>,
A: Sized,
B: Sized,
C: Sized,
T: Copy,
fn transpose_inplace<const LEN: usize>(
&self,
a: &mut impl StaticVec<T, LEN>,
columns: usize
) -> <Self as Transpose<T>>::TransposeInplaceOutput where
Self: Transpose<T>,
fn transpose<const LEN: usize>(
&self,
a: &impl StaticVec<T, LEN>,
buffer: &mut impl StaticVec<T, LEN>,
columns: usize
) -> <Self as Transpose<T>>::TransposeOutput where
Self: Transpose<T>,
fn add<const LEN: usize>(
&self,
a: &impl StaticVec<T, LEN>,
b: &impl StaticVec<T, LEN>,
c: &mut impl StaticVec<T, LEN>
) -> <Self as Addition<T>>::AddOutput where
Self: Addition<T>,
fn sub<const LEN: usize>(
&self,
a: &impl StaticVec<T, LEN>,
b: &impl StaticVec<T, LEN>,
c: &mut impl StaticVec<T, LEN>
) -> <Self as Subtraction<T>>::SubOutput where
Self: Subtraction<T>,
fn mul<const LEN: usize>(
&self,
a: &impl StaticVec<T, LEN>,
b: &impl StaticVec<T, LEN>,
c: &mut impl StaticVec<T, LEN>
) -> <Self as Multiplication<T>>::MulOutput where
Self: Multiplication<T>,
fn div<const LEN: usize>(
&self,
a: &impl StaticVec<T, LEN>,
b: &impl StaticVec<T, LEN>,
c: &mut impl StaticVec<T, LEN>
) -> <Self as Divition<T>>::DivOutput where
Self: Divition<T>,
sourceimpl Backend<f64> for Blas
impl Backend<f64> for Blas
fn dot<const LEN: usize>(
&self,
a: &impl StaticVec<T, LEN>,
b: &impl StaticVec<T, LEN>
) -> <Self as DotProduct<T>>::DotOutput where
Self: DotProduct<T>,
fn norm<const LEN: usize>(
&self,
a: &impl StaticVec<T, LEN>
) -> <Self as Normalize<T>>::NormOutput where
Self: Normalize<T>,
fn normalize<const LEN: usize>(
&self,
a: &mut impl StaticVec<T, LEN>
) -> <Self as Normalize<T>>::NormalizeOutput where
Self: Normalize<T>,
T: From<<Self as Normalize<T>>::NormOutput>,
fn matrix_mul<A: StaticVec<T, ALEN>, B: StaticVec<T, BLEN>, C: StaticVec<T, CLEN>, const ALEN: usize, const BLEN: usize, const CLEN: usize>(
&self,
a: &A,
b: &B,
buffer: &mut C,
m: usize,
n: usize,
k: usize,
lda: usize,
ldb: usize,
ldc: usize,
a_trans: bool,
b_trans: bool
) -> <Self as MatrixMul<T>>::MatrixMulOutput where
Self: MatrixMul<T>,
A: Sized,
B: Sized,
C: Sized,
T: Copy,
fn matrix_vector_mul<A: StaticVec<T, ALEN>, B: StaticVec<T, BLEN>, C: StaticVec<T, CLEN>, const ALEN: usize, const BLEN: usize, const CLEN: usize>(
&self,
a: &A,
b: &B,
buffer: &mut C,
m: usize,
n: usize,
lda: usize,
a_trans: bool
) -> <Self as MatrixMul<T>>::MatrixVectorMulOutput where
Self: MatrixMul<T>,
A: Sized,
B: Sized,
C: Sized,
T: Copy,
fn transpose_inplace<const LEN: usize>(
&self,
a: &mut impl StaticVec<T, LEN>,
columns: usize
) -> <Self as Transpose<T>>::TransposeInplaceOutput where
Self: Transpose<T>,
fn transpose<const LEN: usize>(
&self,
a: &impl StaticVec<T, LEN>,
buffer: &mut impl StaticVec<T, LEN>,
columns: usize
) -> <Self as Transpose<T>>::TransposeOutput where
Self: Transpose<T>,
fn add<const LEN: usize>(
&self,
a: &impl StaticVec<T, LEN>,
b: &impl StaticVec<T, LEN>,
c: &mut impl StaticVec<T, LEN>
) -> <Self as Addition<T>>::AddOutput where
Self: Addition<T>,
fn sub<const LEN: usize>(
&self,
a: &impl StaticVec<T, LEN>,
b: &impl StaticVec<T, LEN>,
c: &mut impl StaticVec<T, LEN>
) -> <Self as Subtraction<T>>::SubOutput where
Self: Subtraction<T>,
fn mul<const LEN: usize>(
&self,
a: &impl StaticVec<T, LEN>,
b: &impl StaticVec<T, LEN>,
c: &mut impl StaticVec<T, LEN>
) -> <Self as Multiplication<T>>::MulOutput where
Self: Multiplication<T>,
fn div<const LEN: usize>(
&self,
a: &impl StaticVec<T, LEN>,
b: &impl StaticVec<T, LEN>,
c: &mut impl StaticVec<T, LEN>
) -> <Self as Divition<T>>::DivOutput where
Self: Divition<T>,
sourceimpl DotProduct<Complex<f32>> for Blas
impl DotProduct<Complex<f32>> for Blas
Dot product for two complex vectors. Also has support for multiple (and mixed) types.
sourceimpl DotProduct<Complex<f64>> for Blas
impl DotProduct<Complex<f64>> for Blas
Dot product for two complex vectors. Also has support for multiple (and mixed) types.
sourceimpl DotProduct<f32> for Blas
impl DotProduct<f32> for Blas
Thin wrapper around blas for the various dot product functions that works for multiple different (and mixed) vector types.
Example
use slas::prelude::*;
assert!(slas_backend::Blas.dot(&[1., 2., 3.], &moo![f32: -1, 2, -1]) == 0.);sourceimpl DotProduct<f64> for Blas
impl DotProduct<f64> for Blas
Thin wrapper around blas for the various dot product functions that works for multiple different (and mixed) vector types.
Example
use slas::prelude::*;
assert!(slas_backend::Blas.dot(&[1., 2., 3.], &moo![f32: -1, 2, -1]) == 0.);sourceimpl MatrixMul<f32> for Blas
impl MatrixMul<f32> for Blas
This is matrix multiplication, NOT element wise multiplication. Take a look at wiki, 3Blue1Brown at yt and/or Khan Academy for more information.
It’s notable that your left hand matrix needs to be as wide as the right hand matrix is tall.
sourcefn matrix_vector_mul<A: StaticVec<f32, ALEN>, B: StaticVec<f32, BLEN>, C: StaticVec<f32, CLEN>, const ALEN: usize, const BLEN: usize, const CLEN: usize>(
&self,
a: &A,
b: &B,
buffer: &mut C,
m: usize,
n: usize,
lda: usize,
a_trans: bool
) where
A: Sized,
B: Sized,
fn matrix_vector_mul<A: StaticVec<f32, ALEN>, B: StaticVec<f32, BLEN>, C: StaticVec<f32, CLEN>, const ALEN: usize, const BLEN: usize, const CLEN: usize>(
&self,
a: &A,
b: &B,
buffer: &mut C,
m: usize,
n: usize,
lda: usize,
a_trans: bool
) where
A: Sized,
B: Sized,
Matrix-vector multiplication using gemv.
fn matrix_mul<A: StaticVec<f32, ALEN>, B: StaticVec<f32, BLEN>, C: StaticVec<f32, CLEN>, const ALEN: usize, const BLEN: usize, const CLEN: usize>(
&self,
a: &A,
b: &B,
buffer: &mut C,
m: usize,
n: usize,
k: usize,
lda: usize,
ldb: usize,
ldc: usize,
a_trans: bool,
b_trans: bool
) where
A: Sized,
B: Sized,
type MatrixMulOutput = ()
type MatrixVectorMulOutput = ()
sourceimpl MatrixMul<f64> for Blas
impl MatrixMul<f64> for Blas
This is matrix multiplication, NOT element wise multiplication. Take a look at wiki, 3Blue1Brown at yt and/or Khan Academy for more information.
It’s notable that your left hand matrix needs to be as wide as the right hand matrix is tall.
sourcefn matrix_vector_mul<A: StaticVec<f64, ALEN>, B: StaticVec<f64, BLEN>, C: StaticVec<f64, CLEN>, const ALEN: usize, const BLEN: usize, const CLEN: usize>(
&self,
a: &A,
b: &B,
buffer: &mut C,
m: usize,
n: usize,
lda: usize,
a_trans: bool
) where
A: Sized,
B: Sized,
fn matrix_vector_mul<A: StaticVec<f64, ALEN>, B: StaticVec<f64, BLEN>, C: StaticVec<f64, CLEN>, const ALEN: usize, const BLEN: usize, const CLEN: usize>(
&self,
a: &A,
b: &B,
buffer: &mut C,
m: usize,
n: usize,
lda: usize,
a_trans: bool
) where
A: Sized,
B: Sized,
Matrix-vector multiplication using gemv.
fn matrix_mul<A: StaticVec<f64, ALEN>, B: StaticVec<f64, BLEN>, C: StaticVec<f64, CLEN>, const ALEN: usize, const BLEN: usize, const CLEN: usize>(
&self,
a: &A,
b: &B,
buffer: &mut C,
m: usize,
n: usize,
k: usize,
lda: usize,
ldb: usize,
ldc: usize,
a_trans: bool,
b_trans: bool
) where
A: Sized,
B: Sized,
type MatrixMulOutput = ()
type MatrixVectorMulOutput = ()
impl Copy for Blas
Auto Trait Implementations
impl RefUnwindSafe for Blas
impl Send for Blas
impl Sync for Blas
impl Unpin for Blas
impl UnwindSafe for Blas
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more