@@ -10,6 +10,12 @@ pub enum Diag {
10
10
NonUnit = b'N' ,
11
11
}
12
12
13
+ impl Diag {
14
+ fn as_ptr ( & self ) -> * const i8 {
15
+ self as * const Diag as * const i8
16
+ }
17
+ }
18
+
13
19
/// Wraps `*trtri` and `*trtrs`
14
20
pub trait Triangular_ : Scalar {
15
21
fn solve_triangular (
@@ -60,15 +66,15 @@ macro_rules! impl_triangular {
60
66
let mut info = 0 ;
61
67
unsafe {
62
68
$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( ) ,
72
78
& mut info,
73
79
) ;
74
80
}
@@ -84,7 +90,7 @@ macro_rules! impl_triangular {
84
90
} ;
85
91
} // impl_triangular!
86
92
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