lapack_traits/blas/
syrk.rs

1use crate::Scalar;
2use cblas::{Layout, Part, Transpose, ssyrk, dsyrk, csyrk, zsyrk};
3use num_complex::Complex32 as c32;
4use num_complex::Complex64 as c64;
5
6pub trait Tsyrk : Scalar {
7    unsafe fn syrk(layout: Layout,
8            uplo: Part,
9            trans: Transpose,
10            n: i32,
11            k: i32,
12            alpha: Self,
13            a: &[Self],
14            lda: i32,
15            beta: Self,
16            c: &mut [Self],
17            ldc: i32,
18    );
19}
20
21macro_rules! impl_tsyrk{
22    ($N: ty, $tsyrk: path) => (
23        impl Tsyrk for $N{
24            unsafe fn syrk(
25                layout: Layout,
26                uplo: Part,
27                trans: Transpose,
28                n: i32,
29                k: i32,
30                alpha: Self,
31                a: &[Self],
32                lda: i32,
33                beta: Self,
34                c: &mut [Self],
35                ldc: i32
36            )
37            {
38                $tsyrk(layout, uplo, trans, n, k, alpha, a, lda, beta, c, ldc)
39            }
40        }
41    )
42}
43
44impl_tsyrk!(f32, ssyrk);
45impl_tsyrk!(f64, dsyrk);
46impl_tsyrk!(c32, csyrk);
47impl_tsyrk!(c64, zsyrk);