[Rcpp-devel] warning from Rcpp gallery 'sample' implementation

Ben Bolker bbolker at gmail.com
Mon Nov 21 22:24:13 CET 2016


Using the amazingly useful

http://gallery.rcpp.org/articles/using-the-Rcpp-based-sample-implementation/

I get a bunch of compiler warnings (copied in full below); the crux seems
to be

typename T1::elem_type = double; arma::uword = unsigned int]’ is deprecated

   I could dig in and try to fix this myself but feel like it might be a
deep rabbit hole for me ...  This is not critical, but it would
certainly be nice to have my code compile clean.

  (I'm happy to report this elsewhere if there is a more appropriate venue.)

 Also, FWIW, I get

lists.r-forge.r-project.org uses an invalid security certificate. The
certificate is only valid for the following names: *.r-project.org,
r-project.org Error code: SSL_ERROR_BAD_CERT_DOMAIN

  when subscribing to the list ...

 Any help appreciated ...

    Ben Bolker



sessionInfo():

R Under development (unstable) (2016-10-08 r71471)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 14.04.5 LTS

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] pevosim_0.0.0.9000 testthat_1.0.2

loaded via a namespace (and not attached):
[1] compiler_3.4.0            magrittr_1.5
[3] R6_2.2.0                  tools_3.4.0
[5] RcppArmadillo_0.7.500.0.0 crayon_1.3.2
[7] Rcpp_0.12.8

In file included from funs.cpp:2:0:
/usr/local/lib/R/site-library/RcppArmadillo/include/RcppArmadilloExtensions/sample.h:
In function ‘void Rcpp::RcppArmadillo::ProbSampleReplace(arma::uvec&,
int, int, arma::vec&)’:
/usr/local/lib/R/site-library/RcppArmadillo/include/RcppArmadilloExtensions/sample.h:149:55:
warning: ‘const arma::mtOp<unsigned int, T1, arma::op_sort_index>
arma::sort_index(const arma::Base<typename T1::elem_type, T1>&,
arma::uword) [with T1 = arma::Mat<double>; typename T1::elem_type =
double; arma::uword = unsigned int]’ is deprecated (declared at
/usr/local/lib/R/site-library/RcppArmadillo/include/armadillo_bits/fn_sort_index.hpp:37)
[-Wdeprecated-declarations]
             arma::uvec perm = arma::sort_index(prob, 1); //descending
sort of i
                                                       ^
/usr/local/lib/R/site-library/RcppArmadillo/include/RcppArmadilloExtensions/sample.h:150:38:
warning: ‘typename arma::enable_if2<arma::is_arma_type<T1>::value, const
arma::Op<T1, arma::op_sort_default> >::result arma::sort(const T1&,
arma::uword) [with T1 = arma::Col<double>; typename
arma::enable_if2<arma::is_arma_type<T1>::value, const arma::Op<T1,
arma::op_sort_default> >::result = const arma::Op<arma::Col<double>,
arma::op_sort_default>; arma::uword = unsigned int]’ is deprecated
(declared at
/usr/local/lib/R/site-library/RcppArmadillo/include/armadillo_bits/fn_sort.hpp:47)
[-Wdeprecated-declarations]
             prob = arma::sort(prob, 1);  // descending sort of prob
                                      ^
/usr/local/lib/R/site-library/RcppArmadillo/include/RcppArmadilloExtensions/sample.h:
In function ‘void Rcpp::RcppArmadillo::ProbSampleNoReplace(arma::uvec&,
int, int, arma::vec&)’:
/usr/local/lib/R/site-library/RcppArmadillo/include/RcppArmadilloExtensions/sample.h:211:55:
warning: ‘const arma::mtOp<unsigned int, T1, arma::op_sort_index>
arma::sort_index(const arma::Base<typename T1::elem_type, T1>&,
arma::uword) [with T1 = arma::Mat<double>; typename T1::elem_type =
double; arma::uword = unsigned int]’ is deprecated (declared at
/usr/local/lib/R/site-library/RcppArmadillo/include/armadillo_bits/fn_sort_index.hpp:37)
[-Wdeprecated-declarations]
             arma::uvec perm = arma::sort_index(prob, 1); //descending
sort of i
                                                       ^
/usr/local/lib/R/site-library/RcppArmadillo/include/RcppArmadilloExtensions/sample.h:212:38:
warning: ‘typename arma::enable_if2<arma::is_arma_type<T1>::value, const
arma::Op<T1, arma::op_sort_default> >::result arma::sort(const T1&,
arma::uword) [with T1 = arma::Col<double>; typename
arma::enable_if2<arma::is_arma_type<T1>::value, const arma::Op<T1,
arma::op_sort_default> >::result = const arma::Op<arma::Col<double>,
arma::op_sort_default>; arma::uword = unsigned int]’ is deprecated
(declared at
/usr/local/lib/R/site-library/RcppArmadillo/include/armadillo_bits/fn_sort.hpp:47)
[-Wdeprecated-declarations]
             prob = arma::sort(prob, 1);  // descending sort of prob
                                      ^





More information about the Rcpp-devel mailing list