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 procedure). 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 this submatrix
| 257 | September 30, 1994 |
| 258 | *************************************************************************/ |
| 259 | void applyreflectionfromtheright(ap::real_2d_array& c, |
| 260 | double tau, |
| 261 | const ap::real_1d_array& v, |
| 262 | int m1, |
| 263 | int m2, |
| 264 | int n1, |
| 265 | int n2, |
| 266 | ap::real_1d_array& work) |
| 267 | { |
| 268 | double t; |
| 269 | int i; |
| 270 | int vm; |
| 271 | |
| 272 | if( ap::fp_eq(tau,0)||n1>n2||m1>m2 ) |
| 273 | { |
| 274 | return; |
| 275 | } |
| 276 | vm = n2-n1+1; |
| 277 | for(i = m1; i <= m2; i++) |
| 278 | { |
| 279 | t = ap::vdotproduct(&c(i, n1), 1, &v(1), 1, ap::vlen(n1,n2)); |
| 280 | t = t*tau; |
| 281 | ap::vsub(&c(i, n1), 1, &v(1), 1, ap::vlen(n1,n2), t); |
| 282 | } |
| 283 | } |
| 284 | |
| 285 | |
| 286 |
no test coverage detected