QR decomposition of a rectangular complex matrix of size MxN Input parameters: A - matrix A whose indexes range within [0..M-1, 0..N-1] M - number of rows in matrix A. N - number of columns in matrix A. Output parameters: A - matrices Q and R in compact form Tau - array of scalar factors which are used to form matrix Q. Array whose indexes range
| 371 | September 30, 1994 |
| 372 | *************************************************************************/ |
| 373 | void cmatrixqr(ap::complex_2d_array& a, |
| 374 | int m, |
| 375 | int n, |
| 376 | ap::complex_1d_array& tau) |
| 377 | { |
| 378 | ap::complex_1d_array work; |
| 379 | ap::complex_1d_array t; |
| 380 | ap::complex_1d_array taubuf; |
| 381 | int minmn; |
| 382 | ap::complex_2d_array tmpa; |
| 383 | ap::complex_2d_array tmpt; |
| 384 | ap::complex_2d_array tmpr; |
| 385 | int blockstart; |
| 386 | int blocksize; |
| 387 | int rowscount; |
| 388 | int i; |
| 389 | // int j; |
| 390 | // int k; |
| 391 | ap::complex v; |
| 392 | |
| 393 | if( m<=0||n<=0 ) |
| 394 | { |
| 395 | return; |
| 396 | } |
| 397 | minmn = ap::minint(m, n); |
| 398 | work.setlength(ap::maxint(m, n)+1); |
| 399 | t.setlength(ap::maxint(m, n)+1); |
| 400 | tau.setlength(minmn); |
| 401 | taubuf.setlength(minmn); |
| 402 | tmpa.setlength(m, ablascomplexblocksize(a)); |
| 403 | tmpt.setlength(ablascomplexblocksize(a), ablascomplexblocksize(a)); |
| 404 | tmpr.setlength(2*ablascomplexblocksize(a), n); |
| 405 | |
| 406 | // |
| 407 | // Blocked code |
| 408 | // |
| 409 | blockstart = 0; |
| 410 | while(blockstart!=minmn) |
| 411 | { |
| 412 | |
| 413 | // |
| 414 | // Determine block size |
| 415 | // |
| 416 | blocksize = minmn-blockstart; |
| 417 | if( blocksize>ablascomplexblocksize(a) ) |
| 418 | { |
| 419 | blocksize = ablascomplexblocksize(a); |
| 420 | } |
| 421 | rowscount = m-blockstart; |
| 422 | |
| 423 | // |
| 424 | // QR decomposition of submatrix. |
| 425 | // Matrix is copied to temporary storage to solve |
| 426 | // some TLB issues arising from non-contiguous memory |
| 427 | // access pattern. |
| 428 | // |
| 429 | cmatrixcopy(rowscount, blocksize, a, blockstart, blockstart, tmpa, 0, 0); |
| 430 | cmatrixqrbasecase(tmpa, rowscount, blocksize, work, t, taubuf); |
nothing calls this directly
no test coverage detected