[Rcpp-devel] element wise multiplication of a subcube and a row of a matrix
Shaami
nzshaam at gmail.com
Mon Jan 9 02:52:16 CET 2017
Hi Rcpp Friends
I am posting again a question about the subject cited. I tried to search
this problem but did not find. My question is why we cannot multiply
element wise a subcube and a row of a matrix.
Any help would be appriciated. The following is sample code which is giving
erros about the operand %.
#include <RcppArmadillo.h>
using namespace Rcpp;
using namespace RcppArmadillo;
using namespace arma;
//[[Rcpp::depends(RcppArmadillo)]]
//[[Rcpp::export]]
arma::rowvec sub(arma::cube a, arma::mat b)
{
rowvec x = a.subcube(0, 0, 0, 0, 2, 0)% b.row(0);
return x;
}
Thank You
Shaami
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20170109/ce7cf2bf/attachment.html>
More information about the Rcpp-devel
mailing list