| 145 | } |
| 146 | |
| 147 | UTriMatrix::value_type UCrcond (const UTriMatrix& UC) |
| 148 | /* Estimate the reciprocal condition number for inversion of the original PSD |
| 149 | * matrix for which U is the factor UU' |
| 150 | * |
| 151 | * The rcond of the original matrix is simply the square of the rcond of diagonal(UC) |
| 152 | */ |
| 153 | { |
| 154 | assert (UC.size1() == UC.size2()); |
| 155 | Float rcond = rcond_internal (diag(UC)); |
| 156 | // Square to get rcond of original matrix, take care to propogate rcond's sign! |
| 157 | if (rcond < 0) |
| 158 | return -(rcond*rcond); |
| 159 | else |
| 160 | return rcond*rcond; |
| 161 | } |
| 162 | |
| 163 | inline UTriMatrix::value_type UCrcond (const UTriMatrix& UC, std::size_t n) |
| 164 | /* As above but for use by UCfactor functions where only first n elements are used |
no test coverage detected