Post Reply 
SVD problem.?bug
02-03-2018, 07:05 PM
Post: #6
RE: SVD problem.?bug
They come from a qr factorization, and you are right, I will remove them.
Let me explain a little bit: numeric algorithms is not my main speciality, it's symbolics. On many platforms where giac is ported, I have access to lapack/atlas/etc. where SVD is available. On the Prime, these libs are not available. But I didn't want to take a lot of time and effort to implement a state of the art SVD algorithm (it's not something that students need on a calculator at least here in France, it's much work: look at Han's code, and imagine the additional work to implement all that code efficiently in C++). Instead I wrote something quick (and a little dirty).
The idea is the following: let m be a matrix with #rows>=#columns (otherwise tranpose), if m=u*diag(d)*trn(q) then trn(m)*m=q*diag(d)^2*trn(q), therefore you get q and d by diagonalization of trn(m)*m. Then you get u, except if 0 is eigenvalue of d (m not full rank), in that case I complete u by doing a qr factorization.
It's bad for matrices that are not full-ranked or more generally having a large condition number. But for that kind of matrices, you can use Han's svd program or switch to a port of giac with lapack/atlas support.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
SVD problem.?bug - toshk - 01-26-2018, 10:18 AM
RE: SVD problem.?bug - parisse - 01-26-2018, 04:53 PM
RE: SVD problem.?bug - toshk - 01-29-2018, 08:43 PM
RE: SVD problem.?bug - Han - 01-30-2018, 06:17 PM
RE: SVD problem.?bug - mark4flies - 02-03-2018, 05:47 PM
RE: SVD problem.?bug - parisse - 02-03-2018 07:05 PM
RE: SVD problem.?bug - toshk - 02-03-2018, 09:20 PM
RE: SVD problem.?bug - parisse - 02-04-2018, 06:49 AM
RE: SVD problem.?bug - mark4flies - 02-04-2018, 01:36 PM
RE: SVD problem.?bug - compsystems - 02-04-2018, 03:38 PM



User(s) browsing this thread: 1 Guest(s)