summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSébastien Labbé <slabqc@gmail.com>2018-04-22 15:53:04 +0200
committerSébastien Labbé <slabqc@gmail.com>2018-05-24 10:12:37 +0200
commitcf7b435c4c403a2d4c22d61df15a57e310bb2ea8 (patch)
tree6d43050318b361f0800ac549b471d35846276457
parent25125: setting ncpus=None as default (diff)
25125: improved sentences before some doctests
-rw-r--r--src/sage/combinat/matrices/dancing_links.pyx22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/sage/combinat/matrices/dancing_links.pyx b/src/sage/combinat/matrices/dancing_links.pyx
index a87f117..d981994 100644
--- a/src/sage/combinat/matrices/dancing_links.pyx
+++ b/src/sage/combinat/matrices/dancing_links.pyx
@@ -506,7 +506,9 @@ cdef class dancing_linksWrapper:
INPUT:
- ``ncpus`` -- integer (default: ``None``), maximal number of
- subprocesses to use at the same time
+ subprocesses to use at the same time. If ``None``, it detects the
+ number of effective CPUs in the system using
+ :func:`sage.parallel.ncpus.ncpus()`.
- ``column`` -- integer (default: ``None``), the column used to split
the problem, if ``None`` a random column is chosen
@@ -522,7 +524,7 @@ cdef class dancing_linksWrapper:
sage: sorted(d.one_solution())
[0, 1]
- Using parallel computations::
+ The number of CPUs can be specified as input::
sage: solutions = [[0,1], [2,3], [4,5]]
sage: sorted(d.one_solution(ncpus=2)) in solutions
@@ -583,7 +585,9 @@ cdef class dancing_linksWrapper:
INPUT:
- ``ncpus`` -- integer (default: ``None``), maximal number of
- subprocesses to use at the same time
+ subprocesses to use at the same time. If ``None``, it detects the
+ number of effective CPUs in the system using
+ :func:`sage.parallel.ncpus.ncpus()`.
- ``column`` -- integer (default: ``None``), the column used to split
the problem, if ``None`` a random column is chosen
@@ -600,7 +604,7 @@ cdef class dancing_linksWrapper:
sage: [sorted(s) for s in S]
[[0, 1], [2, 3], [4, 5]]
- Using parallel computations::
+ The number of CPUs can be specified as input::
sage: S = Subsets(range(4))
sage: rows = map(list, S)
@@ -671,7 +675,9 @@ cdef class dancing_linksWrapper:
INPUT:
- ``ncpus`` -- integer (default: ``None``), maximal number of
- subprocesses to use at the same time
+ subprocesses to use at the same time. If ``None``, it detects the
+ number of effective CPUs in the system using
+ :func:`sage.parallel.ncpus.ncpus()`.
- ``column`` -- integer (default: ``None``), the column used to split
the problem, if ``None`` a random column is chosen
@@ -723,7 +729,9 @@ cdef class dancing_linksWrapper:
- ``ncpus`` -- integer (default: ``None``), maximal number of
subprocesses to use at the same time. If `ncpus>1` the dancing
links problem is split into independent subproblems to allow
- parallel computation.
+ parallel computation. If ``None``, it detects the number of
+ effective CPUs in the system using
+ :func:`sage.parallel.ncpus.ncpus()`.
- ``column`` -- integer (default: ``None``), the column used to split
the problem, if ``None`` a random column is chosen (this argument
is ignored if ``ncpus`` is ``1``)
@@ -743,7 +751,7 @@ cdef class dancing_linksWrapper:
sage: x.number_of_solutions()
2
- ::
+ The number of CPUs can be specified as input::
sage: rows = [[0,1,2], [3,4,5], [0,1], [2,3,4,5], [0], [1,2,3,4,5]]
sage: x = dlx_solver(rows)