Skip to content

Commit

Permalink
undo wrong changes
Browse files Browse the repository at this point in the history
  • Loading branch information
fchapoton committed Jan 20, 2025
1 parent a92cb5d commit f6311ca
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
12 changes: 7 additions & 5 deletions src/sage/combinat/parallelogram_polyomino.py
Original file line number Diff line number Diff line change
Expand Up @@ -2174,7 +2174,7 @@ def height(self):
return 0
return self.lower_heights()[-1]

def cell_is_inside(self, w, h) -> bool:
def cell_is_inside(self, w, h):
r"""
Determine whether the cell at a given position
is inside the parallelogram polyomino.
Expand All @@ -2187,8 +2187,8 @@ def cell_is_inside(self, w, h) -> bool:
OUTPUT:
Return ``False`` if there is no cell at the given position,
return ``True`` if there is a cell.
Return 0 if there is no cell at the given position,
return 1 if there is a cell.
EXAMPLES::
Expand Down Expand Up @@ -2217,8 +2217,10 @@ def cell_is_inside(self, w, h) -> bool:
widths = self.widths()

if h >= len(widths) or h < 0:
return False
return lower_widths[h] <= w < lower_widths[h] + widths[h]
return 0
if lower_widths[h] <= w and w < lower_widths[h] + widths[h]:
return 1
return 0

@cached_method
def get_array(self):
Expand Down
7 changes: 4 additions & 3 deletions src/sage/combinat/sloane_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -8083,10 +8083,11 @@ def perm_mh(m, h):
- Jaap Spies (2006)
"""
n = m + h
A = MatrixSpace(ZZ, m, n).zero()
M = MatrixSpace(ZZ, m, n)
A = M(0)
for i in range(m):
for j in range(i, n):
if j <= i + h:
for j in range(n):
if i <= j and j <= i + h:
A[i, j] = 1
return A.permanent()

Expand Down

0 comments on commit f6311ca

Please sign in to comment.