-
-
Notifications
You must be signed in to change notification settings - Fork 674
Closed
Description
This patch adds a new implementation for construction of Christoffel words using continued fraction :
sage: %timeit words.ChristoffelWord(5, 9, algorithm='linear')
625 loops, best of 3: 67.7 µs per loop
sage: %timeit words.ChristoffelWord(5, 9, algorithm='cf')
625 loops, best of 3: 309 µs per loop
For large words, it is much faster than the actual implementation.
sage: %timeit words.ChristoffelWord(500, 90001, algorithm='linear')
5 loops, best of 3: 111 ms per loop
sage: %timeit words.ChristoffelWord(500, 90001, algorithm='cf')
125 loops, best of 3: 4 ms per loop
CC: @sagetrac-abmasse
Component: combinatorics
Keywords: christoffel words
Author: Sébastien Labbé
Reviewer: Alexandre Blondin Massé
Merged: sage-4.3.4.alpha0
Issue created by migration from https://trac.sagemath.org/ticket/8268