| 1011 | |
| 1012 | template<typename typ> |
| 1013 | static inline void |
| 1014 | slogdet_from_factored_diagonal(typ* src, |
| 1015 | fortran_int m, |
| 1016 | typ *sign, |
| 1017 | typ *logdet) |
| 1018 | { |
| 1019 | typ acc_sign = *sign; |
| 1020 | typ acc_logdet = numeric_limits<typ>::zero; |
| 1021 | int i; |
| 1022 | for (i = 0; i < m; i++) { |
| 1023 | typ abs_element = *src; |
| 1024 | if (abs_element < numeric_limits<typ>::zero) { |
| 1025 | acc_sign = -acc_sign; |
| 1026 | abs_element = -abs_element; |
| 1027 | } |
| 1028 | |
| 1029 | acc_logdet += npylog(abs_element); |
| 1030 | src += m+1; |
| 1031 | } |
| 1032 | |
| 1033 | *sign = acc_sign; |
| 1034 | *logdet = acc_logdet; |
| 1035 | } |
| 1036 | |
| 1037 | template<typename typ> |
| 1038 | static inline typ |
no test coverage detected