Base case for complex QR -- LAPACK routine (version 3.0) -- Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., Courant Institute, Argonne National Lab, and Rice University September 30, 1994. Sergey Bochkanov, ALGLIB project, translation from FORTRAN to pseudocode, 2007-2010. *************************************************************************/
| 2963 | pseudocode, 2007-2010. |
| 2964 | *************************************************************************/ |
| 2965 | static void cmatrixqrbasecase(ap::complex_2d_array& a, |
| 2966 | int m, |
| 2967 | int n, |
| 2968 | ap::complex_1d_array& work, |
| 2969 | ap::complex_1d_array& t, |
| 2970 | ap::complex_1d_array& tau) |
| 2971 | { |
| 2972 | int i; |
| 2973 | int k; |
| 2974 | int mmi; |
| 2975 | int minmn; |
| 2976 | ap::complex tmp; |
| 2977 | |
| 2978 | minmn = ap::minint(m, n); |
| 2979 | if( minmn<=0 ) |
| 2980 | { |
| 2981 | return; |
| 2982 | } |
| 2983 | |
| 2984 | // |
| 2985 | // Test the input arguments |
| 2986 | // |
| 2987 | k = ap::minint(m, n); |
| 2988 | for(i = 0; i <= k-1; i++) |
| 2989 | { |
| 2990 | |
| 2991 | // |
| 2992 | // Generate elementary reflector H(i) to annihilate A(i+1:m,i) |
| 2993 | // |
| 2994 | mmi = m-i; |
| 2995 | ap::vmove(&t(1), 1, &a(i, i), a.getstride(), "N", ap::vlen(1,mmi)); |
| 2996 | complexgeneratereflection(t, mmi, tmp); |
| 2997 | tau(i) = tmp; |
| 2998 | ap::vmove(&a(i, i), a.getstride(), &t(1), 1, "N", ap::vlen(i,m-1)); |
| 2999 | t(1) = 1; |
| 3000 | if( i<n-1 ) |
| 3001 | { |
| 3002 | |
| 3003 | // |
| 3004 | // Apply H'(i) to A(i:m,i+1:n) from the left |
| 3005 | // |
| 3006 | complexapplyreflectionfromtheleft(a, ap::conj(tau(i)), t, i, m-1, i+1, n-1, work); |
| 3007 | } |
| 3008 | } |
| 3009 | } |
| 3010 | |
| 3011 | |
| 3012 | /************************************************************************* |
no test coverage detected