Unpacking matrix Q which reduces a matrix to bidiagonal form. 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. TAUQ - scalar factors which are used to form Q. Output of ToBidiagonal subrout
| 1563 | Bochkanov Sergey |
| 1564 | *************************************************************************/ |
| 1565 | void rmatrixbdunpackq(const ap::real_2d_array& qp, |
| 1566 | int m, |
| 1567 | int n, |
| 1568 | const ap::real_1d_array& tauq, |
| 1569 | int qcolumns, |
| 1570 | ap::real_2d_array& q) |
| 1571 | { |
| 1572 | int i; |
| 1573 | int j; |
| 1574 | |
| 1575 | ap::ap_error::make_assertion(qcolumns<=m, "RMatrixBDUnpackQ: QColumns>M!"); |
| 1576 | ap::ap_error::make_assertion(qcolumns>=0, "RMatrixBDUnpackQ: QColumns<0!"); |
| 1577 | if( m==0||n==0||qcolumns==0 ) |
| 1578 | { |
| 1579 | return; |
| 1580 | } |
| 1581 | |
| 1582 | // |
| 1583 | // prepare Q |
| 1584 | // |
| 1585 | q.setlength(m, qcolumns); |
| 1586 | for(i = 0; i <= m-1; i++) |
| 1587 | { |
| 1588 | for(j = 0; j <= qcolumns-1; j++) |
| 1589 | { |
| 1590 | if( i==j ) |
| 1591 | { |
| 1592 | q(i,j) = 1; |
| 1593 | } |
| 1594 | else |
| 1595 | { |
| 1596 | q(i,j) = 0; |
| 1597 | } |
| 1598 | } |
| 1599 | } |
| 1600 | |
| 1601 | // |
| 1602 | // Calculate |
| 1603 | // |
| 1604 | rmatrixbdmultiplybyq(qp, m, n, tauq, q, m, qcolumns, false, false); |
| 1605 | } |
| 1606 | |
| 1607 | |
| 1608 | /************************************************************************* |
no test coverage detected