Unpacking of matrix L from the LQ decomposition of a matrix A Input parameters: A - matrices Q and L in compact form. Output of CMatrixLQ 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
| 1325 | Bochkanov Sergey |
| 1326 | *************************************************************************/ |
| 1327 | void cmatrixlqunpackl(const ap::complex_2d_array& a, |
| 1328 | int m, |
| 1329 | int n, |
| 1330 | ap::complex_2d_array& l) |
| 1331 | { |
| 1332 | int i; |
| 1333 | int k; |
| 1334 | |
| 1335 | if( m<=0||n<=0 ) |
| 1336 | { |
| 1337 | return; |
| 1338 | } |
| 1339 | l.setlength(m, n); |
| 1340 | for(i = 0; i <= n-1; i++) |
| 1341 | { |
| 1342 | l(0,i) = 0; |
| 1343 | } |
| 1344 | for(i = 1; i <= m-1; i++) |
| 1345 | { |
| 1346 | ap::vmove(&l(i, 0), 1, &l(0, 0), 1, "N", ap::vlen(0,n-1)); |
| 1347 | } |
| 1348 | for(i = 0; i <= m-1; i++) |
| 1349 | { |
| 1350 | k = ap::minint(i, n-1); |
| 1351 | ap::vmove(&l(i, 0), 1, &a(i, 0), 1, "N", ap::vlen(0,k)); |
| 1352 | } |
| 1353 | } |
| 1354 | |
| 1355 | |
| 1356 | /************************************************************************* |