nalgebra icon indicating copy to clipboard operation
nalgebra copied to clipboard

Compute full SVD

Open michael-p opened this issue 6 years ago • 5 comments
trafficstars

For a matrix of shape R, C nalgebra's SVD decomposition currently computes the singular vector matrices U and V_t with shapes R, M and M, C where M = min(R, C). Although this is sufficient for many tasks like solving linear equation systems, in a lot of applications (e.g. in computer vision for homography or fundamental matrix decomposition) it is required to have a full decomposition where U and V_t have shape R, R and C, C. This is also what Eigen, nalgebra-lapack and SciPy compute by default.

It would be great if nalgebra provided this as well, at least optionally!

michael-p avatar Apr 20 '19 08:04 michael-p

Hi! Thank you for pointing this out. We should rename the current SVD to ThinSVD and implement the "fat" one under the SVD type.

sebcrozet avatar Apr 20 '19 11:04 sebcrozet

Is someone working on this?

jannschu avatar Apr 03 '20 22:04 jannschu

@jannschu maybe the SVD implementation in nalgebra-lapack works for you, at least for now?

astraw avatar Apr 03 '20 22:04 astraw

I've just ran into this at well. As a non-expert, I spent a while very confused as to why nalgebra's SVD was providing matrices of weird dimensionality, since it doesn't mention "thin" anywhere.

I want the full SVD because I'm trying to compute both the pseudoinverse and null space of a matrix. This is motivated by implementation of the algorithm described in section 3.3 of Optimized Thruster Allocation Utilizing Dual Quaternions for the Asteroid Sample Return Mission (Smith, 2017).

Ralith avatar May 03 '23 21:05 Ralith

I would also like to have the full SVD as I need it for extracting the basis of the null space. It should be written in the documentation at the bare minimum, it is misleading to label the functionality as SVD when it in fact does not compute the SVD but a matrix subset of it.

Makogan avatar Aug 19 '23 05:08 Makogan