Skip to content

Commit f75d64f

Browse files
author
dirmeier
committed
Fixes container bug and adds address sanitation to travis
1 parent 4efb0a2 commit f75d64f

File tree

6 files changed

+17
-3
lines changed

6 files changed

+17
-3
lines changed

.Rbuildignore

+1
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,4 @@ build-pkg*
3030
\.tex$
3131
\.tar.gz$
3232
^appveyor\.yml$
33+
.valgrindrc

.travis.yml

+7-1
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,20 @@ r:
33
- release
44
- devel
55

6-
sudo: false
6+
sudo: required
77
dist: trusty
88

99
cache: packages
1010

1111
r_packages:
12+
- devtools
1213
- covr
1314
- testthat
1415
- lintr
1516

17+
before_install:
18+
- sudo apt-get install valgrind
19+
1620
env:
1721
global:
1822
- R_BUILD_ARGS="--no-build-vignettes --no-manual"
@@ -22,3 +26,5 @@ env:
2226
after_success:
2327
- Rscript -e 'covr::codecov()'
2428
- Rscript -e 'lintr::lint_package()'
29+
- Rscript -e "devtools::install_github('dirmeier/diffusr')"
30+
- R -d "valgrind --tool=memcheck --leak-check=full --track-origins=yes" --vanilla < diffusr.Rcheck/diffusr-Ex.R

.valgrindrc

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
--leak-check=full
2+
--track-origins=yes

DESCRIPTION

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Package: diffusr
22
Type: Package
33
Title: Network Diffusion Algorithms
44
Version: 0.1.3
5-
Date: 2017-10-29
5+
Date: 2018-04-20
66
Authors@R: person("Simon", "Dirmeier",
77
email = "[email protected]",
88
role = c("aut", "cre"))

inst/NEWS

+5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
Versions
22
========
33

4+
### v0.1.3
5+
6+
* Adds correction for hubs
7+
* Fixes container overflow bug
8+
49
### v0.1.2
510

611
* Removes `insulated.heat.diffusion`

src/neighbors.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ std::vector<std::pair<int, double>> current_neighbors(
8383
}
8484

8585
// add neighbors that are as close as the first neighbor `cn`
86-
while (equals(queue.top().second, cn.second, .001) && queue.size())
86+
while (queue.size() && equals(queue.top().second, cn.second, .001))
8787
{
8888
std::pair<int, double> nn = queue.top();
8989
if (!visited[nn.first])

0 commit comments

Comments
 (0)