#17979: Reimplementation of IntegerListsLex
-------------------------------------+-------------------------------------
Reporter: aschilling | Owner:
Type: defect | Status: needs_work
Priority: blocker | Milestone: sage-6.6
Component: combinatorics | Resolution:
Keywords: days64 | Merged in:
Authors: Bryan Gillespie, | Reviewers: Nathann Cohen, Jeroen
Anne Schilling, Nicolas M. Thiery | Demeyer, Travis Scrimshaw
Report Upstream: N/A | Work issues:
Branch: | Commit:
public/ticket/17979 | 4b4c54e075e768ba24186583d4ba033419982cba
Dependencies: | Stopgaps:
-------------------------------------+-------------------------------------
Comment (by jdemeyer):
The code in `IntegerListsLex.__init__` could be simplified.
Compare this from #17920:
{{{
if n is not None:
n = integer_or_infinity(n)
min_sum = n
max_sum = n
# Set self.n, which is not used by IntegerLists_polyhedron,
# but by some derived classes
self.n = n
if length is not None:
min_length = length
max_length = length
if min_length < 0:
min_length = 0
self.min_sum = integer_or_infinity(min_sum)
self.max_sum = integer_or_infinity(max_sum)
self.min_length = integer_or_infinity(min_length)
self.max_length = integer_or_infinity(max_length)
self.min_part = integer_or_infinity(min_part)
self.max_part = integer_or_infinity(max_part)
self.min_slope = integer_or_infinity(min_slope)
self.max_slope = integer_or_infinity(max_slope)
}}}
to this from #17979:
{{{
if n is not None:
n = ZZ(n)
self._min_sum = n
self._max_sum = n
else:
self._min_sum = min_sum
self._max_sum = max_sum
if length is not None:
length = ZZ(length)
min_length = length
max_length = length
else:
min_length = ZZ(min_length)
if min_length < 0:
min_length = 0
if max_length != Infinity:
max_length = ZZ(max_length)
self._max_length = max_length
self._min_length = min_length
if min_slope != -Infinity:
min_slope = ZZ(min_slope)
self._min_slope = min_slope
if max_slope != Infinity:
max_slope = ZZ(max_slope)
self._max_slope = max_slope
min_part = ZZ(min_part)
if min_part < 0:
raise NotImplementedError("strictly negative min_part")
if max_part != Infinity:
max_part = ZZ(max_part)
}}}
--
Ticket URL: <http://trac.sagemath.org/ticket/17979#comment:317>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.