Skip to content

Commit 1aef3bc

Browse files
author
dirmeier
committed
Some fixes and clean CRAN CHECK
1 parent 067204a commit 1aef3bc

File tree

13 files changed

+41
-53
lines changed

13 files changed

+41
-53
lines changed

.lintr

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,10 @@ linters: list(linelen=line_length_linter(80),
66
snakelinter=snake_case_linter,
77
closedcurly=closed_curly_linter,
88
trailingwhites=trailing_whitespace_linter)
9-
exclusions: list("tests/testthat.R",
9+
exclusions: list("tests/testthat.R",
1010
"tests/testthat/test_knn.R",
1111
"tests/testthat/test_mrw.R",
12-
"tests/testthat/test_insulated_heat.R",
13-
"tests/testthat/test_laplacian_heat.R",
12+
"tests/testthat/test_heat.R",
1413
"tests/testthat/test_util.R",
1514
"inst/doc/diffusr.R",
1615
"R/RcppExports.R")

.travis.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
language: r
22
r:
3-
- oldrel
43
- release
54
- devel
65

@@ -12,9 +11,7 @@ cache: packages
1211
r_packages:
1312
- covr
1413
- testthat
15-
16-
r_github_packages:
17-
- jimhester/lintr
14+
- lintr
1815

1916
env:
2017
global:

DESCRIPTION

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@ Package: diffusr
22
Type: Package
33
Title: Network Diffusion Algorithms
44
Version: 0.1.2
5-
Authors@R: person("Simon", "Dirmeier",
5+
Date: 2017-10-29
6+
Authors@R: person("Simon", "Dirmeier",
67
email = "simon.dirmeier@gmx.de",
78
role = c("aut", "cre"))
89
Maintainer: Simon Dirmeier <simon.dirmeier@gmx.de>
910
Description: Implementation of network diffusion algorithms such as
10-
heat diffusrion or Markov random walks. Network diffusion algorithms generally
11+
heat diffusion or Markov random walks. Network diffusion algorithms generally
1112
spread information in the form of node weights along the edges of a graph to other nodes.
1213
These weights can for example be interpreted as temperature, an initial amount
1314
of water, the activation of neurons in the brain, or the location of a random

R/heat_diffusion.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ setMethod(
8686
message("setting diag of graph to zero")
8787
diag(graph) <- 0
8888
}
89-
invisible(heat_diffusion_(h0,
90-
normalize.laplacian(graph),
91-
t))
89+
90+
invisible(
91+
heat_diffusion_(h0, normalize.laplacian(graph), t))
9292
}
9393
)

R/mat_util.R

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,7 @@ normalize.laplacian.numeric <- function(obj, ...)
9191
{
9292
adj <- igraph::graph_from_adjacency_matrix(obj,
9393
mode="directed",
94-
weighted=T)
94+
weighted=TRUE)
9595
comps <- igraph::components(adj)
9696
ifelse(length(comps$csize) == 1, TRUE, FALSE)
9797
}
98-

R/mrw.R

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,8 @@ setMethod(
106106

107107
stoch.graph <- normalize.stochastic(graph)
108108
if(!.is.ergodic(stoch.graph))
109-
stop("the provided graph has more than one component. It is likely not ergodic.")
110-
111-
print(p0)
112-
print(stoch.graph)
113-
print(r)
114-
print(thresh)
115-
print(niter)
116-
print(do.analytical)
109+
stop(paste("the provided graph has more than one component.",
110+
"It is likely not ergodic."))
117111

118112
invisible(
119113
mrwr_(normalize.stochastic(p0),

R/neighbors.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ setMethod(
7979
}
8080
l <- neighbors_(int.nodes, graph, k)
8181
names(l) <- int.nodes
82+
8283
invisible(l)
8384
}
8485
)
85-

diffusr.Rproj

Lines changed: 0 additions & 20 deletions
This file was deleted.

src/heat_diffusion.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ Eigen::MatrixXd heat_diffusion_(const Eigen::MatrixXd& v0,
4444
Eigen::SelfAdjointEigenSolver<Eigen::MatrixXd> es(W);
4545
Eigen::MatrixXd V = es.eigenvectors();
4646
Eigen::VectorXd D = es.eigenvalues();
47-
Eigen::VectorXd co = V.transpose() * v0;
47+
Eigen::MatrixXd co = V.transpose() * v0;
48+
49+
// solution to the heat equation at time t
4850
for (int i = 0; i < co.rows(); ++i)
4951
{
5052
for (int j = 0; j < co.cols(); ++j)

src/mrw.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
// [[Rcpp::depends(RcppEigen)]]
2424
#include <RcppEigen.h>
2525
#include <vector>
26-
#include <iostream>
2726

2827
//' Do a Markon random walk (with restart) on an column-normalised adjacency
2928
//' matrix.

0 commit comments

Comments
 (0)