MCPcopy Create free account
hub / github.com/BoevaLab/FREEC / cmatrixqrunpackq

Function cmatrixqrunpackq

src/ortfac.cpp:1004–1122  ·  view source on GitHub ↗

Partial unpacking of matrix Q from QR decomposition of a complex matrix A. Input parameters: A - matrices Q and R in compact form. Output of CMatrixQR subroutine . M - number of rows in matrix A. M>=0. N - number of columns in matrix A. N>=0. Tau - scalar factors which are used to form Q. Output

Source from the content-addressed store, hash-verified

1002 Bochkanov Sergey
1003*************************************************************************/
1004void cmatrixqrunpackq(const ap::complex_2d_array& a,
1005 int m,
1006 int n,
1007 const ap::complex_1d_array& tau,
1008 int qcolumns,
1009 ap::complex_2d_array& q)
1010{
1011 ap::complex_1d_array work;
1012 ap::complex_1d_array t;
1013 ap::complex_1d_array taubuf;
1014 int minmn;
1015 int refcnt;
1016 ap::complex_2d_array tmpa;
1017 ap::complex_2d_array tmpt;
1018 ap::complex_2d_array tmpr;
1019 int blockstart;
1020 int blocksize;
1021 int rowscount;
1022 int i;
1023 int j;
1024// int k;
1025 ap::complex v;
1026
1027 ap::ap_error::make_assertion(qcolumns<=m, "UnpackQFromQR: QColumns>M!");
1028 if( m<=0||n<=0 )
1029 {
1030 return;
1031 }
1032
1033 //
1034 // init
1035 //
1036 minmn = ap::minint(m, n);
1037 refcnt = ap::minint(minmn, qcolumns);
1038 work.setlength(ap::maxint(m, n)+1);
1039 t.setlength(ap::maxint(m, n)+1);
1040 taubuf.setlength(minmn);
1041 tmpa.setlength(m, ablascomplexblocksize(a));
1042 tmpt.setlength(ablascomplexblocksize(a), ablascomplexblocksize(a));
1043 tmpr.setlength(2*ablascomplexblocksize(a), qcolumns);
1044 q.setlength(m, qcolumns);
1045 for(i = 0; i <= m-1; i++)
1046 {
1047 for(j = 0; j <= qcolumns-1; j++)
1048 {
1049 if( i==j )
1050 {
1051 q(i,j) = 1;
1052 }
1053 else
1054 {
1055 q(i,j) = 0;
1056 }
1057 }
1058 }
1059
1060 //
1061 // Blocked code

Callers

nothing calls this directly

Calls 8

ablascomplexblocksizeFunction · 0.85
cmatrixcopyFunction · 0.85
vmoveFunction · 0.85
cmatrixblockreflectorFunction · 0.85
cmatrixgemmFunction · 0.85
getstrideMethod · 0.80
setlengthMethod · 0.45

Tested by

no test coverage detected