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

Function rmatrixqrunpackr

src/ortfac.cpp:770–796  ·  view source on GitHub ↗

Unpacking of matrix R from the QR decomposition of a matrix A Input parameters: A - matrices Q and R in compact form. Output of RMatrixQR subroutine. M - number of rows in given matrix A. M>=0. N - number of columns in given matrix A. N>=0. Output parameters: R - matrix R, array[0..M-1, 0..N-1]. -- ALGLIB routine -- 17.02.20

Source from the content-addressed store, hash-verified

768 Bochkanov Sergey
769*************************************************************************/
770void rmatrixqrunpackr(const ap::real_2d_array& a,
771 int m,
772 int n,
773 ap::real_2d_array& r)
774{
775 int i;
776 int k;
777
778 if( m<=0||n<=0 )
779 {
780 return;
781 }
782 k = ap::minint(m, n);
783 r.setlength(m, n);
784 for(i = 0; i <= n-1; i++)
785 {
786 r(0,i) = 0;
787 }
788 for(i = 1; i <= m-1; i++)
789 {
790 ap::vmove(&r(i, 0), 1, &r(0, 0), 1, ap::vlen(0,n-1));
791 }
792 for(i = 0; i <= k-1; i++)
793 {
794 ap::vmove(&r(i, i), 1, &a(i, i), 1, ap::vlen(i,n-1));
795 }
796}
797
798
799/*************************************************************************

Callers

nothing calls this directly

Calls 2

vmoveFunction · 0.85
setlengthMethod · 0.45

Tested by

no test coverage detected