Displaying 4 results from an estimated 4 matches for "mechnaism".
Did you mean:
mechanism
2018 Jun 08
4
Subsetting the "ROW"s of an object
...>> system.time(for (i in 1:10000) subset_ROW4(arr,seq(1,length=10,by=100),TRUE))
>>
>> and with
>>
>> system.time(for (i in 1:10000) subset_ROW4(arr,seq(1,length=10,by=100),FALSE))
>
> I think that's because you used a relatively low precision timing
> mechnaism, and included the index generation in the timing. I see:
>
> arr <- array(rnorm(2^22),c(2^10,4,4,4))
> i <- seq(1,length = 10, by = 100)
>
> bench::mark(
> arr[i, TRUE, TRUE, TRUE],
> arr[i, , , ]
> )
> #> # A tibble: 2 x 1
> #> expression min...
2018 Jun 08
3
Subsetting the "ROW"s of an object
> On Jun 8, 2018, at 10:37 AM, Herv? Pag?s <hpages at fredhutch.org> wrote:
>
> Also the TRUEs cause problems if some dimensions are 0:
>
> > matrix(raw(0), nrow=5, ncol=0)[1:3 , TRUE]
> Error in matrix(raw(0), nrow = 5, ncol = 0)[1:3, TRUE] :
> (subscript) logical subscript too long
OK. But this is easy enough to handle.
>
> H.
>
> On
2018 Jun 08
0
Subsetting the "ROW"s of an object
...> I get identical times with
>
> system.time(for (i in 1:10000) subset_ROW4(arr,seq(1,length=10,by=100),TRUE))
>
> and with
>
> system.time(for (i in 1:10000) subset_ROW4(arr,seq(1,length=10,by=100),FALSE))
I think that's because you used a relatively low precision timing
mechnaism, and included the index generation in the timing. I see:
arr <- array(rnorm(2^22),c(2^10,4,4,4))
i <- seq(1,length = 10, by = 100)
bench::mark(
arr[i, TRUE, TRUE, TRUE],
arr[i, , , ]
)
#> # A tibble: 2 x 1
#> expression min mean median max n_gc
#> <chr&...
2018 Jun 08
0
Subsetting the "ROW"s of an object
...(i in 1:10000) subset_ROW4(arr,seq(1,length=10,by=100),TRUE))
>>>
>>> and with
>>>
>>> system.time(for (i in 1:10000) subset_ROW4(arr,seq(1,length=10,by=100),FALSE))
>>
>> I think that's because you used a relatively low precision timing
>> mechnaism, and included the index generation in the timing. I see:
>>
>> arr <- array(rnorm(2^22),c(2^10,4,4,4))
>> i <- seq(1,length = 10, by = 100)
>>
>> bench::mark(
>> arr[i, TRUE, TRUE, TRUE],
>> arr[i, , , ]
>> )
>> #> # A tibble: 2 x 1
&...