Skip to content

Commit 2aa3eea

Browse files
committed
Fix pow
1 parent 8a7c83e commit 2aa3eea

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

DESCRIPTION

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,12 @@ Description: The traditional linear regression trend, Modified Mann-Kendall (MK)
99
Hamed, K. H., & Rao, A. R. (1998). A modified Mann-Kendall trend test for
1010
autocorrelated data. Journal of hydrology, 204(1-4), 182-196.
1111
<doi:10.1016/S0022-1694(97)00125-X>.
12-
Version: 0.1.1
12+
Version: 0.1.2
1313
Authors@R: c(
14-
person("Dongdong", "Kong", role = c("aut", "cre"),
15-
email = "kongdd.sysu@gmail.com", comment = c(ORCID = "0000-0003-1836-8172")))
14+
person("Dongdong", "Kong", role = c("aut", "cre"),
15+
email = "kongdd.sysu@gmail.com", comment = c(ORCID = "0000-0003-1836-8172")),
16+
person('Heyang', 'Song', role = "aut",
17+
email = "7800556@gmail.com", comment = c(ORCID = "0000-0002-4192-5603")))
1618
License: MIT + file LICENSE
1719
Encoding: UTF-8
1820
Roxygen: list(markdown = TRUE)

src/movmean.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ arma::mat sgmat_S(int halfwin = 5, int d = 2) {
2626

2727
for (int i = 0; i < frame; i++) {
2828
for (int j =0; j <= d; j++) {
29-
mat(i, j) = pow(i - halfwin, j);
29+
mat(i, j) = pow(i * 1.0 - halfwin, j * 1.0);
3030
}
3131
}
3232
// Rcout << mat << std::endl;
@@ -78,7 +78,7 @@ arma::mat sgmat_wB(const arma::mat S, const arma::colvec w) {
7878
//' @examples
7979
//' y <- c(1, 3, 2, 5, 6, 8, 10, 1)
8080
//' w <- seq_along(y)/length(y)
81-
//'
81+
//'
8282
//' halfwin = 2
8383
//' d = 2
8484
//' s1 <- smooth_wSG(y, halfwin, d, w)
@@ -180,7 +180,7 @@ NumericVector movmean(
180180
const arma::colvec y,
181181
int halfwin = 1,
182182
bool SG_style = false,
183-
Nullable<NumericVector> w = R_NilValue)
183+
Nullable<NumericVector> w = R_NilValue)
184184
{
185185
int n = y.size();
186186
arma::colvec yy(y);

0 commit comments

Comments
 (0)