|
28 | 28 |
|
29 | 29 | from sage.misc.cachefunc import cached_method
|
30 | 30 | from sage.matrix.constructor import matrix
|
| 31 | +from sage.misc.lazy_import import lazy_import |
31 | 32 | from sage.structure.element import is_Matrix
|
32 | 33 | from sage.matrix.matrix_space import MatrixSpace
|
33 | 34 | from sage.misc.inherit_comparison import InheritComparisonClasscallMetaclass
|
34 | 35 | from sage.misc.classcall_metaclass import typecall
|
35 | 36 | from sage.combinat.subset import powerset
|
36 |
| -from sage.matrix.matrix_integer_sparse import Matrix_integer_sparse |
37 | 37 | from sage.rings.integer_ring import ZZ
|
38 | 38 | from sage.combinat.root_system.cartan_type import CartanType, CartanType_abstract
|
39 | 39 | from sage.combinat.root_system.root_system import RootSystem
|
40 | 40 | from sage.sets.family import Family
|
41 |
| -from sage.graphs.digraph import DiGraph |
42 | 41 |
|
| 42 | +lazy_import('sage.graphs.digraph', 'DiGraph') |
| 43 | +lazy_import('sage.combinat.root_system.dynkin_diagram', 'DynkinDiagram_class') |
43 | 44 |
|
44 |
| -class CartanMatrix(Matrix_integer_sparse, CartanType_abstract, |
45 |
| - metaclass=InheritComparisonClasscallMetaclass): |
| 45 | + |
| 46 | +try: |
| 47 | + from sage.matrix.matrix_integer_sparse import Matrix_integer_sparse as Base |
| 48 | +except ImportError: |
| 49 | + from sage.matrix.matrix_generic_sparse import Matrix_generic_sparse as Base |
| 50 | + |
| 51 | + |
| 52 | +class CartanMatrix(Base, CartanType_abstract, |
| 53 | + metaclass=InheritComparisonClasscallMetaclass): |
46 | 54 | r"""
|
47 | 55 | A (generalized) Cartan matrix.
|
48 | 56 |
|
@@ -274,7 +282,6 @@ def __classcall_private__(cls, data=None, index_set=None,
|
274 | 282 | dynkin_diagram = None
|
275 | 283 | subdivisions = None
|
276 | 284 |
|
277 |
| - from sage.combinat.root_system.dynkin_diagram import DynkinDiagram_class |
278 | 285 | if isinstance(data, DynkinDiagram_class):
|
279 | 286 | dynkin_diagram = data
|
280 | 287 | cartan_type = data._cartan_type
|
|
0 commit comments