<%@include file="includes/setup.md.rsp"%>

<%@string colname="colQuantiles"%>
<%@string rowname="rowQuantiles"%>
<%@meta title="${colname}() and ${rowname}() benchmarks"%>
<%@meta author="Henrik Bengtsson"%>
<%@meta date="2014-06-09"%>

<%@include file="${header}"%>


# <%@meta name="title"%>

This report benchmark the performance of <%=colname%>() and <%=rowname%>() against alternative methods.

## Alternative methods

* apply() + quantile()


## Data
```r
<%=withCapture({
<%@include file="R/random-matrices.R"%>
data <- rmatrices(mode = "double")
})%>
```

## Results

<% for (dataLabel in names(data)) { %>
<% message(dataLabel) %>
### <%=dataLabel%> matrix


```r
<%=withCapture({
X <- data[[.dataLabel.]]
gc()

probs <- seq(from = 0, to = 1, by = 0.25)

colStats <- microbenchmark(
 colQuantiles     = colQuantiles(X, probs = probs, na.rm = FALSE),
 "apply+quantile" = apply(X, MARGIN = 2L, FUN = quantile, probs = probs, na.rm = FALSE),
 unit = "ms"
)

X <- t(X)
gc()

rowStats <- microbenchmark(
 rowQuantiles     = rowQuantiles(X, probs = probs, na.rm = FALSE),
 "apply+quantile" = apply(X, MARGIN = 1L, FUN = quantile, probs = probs, na.rm = FALSE),
 unit = "ms"
)
})%>
```

<% crBenchmarkResults(colStats, rowStats, tags=dataLabel) %>

<% } # for (dataLabel ...) %>


<%@include file="${footer}"%>


<%---------------------------------------------------------------------------
HISTORY:
2014-06-09
o Created.
---------------------------------------------------------------------------%>
