Le 15/09/2015 14:09, Serguei Sokol a écrit :
Le 15/09/2015 13:53, Dirk Eddelbuettel a écrit :
On 15 September 2015 at 12:16, Serguei Sokol wrote:
| Hi,
|
| If we declare the following toy function where a numeric matrix is passed by
reference,
| it works as expected, the matrix m is modified "
Le 15/09/2015 13:53, Dirk Eddelbuettel a écrit :
On 15 September 2015 at 12:16, Serguei Sokol wrote:
| Hi,
|
| If we declare the following toy function where a numeric matrix is passed by
reference,
| it works as expected, the matrix m is modified "in place":
|
| cppFunction('
| mat m2(mat& m)
On 15 September 2015 at 12:16, Serguei Sokol wrote:
| Hi,
|
| If we declare the following toy function where a numeric matrix is passed by
reference,
| it works as expected, the matrix m is modified "in place":
|
| cppFunction('
| mat m2(mat& m) {
| m=m*2;
| return(m);
| }', depends="Rc
Hi,
If we declare the following toy function where a numeric matrix is passed by
reference,
it works as expected, the matrix m is modified "in place":
cppFunction('
mat m2(mat& m) {
m=m*2;
return(m);
}', depends="RcppArmadillo", inc="using namespace arma;")
m=matrix(1:4, 2)+pi
m2(m)