Ticket #10515: trac_10515_matrix_group_list_cs.2.patch

File trac_10515_matrix_group_list_cs.2.patch, 1.2 KB (added by aly.deines, 9 years ago)

added doctests

  • sage/groups/matrix_gps/matrix_group.py

    # HG changeset patch
    # User Alyson Deines <aly.deines@gmail.com>
    # Date 1294622599 28800
    # Node ID bd6abc402bcfcdb397422a46d509095630271e44
    # Parent  fda5405ca19b1e36c6049949c705c9bce7652a30
    Trac 10515: added doctests
    
    diff -r fda5405ca19b -r bd6abc402bcf sage/groups/matrix_gps/matrix_group.py
    a b  
    546546            Matrix group over Integer Ring with 3 generators:
    547547            [[[-1, 0], [0, 1]], [[1, 0], [0, -1]], [[-1, 0], [0, -1]]]
    548548
     549        An example over a field (see trac 10515)::
     550       
     551            sage: gens = [matrix(QQ,2,[1,0,0,1])]
     552            sage: MatrixGroup(gens).list()
     553            [[1 0]
     554            [0 1]]
     555
    549556        ::
    550557       
    551558            sage: GL(2,ZZ).list()
     
    562569            raise ValueError, "group must be finite"
    563570
    564571        MS = self.matrix_space()
    565         if not self.base_ring().is_field():
     572        R = self.base_ring()
     573        if not R.is_field() or not R.is_finite():
    566574            s = self._gap_().Elements().str(use_file=True)
    567575            es = eval(s)
    568576            v = [self.element_class(MS(x), self, check=False) for x in es]