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

Function complexapplyreflectionfromtheright

src/creflections.cpp:266–304  ·  view source on GitHub ↗

Application of an elementary reflection to a rectangular matrix of size MxN The algorithm post-multiplies the matrix by an elementary reflection transformation which is given by column V and scalar Tau (see the description of the GenerateReflection). Not the whole matrix but only a part of it is transformed (rows from M1 to M2, columns from N1 to N2). Only the elements of th

Source from the content-addressed store, hash-verified

264 September 30, 1994
265*************************************************************************/
266void complexapplyreflectionfromtheright(ap::complex_2d_array& c,
267 ap::complex tau,
268 ap::complex_1d_array& v,
269 int m1,
270 int m2,
271 int n1,
272 int n2,
273 ap::complex_1d_array& work)
274{
275 ap::complex t;
276 int i;
277 int vm;
278
279 if( tau==0||n1>n2||m1>m2 )
280 {
281 return;
282 }
283
284 //
285 // w := C * v
286 //
287 vm = n2-n1+1;
288 for(i = m1; i <= m2; i++)
289 {
290 t = ap::vdotproduct(&c(i, n1), 1, "N", &v(1), 1, "N", ap::vlen(n1,n2));
291 work(i) = t;
292 }
293
294 //
295 // C := C - w * conj(v^T)
296 //
297 ap::vmove(&v(1), 1, &v(1), 1, "Conj", ap::vlen(1,vm));
298 for(i = m1; i <= m2; i++)
299 {
300 t = work(i)*tau;
301 ap::vsub(&c(i, n1), 1, &v(1), 1, "N", ap::vlen(n1,n2), t);
302 }
303 ap::vmove(&v(1), 1, &v(1), 1, "Conj", ap::vlen(1,vm));
304}
305
306
307

Callers 3

cmatrixlqFunction · 0.85
cmatrixlqunpackqFunction · 0.85
cmatrixlqbasecaseFunction · 0.85

Calls 3

vdotproductFunction · 0.85
vmoveFunction · 0.85
vsubFunction · 0.85

Tested by

no test coverage detected