Unpacking matrix P which reduces matrix A to bidiagonal form. The subroutine returns transposed matrix P. Input parameters: QP - matrices Q and P in compact form. Output of ToBidiagonal subroutine. M - number of rows in matrix A. N - number of columns in matrix A. TAUP - scalar factors which are used to form P. Output of
| 1788 | Bochkanov Sergey |
| 1789 | *************************************************************************/ |
| 1790 | void rmatrixbdunpackpt(const ap::real_2d_array& qp, |
| 1791 | int m, |
| 1792 | int n, |
| 1793 | const ap::real_1d_array& taup, |
| 1794 | int ptrows, |
| 1795 | ap::real_2d_array& pt) |
| 1796 | { |
| 1797 | int i; |
| 1798 | int j; |
| 1799 | |
| 1800 | ap::ap_error::make_assertion(ptrows<=n, "RMatrixBDUnpackPT: PTRows>N!"); |
| 1801 | ap::ap_error::make_assertion(ptrows>=0, "RMatrixBDUnpackPT: PTRows<0!"); |
| 1802 | if( m==0||n==0||ptrows==0 ) |
| 1803 | { |
| 1804 | return; |
| 1805 | } |
| 1806 | |
| 1807 | // |
| 1808 | // prepare PT |
| 1809 | // |
| 1810 | pt.setlength(ptrows, n); |
| 1811 | for(i = 0; i <= ptrows-1; i++) |
| 1812 | { |
| 1813 | for(j = 0; j <= n-1; j++) |
| 1814 | { |
| 1815 | if( i==j ) |
| 1816 | { |
| 1817 | pt(i,j) = 1; |
| 1818 | } |
| 1819 | else |
| 1820 | { |
| 1821 | pt(i,j) = 0; |
| 1822 | } |
| 1823 | } |
| 1824 | } |
| 1825 | |
| 1826 | // |
| 1827 | // Calculate |
| 1828 | // |
| 1829 | rmatrixbdmultiplybyp(qp, m, n, taup, pt, ptrows, n, true, true); |
| 1830 | } |
| 1831 | |
| 1832 | |
| 1833 | /************************************************************************* |
no test coverage detected