Ticket #10763: trac_10763-speedup-matrix-multiplication-reviewer.patch

File trac_10763-speedup-matrix-multiplication-reviewer.patch, 1.5 KB (added by rbeezer, 10 years ago)
  • sage/matrix/matrix1.pyx

    # HG changeset patch
    # User Rob Beezer <beezer@ups.edu>
    # Date 1298788480 28800
    # Node ID 08c0bc89719dc24f305b27c7a8435816c4dc3095
    # Parent  4d0709ca2bd59a2c99e3666fb152ac6e717f7a5b
    10763: matrix multiplication speedup, reviewer additions
    
    diff -r 4d0709ca2bd5 -r 08c0bc89719d sage/matrix/matrix1.pyx
    a b  
    14181418            from sage.matrix.matrix_space import _cache
    14191419            MS = _cache[base_ring, nrows, ncols, sparse]()
    14201420        except KeyError:
     1421            MS = None
     1422        if MS is None:
    14211423            return MatrixSpace(base_ring, nrows, ncols, sparse)
    1422         if MS is not None:
     1424        else:
    14231425            return MS
    1424         return MatrixSpace(base_ring, nrows, ncols, sparse)
    14251426
    14261427    def new_matrix(self, nrows=None, ncols=None, entries=0,
    14271428                   coerce=True, copy=True, sparse=None):
  • sage/matrix/matrix_space.py

    diff -r 4d0709ca2bd5 -r 08c0bc89719d sage/matrix/matrix_space.py
    a b  
    11571157        try:
    11581158            MS = _cache[base,nrows,ncols,sparse]()
    11591159        except KeyError:
     1160            MS = None
     1161        if MS is None:
    11601162            return MatrixSpace(base, nrows, ncols, sparse=sparse)
    1161         if MS is not None:
     1163        else:
    11621164            return MS
    1163         return MatrixSpace(base, nrows, ncols, sparse=sparse)
    11641165
    11651166    def ncols(self):
    11661167        """