File tree Expand file tree Collapse file tree 1 file changed +19
-9
lines changed Expand file tree Collapse file tree 1 file changed +19
-9
lines changed Original file line number Diff line number Diff line change @@ -1714,17 +1714,27 @@ static inline void
1714
1714
}
1715
1715
1716
1716
for (iter = 0 ; iter < outer_dim ; ++ iter ) {
1717
+ int not_ok ;
1717
1718
/* copy the matrix in */
1718
1719
linearize_ @TYPE @_matrix (eigh_params .A , args [0 ], & matrix_in_ld );
1719
- call_ @lapack_func @(& eigh_params );
1720
- delinearize_ @BASETYPE @_matrix (args [1 ],
1721
- eigh_params .W ,
1722
- & eigenvalues_out_ld );
1723
-
1724
- if ('V' == eigh_params .JOBZ ) {
1725
- delinearize_ @TYPE @_matrix (args [2 ],
1726
- eigh_params .A ,
1727
- & eigenvectors_out_ld );
1720
+ not_ok = call_ @lapack_func @(& eigh_params );
1721
+ if (!not_ok ) {
1722
+ /* lapack ok, copy result out */
1723
+
8000
delinearize_ @BASETYPE @_matrix (args [1 ],
1724
+ eigh_params .W ,
1725
+ & eigenvalues_out_ld );
1726
+
1727
+ if ('V' == eigh_params .JOBZ ) {
1728
+ delinearize_ @TYPE @_matrix (args [2 ],
1729
+ eigh_params .A ,
1730
+ & eigenvectors_out_ld );
1731
+ }
1732
+ } else {
1733
+ /* lapack fail, set result to nan */
1734
+ nan_ @BASETYPE @_matrix (args [1 ], & eigenvalues_out_ld );
1735
+ if ('V' == eigh_params .JOBZ ) {
1736
+ nan_ @TYPE @_matrix (args [2 ], & eigenvectors_out_ld );
1737
+ }
1728
1738
}
1729
1739
update_pointers ((npy_uint8 * * )args , outer_steps , op_count );
1730
1740
}
You can’t perform that action at this time.
0 commit comments