length) ;
>>>int *psrc = INTEGER(s_src) ;
>>>int *pdest ;
>>>int i ;
>>>SEXP s_dest ;
>>>PROTECT(s_dest = allocVector(INTSXP, dest_length)) ;
>>>pdest = INTEGER(s_dest) ;
>>>if(TYPEOF(s_src) != INTSXP) error(&q
t.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 in duplicate.c
rror("src must be integer data") ;
for(i=0;i
-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] sugges
main 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 copyVector(SEXP s, SEXP t)
{
int i, ns, nt;
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 l
src) != INTSXP) error("src must be integer data") ;
for(i=0;i -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
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" wrote in message
news:65d21b93-a737-4a94-bdf4-ad7e90518...@r-project.org...
>
> On Apr 21
m: 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 in duplicate.c
>
> Le 21/04/10 17:
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 cop
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
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 (TYPEOF(
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
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
>
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 % nt]
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 (ver
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
>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 :
c
17 matches
Mail list logo