Skip to content

Commit 606fe44

Browse files
committed
uint -> unsigned int
All checks OK
1 parent 7d64c7c commit 606fe44

File tree

3 files changed

+16
-34
lines changed

3 files changed

+16
-34
lines changed

cran-comments.md

Lines changed: 11 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,25 @@
11
## Test environments
22
* local Debian GNU/Linux bullseye install, R 3.6.1
3-
* rhub (`"fedora-clang-devel"`)
3+
* rhub's `check_with_sanitizers`
4+
* win-builder all
45

56
## R CMD check results
67

78
### (local)
89

9-
checking installed package size ... NOTE
10-
installed size is 5.1Mb
11-
sub-directories of 1Mb or more:
12-
libs 4.7Mb
10+
checking installed package size ... NOTE
11+
installed size is 5.1Mb
12+
sub-directories of 1Mb or more:
13+
libs 4.7Mb
1314

1415
0 errors | 0 warnings | 1 note
1516

16-
This note only appears when compiling with g++ in Linux. I believe it is related to Rcpp modules and g++, because `Rcpp::Rcpp.package.skeleton(module=T)` produces the same note.
17+
### Debian Linux, R-devel, GCC ASAN/UBSAN
1718

18-
### r-devel-linux-x86_64-fedora-clang
19+
0 errors | 0 warnings | 0 note
1920

20-
(BEFORE)
21-
ERROR
21+
### win-builder
2222

23+
0 errors | 0 warnings | 1 note
2324

24-
In file included from nExtJT.cpp:4:
25-
In file included from /data/gannet/ripley/R/test-clang/RcppArmadillo/include/RcppArmadillo.h:31:
26-
In file included from /data/gannet/ripley/R/test-clang/RcppArmadillo/include/RcppArmadilloForward.h:26:
27-
In file included from /data/gannet/ripley/R/test-clang/Rcpp/include/RcppCommon.h:168:
28-
In file included from /data/gannet/ripley/R/test-clang/Rcpp/include/Rcpp/as.h:25:
29-
/data/gannet/ripley/R/test-clang/Rcpp/include/Rcpp/internal/Exporter.h:31:30: error: reference member 't' binds to a temporary object whose lifetime would be shorter than the lifetime of the constructed object
30-
Exporter( SEXP x ) : t(x){}
31-
32-
33-
This is fixed in the new version. Solution found [here](https://stackoverflow.com/questions/56004251/rcpp-module-error-with-a-constructor-taking-numericvector-as-parameter)
34-
35-
Result on rhub **Fedora Linux, R-devel, clang, gfortran**
36-
37-
* checking CRAN incoming feasibility ... NOTE
38-
Maintainer: ‘Juan C. Laria <juank.laria@gmail.com>’
39-
40-
Days since last update: 1
41-
42-
Possibly mis-spelled words in DESCRIPTION:
43-
Culp (15:600)
25+
Days since last update: 2

src/losses.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ double R_logit(const arma::vec & beta,
5555

5656
// There is a more efficient and stable computation
5757
double rlogit = 0;
58-
for (uint i = 0; i < eta.n_elem; i++)
58+
for (unsigned int i = 0; i < eta.n_elem; i++)
5959
{
6060
rlogit += eta[i] = log1pexp(eta[i]) - y[i] * eta[i];
6161
}
@@ -67,7 +67,7 @@ double R_logit2(const arma::vec & beta,
6767
arma::vec eta = X*beta;
6868
// There is a more efficient and stable computation
6969
double rlogit = 0;
70-
for (uint i = 0; i < eta.n_elem; i++)
70+
for (unsigned int i = 0; i < eta.n_elem; i++)
7171
{
7272
rlogit += eta[i] = log1pexp(eta[i]) - y * eta[i];
7373
}
@@ -90,7 +90,7 @@ arma::vec grad_R_logit(const arma::vec & beta,
9090

9191
// More stable
9292
arma::vec tmp = X*beta;
93-
for (uint i = 0; i < tmp.n_elem; i++)
93+
for (unsigned int i = 0; i < tmp.n_elem; i++)
9494
{
9595
tmp[i] = inv1pexpm(tmp[i]) - y[i];
9696
}
@@ -101,7 +101,7 @@ arma::vec grad_R_logit2(const arma::vec & beta,
101101
double y){
102102
// More stable
103103
arma::vec tmp = X*beta;
104-
for (uint i = 0; i < tmp.n_elem; i++)
104+
for (unsigned int i = 0; i < tmp.n_elem; i++)
105105
{
106106
tmp[i] = inv1pexpm(tmp[i]) - y;
107107
}

src/nExtJT.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
// Soft-threshold operator
3434
arma::vec soft_thresh(const arma::vec & z, double l){
3535
arma::vec S = arma::vec(z.n_elem);
36-
for(uint i=0; i<z.n_elem; i++){
36+
for(unsigned int i=0; i<z.n_elem; i++){
3737
if(std::abs(z[i]) <= l){
3838
S(i) = 0;
3939
}else{

0 commit comments

Comments
 (0)