@karlnapf I've changed it to dimxN SGMatrix, but I did a transposeInPlace after mapping to eigen and after computing I return a Nxdim instead (didn't transpose back), because if we had dimxN, this would produce a NxN covariance matrix when we'll try to compute empirical covariance using CStatistics::covariance_matrix(..). Is that okay? Otherwise we'd have to transpose it again when we'd pass it for empirical cov. I also added some ASSERTs.