I want to calculate the eigenvalues and eigenvectors of a positive semi-definite matrix in Scala (using Breeze), and I'm stuck.
From the Breeze linear algebra library reference example:
val A = DenseMatrix((9.0,0.0,0.0),(0.0,82.0,0.0),(0.0,0.0,25.0))
val EigSym(lambda, evs) = eigSym(A)
First of all in my program A is a covariance matrix:
val EigSym(lambda,evs)=EigSym(cov)
and I'm getting the following error:
Error:(120, 34) not enough arguments for method apply: (eigenvalues: V, eigenvectors: M)breeze.linalg.eigSym.EigSym[V,M] in object EigSym.
Unspecified value parameter eigenvectors.
val EigSym(lambda,evs)=EigSym(cov)
^
What should the other argument be?
Secondly, can anyone explain for me why we need "EigSym(lambda,evs)" on the left hand side (I'm new to Scala, and expect just (lambda,evs)).
Thanks!