On Thu, Jul 11, 2013 at 8:32 AM, Changi Han wrote:
> Hello,
>
> I think I (superficially) understand the difference between:
>
> // [[Rcpp::export]]
> double sum1(Rcpp::NumericMatrix M) {
> arma::mat A(M.begin(), M.rows(), M.cols(), false);
> return sum(sum(A));
> }
>
>
> // [[Rcpp::export
I entirely missed that thread ... sorry. I came across the above examples
at:
http://lists.r-forge.r-project.org/pipermail/rcpp-devel/2013-April/005680.html
On Thu, Jul 11, 2013 at 8:38 PM, Gabor Grothendieck wrote:
> On Thu, Jul 11, 2013 at 8:32 AM, Changi Han
> wrote:
> > Hello,
> >
> > I t
On Thu, Jul 11, 2013 at 8:56 AM, Changi Han wrote:
> I entirely missed that thread ... sorry. I came across the above examples
> at:
>
> http://lists.r-forge.r-project.org/pipermail/rcpp-devel/2013-April/005680.html
>
>
> On Thu, Jul 11, 2013 at 8:38 PM, Gabor Grothendieck
> wrote:
>>
>> On Thu,
Hello,
This comes up every now and then, I think we can find a syntax to
initiate an arma::mat that would allow what you want.
It is not likely it will come via attributes. The idea is to keep them
simple. The solutions I see below would eventually lead to clutter, and
we are heading in the
Hi,
That's great, thanks for considering this!
Following this discussion, I went to browse through my code looking for
wrap() and as() statements that could benefit from a speed-up of memory
reuse. Of course I didn't find any.
I switched to using Modules when they were introduced, the code being
I am sure there are better ways to achieve the goal. I would suggest that
these two be similar if possible. I think the naive expectation is for them
to be consistent.
// [[Rcpp::export]]
stuff function(Rcpp::stuff) {
}
// [[Rcpp::export]]
stuff function(arma::stuff) {
}
Thank you again. Cheers.
These __are__ similar. The difference is in the classes themselves.
Rcpp classes are proxy classes so C++ copy mechanism does not apply to
them. arma classes are proper c++ classes, so C++ semantics apply.
I'm at useR right now, so I can't really work on this. I'll submit at
least ideas later.
On 11 July 2013 at 10:33, baptiste auguie wrote:
| Hi,
|
| That's great, thanks for considering this!
|
| Following this discussion, I went to browse through my code looking for wrap()
| and as() statements that could benefit from a speed-up of memory reuse. Of
| course I didn't find any.
| I s
On 11 July 2013 at 21:34, Changi Han wrote:
| I am sure there are better ways to achieve the goal. I would suggest that
these
| two be similar if possible. I think the naive expectation is for them to be
| consistent.
|
| // [[Rcpp::export]]
| stuff function(Rcpp::stuff) {
| }
|
| // [[Rcpp::ex
Everybody has this existing example in their copy of Armadillo.
I am running it here from SVN rather than the installed directory, but this
should not make a difference. Machine is my not-overly-powerful thinkpad used
for traveling:
edd@don:~/svn/rcpp/pkg/RcppArmadillo/inst/examples$ r fastLm.r
1. Just to be clear what we have been discussing here is not just how to
avoid copying but how to avoid copying while using as and wrap
or approaches that automatically generate as and wrap. I was already
aware of how to avoid copying using Armadillo how to use Armadillo types
as arguments and ret
On 11 July 2013 at 19:21, Gabor Grothendieck wrote:
| 1. Just to be clear what we have been discussing here is not just how to
| avoid copying but how to avoid copying while using as and wrap
| or approaches that automatically generate as and wrap. I was already
| aware of how to avoid copying us
On Fri, Jul 12, 2013 at 1:42 AM, Dirk Eddelbuettel wrote:
>
> On 11 July 2013 at 19:21, Gabor Grothendieck wrote:
> | 1. Just to be clear what we have been discussing here is not just how to
> | avoid copying but how to avoid copying while using as and wrap
> | or approaches that automatically gen
I apologize if my emails were badly phrased, or disrespectful. No intention
of saying anything was broken, suspicious or wrong.
I second Gabor. His described use case matches mine. The outer loop is an
optimization routine coming from other libraries. Rcpp is used to speed up
the objective, gradie
Hello,
(sorry this had to wait a few months, but now I have an idea about this)
We all love to be able to do that:
#include
using namespace Rcpp ;
// [[Rcpp::depends("RcppArmadillo")]]
// [[Rcpp::export]]
void do_stuff( arma::mat m ){
// do stuff with m
}
This is really nice. But R does
>
> Is it a big deal that we would cheat on chat reference passing means ?
>
If you want to implement these sort of semantics I think at a _minimum_ the
type should be const & (otherwise it looks like you are going to actually
modify the matrix in place which would appear to bypass the implicit me
Le 13/09/13 14:00, JJ Allaire a écrit :
Is it a big deal that we would cheat on chat reference passing means ?
If you want to implement these sort of semantics I think at a _minimum_
the type should be const & (otherwise it looks like you are going to
actually modify the matrix in place whi
Le 13/09/13 14:15, Romain Francois a écrit :
But I realize this might be a strech and we can definitely only have
const references. Which is easier to implement anyway and we would not
need the reference counting stuff I was talking about before.
spoke too soon. We would need it otherwise we r
Le 13/09/13 14:00, JJ Allaire a écrit :
Is it a big deal that we would cheat on chat reference passing means ?
If you want to implement these sort of semantics I think at a _minimum_
the type should be const & (otherwise it looks like you are going to
actually modify the matrix in place whi
On 13 September 2013 at 17:56, Romain Francois wrote:
| Here is where I am now. To wrap up this function:
[...]
| This is simple and elegant. And now we can pass down references and
| const references of armadillo matrices from R without performance penalty.
|
| This makes using RcppArmadillo ev
20 matches
Mail list logo