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

Commit

Permalink
a few more fixes for various doctests
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Kliem committed Jul 12, 2021
1 parent 531f859 commit f975a60
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/sage/graphs/base/dense_graph.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,10 @@ def _test_adjacency_sequence_out():
high = 500
randg = DiGraph(GraphGenerators().RandomGNP(randint(low, high), random()))
n = randg.order()
while n <= 1:
randg = DiGraph(GraphGenerators().RandomGNP(randint(low, high), random()))
n = randg.order()

cdef DenseGraph g = DenseGraph(n,
verts=randg.vertex_iterator(),
arcs=randg.edge_iterator(labels=False))
Expand Down
2 changes: 2 additions & 0 deletions src/sage/graphs/digraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -1576,6 +1576,8 @@ def feedback_edge_set(self, constraint_generation=True, value_only=False, solver
`vu` is in the returned feedback arc set::
sage: g = graphs.RandomGNP(5,.3)
sage: while not g.num_edges():
....: g = graphs.RandomGNP(5,.3)
sage: dg = DiGraph(g)
sage: feedback = dg.feedback_edge_set()
sage: u,v,l = next(g.edge_iterator())
Expand Down
9 changes: 7 additions & 2 deletions src/sage/rings/number_field/number_field_ideal.py
Original file line number Diff line number Diff line change
Expand Up @@ -2196,8 +2196,13 @@ def invertible_residues(self, reduce=True):
Check that the integrality is not lost, cf. :trac:`30801`::
sage: K.<a> = NumberField(x^2 + x + 1)
sage: list(K.ideal(8).invertible_residues())[:5]
[1, a - 1, -3*a, -2*a + 3, -a - 1]
sage: for k in K.ideal(8).invertible_residues():
....: assert k.is_unit() and k.is_integral()
sage: some_residues = list(K.ideal(8).invertible_residues())[:5]
sage: one = [1, a - 1, -3*a, -2*a + 3, -a - 1]
sage: other = [1, a + 2, 3*a + 3, -2*a + 3, a]
sage: some_residues in (one, other)
True
AUTHOR: John Cremona
"""
Expand Down

0 comments on commit f975a60

Please sign in to comment.