Application of an elementary reflection to a rectangular matrix of size MxN The algorithm pre-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 this s
| 193 | September 30, 1994 |
| 194 | *************************************************************************/ |
| 195 | void complexapplyreflectionfromtheleft(ap::complex_2d_array& c, |
| 196 | ap::complex tau, |
| 197 | const ap::complex_1d_array& v, |
| 198 | int m1, |
| 199 | int m2, |
| 200 | int n1, |
| 201 | int n2, |
| 202 | ap::complex_1d_array& work) |
| 203 | { |
| 204 | ap::complex t; |
| 205 | int i; |
| 206 | int vm; |
| 207 | |
| 208 | if( tau==0||n1>n2||m1>m2 ) |
| 209 | { |
| 210 | return; |
| 211 | } |
| 212 | |
| 213 | // |
| 214 | // w := C^T * conj(v) |
| 215 | // |
| 216 | vm = m2-m1+1; |
| 217 | for(i = n1; i <= n2; i++) |
| 218 | { |
| 219 | work(i) = 0; |
| 220 | } |
| 221 | for(i = m1; i <= m2; i++) |
| 222 | { |
| 223 | t = ap::conj(v(i+1-m1)); |
| 224 | ap::vadd(&work(n1), 1, &c(i, n1), 1, "N", ap::vlen(n1,n2), t); |
| 225 | } |
| 226 | |
| 227 | // |
| 228 | // C := C - tau * v * w^T |
| 229 | // |
| 230 | for(i = m1; i <= m2; i++) |
| 231 | { |
| 232 | t = v(i-m1+1)*tau; |
| 233 | ap::vsub(&c(i, n1), 1, &work(n1), 1, "N", ap::vlen(n1,n2), t); |
| 234 | } |
| 235 | } |
| 236 | |
| 237 | |
| 238 | /************************************************************************* |
no test coverage detected