Multiplication by matrix P which reduces matrix A to bidiagonal form. The algorithm allows pre- or post-multiply by P or P'. Input parameters: QP - matrices Q and P in compact form. Output of RMatrixBD subroutine. M - number of rows in matrix A. N - number of columns in matrix A. TAUP - scalar factors which are used
| 1861 | Bochkanov Sergey |
| 1862 | *************************************************************************/ |
| 1863 | void rmatrixbdmultiplybyp(const ap::real_2d_array& qp, |
| 1864 | int m, |
| 1865 | int n, |
| 1866 | const ap::real_1d_array& taup, |
| 1867 | ap::real_2d_array& z, |
| 1868 | int zrows, |
| 1869 | int zcolumns, |
| 1870 | bool fromtheright, |
| 1871 | bool dotranspose) |
| 1872 | { |
| 1873 | int i; |
| 1874 | ap::real_1d_array v; |
| 1875 | ap::real_1d_array work; |
| 1876 | int mx; |
| 1877 | int i1; |
| 1878 | int i2; |
| 1879 | int istep; |
| 1880 | |
| 1881 | if( m<=0||n<=0||zrows<=0||zcolumns<=0 ) |
| 1882 | { |
| 1883 | return; |
| 1884 | } |
| 1885 | ap::ap_error::make_assertion((fromtheright&&(zcolumns==n))||((!fromtheright)&&(zrows==n)), "RMatrixBDMultiplyByP: incorrect Z size!"); |
| 1886 | |
| 1887 | // |
| 1888 | // init |
| 1889 | // |
| 1890 | mx = ap::maxint(m, n); |
| 1891 | mx = ap::maxint(mx, zrows); |
| 1892 | mx = ap::maxint(mx, zcolumns); |
| 1893 | v.setlength(mx+1); |
| 1894 | work.setlength(mx+1); |
| 1895 | if( m>=n ) |
| 1896 | { |
| 1897 | |
| 1898 | // |
| 1899 | // setup |
| 1900 | // |
| 1901 | if( fromtheright ) |
| 1902 | { |
| 1903 | i1 = n-2; |
| 1904 | i2 = 0; |
| 1905 | istep = -1; |
| 1906 | } |
| 1907 | else |
| 1908 | { |
| 1909 | i1 = 0; |
| 1910 | i2 = n-2; |
| 1911 | istep = +1; |
| 1912 | } |
| 1913 | if( !dotranspose ) |
| 1914 | { |
| 1915 | i = i1; |
| 1916 | i1 = i2; |
| 1917 | i2 = i; |
| 1918 | istep = -istep; |
| 1919 | } |
| 1920 |
no test coverage detected