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

Function rmatrixlqunpackq

src/ortfac.cpp:820–935  ·  view source on GitHub ↗

Partial unpacking of matrix Q from the LQ decomposition of a matrix A Input parameters: A - matrices L and Q 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. Tau - scalar factors which are used to form Q. Output of the RMatrixLQ s

Source from the content-addressed store, hash-verified

818 Bochkanov Sergey
819*************************************************************************/
820void rmatrixlqunpackq(const ap::real_2d_array& a,
821 int m,
822 int n,
823 const ap::real_1d_array& tau,
824 int qrows,
825 ap::real_2d_array& q)
826{
827 ap::real_1d_array work;
828 ap::real_1d_array t;
829 ap::real_1d_array taubuf;
830 int minmn;
831 int refcnt;
832 ap::real_2d_array tmpa;
833 ap::real_2d_array tmpt;
834 ap::real_2d_array tmpr;
835 int blockstart;
836 int blocksize;
837 int columnscount;
838 int i;
839 int j;
840// int k;
841// double v;
842
843 ap::ap_error::make_assertion(qrows<=n, "RMatrixLQUnpackQ: QRows>N!");
844 if( m<=0||n<=0||qrows<=0 )
845 {
846 return;
847 }
848
849 //
850 // init
851 //
852 minmn = ap::minint(m, n);
853 refcnt = ap::minint(minmn, qrows);
854 work.setlength(ap::maxint(m, n)+1);
855 t.setlength(ap::maxint(m, n)+1);
856 taubuf.setlength(minmn);
857 tmpa.setlength(ablasblocksize(a), n);
858 tmpt.setlength(ablasblocksize(a), 2*ablasblocksize(a));
859 tmpr.setlength(qrows, 2*ablasblocksize(a));
860 q.setlength(qrows, n);
861 for(i = 0; i <= qrows-1; i++)
862 {
863 for(j = 0; j <= n-1; j++)
864 {
865 if( i==j )
866 {
867 q(i,j) = 1;
868 }
869 else
870 {
871 q(i,j) = 0;
872 }
873 }
874 }
875
876 //
877 // Blocked code

Callers 1

rmatrixsvdFunction · 0.85

Calls 7

ablasblocksizeFunction · 0.85
rmatrixcopyFunction · 0.85
vmoveFunction · 0.85
rmatrixblockreflectorFunction · 0.85
rmatrixgemmFunction · 0.85
setlengthMethod · 0.45

Tested by

no test coverage detected