having trouble on the use of SVD single value decomposition comand

148 views
Skip to first unread message

Jean-Rassaire Fouefack

unread,
Jul 13, 2017, 1:04:29 PM7/13/17
to Scala Breeze
Hi everyone

I am trying  to use the SVD command.
 let's use this simple example 

assume I have this matrix 


var A = new DenseMatrix(2, 2, Array(1.0, 0.0, 1.0, 1.0))
val (u,s,v) = svd(A)
println(u)



It shown this error

Error:(40, 9) constructor cannot be instantiated to expected type;
 found   : (T1, T2, T3)
 required: breeze.linalg.svd.SVD[breeze.linalg.DenseMatrix[Double],breeze.linalg.DenseVector[Double]]
    val (u,s,v) = svd(A)


Please assist me on how to exactrat the return values of "svd(A)" or how to use this function (svd)in general.

David Hall

unread,
Jul 13, 2017, 1:05:09 PM7/13/17
to scala-...@googlegroups.com
This should do it:

val svd.SVD(u, s, v) = svd(A)

-- David



--
You received this message because you are subscribed to the Google Groups "Scala Breeze" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-breeze+unsubscribe@googlegroups.com.
To post to this group, send email to scala-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/scala-breeze/514061af-8a4d-499f-b684-a3eecfd75412%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages