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

Function cmatrixlqbasecase

src/ortfac.cpp:3022–3067  ·  view source on GitHub ↗

Base case for complex LQ -- LAPACK routine (version 3.0) -- Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd., Courant Institute, Argonne National Lab, and Rice University September 30, 1994. Sergey Bochkanov, ALGLIB project, translation from FORTRAN to pseudocode, 2007-2010. *************************************************************************/

Source from the content-addressed store, hash-verified

3020 pseudocode, 2007-2010.
3021*************************************************************************/
3022static void cmatrixlqbasecase(ap::complex_2d_array& a,
3023 int m,
3024 int n,
3025 ap::complex_1d_array& work,
3026 ap::complex_1d_array& t,
3027 ap::complex_1d_array& tau)
3028{
3029 int i;
3030 int minmn;
3031 ap::complex tmp;
3032
3033 minmn = ap::minint(m, n);
3034 if( minmn<=0 )
3035 {
3036 return;
3037 }
3038
3039 //
3040 // Test the input arguments
3041 //
3042 for(i = 0; i <= minmn-1; i++)
3043 {
3044
3045 //
3046 // Generate elementary reflector H(i)
3047 //
3048 // NOTE: ComplexGenerateReflection() generates left reflector,
3049 // i.e. H which reduces x by applyiong from the left, but we
3050 // need RIGHT reflector. So we replace H=E-tau*v*v' by H^H,
3051 // which changes v to conj(v).
3052 //
3053 ap::vmove(&t(1), 1, &a(i, i), 1, "Conj", ap::vlen(1,n-i));
3054 complexgeneratereflection(t, n-i, tmp);
3055 tau(i) = tmp;
3056 ap::vmove(&a(i, i), 1, &t(1), 1, "Conj", ap::vlen(i,n-1));
3057 t(1) = 1;
3058 if( i<m-1 )
3059 {
3060
3061 //
3062 // Apply H'(i)
3063 //
3064 complexapplyreflectionfromtheright(a, tau(i), t, i+1, m-1, i, n-1, work);
3065 }
3066 }
3067}
3068
3069
3070/*************************************************************************

Callers 1

cmatrixlqFunction · 0.85

Calls 3

vmoveFunction · 0.85

Tested by

no test coverage detected