1- //! Implement linear solver and inverse matrix
1+ //! Linear problem for triangular matrices
22
33use crate :: { error:: * , layout:: * , * } ;
44use cauchy:: * ;
55
6- /// Wraps `*trtri` and `*trtrs`
7- pub trait Triangular_ : Scalar {
6+ /// Solve linear problem for triangular matrices
7+ ///
8+ /// LAPACK correspondance
9+ /// ----------------------
10+ ///
11+ /// | f32 | f64 | c32 | c64 |
12+ /// |:-------|:-------|:-------|:-------|
13+ /// | strtrs | dtrtrs | ctrtrs | ztrtrs |
14+ ///
15+ pub trait SolveTriangularImpl : Scalar {
816 fn solve_triangular (
917 al : MatrixLayout ,
1018 bl : MatrixLayout ,
@@ -16,8 +24,8 @@ pub trait Triangular_: Scalar {
1624}
1725
1826macro_rules! impl_triangular {
19- ( $scalar: ty, $trtri : path , $ trtrs: path) => {
20- impl Triangular_ for $scalar {
27+ ( $scalar: ty, $trtrs: path) => {
28+ impl SolveTriangularImpl for $scalar {
2129 fn solve_triangular(
2230 a_layout: MatrixLayout ,
2331 b_layout: MatrixLayout ,
@@ -79,7 +87,7 @@ macro_rules! impl_triangular {
7987 } ;
8088} // impl_triangular!
8189
82- impl_triangular ! ( f64 , lapack_sys:: dtrtri_ , lapack_sys :: dtrtrs_) ;
83- impl_triangular ! ( f32 , lapack_sys:: strtri_ , lapack_sys :: strtrs_) ;
84- impl_triangular ! ( c64, lapack_sys:: ztrtri_ , lapack_sys :: ztrtrs_) ;
85- impl_triangular ! ( c32, lapack_sys:: ctrtri_ , lapack_sys :: ctrtrs_) ;
90+ impl_triangular ! ( f64 , lapack_sys:: dtrtrs_) ;
91+ impl_triangular ! ( f32 , lapack_sys:: strtrs_) ;
92+ impl_triangular ! ( c64, lapack_sys:: ztrtrs_) ;
93+ impl_triangular ! ( c32, lapack_sys:: ctrtrs_) ;
0 commit comments