@@ -10,6 +10,12 @@ pub enum Diag {
1010 NonUnit = b'N' ,
1111}
1212
13+ impl Diag {
14+ fn as_ptr ( & self ) -> * const i8 {
15+ self as * const Diag as * const i8
16+ }
17+ }
18+
1319/// Wraps `*trtri` and `*trtrs`
1420pub trait Triangular_ : Scalar {
1521 fn solve_triangular (
@@ -60,15 +66,15 @@ macro_rules! impl_triangular {
6066 let mut info = 0 ;
6167 unsafe {
6268 $trtrs(
63- uplo as u8 ,
64- Transpose :: No as u8 ,
65- diag as u8 ,
66- m,
67- nrhs,
68- a_t. as_ref( ) . map( |v| v. as_slice( ) ) . unwrap_or( a) ,
69- a_layout. lda( ) ,
70- b_t. as_mut( ) . map( |v| v. as_mut_slice( ) ) . unwrap_or( b) ,
71- b_layout. lda( ) ,
69+ uplo. as_ptr ( ) ,
70+ Transpose :: No . as_ptr ( ) ,
71+ diag. as_ptr ( ) ,
72+ & m,
73+ & nrhs,
74+ AsPtr :: as_ptr ( a_t. as_ref( ) . map( |v| v. as_slice( ) ) . unwrap_or( a) ) ,
75+ & a_layout. lda( ) ,
76+ AsPtr :: as_mut_ptr ( b_t. as_mut( ) . map( |v| v. as_mut_slice( ) ) . unwrap_or( b) ) ,
77+ & b_layout. lda( ) ,
7278 & mut info,
7379 ) ;
7480 }
@@ -84,7 +90,7 @@ macro_rules! impl_triangular {
8490 } ;
8591} // impl_triangular!
8692
87- impl_triangular ! ( f64 , lapack :: dtrtri , lapack :: dtrtrs ) ;
88- impl_triangular ! ( f32 , lapack :: strtri , lapack :: strtrs ) ;
89- impl_triangular ! ( c64, lapack :: ztrtri , lapack :: ztrtrs ) ;
90- impl_triangular ! ( c32, lapack :: ctrtri , lapack :: ctrtrs ) ;
93+ impl_triangular ! ( f64 , lapack_sys :: dtrtri_ , lapack_sys :: dtrtrs_ ) ;
94+ impl_triangular ! ( f32 , lapack_sys :: strtri_ , lapack_sys :: strtrs_ ) ;
95+ impl_triangular ! ( c64, lapack_sys :: ztrtri_ , lapack_sys :: ztrtrs_ ) ;
96+ impl_triangular ! ( c32, lapack_sys :: ctrtri_ , lapack_sys :: ctrtrs_ ) ;
0 commit comments