Commit 3d9d5bc0 authored by Corson N. Areshenkoff's avatar Corson N. Areshenkoff

Change naming convention

parent cc243b94
export(heatkern)
export(garm.heatkern)
heatkern.kernel <- function(x, time = NULL, ...){
garm.heatkern.kernel <- function(x, time = NULL, ...){
if (is.null(time)){
stop('Must specify time points')
......@@ -11,7 +11,7 @@ heatkern.kernel <- function(x, time = NULL, ...){
L <- laplacian_matrix(x, normalized = F, sparse = F)
# Spectral decomposition
eig <- eigen(L)
eig <- eigen(L, symmetric = T)
lambda <- eig$values
V <- eig$vectors
......@@ -22,13 +22,13 @@ heatkern.kernel <- function(x, time = NULL, ...){
return(hk)
}
heatkern.trace <- function(x, time = NULL, ...){
garm.heatkern.trace <- function(x, time = NULL, ...){
hk.mat <- heatkern.kernel(x, time)
hk.trace <- apply(hk.mat, 3, function(i) sum(diag(i)))
return(hk.trace)
}
heatkern.heatcontent <- function(x, m = 1, ...) {
garm.heatkern.heatcontent <- function(x, m = 1, ...) {
if (!is.numeric(m) || length(m) != 1 || m %% 1 != 0 || m <= 0){
stop('m must be an integer >= 1')
......@@ -51,7 +51,7 @@ heatkern.heatcontent <- function(x, m = 1, ...) {
}
heatkern.distribution <- function(x, time = NULL, init = NULL, ...){
garm.heatkern.distribution <- function(x, time = NULL, init = NULL, ...){
hk.mat <- heatkern.kernel(x, time)
if (!length(init) == dim(hk.mat)[1]){
......
......@@ -31,7 +31,7 @@
#' }
#' @author Corson N. Areshenkoff \email{areshenk@protonmail.com}
heatkern <- function(x, stat = 'kernel', ...){
garm.heatkern <- function(x, stat = 'kernel', ...){
if (class(x) != 'igraph'){
stop('Input x must be of class igraph')
......@@ -39,10 +39,10 @@ heatkern <- function(x, stat = 'kernel', ...){
# Wrapper
h <- switch(stat,
kernel = heatkern.kernel(x, ...),
trace = heatkern.trace(x, ...),
heatcontent = heatkern.heatcontent(x, ...),
distribution = heatkern.distribution(x, ...))
kernel = garm.heatkern.kernel(x, ...),
trace = garm.heatkern.trace(x, ...),
heatcontent = garm.heatkern.heatcontent(x, ...),
distribution = garm.heatkern.distribution(x, ...))
return(drop(h))
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment