Skip to content

Commit 10551eb

Browse files
authored
Merge pull request #1 from BerriJ/develop
Release 0.1.0
2 parents e6617cd + 53c9a73 commit 10551eb

File tree

10 files changed

+25
-23
lines changed

10 files changed

+25
-23
lines changed

.github/workflows/R-CMD-check-Dev.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
R_KEEP_PKG_SOURCE: yes
2626

2727
steps:
28-
- uses: actions/checkout@v2
28+
- uses: actions/checkout@v4
2929

3030
- uses: r-lib/actions/setup-pandoc@v2
3131

.github/workflows/R-CMD-check.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
R_KEEP_PKG_SOURCE: yes
2727

2828
steps:
29-
- uses: actions/checkout@v2
29+
- uses: actions/checkout@v4
3030

3131
- uses: r-lib/actions/setup-pandoc@v2
3232

.github/workflows/pkgdown.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
env:
1212
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
1313
steps:
14-
- uses: actions/checkout@v2
14+
- uses: actions/checkout@v4
1515

1616
- uses: r-lib/actions/setup-r@v2
1717

CRAN-SUBMISSION

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
Version: 0.0.2
2-
Date: 2022-03-01 09:49:30 UTC
3-
SHA: 11f3b178b03cc42cf402292a360254958a1ea13f
1+
Version: 0.1.0
2+
Date: 2023-09-27 08:05:00 UTC
3+
SHA: bec2f04098b3d23048a71441174f229ff33bd459

DESCRIPTION

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Package: dccpp
22
Type: Package
33
Title: Fast Computation of Distance Correlations
4-
Version: 0.0.2
5-
Date: 2022-03-01
4+
Version: 0.1.0
5+
Date: 2023-09-27
66
Authors@R: c(
77
person(given = "Jonathan",
88
family = "Berrisch",
@@ -12,13 +12,12 @@ Authors@R: c(
1212
)
1313
Description: Fast computation of the distance covariance 'dcov' and distance correlation 'dcor'. The computation cost is only O(n log(n)) for the distance correlation (see Chaudhuri, Hu (2019) <arXiv:1810.11332> <doi:10.1016/j.csda.2019.01.016>). The functions are written entirely in C++ to speed up the computation.
1414
License: GPL (>= 3)
15-
SystemRequirements: C++11
1615
URL: https://dccpp.berrisch.biz/, https://github.com/BerriJ/dccpp
1716
BugReports: https://github.com/BerriJ/dccpp/issues
1817
Encoding: UTF-8
1918
Imports: Rcpp (>= 1.0.8)
2019
LinkingTo: Rcpp, RcppArmadillo
21-
RoxygenNote: 7.1.2
20+
RoxygenNote: 7.2.3
2221
Suggests:
2322
testthat (>= 3.0.0)
2423
Config/testthat/edition: 3

NEWS.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
dccpp 0.1.0 (Release date: 2023-09-27)
2+
==============
3+
4+
## Fixes
5+
6+
Fix overflow in `dcov` and `dcor` for large sample sizes (> 46340).
7+
18
dccpp 0.0.2 (Release date: 2022-01-03)
29
==============
310

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ The dccpp R Package
33
======================
44

55
<!-- badges: start -->
6-
[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/berrij/dccpp/R-CMD-check?label=Build&style=for-the-badge)](https://github.com/BerriJ/dccpp/actions/workflows/R-CMD-check.yaml)
7-
[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/berrij/dccpp/pkgdown?label=Documentation&style=for-the-badge)](https://dccpp.berrisch.biz/)
8-
[![Lifecycle: stable](https://img.shields.io/badge/Lifecycle-stable-green?style=for-the-badge)](https://lifecycle.r-lib.org/articles/stages.html#stable)
6+
[![R-CMD-check](https://img.shields.io/github/actions/workflow/status/berrij/dccpp/R-CMD-check.yaml?&style=for-the-badge)](https://github.com/BerriJ/dccpp/actions/workflows/R-CMD-check.yaml)
7+
[![GitHub Workflow Status (branch)](https://img.shields.io/github/actions/workflow/status/berrij/dccpp/pkgdown.yaml?label=Documentation&style=for-the-badge)](https://dccpp.berrisch.biz/)
8+
[![Lifecycle: stable](https://img.shields.io/badge/Lifecycle-stable-brightgreen?style=for-the-badge)](https://lifecycle.r-lib.org/articles/stages.html#stable)
99
<!-- badges: end -->
1010

1111
Fast computation of the distance covariance `dcov` and distance correlation `dcor`. The computation cost is only O(n log(n)) for the distance correlation (see Chaudhuri, Hu, 2019, [arXiv](https://arxiv.org/abs/1810.11332), [elsevier](https://doi.org/10.1016/j.csda.2019.01.016)). The functions are written entirely in C++ to speed up the computation.

src/Makevars

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
## And with R 3.4.0, and RcppArmadillo 0.7.960.*, we turn C++11 on as OpenMP
1010
## support within Armadillo prefers / requires it
1111

12-
CXX_STD = CXX11
13-
1412
INC = -I../inst/include
1513

1614
PKG_CXXFLAGS = $(SHLIB_OPENMP_CXXFLAGS) $(INC)

src/Makevars.win

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
## And with R 3.4.0, and RcppArmadillo 0.7.960.*, we turn C++11 on as OpenMP
1010
## support within Armadillo prefers / requires it
1111

12-
CXX_STD = CXX11
13-
1412
INC = -I../inst/include
1513

1614
PKG_CXXFLAGS = $(SHLIB_OPENMP_CXXFLAGS) $(INC)

src/dc.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,19 @@ using namespace arma;
3131
//[[Rcpp::export]]
3232
double dcov(const arma::colvec &x, const arma::colvec &y)
3333
{
34-
int n = x.n_elem;
34+
long long int n = x.n_elem;
3535

3636
// Sort elements by x order
3737
vec ys = y.elem(sort_index(x));
38-
vec xs = arma::sort(x);
38+
vec xs = sort(x);
3939

4040
vec si = cumsum(xs);
4141

4242
// Element wise multiplication
4343
vec ax = regspace(-(n - 2), 2, n) % xs + (si(si.n_elem - 1) - 2 * si);
4444
mat v = join_horiz(xs, ys, xs % ys);
4545

46-
arma::umat idx(n, 2, fill::zeros);
46+
umat idx(n, 2, fill::zeros);
4747
idx.col(0) = regspace<uvec>(1, n);
4848

4949
mat iv1(n, 1, fill::zeros);
@@ -54,10 +54,10 @@ double dcov(const arma::colvec &x, const arma::colvec &y)
5454
int i = 1;
5555
int r = 1;
5656
int s = 2;
57-
58-
int gap, k, st1, e1, st2, e2, kf;
57+
int gap, k, e1, e2, kf;
58+
long long int st1, st2;
5959
double idx1, idx2;
60-
arma::uvec idxr(idx.n_rows);
60+
uvec idxr(idx.n_rows);
6161
mat csumv(v.n_rows + 1, v.n_cols);
6262

6363
idxr = idx.col(r - 1);

0 commit comments

Comments
 (0)