Ticket #15277: trac_15277_review.patch

File trac_15277_review.patch, 1.7 KB (added by Frédéric Chapoton, 9 years ago)
  • sage/combinat/root_system/dynkin_diagram.py

    # HG changeset patch
    # User Frederic Chapoton <chapoton at math.univ-lyon1.fr>
    # Date 1381773973 -7200
    # Node ID 72d1e5a29618d4d9ad4aaf6a2702e290394f8fc6
    # Parent  a43f72059db2375f1b525638cea5ddbfee370a53
    trac #15277 review patch : details
    
    diff --git a/sage/combinat/root_system/dynkin_diagram.py b/sage/combinat/root_system/dynkin_diagram.py
    a b AUTHORS: 
    2929#*****************************************************************************
    3030from sage.misc.cachefunc import cached_method
    3131from sage.matrix.matrix import is_Matrix
    32 from sage.functions.generalized import sgn
    3332from sage.graphs.digraph import DiGraph
    3433from sage.combinat.root_system.cartan_type import CartanType, CartanType_abstract
    3534from sage.combinat.root_system.cartan_matrix import CartanMatrix
    def DynkinDiagram(*args, **kwds): 
    184183            try:
    185184                return mat.cartan_type().dynkin_diagram()
    186185            except AttributeError:
     186                ct = CartanType(*args)
    187187                raise ValueError("Dynkin diagram data not yet hardcoded for type %s"%ct)
    188188        if len(args) > 1:
    189189            index_set = tuple(args[1])
    def DynkinDiagram(*args, **kwds): 
    192192        else:
    193193            index_set = mat.index_set()
    194194        D = DynkinDiagram_class(index_set=index_set)
    195         n = mat.nrows()
    196         for (i,j) in mat.nonzero_positions():
     195        for (i, j) in mat.nonzero_positions():
    197196            if i != j:
    198                 D.add_edge(index_set[i], index_set[j], -mat[j,i])
     197                D.add_edge(index_set[i], index_set[j], -mat[j, i])
    199198        return D
    200199    ct = CartanType(*args)
    201200    try: