hin-tak.leung@cimr.cam.ac.uk
2006-Jan-27 14:33 UTC
[Rd] sub* assgnment unimplemented for raw (RAWSXP) types. (PR#8530)
Full_Name: Hin-Tak Leung Version: R 2.2.1 OS: x86_64-redhat-linux-gnu Submission from: (NULL) (131.111.186.92) Matrix subset assignment and [[<- assignment are unimplemented for raw (RAWSXP) types. I have a working patch implementing the functionality, to follow. --please do not edit the information below-- Version: platform = x86_64-redhat-linux-gnu arch = x86_64 os = linux-gnu system = x86_64, linux-gnu status major = 2 minor = 2.1 year = 2005 month = 12 day = 20 svn rev = 36812 language = R Locale: LC_CTYPE=en_US.UTF-8;LC_NUMERIC=C;LC_TIME=en_US.UTF-8;LC_COLLATE=en_US.UTF-8;LC_MONETARY=en_US.UTF-8;LC_MESSAGES=en_US.UTF-8;LC_PAPER=C;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=C;LC_IDENTIFICATION=C Search Path: .GlobalEnv, package:methods, package:stats, package:graphics, package:grDevices, package:utils, package:datasets, Autoloads, package:base
Hin-Tak Leung
2006-Jan-27 14:49 UTC
[Rd] sub* assgnment unimplemented for raw (RAWSXP) types. (PR#8530)
hin-tak.leung at cimr.cam.ac.uk wrote:> Full_Name: Hin-Tak Leung > Version: R 2.2.1 > OS: x86_64-redhat-linux-gnu > Submission from: (NULL) (131.111.186.92) > > > Matrix subset assignment and [[<- assignment > are unimplemented for raw (RAWSXP) types. > > I have a working patch implementing the functionality, > to follow.Same thing, sorry for two bug reports and two patches related to RAWSXP, but they are independent issues. Attached in ready-to-patch form and also insert (white spaces will go wrong) here. Please review, comment and possibly commit, and hope to see it in R 2.3.x. =====================--- src/main/subassign.c.orig 2005-12-05 23:00:17.000000000 +0000 +++ src/main/subassign.c 2006-01-27 12:50:47.000000000 +0000 @@ -868,6 +868,23 @@ } } break; + case 2424: /* raw <- raw */ + + for (j = 0; j < ncs; j++) { + jj = INTEGER(sc)[j]; + if (jj == NA_INTEGER) continue; + jj = jj - 1; + for (i = 0; i < nrs; i++) { + ii = INTEGER(sr)[i]; + if (ii == NA_INTEGER) continue; + ii = ii - 1; + ij = ii + jj * nr; + RAW(x)[ij] = RAW(y)[k]; + k = (k + 1) % ny; + } + } + break; + default: error(_("incompatible types (case %d) in matrix subset assignment"), which); @@ -1611,6 +1628,11 @@ SET_VECTOR_ELT(x, offset, y); break; + case 2424: /* raw <- raw */ + + RAW(x)[offset] = RAW(y)[0]; + break; + default: error(_("incompatible types (%d) in [[ assignment"), which); } ===========================