@@ -120,85 +120,3 @@ macro_rules! impl_rcond_work_r {
120
120
}
121
121
impl_rcond_work_r ! ( f64 , lapack_sys:: dgecon_) ;
122
122
impl_rcond_work_r ! ( f32 , lapack_sys:: sgecon_) ;
123
-
124
- pub trait Rcond_ : Scalar + Sized {
125
- /// Estimates the the reciprocal of the condition number of the matrix in 1-norm.
126
- ///
127
- /// `anorm` should be the 1-norm of the matrix `a`.
128
- fn rcond ( l : MatrixLayout , a : & [ Self ] , anorm : Self :: Real ) -> Result < Self :: Real > ;
129
- }
130
-
131
- macro_rules! impl_rcond_real {
132
- ( $scalar: ty, $gecon: path) => {
133
- impl Rcond_ for $scalar {
134
- fn rcond( l: MatrixLayout , a: & [ Self ] , anorm: Self :: Real ) -> Result <Self :: Real > {
135
- let ( n, _) = l. size( ) ;
136
- let mut rcond = Self :: Real :: zero( ) ;
137
- let mut info = 0 ;
138
-
139
- let mut work: Vec <MaybeUninit <Self >> = vec_uninit( 4 * n as usize ) ;
140
- let mut iwork: Vec <MaybeUninit <i32 >> = vec_uninit( n as usize ) ;
141
- let norm_type = match l {
142
- MatrixLayout :: C { .. } => NormType :: Infinity ,
143
- MatrixLayout :: F { .. } => NormType :: One ,
144
- } ;
145
- unsafe {
146
- $gecon(
147
- norm_type. as_ptr( ) ,
148
- & n,
149
- AsPtr :: as_ptr( a) ,
150
- & l. lda( ) ,
151
- & anorm,
152
- & mut rcond,
153
- AsPtr :: as_mut_ptr( & mut work) ,
154
- AsPtr :: as_mut_ptr( & mut iwork) ,
155
- & mut info,
156
- )
157
- } ;
158
- info. as_lapack_result( ) ?;
159
-
160
- Ok ( rcond)
161
- }
162
- }
163
- } ;
164
- }
165
-
166
- impl_rcond_real ! ( f32 , lapack_sys:: sgecon_) ;
167
- impl_rcond_real ! ( f64 , lapack_sys:: dgecon_) ;
168
-
169
- macro_rules! impl_rcond_complex {
170
- ( $scalar: ty, $gecon: path) => {
171
- impl Rcond_ for $scalar {
172
- fn rcond( l: MatrixLayout , a: & [ Self ] , anorm: Self :: Real ) -> Result <Self :: Real > {
173
- let ( n, _) = l. size( ) ;
174
- let mut rcond = Self :: Real :: zero( ) ;
175
- let mut info = 0 ;
176
- let mut work: Vec <MaybeUninit <Self >> = vec_uninit( 2 * n as usize ) ;
177
- let mut rwork: Vec <MaybeUninit <Self :: Real >> = vec_uninit( 2 * n as usize ) ;
178
- let norm_type = match l {
179
- MatrixLayout :: C { .. } => NormType :: Infinity ,
180
- MatrixLayout :: F { .. } => NormType :: One ,
181
- } ;
182
- unsafe {
183
- $gecon(
184
- norm_type. as_ptr( ) ,
185
- & n,
186
- AsPtr :: as_ptr( a) ,
187
- & l. lda( ) ,
188
- & anorm,
189
- & mut rcond,
190
- AsPtr :: as_mut_ptr( & mut work) ,
191
- AsPtr :: as_mut_ptr( & mut rwork) ,
192
- & mut info,
193
- )
194
- } ;
195
- info. as_lapack_result( ) ?;
196
-
197
- Ok ( rcond)
198
- }
199
- }
200
- } ;
201
- }
202
-
203
- impl_rcond_complex ! ( c32, lapack_sys:: cgecon_) ;
204
- impl_rcond_complex ! ( c64, lapack_sys:: zgecon_) ;
0 commit comments