R/QR.R

Defines functions QR

Documented in QR

QR <-
function(X){ 

    n <- dim(X)[1]
    if(dim(X)[2]!=n)stop("Applies only to quadratic matrices \n")

    Ident <- diag(n)
    Q <- Ident
    R <- X
    Emark <- X
    for(j in 1:(n-1)){
        Emark <- R[j:n,j:n]
        Qmark <- .householder(Emark[,1])
        Q1 <- Ident
        Q1[j:n,j:n] <- Qmark
        R <- Q1%*%R    
        Q <- Q%*%Q1
    }

    return(list(Q=Q,R=R))
}

Try the GSEArot package in your browser

Any scripts or data that you put into this service are public.

GSEArot documentation built on May 2, 2019, 4:56 p.m.