Ticket #10987: trac-10987-decomposition_of_subspaces.patch

File trac-10987-decomposition_of_subspaces.patch, 1.8 KB (added by mraum, 10 years ago)
  • sage/matrix/matrix2.pyx

    # HG changeset patch
    # User Martin Raum <Martin.Raum@matha.rwth-aachen.de>
    # Date 1300825718 -3600
    # Node ID 44f123a2177ef7cfb71910c1410b5cbe90264254
    # Parent  14d5de3ffc211021f81b0a4416b2a3a426718a0c
    #10987: Add optional argument to decomposition_of_subspace making restrict not check the subspace
    
    diff -r 14d5de3ffc21 -r 44f123a2177e sage/matrix/matrix2.pyx
    a b  
    31963196            return E, Edual
    31973197        return E
    31983198
    3199     def decomposition_of_subspace(self, M, **kwds):
     3199    def decomposition_of_subspace(self, M, check_restrict = True, **kwds):
    32003200        """
    32013201        Suppose the right action of self on M leaves M invariant. Return
    32023202        the decomposition of M as a list of pairs (W, is_irred) where
     
    32053205       
    32063206        Additional inputs besides M are passed onto the decomposition
    32073207        command.
     3208
     3209        INPUT:
     3210
     3211            - ``check_restrict`` -- A boolean (default: ``True``); Call restrict
     3212                                    with or withour check.
    32083213       
    32093214        EXAMPLES::
    32103215       
     
    32493254            [ 0  0  0  1  0  0]
    32503255            [ 0  0  0  0  0  1], False)
    32513256            ]
     3257
     3258        TESTS::
     3259
     3260            sage: t = matrix(QQ, 3, [3, 0, -2, 0, -2, 0, 0, 0, 0]);
     3261            sage: t.decomposition_of_subspace(v, check_restrict = False) == t.decomposition_of_subspace(v)
     3262            True
    32523263        """
    32533264        if not sage.modules.free_module.is_FreeModule(M):
    32543265            raise TypeError, "M must be a free module."
     
    32643275        time = verbose(t=0)
    32653276
    32663277        # 1. Restrict
    3267         B = self.restrict(M)
     3278        B = self.restrict(M, check = check_restrict)
    32683279        time0 = verbose("decompose restriction -- ", time)
    32693280
    32703281        # 2. Decompose restriction