lapack_traits/lapack/
gesv.rs

1use crate::Scalar;
2use lapacke::{Layout, sgesv, dgesv, cgesv, zgesv};
3use num_complex::Complex32 as c32;
4use num_complex::Complex64 as c64;
5
6pub trait Tgesv : Scalar {
7    unsafe fn gesv(layout: Layout,
8            n: i32,
9            nrhs: i32,
10            a: &mut [Self],
11            lda: i32,
12            ipiv: &mut [i32],
13            b: &mut [Self],
14            ldb: i32,) -> i32;
15}
16
17macro_rules! impl_tgesv(
18    ($N: ty, $tgesv: path) => (
19        impl Tgesv for $N{
20            #[inline]
21            unsafe fn gesv(
22                layout: Layout,
23                n: i32,
24                nrhs: i32,
25                a: &mut [Self],
26                lda: i32,
27                ipiv: &mut [i32],
28                b: &mut [Self],
29                ldb: i32,) -> i32
30            {
31                $tgesv(layout, n, nrhs, a, lda, ipiv, b, ldb)
32            }
33        }
34    )
35);
36
37impl_tgesv!(f32, sgesv);
38impl_tgesv!(f64, dgesv);
39impl_tgesv!(c32, cgesv);
40impl_tgesv!(c64, zgesv);
41