Unpacking of matrix L from the LQ decomposition of a matrix A Input parameters: A - matrices Q and L in compact form. Output of RMatrixLQ subroutine. M - number of rows in given matrix A. M>=0. N - number of columns in given matrix A. N>=0. Output parameters: L - matrix L, array[0..M-1, 0..N-1]. -- ALGLIB routine -- 17.02.20
| 952 | Bochkanov Sergey |
| 953 | *************************************************************************/ |
| 954 | void rmatrixlqunpackl(const ap::real_2d_array& a, |
| 955 | int m, |
| 956 | int n, |
| 957 | ap::real_2d_array& l) |
| 958 | { |
| 959 | int i; |
| 960 | int k; |
| 961 | |
| 962 | if( m<=0||n<=0 ) |
| 963 | { |
| 964 | return; |
| 965 | } |
| 966 | l.setlength(m, n); |
| 967 | for(i = 0; i <= n-1; i++) |
| 968 | { |
| 969 | l(0,i) = 0; |
| 970 | } |
| 971 | for(i = 1; i <= m-1; i++) |
| 972 | { |
| 973 | ap::vmove(&l(i, 0), 1, &l(0, 0), 1, ap::vlen(0,n-1)); |
| 974 | } |
| 975 | for(i = 0; i <= m-1; i++) |
| 976 | { |
| 977 | k = ap::minint(i, n-1); |
| 978 | ap::vmove(&l(i, 0), 1, &a(i, 0), 1, ap::vlen(0,k)); |
| 979 | } |
| 980 | } |
| 981 | |
| 982 | |
| 983 | /************************************************************************* |