Re: [Rd] suggestion how to use memcpy in duplicate.c

2010-04-24 Thread Simon Urbanek
-boun...@r-project.org [mailto:r-devel-boun...@r-project.org] On Behalf Of Romain Francois Sent: Wednesday, April 21, 2010 12:32 PM To: Matthew Dowle Cc: r-de...@stat.math.ethz.ch Subject: Re: [Rd] suggestion how to use memcpy in duplicate.c Le 21/04/10 17:54, Matthew Dowle a écrit : From

Re: [Rd] suggestion how to use memcpy in duplicate.c

2010-04-23 Thread Hervé Pagès
21, 2010 12:32 PM To: Matthew Dowle Cc: r-de...@stat.math.ethz.ch Subject: Re: [Rd] suggestion how to use memcpy in duplicate.c Le 21/04/10 17:54, Matthew Dowle a écrit : From copyVector in duplicate.c : void copyVector(SEXP s, SEXP t) { int i, ns, nt; nt = LENGTH(t); ns = LENGTH(s

Re: [Rd] suggestion how to use memcpy in duplicate.c

2010-04-23 Thread Hervé Pagès
Software wdunlap tibco.com -Original Message- From: r-devel-boun...@r-project.org [mailto:r-devel-boun...@r-project.org] On Behalf Of Romain Francois Sent: Wednesday, April 21, 2010 12:32 PM To: Matthew Dowle Cc: r-de...@stat.math.ethz.ch Subject: Re: [Rd] suggestion how to use memcpy

Re: [Rd] suggestion how to use memcpy in duplicate.c

2010-04-23 Thread Hervé Pagès
-devel-boun...@r-project.org] On Behalf Of Romain Francois Sent: Wednesday, April 21, 2010 12:32 PM To: Matthew Dowle Cc: r-de...@stat.math.ethz.ch Subject: Re: [Rd] suggestion how to use memcpy in duplicate.c Le 21/04/10 17:54, Matthew Dowle a écrit : From copyVector in duplicate.c : void

Re: [Rd] suggestion how to use memcpy in duplicate.c

2010-04-22 Thread Matthew Dowle
Is this a thumbs up for memcpy for DUPLICATE_ATOMIC_VECTOR at least ? If there is further specific testing then let me know, happy to help, but you seem to have beaten me to it. Matthew Simon Urbanek simon.urba...@r-project.org wrote in message

Re: [Rd] suggestion how to use memcpy in duplicate.c

2010-04-22 Thread Matthew Dowle
how to use memcpy in duplicate.c Le 21/04/10 17:54, Matthew Dowle a écrit : From copyVector in duplicate.c : void copyVector(SEXP s, SEXP t) { int i, ns, nt; nt = LENGTH(t); ns = LENGTH(s); switch (TYPEOF(s)) { ... case INTSXP: for (i = 0; i

Re: [Rd] suggestion how to use memcpy in duplicate.c

2010-04-22 Thread Simon Urbanek
On Apr 22, 2010, at 7:12 AM, Matthew Dowle wrote: Is this a thumbs up for memcpy for DUPLICATE_ATOMIC_VECTOR at least ? If there is further specific testing then let me know, happy to help, but you seem to have beaten me to it. I was not volunteering to do anything - I was just

[Rd] suggestion how to use memcpy in duplicate.c

2010-04-21 Thread Matthew Dowle
From copyVector in duplicate.c : void copyVector(SEXP s, SEXP t) { int i, ns, nt; nt = LENGTH(t); ns = LENGTH(s); switch (TYPEOF(s)) { ... case INTSXP: for (i = 0; i ns; i++) INTEGER(s)[i] = INTEGER(t)[i % nt]; break; ... could that be replaced with :

Re: [Rd] suggestion how to use memcpy in duplicate.c

2010-04-21 Thread Simon Urbanek
Matt, On Apr 21, 2010, at 11:54 AM, Matthew Dowle wrote: From copyVector in duplicate.c : void copyVector(SEXP s, SEXP t) { int i, ns, nt; nt = LENGTH(t); ns = LENGTH(s); switch (TYPEOF(s)) { ... case INTSXP: for (i = 0; i ns; i++) INTEGER(s)[i] =

Re: [Rd] suggestion how to use memcpy in duplicate.c

2010-04-21 Thread Seth Falcon
On 4/21/10 10:45 AM, Simon Urbanek wrote: Won't that miss the last incomplete chunk? (and please don't use DATAPTR on INTSXP even though the effect is currently the same) In general it seems that the it depends on nt whether this is efficient or not since calls to short memcpy are expensive

Re: [Rd] suggestion how to use memcpy in duplicate.c

2010-04-21 Thread Romain Francois
Le 21/04/10 17:54, Matthew Dowle a écrit : From copyVector in duplicate.c : void copyVector(SEXP s, SEXP t) { int i, ns, nt; nt = LENGTH(t); ns = LENGTH(s); switch (TYPEOF(s)) { ... case INTSXP: for (i = 0; i ns; i++) INTEGER(s)[i] = INTEGER(t)[i %

Re: [Rd] suggestion how to use memcpy in duplicate.c

2010-04-21 Thread Simon Urbanek
On Apr 21, 2010, at 2:15 PM, Seth Falcon wrote: On 4/21/10 10:45 AM, Simon Urbanek wrote: Won't that miss the last incomplete chunk? (and please don't use DATAPTR on INTSXP even though the effect is currently the same) In general it seems that the it depends on nt whether this is

Re: [Rd] suggestion how to use memcpy in duplicate.c

2010-04-21 Thread Simon Urbanek
On Apr 21, 2010, at 3:32 PM, Romain Francois wrote: Le 21/04/10 17:54, Matthew Dowle a écrit : From copyVector in duplicate.c : void copyVector(SEXP s, SEXP t) { int i, ns, nt; nt = LENGTH(t); ns = LENGTH(s); switch (TYPEOF(s)) { ... case INTSXP: for (i =

Re: [Rd] suggestion how to use memcpy in duplicate.c

2010-04-21 Thread Romain Francois
Le 21/04/10 21:39, Simon Urbanek a écrit : On Apr 21, 2010, at 3:32 PM, Romain Francois wrote: Le 21/04/10 17:54, Matthew Dowle a écrit : From copyVector in duplicate.c : void copyVector(SEXP s, SEXP t) { int i, ns, nt; nt = LENGTH(t); ns = LENGTH(s); switch

Re: [Rd] suggestion how to use memcpy in duplicate.c

2010-04-21 Thread Simon Urbanek
On Apr 21, 2010, at 4:13 PM, Romain Francois wrote: Le 21/04/10 21:39, Simon Urbanek a écrit : On Apr 21, 2010, at 3:32 PM, Romain Francois wrote: Le 21/04/10 17:54, Matthew Dowle a écrit : From copyVector in duplicate.c : void copyVector(SEXP s, SEXP t) { int i, ns, nt;

Re: [Rd] suggestion how to use memcpy in duplicate.c

2010-04-21 Thread Simon Urbanek
On Apr 21, 2010, at 4:39 PM, Simon Urbanek wrote: On Apr 21, 2010, at 4:13 PM, Romain Francois wrote: Le 21/04/10 21:39, Simon Urbanek a écrit : On Apr 21, 2010, at 3:32 PM, Romain Francois wrote: Le 21/04/10 17:54, Matthew Dowle a écrit : From copyVector in duplicate.c :

Re: [Rd] suggestion how to use memcpy in duplicate.c

2010-04-21 Thread William Dunlap
-project.org [mailto:r-devel-boun...@r-project.org] On Behalf Of Romain Francois Sent: Wednesday, April 21, 2010 12:32 PM To: Matthew Dowle Cc: r-de...@stat.math.ethz.ch Subject: Re: [Rd] suggestion how to use memcpy in duplicate.c Le 21/04/10 17:54, Matthew Dowle a écrit : From copyVector