【问题标题】:operation between uword and integer in RcppAmadilloRcppAmadillo中uword和整数之间的操作
【发布时间】:2020-05-01 17:55:36
【问题描述】:

我正在向 biocondutor 提交一个 R 包,其中包含一些 RcppArmadillo 代码。我从一个平台收到了一些关于 uword 和 int 之间操作的投诉。下面,drop_bin(0) 是 uword,bin_number 是整数。当我将 uword 与整数进行比较时会发生此错误。但是,当我在我的 mac osx 中运行它时,我根本看不到错误。有没有办法绕过它?谢谢。

degnormCPP.cpp: In function 'arma::uvec bin_drop(int, int, arma::rowvec)':
degnormCPP.cpp:27:18: warning: comparison of integer expressions of different signedness: 'unsigned int' and 'int' [-Wsign-compare]

   if (drop_bin(0)==bin_number-1){...}
       ~~~~~~~~~~~^~~~~~~~~~~~~~

degnormCPP.cpp: In function 'Rcpp::List optiNMFCPP(arma::mat, arma::vec, int)':

【问题讨论】:

    标签: rcpparmadillo


    【解决方案1】:

    我想我通过演员找到了答案。

    if ((int) drop_bin(0)==bin_number-1){...}
    

    bioconductor 似乎不再抱怨

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-11-09
      • 2021-10-27
      • 1970-01-01
      • 1970-01-01
      • 2012-03-17
      • 2023-03-17
      • 1970-01-01
      • 2023-03-02
      相关资源
      最近更新 更多