Skip to content

Commit

Permalink
RC 0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mdsumner committed Dec 21, 2023
1 parent c115562 commit c2a5c6b
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 6 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
^README\.Rmd$
^CODE_OF_CONDUCT\.md$
^CRAN-SUBMISSION$
^cran-comments\.md$
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: area
Title: Calculate Area of Triangles and Polygons
Version: 0.1.0.9001
Version: 0.2.0
Authors@R:
person(given = "Michael",
family = "Sumner",
Expand Down
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# area dev
# area 0.2.0

* Improved C++ sum method to match benchmarks (from 2023 advent of code Day 18,
see https://github.com/hypertidy/area/issues/4). Thanks to Tan Ho, Jonathan Carroll, and Rich FitzJohn.
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,15 @@ df <- sfheaders::sf_to_df(xsf)
#> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 1 1 1 2203380098. 1
#> 2 2 1 1 103039733. 1
#> 3 3 1 1 750145539388. 1
#> 3 3 1 1 750145539384. 1
#> 4 3 1 2 100909770. -1
#> 5 3 1 3 2203380098. -1
#> 6 3 1 4 45585186. -1
#> 7 3 1 5 89780792. -1
#> 8 3 1 6 110755146. -1
#> 9 3 1 7 59287239. -1
#> 10 3 1 8 66189369. -1
#> # … with 179 more rows
#> # 179 more rows
sum(mmarea$area * mmarea$hole)
#> [1] 1.923706e+12
sum(sf::st_area(xsf))
Expand Down Expand Up @@ -146,8 +146,8 @@ dim(trxy)
#> [1] 18291 2
rbenchmark::benchmark(R = {a <- tri_area(trxy)}, cpp = {b <- triangle_area(trxy)})
#> test replications elapsed relative user.self sys.self user.child sys.child
#> 2 cpp 100 0.065 1.000 0.050 0.016 0 0
#> 1 R 100 0.296 4.554 0.233 0.064 0 0
#> 2 cpp 100 0.049 1.000 0.040 0.008 0 0
#> 1 R 100 0.237 4.837 0.209 0.028 0 0
sum(abs(a - b))
#> [1] 0.0004653583
mean(c(sum(a), sum(b)))
Expand Down
7 changes: 7 additions & 0 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## R CMD check results

0 errors | 0 warnings | 0 notes

* Fix for inaccuracy with sums in C++.


0 comments on commit c2a5c6b

Please sign in to comment.