Ticket #174: trac-174-part3.patch

File trac-174-part3.patch, 1.8 KB (added by was, 14 years ago)
  • sage/matrix/matrix_integer_dense.pyx

    # HG changeset patch
    # User William Stein <wstein@gmail.com>
    # Date 1202486838 28800
    # Node ID f6be5f024f726d678a1c133a34f9872ddfae127a
    # Parent  32d885f93e2cd6351f1baa01b620350a5bc62017
    Add det bound option to NTL hnf algorithm.
    
    diff -r 32d885f93e2c -r f6be5f024f72 sage/matrix/matrix_integer_dense.pyx
    a b cdef class Matrix_integer_dense(matrix_d 
    10111011    def _echelon_strassen(self):
    10121012        raise NotImplementedError
    10131013
    1014     def echelon_form(self, algorithm="default", cutoff=0, include_zero_rows=True):
     1014    def echelon_form(self, algorithm="default", cutoff=0, include_zero_rows=True, D=None):
    10151015        r"""
    10161016        Return the echelon form of this matrix over the integers also
    10171017        known as the hermit normal form (HNF).
    cdef class Matrix_integer_dense(matrix_d 
    10231023            cutoff -- ignored currently
    10241024            include_zero_rows -- (default: True)
    10251025                                 if False, don't include zero rows
     1026            D -- (default: None)  if given and the algorithm is 'ntl', then D
     1027                   must be a multiple of the determinant and this function
     1028                   will use that fact.
    10261029
    10271030        EXAMPLES:
    10281031            sage: A = MatrixSpace(ZZ,2)([1,2,3,4])
    cdef class Matrix_integer_dense(matrix_d 
    11311134                    v[i,j] = self.get_unsafe(nr-i-1,nc-j-1)
    11321135
    11331136            try:
    1134                 w = v.HNF()
     1137                w = v.HNF(D=D)
    11351138            except RuntimeError: # HNF may fail if a nxm matrix has rank < m
    11361139                return self.echelon_form(algorithm='pari',
    11371140                                         include_zero_rows=include_zero_rows,