R/makeRW1Q.R

Defines functions makeRW1Q

Documented in makeRW1Q

makeRW1Q <-
function(n) {
        Q <- matrix(0, nrow = n, ncol = n)
        Q[1, 1:2] <- Q[n, n:(n-1)] <- c(1,-1)
        for( j in 2:(n-1) )
              Q[j,] <- c( rep(0,j-2), c(-1,2,-1), rep(0, n-j-1))
        Q
}

Try the CARrampsOcl package in your browser

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

CARrampsOcl documentation built on May 2, 2019, 3:27 a.m.