Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Faster SwapMatrixRows and SwapMatrixColumns for 8bit matrices #5838

Merged
merged 1 commit into from
Nov 13, 2024

Commits on Nov 11, 2024

  1. Fast SwapMatrixRows/columns for 8bit matrices

    Before:
    
        gap> mat:=IdentityMat(10,GF(5));; ConvertToMatrixRep(mat);; mat;
        < mutable compressed matrix 10x10 over GF(5) >
        gap> for i in [1..1000000] do SwapMatrixColumns(mat,1,2); od; time;
        1308
        gap> for i in [1..1000000] do SwapMatrixRows(mat,1,2); od; time;
        125
        gap> for i in [1..1000000] do tmp:=mat[1];mat[1]:=mat[2];mat[2]:=tmp; od; time;
        92
    
    After:
    
        gap> mat:=IdentityMat(10,GF(5));; ConvertToMatrixRep(mat);; mat;
        < mutable compressed matrix 10x10 over GF(5) >
        gap> for i in [1..1000000] do SwapMatrixColumns(mat,1,2); od; time;
        198
        gap> for i in [1..1000000] do SwapMatrixRows(mat,1,2); od; time;
        28
        gap> for i in [1..1000000] do tmp:=mat[1];mat[1]:=mat[2];mat[2]:=tmp; od; time;
        92
    fingolfin committed Nov 11, 2024
    Configuration menu
    Copy the full SHA
    aaeedb6 View commit details
    Browse the repository at this point in the history