-
-
Notifications
You must be signed in to change notification settings - Fork 482
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gh-36359: a few details in combinat (designs)
Cleaning up a few files in combinat/designs, in particular about missing empty lines. ### 📝 Checklist - [x] The title is concise, informative, and self-explanatory. - [x] The description explains in detail what this PR is about. URL: #36359 Reported by: Frédéric Chapoton Reviewer(s): David Coudert, Frédéric Chapoton
- Loading branch information
Showing
5 changed files
with
64 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
""" | ||
Dancing links C++ wrapper | ||
""" | ||
#***************************************************************************** | ||
# **************************************************************************** | ||
# Copyright (C) 2008 Carlo Hamalainen <[email protected]>, | ||
# | ||
# Distributed under the terms of the GNU General Public License (GPL) | ||
|
@@ -13,14 +13,15 @@ | |
# | ||
# The full text of the GPL is available at: | ||
# | ||
# http://www.gnu.org/licenses/ | ||
#***************************************************************************** | ||
# https://www.gnu.org/licenses/ | ||
# **************************************************************************** | ||
|
||
# OneExactCover and AllExactCovers are almost exact copies of the | ||
# functions with the same name in sage/combinat/dlx.py by Tom Boothby. | ||
|
||
from .dancing_links import dlx_solver | ||
|
||
|
||
def DLXCPP(rows): | ||
""" | ||
Solves the Exact Cover problem by using the Dancing Links algorithm | ||
|
@@ -85,6 +86,7 @@ def DLXCPP(rows): | |
while x.search(): | ||
yield x.get_solution() | ||
|
||
|
||
def AllExactCovers(M): | ||
""" | ||
Solves the exact cover problem on the matrix M (treated as a dense | ||
|
@@ -112,6 +114,7 @@ def AllExactCovers(M): | |
for s in DLXCPP(rows): | ||
yield [M.row(i) for i in s] | ||
|
||
|
||
def OneExactCover(M): | ||
""" | ||
Solves the exact cover problem on the matrix M (treated as a dense | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters