With qc for j 1 r vj 1 n aj 1 n j vj

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: (j : n 1 : n) = row.house(C(j : n j : n) v(j : n)) end { This can be done in O(n2r) operations. Direct computation of Q requires O(n3) operations 10 Rotations De nition 2: A rotation G(i j 2 1 6. 6. 60 6 G(i j ) = 6 .. 6 6 60 6. 4. 0 ) 2 <n n has the form 0 .. 0 .. .. .. c s ;s c .. 0 .. 0 i c = cos 3 0 .. 7 7 07 i 7 .. 7 7 7 07 j .. 7 5 1 (4a) j s = sin { The transformation is called a (4b) plane rotation Givens rotation Some Properties of Givens Rotations { G(i j ) is orthogonal { G(i j ) is a rank-2 modi cation of I { The multiplication G(i j )T x is a counterclockwise rotation of x in the i j plane 11 Rotations If x 2 <n then y = G(i j )T x 8 < cxi ; sxj if k = i yk = : sxi + cxj if k = j xk otherwise If we want yj = 0 then c = q xi x2 + x2 i j s = q ;xj x2 + x2 i j (5a) (5b) Calculation of a Givens rotation function c, s] = givens(a, b) % givens: Compute the Givens transformation c, s such % that ca - sb = r and sa + cb = 0. if b = 0 c=1 s=0 elseif j b j > j a j tau = -a/b s = 1/ sqrt(1 + tau^2) c = s*tau else tau = -b/a c = 1/ sqrt(1 + tau^2) s = c*tau end 12 Rotations Function for a pre-Givens rotation { The multiplication only a ects rows i and j { Regard A as a 2 q matrix and compute c B = s ;s A c B is 2 q { Overwrite B with A function A = row.rot(A, c, s) % row.rot: Compute the rotation G(i j )A where % A 2 <2 q . The rotation is...
View Full Document

This document was uploaded on 03/16/2014 for the course CSCI 6800 at Rensselaer Polytechnic Institute.

Ask a homework question - tutors are online