| 749 | } |
| 750 | |
| 751 | void UdUseperate (RowMatrix& U, Vec& d, const RowMatrix& UD) |
| 752 | /* Extract the separate U and d parts of the UD factorisation |
| 753 | * Output: |
| 754 | * U and d parts of UD |
| 755 | */ |
| 756 | { |
| 757 | std::size_t i,j; |
| 758 | const std::size_t n = UD.size1(); |
| 759 | assert (n == UD.size2()); |
| 760 | |
| 761 | for (j = 0; j < n; ++j) |
| 762 | { |
| 763 | // Extract d and set diagonal to 1 |
| 764 | d[j] = UD(j,j); |
| 765 | RowMatrix::Row Uj(U,j); |
| 766 | Uj[j] = 1; |
| 767 | for (i = 0; i < j; ++i) |
| 768 | { |
| 769 | U(i,j) = UD(i,j); |
| 770 | // Zero lower triangle of U |
| 771 | Uj[i] = 0; |
| 772 | } |
| 773 | } |
| 774 | } |
| 775 | |
| 776 | |
| 777 | /* |
no outgoing calls
no test coverage detected