Bug in main SVD wrapper
resizes U to the dimensions of At ( the input Data ). However this will crash for over-complete matrices ( e.g. 12x10 ). This line may have originally been introduced when the function used
arma:svd for compatibility with the newmat interface. However
svd_econ appears to always output a U of the expected size, including for the case of an over-complete input ( 12x10 -> 10x10 ). One fix would be to make the first limit
min(At.n_rows-1, At.n_cols-1) but it may be simpler to just drop the submatrix call - perhaps avoid the copy altogether and pass U straight in, setting
!withU similar to V.