Calculate matrix stats

## Arguments

- matrix
Input matrix object

- row_stats
Which row statistics to compute

- col_stats
Which col statistics to compute

- threads
Number of threads to use during execution

## Details

The statistics will be calculated in a single pass over the matrix, so this method is desirable to use for efficiency purposes compared to the more standard rowMeans or colMeans if multiple statistics are needed. The stats are ordered by complexity: nonzero, mean, then variance. All less complex stats are calculated in the process of calculating a more complicated stat. So to calculate mean and variance simultaneously, just ask for variance, which will compute mean and nonzero counts as a side-effect