Skip to content
Prev 76216 / 398502 Next

Matrix oriented computing

On Fri, 2005-08-26 at 15:25 +0200, Peter Dalgaard wrote:
What I find interesting, is that I would have intuitively expected
outer() to be faster than sapply().  However:
[1] 0.01 0.00 0.01 0.00 0.00
gcFirst = TRUE)
[1] 0.01 0.00 0.01 0.00 0.00
 
# No round() or t() to test for overhead
[1] 0.01 0.00 0.02 0.00 0.00


# Bear in mind the round() on mat1 above
[1] "Mean relative  difference: 4.905485e-05"
[1] TRUE


Even when increasing the size of 'df' to 1:1000:
[1] 0.16 0.01 0.16 0.00 0.00
TRUE)
[1] 0.16 0.00 0.18 0.00 0.00
[1] 0.16 0.01 0.17 0.00 0.00



It also seems that, at least in this case, t() and round() do not add
much overhead.

Best regards,

Marc