diff --git a/DESCRIPTION b/DESCRIPTION index b0bafc4..1812037 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: hilbertSimilarity Type: Package Title: Hilbert Similarity Index for High Dimensional Data -Version: 0.4.2.9000 -Date: 2019-10-29 +Version: 0.4.3 +Date: 2019-11-11 Authors@R: c(person('Yann','Abraham',email='yann.abraham@gmail.com',role=c('aut','cre')), person('Marilisa','Neri',email='marilisa.neri@gmail.com',role='aut'), person('John','Skilling',role='ctb')) diff --git a/cran-comments.md b/cran-comments.md index 80a3278..dd49b39 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -16,8 +16,7 @@ ## reviewers comments -* I fixed the problem with changing user parameters, using on.exit() as suggested -* I added missing \value to the documentation of add.cut, do.cut, hilbert.order and show.cut +* I fixed the comment on using math.pow with integer arguments ## Reverse dependencies diff --git a/src/mapping.cpp b/src/mapping.cpp index 826dd28..efeace8 100644 --- a/src/mapping.cpp +++ b/src/mapping.cpp @@ -87,10 +87,14 @@ NumericVector hilbertMapping(NumericMatrix x, int bits) { X[i] = x(k,i); } AxestoTranspose (X, bits, ndim); // Hilbert transpose for bits and Ndim dimensions - for (int j=bits-1, power=(bits*ndim)-1; j>=0; j--) { - for (int i=0; i>j & 1) * pow (2, power); - } + { + int j; + float power; + for ( j=bits-1, power=(bits*ndim)-1; j>=0; j--) { + for (int i=0; i>j & 1) * pow (2.0, power); + } + } } } return out;