Displaying 2 results from an estimated 2 matches for "r_bit_not".
2015 Aug 21
3
unset() function?
...cross a function in the 'bit' package that
does not have its C code call duplicate but instead assumes the
x[1] <- x[1] will force x to be copied:
"!.bit" <- function(x){
if (length(x)){
ret <- x
ret[1] <- ret[1] # force duplication
.Call("R_bit_not", ret, PACKAGE="bit")
}else{
x
}
}
If you optimize things so that 'ret[1] <- ret[1]' does not copy 'ret',
then this function alters its input. It a function like unset()
were there then the .Call could be
.Call("R_bit_not", unset(x))...
2015 Aug 22
0
unset() function?
...it' package that
> does not have its C code call duplicate but instead assumes the
> x[1] <- x[1] will force x to be copied:
> "!.bit" <- function(x){
> if (length(x)){
> ret <- x
> ret[1] <- ret[1] # force duplication
> .Call("R_bit_not", ret, PACKAGE="bit")
> }else{
> x
> }
> }
> If you optimize things so that 'ret[1] <- ret[1]' does not copy 'ret',
> then this function alters its input. It a function like unset()
> were there then the .Call could be
> .Ca...