Rcpp: Syntactic sugar for * produces unexpected results when dealing with NumericMatrix

前端 未结 2 880
抹茶落季
抹茶落季 2021-01-20 16:09

A recently asked question has lead me to believe the syntactic sugar for * by Rcpp does not work as intended. In the linked question, the user is t

2条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-20 16:41

    This is an unfortunate consequence of a bad design decision, namely making Rcpp matrices derive from Rcpp vectors.

    I'm likely to revert this decision in Rcpp implementations I now maintain: Rcpp11 and Rcpp98. I don't think anymore that there any benefit of having Matrix derive from Vector and it gets in the way of CRTP that is used at the end of this file.

提交回复
热议问题