Search code examples
scalamatrixscala-breeze

How can i take the real part of a complex matrix in breeze


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

Solution

  • mat.mapValues(_.real) should do the trick