Skip to content

Commit 5009b72

Browse files
committed
CRAN version
1 parent b615dec commit 5009b72

7 files changed

Lines changed: 104 additions & 107 deletions

File tree

DESCRIPTION

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
Package: cppSim
22
Title: Fast and Memory Efficient Spatial Interaction Models
33
Version: 0.2
4+
Author:
5+
person("Ivann", "Schlosser", , "ivann.schlosser.19@ucl.ac.uk", role = c("aut", "cre"),
6+
comment = c(ORCID = "0009-0004-4099-3198"))
47
Authors@R:
58
person("Ivann", "Schlosser", , "ivann.schlosser.19@ucl.ac.uk", role = c("aut", "cre"),
69
comment = c(ORCID = "0009-0004-4099-3198"))

dev/config_attachment.yaml

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

src/Makevars

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
CXX_STD = CXX11
2+
PKG_CXXFLAGS = $(SHLIB_OPENMP_CXXFLAGS)
3+
PKG_LIBS = $(SHLIB_OPENMP_CXXFLAGS) $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS)

src/Makevars.win

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
CXX_STD = CXX11
2+
PKG_CXXFLAGS = $(SHLIB_OPENMP_CXXFLAGS)
3+
PKG_LIBS = $(SHLIB_OPENMP_CXXFLAGS) $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS)

src/symbols.rds

58.1 KB
Binary file not shown.

tests/testthat.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99
library(testthat)
1010
library(cppSim)
1111

12-
test_check("cppSim")
12+
testthat::test_check("cppSim")

tests/testthat/test-inputs.R

Lines changed: 94 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -1,94 +1,94 @@
1-
#
2-
# test_that("doubly constrained tested",{
3-
#
4-
# ## error datas
5-
# error_dist <- cbind(cppSim::distance_test,1:ncol(cppSim::distance_test))
6-
#
7-
# error_dist_neg <- cppSim::distance_test
8-
# error_dist_neg[100,150] <- -1
9-
#
10-
# error_flow_neg <- cppSim::flows_test
11-
# error_flow_neg[543,57] <- -1
12-
# # errors
13-
# testthat::expect_error({
14-
# cppSim::run_model(flows = cppSim::flows_test
15-
# ,distance = error_dist)
16-
# })
17-
#
18-
# testthat::expect_error({
19-
# cppSim::run_model(flows = cppSim::flows_test
20-
# ,distance = cppSim::distance_test
21-
# ,beta = -1)
22-
# })
23-
#
24-
# testthat::expect_error({
25-
# cppSim::run_model(flows=cppSim::flows_test
26-
# ,distance = error_dist_neg#cppSim::distance_test
27-
# )
28-
# })
29-
#
30-
# testthat::expect_error({
31-
# cppSim::run_model(flows = error_flow_neg
32-
# ,distance = cppSim::distance_test
33-
# )
34-
# })
35-
#
36-
#
37-
# #### Correct
38-
#
39-
# testthat::expect_type({
40-
#
41-
# cppSim::run_model(flows = cppSim::flows_test
42-
# ,distance = cppSim::distance_test)
43-
#
44-
# },"list")
45-
#
46-
# })
47-
#
48-
# test_that("singly constrained tested", {
49-
#
50-
# ## error datas
51-
# error_dist <- cbind(cppSim::distance_test,1:ncol(cppSim::distance_test))
52-
#
53-
# error_dist_neg <- cppSim::distance_test
54-
# error_dist_neg[100,150] <- -1
55-
#
56-
# orig_flow <- error_flow_neg <- apply(cppSim::flows_test,FUN = sum,MARGIN = 1)
57-
#
58-
# error_flow_neg[543] <- -1
59-
#
60-
# # errors
61-
# # this test works locally, but does not work with checks...
62-
# # testthat::expect_error({
63-
# # cppSim::run_model_single(flows = c(orig_flow,1,2)
64-
# # ,distance = error_dist)
65-
# # })
66-
#
67-
# testthat::expect_error({
68-
# cppSim::run_model_single(flows = orig_flow
69-
# ,distance = cppSim::distance_test
70-
# ,beta = -1)
71-
# })
72-
#
73-
# testthat::expect_error({
74-
# cppSim::run_model_single(flows = orig_flow
75-
# ,distance = error_dist_neg #cppSim::distance_test
76-
# )
77-
# })
78-
#
79-
# testthat::expect_error({
80-
# cppSim::run_model_single(flows = error_flow_neg
81-
# ,distance = cppSim::distance_test
82-
# )
83-
# })
84-
#
85-
# #### Correct
86-
#
87-
# testthat::expect_type({
88-
#
89-
# cppSim::run_model_single(flows = orig_flow
90-
# ,distance = cppSim::distance_test)
91-
#
92-
# },"list")
93-
#
94-
# })
1+
2+
test_that("doubly constrained tested",{
3+
4+
## error datas
5+
error_dist <- cbind(cppSim::distance_test,1:ncol(cppSim::distance_test))
6+
7+
error_dist_neg <- cppSim::distance_test
8+
error_dist_neg[100,150] <- -1
9+
10+
error_flow_neg <- cppSim::flows_test
11+
error_flow_neg[543,57] <- -1
12+
# errors
13+
testthat::expect_error({
14+
cppSim::run_model(flows = cppSim::flows_test
15+
,distance = error_dist)
16+
})
17+
18+
testthat::expect_error({
19+
cppSim::run_model(flows = cppSim::flows_test
20+
,distance = cppSim::distance_test
21+
,beta = -1)
22+
})
23+
24+
testthat::expect_error({
25+
cppSim::run_model(flows=cppSim::flows_test
26+
,distance = error_dist_neg#cppSim::distance_test
27+
)
28+
})
29+
30+
testthat::expect_error({
31+
cppSim::run_model(flows = error_flow_neg
32+
,distance = cppSim::distance_test
33+
)
34+
})
35+
36+
37+
#### Correct
38+
39+
testthat::expect_type({
40+
41+
cppSim::run_model(flows = cppSim::flows_test
42+
,distance = cppSim::distance_test)
43+
44+
},"list")
45+
46+
})
47+
48+
test_that("singly constrained tested", {
49+
50+
## error datas
51+
error_dist <- cbind(cppSim::distance_test,1:ncol(cppSim::distance_test))
52+
53+
error_dist_neg <- cppSim::distance_test
54+
error_dist_neg[100,150] <- -1
55+
56+
orig_flow <- error_flow_neg <- apply(cppSim::flows_test,FUN = sum,MARGIN = 1)
57+
58+
error_flow_neg[543] <- -1
59+
60+
# errors
61+
# this test works locally, but does not work with checks...
62+
testthat::expect_error({
63+
cppSim::run_model_single(flows = c(orig_flow,1,2)
64+
,distance = error_dist)
65+
})
66+
67+
testthat::expect_error({
68+
cppSim::run_model_single(flows = orig_flow
69+
,distance = cppSim::distance_test
70+
,beta = -1)
71+
})
72+
73+
testthat::expect_error({
74+
cppSim::run_model_single(flows = orig_flow
75+
,distance = error_dist_neg #cppSim::distance_test
76+
)
77+
})
78+
79+
testthat::expect_error({
80+
cppSim::run_model_single(flows = error_flow_neg
81+
,distance = cppSim::distance_test
82+
)
83+
})
84+
85+
#### Correct
86+
87+
testthat::expect_type({
88+
89+
cppSim::run_model_single(flows = orig_flow
90+
,distance = cppSim::distance_test)
91+
92+
},"list")
93+
94+
})

0 commit comments

Comments
 (0)