Last chance! 50% off unlimited learning
Sale ends in
givens(A)
Q
and R
, Q
orthonormal and
R
upper triangular, such that A=Q%*%R
.givens(A)
returns a QR decomposition (or factorization) of the
square matrix A
by applying unitary 2-by-2 matrices U
such
that U * [xk;xl] = [x,0]
where x=sqrt(xk^2+xl^2)
householder
## QR decomposition
A <- matrix(c(0,-4,2, 6,-3,-2, 8,1,-1), 3, 3, byrow=TRUE)
gv <- givens(A)
(Q <- gv$Q); (R <- gv$R)
zapsmall(Q %*% R)
givens(magic(5))
Run the code above in your browser using DataLab