Re: [Rd] number of copies - summary

2011-10-04 Thread Terry Therneau
My thanks to Bill Dunlap and Simon Urbanek for clarifying many of the details. This gives me what I need to go forward. Yes, I will likely convert more and more things to .Call over time. This clearly gives the most control over excess memory copies. I am getting more comments from people usi

Re: [Rd] number of copies

2011-10-03 Thread Simon Urbanek
On Oct 3, 2011, at 2:43 PM, Terry Therneau wrote: > > On Mon, 2011-10-03 at 12:31 -0400, Simon Urbanek wrote: >>> Thanks. I was hoping that x[,sorted] would act like "double(n)" >> does in a .C call, and have no extra copies made since it has no local >> assignment. >> >> Yes it does act the s

Re: [Rd] number of copies

2011-10-03 Thread William Dunlap
> -Original Message- > From: r-devel-boun...@r-project.org [mailto:r-devel-boun...@r-project.org] On > Behalf Of Terry Therneau > Sent: Monday, October 03, 2011 11:44 AM > To: Simon Urbanek > Cc: r-devel@r-project.org > Subject: Re: [Rd] number of copies > >

Re: [Rd] number of copies

2011-10-03 Thread Terry Therneau
On Mon, 2011-10-03 at 12:31 -0400, Simon Urbanek wrote: > > Thanks. I was hoping that x[,sorted] would act like "double(n)" > does in a .C call, and have no extra copies made since it has no local > assignment. > > Yes it does act the same way, you get an extra copy with double(n) as > well - th

Re: [Rd] number of copies

2011-10-03 Thread Simon Urbanek
Terry, On Oct 3, 2011, at 10:32 AM, Terry Therneau wrote: > I'm looking at memory efficiency for some of the survival code. The > following fragment appears in coxph.fit >coxfit <- .C("coxfit2", iter=as.integer(maxiter), > as.integer(n), > as.integer(nvar)

[Rd] number of copies

2011-10-03 Thread Terry Therneau
I'm looking at memory efficiency for some of the survival code. The following fragment appears in coxph.fit coxfit <- .C("coxfit2", iter=as.integer(maxiter), as.integer(n), as.integer(nvar), stime, sstat, x= x[sorted,