Skip to content

Make matrices permute_rows / permute_columns accept an input list of indices #40652

@vneiger

Description

@vneiger

Problem Description

Currently, the methods for row and column permutation for matrices (permute_rows, permute_columns, with_permuted_rows, etc.) take as input a Permutation object. At the same time, a frequent usage is to have at hand a list of integers representing the wanted permutation of row indices (or column indices). It would be convenient for the user if these methods could accept such a list of integers as input.

Created after a discussion in #40508 with @xcaruso and @Biffo89

Proposed Solution

Modify the methods so that they accept as input a list of integers representing the permutation (using Sage's standard indexing for matrices, from 0 to n-1). The method could simply convert the list to a permutation object and then follow on with the existing code.

Alternatives Considered

--

Additional Information

No response

Is there an existing issue for this?

  • I have searched the existing issues for a bug report that matches the one I want to file, without success.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions