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

Function applyreflectionfromtheleft

src/reflections.cpp:188–228  ·  view source on GitHub ↗

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 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

Source from the content-addressed store, hash-verified

186 September 30, 1994
187*************************************************************************/
188void applyreflectionfromtheleft(ap::real_2d_array& c,
189 double tau,
190 const ap::real_1d_array& v,
191 int m1,
192 int m2,
193 int n1,
194 int n2,
195 ap::real_1d_array& work)
196{
197 double t;
198 int i;
199 int vm;
200
201 if( ap::fp_eq(tau,0)||n1>n2||m1>m2 )
202 {
203 return;
204 }
205
206 //
207 // w := C' * v
208 //
209 vm = m2-m1+1;
210 for(i = n1; i <= n2; i++)
211 {
212 work(i) = 0;
213 }
214 for(i = m1; i <= m2; i++)
215 {
216 t = v(i+1-m1);
217 ap::vadd(&work(n1), 1, &c(i, n1), 1, ap::vlen(n1,n2), t);
218 }
219
220 //
221 // C := C - tau * v * w'
222 //
223 for(i = m1; i <= m2; i++)
224 {
225 t = v(i-m1+1)*tau;
226 ap::vsub(&c(i, n1), 1, &work(n1), 1, ap::vlen(n1,n2), t);
227 }
228}
229
230
231/*************************************************************************

Callers 8

rmatrixqrFunction · 0.85
rmatrixqrunpackqFunction · 0.85
rmatrixbdFunction · 0.85
rmatrixbdmultiplybyqFunction · 0.85
rmatrixbdmultiplybypFunction · 0.85
rmatrixhessenbergFunction · 0.85
smatrixtdunpackqFunction · 0.85
rmatrixqrbasecaseFunction · 0.85

Calls 2

vaddFunction · 0.85
vsubFunction · 0.85

Tested by

no test coverage detected