2

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
KyBe
  • 842
  • 1
  • 14
  • 33

2 Answers2

1

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

dlwh
  • 2,257
  • 11
  • 23
-1

A simple google search (3 seconds) could have led you to this:

val (er, ei, _) = eig(a)

Taken from here: https://github.com/scalanlp/breeze/wiki/Linear-Algebra-Cheat-Sheet

bash0r
  • 774
  • 6
  • 17