R/laplacian.R

Defines functions laplacian

Documented in laplacian

laplacian <- function(A, normalised = F){
	
	n = dim(A)[1]
	temp = apply(abs(A), 2, sum)
	D = diag(temp, nrow = n)
	
	temp1 = Reciprocal(sqrt(temp))
	half.D = diag(temp1, nrow = n)
	if(normalised == TRUE) 	return(half.D %*% (D - A) %*% half.D)
	if(normalised == FALSE) return(D - A)
	
}

Try the FusedPCA package in your browser

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

FusedPCA documentation built on May 29, 2017, 9:19 p.m.