Implement `cov()` and `cor()`
This MR implements cov()
and cor()
and fixes a handful of other small things that were necessary:
-
strip_diagmat<>
now handles transpose operations; I didn't think this was necessary, becausetrans(diagmat(x))
will just not include anop_htrans
. But...diagmat(x).t()
will. -
SizeProxy
andtraits
needed support fordiagview<>
s. - Fixed missing
compute_n_rows()
andcompute_n_cols()
inop_stddev
. - Fixed order of types in threeway array operations.
The test strategy is primarily to compare with Armadillo, with a few test cases that have hard-coded results.
The implementation could be optimized with custom kernels, but I consider it slightly niche support so I am not going to kill myself over it too much right now.