Open amigalemming opened 6 years ago
Seems to be duplicate of #187.
Numerically returning an identity matrix is a waste and it will take time to create that identity matrix for no reason if the matrix is empty.
This would make many computations slower for no functional benefit.
On Sat, 4 Aug 2018, Ilhan Polat wrote:
Numerically returning an identity matrix is a waste and it will take time to create that identity matrix for no reason if the matrix is empty.
This would make many computations slower for no functional benefit.
It should at least be documented.
I still think, if the programmer requests all orthogonal vectors (JOB='A') then he wants to do something with them. For a 1000x1 matrix GESVD will also compute 999 orthogonal padding vectors, why should it behave differently for 1000x0? Doing nothing for 1000x0 would be correct for the other JOB types.
Ah indeed you are right, my bad. I've overlooked the JOB types issue. It still feels awkward but I see the point for cases where singular vectors are requested.
However checking for zero-size and branching off seems to be a more efficient way in my opinion.
For M=0 or M=0, GESVD returns a zero matrix for VT or U, respectively. Mathematically correct would be to return an identity matrix.