R/snlsvec.R

Defines functions snlsvec

snlsvec <- function(X){
  
  temp <- matrix(rep(TRUE,ncol(X)*nrow(X)),nrow=nrow(X))
  Utri <- temp[upper.tri(temp,diag=TRUE)]
  Ustri <- temp[upper.tri(temp,diag=FALSE)]
  
  x <- X
  x[Ustri] <- sqrt(2) * x[Ustri]
  x <- x[Utri]
  
  return(x)
}

Try the edmcr package in your browser

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

edmcr documentation built on Sept. 10, 2021, 5:10 p.m.