# Ticket #14685: trac_14685-darijs_mod.patch

File trac_14685-darijs_mod.patch, 1.9 KB (added by darij, 7 years ago)

Alternative version of the patch, which applies on my system

• ## sage/combinat/species/series.py

```# HG changeset patch
# User Matthieu Dien <matthieu.dien@gmail.com>
# Date 1370708355 -7200
# Node ID 58c07f33b3989be386d38e7af538e72b4aacb46f
# Parent  06515d305ef1954ac5f7fcd2e5b6a9a2dcd469c3
#14685: error in the computing of the approximate order in LazyPowerSeries

diff --git a/sage/combinat/species/series.py b/sage/combinat/species/series.py```
 a class LazyPowerSeries(AlgebraElement): sage: a.refine_aorder() sage: a.aorder 2 :: sage: L = LazyPowerSeriesRing(QQ) sage: a = L([0,0,0,0,1]) sage: a.aorder 0 sage: a.coefficient(4) 1 sage: a.aorder 0 sage: a.order Unknown series order sage: a.refine_aorder() sage: a.aorder 4 sage: a.order 4 """ #If we already know the order, then we don't have #to worry about the approximate order class LazyPowerSeries(AlgebraElement): c = self._stream n = c.number_computed() while ao < n: if self._stream[ao] == 0: self.aorder += 1 ao += 1 else: self.order = ao break if ao == 0 and n > 0: while ao < n: if self._stream[ao] == 0: self.aorder += 1 ao += 1 else: break #Try to recognize the zero series if ao == n: if ao == n and n > 0: #For non-constant series, we cannot do anything if not c.is_constant(): return