next up previous
Next: About this document ... Up: Appendix Previous: function QRstep

function prodgiv


function$ [x]=$prodgiv 
$ (C,S,x,n);$ 

 % Input: $ C$ - the vector of the cosines coefficients of the Givens rotations
 % $ S$ - the vector of the sines coefficients of the Givens rotations
 % $ x$ - a vector of length $ n$
 % Output: $ x$ - the vector of the product $ H_1(\kappa) x $

% fast product of $ n-1 $ Givens times a vector $ x$
for $ i=n-1:-1:1, $
$ t=C(i)\times x(i)-S (i)\times x(i+1); $
$ x(i+1)=s(i) \times x(i)+c(i) \times x(i+1);$
$ x(i)=t; $
end
Computational complexity: $ 6n $ floating point operations.



Raf Vandebril 2004-10-08