Skip to content

Commit 337625b

Browse files
committed
Reorganized the code and updated the docs
1 parent 99069a1 commit 337625b

17 files changed

+62
-58
lines changed

.vscode/.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ R_PDFVIEWER=/usr/bin/xdg-open
1313
R_PLATFORM=x86_64-redhat-linux-gnu
1414
R_PRINTCMD=
1515
R_RD4PDF=times,inconsolata,hyper
16-
R_SESSION_TMPDIR=/tmp/RtmpMNylqA
16+
R_SESSION_TMPDIR=/tmp/RtmpHERMsP
1717
R_SHARE_DIR=/usr/share/R
1818
R_STRIP_SHARED_LIB=strip --strip-unneeded
1919
R_STRIP_STATIC_LIB=strip --strip-debug

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: diffusr
22
Type: Package
33
Title: Network Diffusion Algorithms
4-
Version: 0.2.0
4+
Version: 0.2.1
55
Date: 2018-04-20
66
Authors@R: person("Simon", "Dirmeier",
77
email = "simon.dirmeier@gmx.de",

NEWS.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# diffusr v0.2.1
2+
3+
* Allow sparse matrix as input
4+
* Lint the code
5+
16
# diffusr v0.2.0
27

38
* Reorganized the code

R/heat_diffusion.R

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ heat.diffusion <- function(h0, graph, t = 0.5, ...) {
7575
diag(graph) <- 0
7676
if (is.dgCMatrix(graph)) {
7777
assert_dgCMatrix(graph)
78-
# TODO: sparse matrix
7978
} else {
8079
assert(
8180
test_matrix(graph, mode = "numeric", nrows = n_elements,
@@ -84,7 +83,7 @@ heat.diffusion <- function(h0, graph, t = 0.5, ...) {
8483
any(graph >= 0),
8584
combine = "and"
8685
)
87-
heat <- heat_diffusion_(h0, laplacian_(graph), t)
8886
}
87+
heat <- heat_diffusion_(h0, laplacian_(graph), t)
8988
return(heat)
9089
}

R/mat_util.R

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,12 @@
2222
#'
2323
#' @export
2424
#'
25-
#' @param obj matrix/vector that is stochstically normalized
25+
#' @param obj \code{\link[base]{matrix}} (or
26+
#' \code{\link[Matrix:dgCMatrix-class]{dgCMatrix}}, \link[base]{vector}) that
27+
#' is stochstically normalized
2628
#' @param ... additional params
27-
#' @return returns the normalized matrix/vector
29+
#' @return returns the normalized \code{\link[base]{matrix}} (or
30+
#' \code{\link[Matrix:dgCMatrix-class]{dgCMatrix}}, \link[base]{vector})
2831
#'
2932
#' @importFrom checkmate assert check_matrix test_numeric test_atomic_vector
3033
#'
@@ -74,7 +77,9 @@ normalize.stochastic <- function(obj, ...) {
7477
#'
7578
#' @export
7679
#'
77-
#' @param obj matrix for which the Laplacian is calculated
80+
#' @param obj \code{\link[base]{matrix}} (or
81+
#' \code{\link[Matrix:dgCMatrix-class]{dgCMatrix}}) for which the Laplacian is
82+
#' calculated
7883
#' @param ... additional params
7984
#' @return returns the Laplacian
8085
#'
@@ -104,9 +109,12 @@ normalize.laplacian <- function(obj, ...) {
104109
#'
105110
#' @export
106111
#'
107-
#' @param obj matrix for which hubs are corrected
112+
#' @param obj \code{\link[base]{matrix}} (or
113+
#' \code{\link[Matrix:dgCMatrix-class]{dgCMatrix}}) for which hubs
114+
#' are corrected
108115
#'
109-
#' @return returns the matrix with hub correction
116+
#' @return returns the \code{\link[base]{matrix}} (or
117+
#' \code{\link[Matrix:dgCMatrix-class]{dgCMatrix}}) with hub correction
110118
#'
111119
#' @useDynLib diffusr
112120
#'

R/mrw.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@
3131
#' (does not need to sum to one).
3232
#'
3333
#' @param graph an (\code{n x n})-dimensional numeric non-negative adjacence
34-
#' matrix representing the graph
34+
#' \code{\link[base]{matrix}} (or
35+
#' \code{\link[Matrix:dgCMatrix-class]{dgCMatrix}}) representing the graph
3536
#'
3637
#' @param r a scalar between (0, 1). restart probability if a Markov random
3738
#' walk with restart is desired

R/neighbors.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@
3232
#' for which the algorithm is applied iteratively
3333
#'
3434
#' @param graph an (\eqn{n \times n})-dimensional numeric non-negative adjacence
35-
#' matrix representing the graph
35+
#' \code{\link[base]{matrix}} (or
36+
#' \code{\link[Matrix:dgCMatrix-class]{dgCMatrix}}, \link[base]{vector})
37+
#' representing the graph
3638
#'
3739
#' @param k the depth of the nearest neighbor search, e.g. the depth of the
3840
#' graph traversal

inst/include/diffusr.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
#if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
2-
#define WINDOWS 1
3-
#else
4-
#define WINDOWS 0
5-
#endif
6-
71
#ifdef INTEL_MKL_VERSION
82
#define EIGEN_USE_MKL_ALL
93
#endif

man/hub.correction.Rd

Lines changed: 5 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/nearest.neighbors.Rd

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)