uan Qiu
> *Sent:* November 26, 2014 2:13 AM
> *To:* David Shih
> *Cc:* rcpp-devel@lists.r-forge.r-project.org
> *Subject:* Re: [Rcpp-devel] Rcpp: Modification of input argument:
> Undefined behaviour
>
>
> Hello David,
> The general answer to your question is, if the type
2:13 AM
To: David Shih
Cc: rcpp-devel@lists.r-forge.r-project.org
Subject: Re: [Rcpp-devel] Rcpp: Modification of input argument: Undefined
behaviour
Hello David,
The general answer to your question is, if the type of your matrix (integer or
numeric) in R is different from the one you declare in Rcpp,
On 26 November 2014 at 02:13, Yixuan Qiu wrote:
| Hello David,
| The general answer to your question is, if the type of your matrix (integer or
| numeric) in R is different from the one you declare in Rcpp, Rcpp will make a
| copy and cast it to the appropriate type.
Precisely.
| For example,
Hello David,
The general answer to your question is, if the type of your matrix (integer
or numeric) in R is different from the one you declare in Rcpp, Rcpp will
make a copy and cast it to the appropriate type.
For example, 1:12 is of type integer, and if you pass it as a
NumericMatrix, Rcpp will
Hello,
There was an earlier post on this subject, but based on my experimentation, the
behaviour of modifying input argument is different depending on how the matrix
was initialization and other factors...
I wrote a Rcpp function to modify an input matrix. After calling this function,
the inpu