Skip to content

Combine Svd versions in one API #623

@manuschneider

Description

@manuschneider

Currently, we have three versions of the SVD: Svd, Gesvd and Rsvd.
At least the former two are essentially exactly the same, the only difference is the LAPACK routine they called. To simplify the API and make maintenance easier, I suggest to combine them in one function, with an additional parameter that specifies the algorithm (say, algorithm = full for gesvd, algorithm = gessd for gessd, algorithm = truncated for Rsvd).
Rsvd could be included as well as an option, but it requires further input parameters for the oversampling. We could add them to the API, but they would be ignored for Gesvd and Gessd.
Alternatively, we could only combine Svd and Gesvd because they have basically the same API, and have a separate API for Rsvd. This might be more natural, otherwise users could be confused why changing the oversampling parameters does not do anything if they chose one of the other algorithms.

Similarly for Svd_truncate and Gesvd_truncate: the two suggest that they use different algorithms, but currently they provide essentially two copies of the same implementation, that both use Gesvd (I guess because we want Gesvd as a standard for truncated SVDs?).

Metadata

Metadata

Assignees

No one assigned

    Labels

    suggestionSuggestion for current codebase

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions