Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Trac #17220: Fix import of ComplexBallField, add doctest
Browse files Browse the repository at this point in the history
  • Loading branch information
cheuberg committed Nov 28, 2015
1 parent db6bde9 commit 2190aa4
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/sage/matrix/matrix_space.py
Original file line number Diff line number Diff line change
Expand Up @@ -986,6 +986,8 @@ def _get_matrix_class(self):
<type 'sage.matrix.matrix_modn_dense_float.Matrix_modn_dense_float'>
sage: type(matrix(GF(16007), 2, range(4)))
<type 'sage.matrix.matrix_modn_dense_double.Matrix_modn_dense_double'>
sage: type(matrix(CBF, 2, range(4)))
<type 'sage.matrix.matrix_complex_ball_dense.Matrix_complex_ball_dense'>
"""
R = self.base_ring()
if self.is_dense():
Expand Down Expand Up @@ -1025,13 +1027,13 @@ def _get_matrix_class(self):
if R is SR:
import matrix_symbolic_dense
return matrix_symbolic_dense.Matrix_symbolic_dense
try:
from sage.rings.complex_ball_acb import ComplexBallField
if isinstance(R, ComplexBallField):
import matrix_complex_ball_dense
return matrix_complex_ball_dense.Matrix_complex_ball_dense
except ImportError:
pass

# ComplexBallField might become a lazy import,
# thus do not import it here too early.
from sage.rings.complex_arb import ComplexBallField
if isinstance(R, ComplexBallField):
import matrix_complex_ball_dense
return matrix_complex_ball_dense.Matrix_complex_ball_dense
return matrix_generic_dense.Matrix_generic_dense

else:
Expand Down

0 comments on commit 2190aa4

Please sign in to comment.