SVD internals

Given A, an m × n matrix with m >= n, the decomposition will be A = UΣ V′.

In the SVD object we store the m × n matrix U, the n × n matrix V and the n-dimensional vector with the singular values.

If it happens that for the A matrix m < n, i.e. the number of rows is less than the number of columns, then we store the SVD of the transpose of A and flag this internally. In this way we can make sure that for the matrix U the number of columns never exceeds the number of rows and at the same time that the dimension of the matrix V never exceeds the dimension of the matrix U.

For example the SVD of a 100 × 20 matrix will result in a 100 × 20 matrix U, a 20 0 matrix V and 20 singular values, the SVD of a 20 × 100 matrix will also result in a 100 × 20 matrix U, a 20 0 matrix V and 20 singular values, however it will be internally flagged as being transposed.