Base case for real LQ -- 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. *************************************************************************/
| 2916 | pseudocode, 2007-2010. |
| 2917 | *************************************************************************/ |
| 2918 | static void rmatrixlqbasecase(ap::real_2d_array& a, |
| 2919 | int m, |
| 2920 | int n, |
| 2921 | ap::real_1d_array& work, |
| 2922 | ap::real_1d_array& t, |
| 2923 | ap::real_1d_array& tau) |
| 2924 | { |
| 2925 | int i; |
| 2926 | int k; |
| 2927 | int minmn; |
| 2928 | double tmp; |
| 2929 | |
| 2930 | minmn = ap::minint(m, n); |
| 2931 | k = ap::minint(m, n); |
| 2932 | for(i = 0; i <= k-1; i++) |
| 2933 | { |
| 2934 | |
| 2935 | // |
| 2936 | // Generate elementary reflector H(i) to annihilate A(i,i+1:n-1) |
| 2937 | // |
| 2938 | ap::vmove(&t(1), 1, &a(i, i), 1, ap::vlen(1,n-i)); |
| 2939 | generatereflection(t, n-i, tmp); |
| 2940 | tau(i) = tmp; |
| 2941 | ap::vmove(&a(i, i), 1, &t(1), 1, ap::vlen(i,n-1)); |
| 2942 | t(1) = 1; |
| 2943 | if( i<n ) |
| 2944 | { |
| 2945 | |
| 2946 | // |
| 2947 | // Apply H(i) to A(i+1:m,i:n) from the right |
| 2948 | // |
| 2949 | applyreflectionfromtheright(a, tau(i), t, i+1, m-1, i, n-1, work); |
| 2950 | } |
| 2951 | } |
| 2952 | } |
| 2953 | |
| 2954 | |
| 2955 | /************************************************************************* |
no test coverage detected