I would like to take the real part of a breeze matrix. I try this as for complex number but it doesn't compile :
val realMat = mat.real
mat.mapValues(_.real) should do the trick
mat.mapValues(_.real)