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

Function rmatrixblockreflector

src/ortfac.cpp:3093–3188  ·  view source on GitHub ↗

Generate block reflector: * fill unused parts of reflectors matrix by zeros * fill diagonal of reflectors matrix by ones * generate triangular factor T PARAMETERS: A - either LengthA*BlockSize (if ColumnwiseA) or BlockSize*LengthA (if not ColumnwiseA) matrix of elementary reflectors. Modified on exit. Tau -

Source from the content-addressed store, hash-verified

3091 Bochkanov Sergey
3092*************************************************************************/
3093static void rmatrixblockreflector(ap::real_2d_array& a,
3094 ap::real_1d_array& tau,
3095 bool columnwisea,
3096 int lengtha,
3097 int blocksize,
3098 ap::real_2d_array& t,
3099 ap::real_1d_array& work)
3100{
3101 int i;
3102 int j;
3103 int k;
3104 double v;
3105
3106
3107 //
3108 // fill beginning of new column with zeros,
3109 // load 1.0 in the first non-zero element
3110 //
3111 for(k = 0; k <= blocksize-1; k++)
3112 {
3113 if( columnwisea )
3114 {
3115 for(i = 0; i <= k-1; i++)
3116 {
3117 a(i,k) = 0;
3118 }
3119 }
3120 else
3121 {
3122 for(i = 0; i <= k-1; i++)
3123 {
3124 a(k,i) = 0;
3125 }
3126 }
3127 a(k,k) = 1;
3128 }
3129
3130 //
3131 // Calculate Gram matrix of A
3132 //
3133 for(i = 0; i <= blocksize-1; i++)
3134 {
3135 for(j = 0; j <= blocksize-1; j++)
3136 {
3137 t(i,blocksize+j) = 0;
3138 }
3139 }
3140 for(k = 0; k <= lengtha-1; k++)
3141 {
3142 for(j = 1; j <= blocksize-1; j++)
3143 {
3144 if( columnwisea )
3145 {
3146 v = a(k,j);
3147 if( ap::fp_neq(v,0) )
3148 {
3149 ap::vadd(&t(j, blocksize), 1, &a(k, 0), 1, ap::vlen(blocksize,blocksize+j-1), v);
3150 }

Callers 4

rmatrixqrFunction · 0.85
rmatrixlqFunction · 0.85
rmatrixqrunpackqFunction · 0.85
rmatrixlqunpackqFunction · 0.85

Calls 4

vaddFunction · 0.85
vmoveFunction · 0.85
vdotproductFunction · 0.85
getstrideMethod · 0.80

Tested by

no test coverage detected