lapack_traits/blas/
asum.rs1use crate::Scalar;
2use num_complex::Complex32 as c32;
3use num_complex::Complex64 as c64;
4
5pub trait RTasum: Scalar {
6 unsafe fn asum(n: i32, x: &[Self], incx: i32) -> Self::Real;
7}
8
9macro_rules! impl_rtasum (
10 ($N: ty, $rtasum: path) => (
11 impl RTasum for $N{
12 unsafe fn asum(n: i32, x: &[Self], incx: i32) -> Self::Real{
13 $rtasum(n, x, incx)
14 }
15 }
16 )
17);
18
19impl_rtasum!(f32, cblas::sasum);
20impl_rtasum!(f64, cblas::dasum);
21impl_rtasum!(c32, cblas::scasum);
22impl_rtasum!(c64, cblas::dzasum);