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

Commit

Permalink
added example
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Kliem committed May 11, 2020
1 parent 61da5b6 commit b05df00
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/doc/en/reference/references/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3246,6 +3246,9 @@ REFERENCES:
.. [KP2011] Manuel Kauers and Peter Paule. The Concrete Tetrahedron.
Springer-Verlag, 2011.
.. [KP2020] Lars Kastner and Marta Panizzut, *Hyperplane arrangements
in polymake*, arxiv:`2003.13548`.
.. [KP2002b] James Kuzmanovich; Andrey Pavlichenkov, *Finite
Groups of Matrices Whose Entries Are Integers*, The American
Mathematical Monthly, Vol. 109, No. 2. (2002) pp. 173-186
Expand Down
25 changes: 25 additions & 0 deletions src/sage/geometry/hyperplane_arrangement/arrangement.py
Original file line number Diff line number Diff line change
Expand Up @@ -1601,6 +1601,31 @@ def regions(self):
sage: chessboard = H(chessboard)
sage: len(chessboard.bounded_regions()) # long time, 359 ms on a Core i7
64
Example 6 of [KP2020]::
sage: from itertools import product
sage: def zero_one(d):
....: for x in product([0,1], repeat=d):
....: if any(y for y in x):
....: yield [0] + list(x)
....:
sage: K.<x,y> = HyperplaneArrangements(QQ)
sage: A = K(*zero_one(2))
sage: len(A.regions())
6
sage: K.<x,y,z> = HyperplaneArrangements(QQ)
sage: A = K(*zero_one(3))
sage: len(A.regions())
32
sage: K.<x,y,z,w> = HyperplaneArrangements(QQ)
sage: A = K(*zero_one(4))
sage: len(A.regions())
370
sage: K.<x,y,z,w,r> = HyperplaneArrangements(QQ)
sage: A = K(*zero_one(5))
sage: len(A.regions()) # not tested (~25s)
11292
"""
if self.base_ring().characteristic() != 0:
raise ValueError('base field must have characteristic zero')
Expand Down

0 comments on commit b05df00

Please sign in to comment.