ported eigenmat from deepnet and slightly unified CPUMatrix and matrix interfaces