You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In general it is not desirable to change arguments in-place, but in some cases it is useful (when you now what you do). So mb it is possible to add by_reference = FALSE argument to type annotations to control how arguments are passed? and if by_reference then function signature might be F(arma::mat &x) instead of F(arma::mat x)
The text was updated successfully, but these errors were encountered:
Sounds like a good idea to use the type hints to control that. Currently a const ref is used by default unless the code mutates the parameter, then it is changed to a copy.
library(armacmp)
translate(function(X, Y) {
X<-X+1return(X+Y)
}, "test")
#> R function#> #> function (X, Y) #> {#> X <- X + 1#> return(X + Y)#> }#> #> C++ function translation#> #> arma::mat test(arma::mat X, const arma::mat& Y)#> {#> X = X + 1.0;#> return X + Y;#> }#>
In general it is not desirable to change arguments in-place, but in some cases it is useful (when you now what you do). So mb it is possible to add
by_reference = FALSE
argument to type annotations to control how arguments are passed? and ifby_reference
then function signature might beF(arma::mat &x)
instead ofF(arma::mat x)
The text was updated successfully, but these errors were encountered: