Skip to content

Commit 41b27c4

Browse files
committed
pre cran submission things
1 parent ac159da commit 41b27c4

9 files changed

Lines changed: 21 additions & 43 deletions

File tree

.Rbuildignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,6 @@
99
^pkgdown$
1010
^vignettes/*_files$
1111
^cran-comments\.md$
12+
^doc$
13+
^Meta$
14+
^revdep$

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,8 @@
66
.httr-oauth
77
.DS_Store
88
inst/doc
9-
9+
dev/
1010
docs
11+
/doc/
12+
/Meta/
13+
revdep/

DESCRIPTION

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
Package: cppSim
2-
Title: Fast and memory efficient spatial interaction models
2+
Title: Fast and Memory Efficient Spatial Interaction Models
33
Version: 0.2
44
Authors@R:
55
person("Ivann", "Schlosser", , "ivann.schlosser.19@ucl.ac.uk", role = c("aut", "cre"),
66
comment = c(ORCID = "0009-0004-4099-3198"))
7-
Author: Ivann Schlosser [auth,cre],
87
Maintainer: Ivann Schlosser <ivann.schlosser.19@ucl.ac.uk>
98
Description: This package builds on top of the RcppArmadillo linear
109
algebra functionalities to do fast spatial interaction models in the
@@ -19,14 +18,14 @@ URL: https://ischlo.github.io/cppSim/, https://github.com/ischlo/cppSim
1918
Depends:
2019
R (>= 2.10)
2120
Imports:
22-
cli,
2321
Rcpp
2422
Suggests:
2523
data.table,
2624
foreach,
2725
knitr,
2826
rlist,
2927
rmarkdown,
28+
cli,
3029
sf,
3130
testthat (>= 3.0.0)
3231
LinkingTo:

R/setup.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
.onLoad <- function(libname, pkgname) {
1+
.onAttach <- function(libname, pkgname) {
22
found <- cpp_found_openmp()
33
if (!found) {
4-
cli::cli_alert_info("Cound not find OpenMP.")
4+
packageStartupMessage("Cound not find OpenMP.")
55
} else {
6-
cli::cli_alert_info("OpenMP detected, parallel computations will be performed.")
6+
packageStartupMessage("OpenMP detected, parallel computations will be performed.")
77
}
88
}

README.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ On the R side, it uses `Rcpp` [@eddelbuettel2011] and `RcppArmadillo` [@eddelbue
9393

9494
## Performance
9595

96-
Compared to the equivalent functions implemented in pure R, it runs about x10 faster for a $\sim 1000\times 1000$ OD matrix, the speed up is increasignly more significant as matrices get bigger.
96+
Compared to the equivalent functions implemented in pure R, it runs about x10 faster for a $\sim 1000\times 1000$ OD matrix, the speed up is increasingly more significant as matrices get bigger.
9797

9898
```{r performance,eval=TRUE,include=TRUE,echo = FALSE}
9999

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ On the R side, it uses `Rcpp` (Eddelbuettel and François 2011) and
108108

109109
Compared to the equivalent functions implemented in pure R, it runs
110110
about x10 faster for a $\sim 1000\times 1000$ OD matrix, the speed up is
111-
increasignly more significant as matrices get bigger.
111+
increasingly more significant as matrices get bigger.
112112

113113
#> [1] ""
114114

references.bib

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

src/gravity_model_functions.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#include <strings.h>
99
#include "support.h"
1010

11-
#define ARMA_USE_OPENMP true
11+
// #define ARMA_USE_OPENMP true
1212

1313
#ifdef _OPENMP
1414
#include <omp.h>
@@ -129,7 +129,8 @@ Rcpp::List run_simulation_cpp(const arma::mat &distance, const arma::mat &flows,
129129
double beta_new = beta_orig + .05;
130130
Rcpp::List res1, res2, res3;
131131
double eps = 1.0;
132-
int i = 0;
132+
// int i = 0;
133+
//
133134
double step = 0.03;
134135

135136
// #ifdef _OPENMP
@@ -161,7 +162,7 @@ Rcpp::List run_simulation_cpp(const arma::mat &distance, const arma::mat &flows,
161162

162163
beta_orig = beta_new;
163164

164-
i++;
165+
// i++;
165166

166167
} while (eps > step);
167168

tests/testthat/test-inputs.R

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
test_that("doubly constrained tested", {
2+
test_that("doubly constrained tested",{
33

44
## error datas
55
error_dist <- cbind(cppSim::distance_test,1:ncol(cppSim::distance_test))
@@ -28,7 +28,7 @@ test_that("doubly constrained tested", {
2828
})
2929

3030
testthat::expect_error({
31-
cppSim::run_model(flows= error_flow_neg
31+
cppSim::run_model(flows = error_flow_neg
3232
,distance = cppSim::distance_test
3333
)
3434
})
@@ -45,8 +45,6 @@ test_that("doubly constrained tested", {
4545

4646
})
4747

48-
49-
5048
test_that("singly constrained tested", {
5149

5250
## error datas
@@ -73,7 +71,7 @@ test_that("singly constrained tested", {
7371

7472
testthat::expect_error({
7573
cppSim::run_model_single(flows = orig_flow
76-
,distance = error_dist_neg#cppSim::distance_test
74+
,distance = error_dist_neg #cppSim::distance_test
7775
)
7876
})
7977

0 commit comments

Comments
 (0)