@@ -0,0 +1,1237 @@
+#!/usr/bin/env python%0A%0A%22%22%22%0ATest and compare pure Python and Cython implementations of%0Athe Bjork-Pereyra Algorithm.%0A%22%22%22%0A%0Afrom numpy import fliplr, vander, abs, arange, array%0Afrom scipy.special import chebyt%0A%0Afrom time import time%0Aimport sys%0A%0Aimport bionet.ted.bpa_python as bpa_python%0Aif sys.platform == 'linux2': %0A    import bionet.ted.bpa_cython_linux2 as bpa_cython%0Aelif sys.platform == 'darwin':%0A    import bionet.ted.bpa_cython_darwin as bpa_cython%0Aelse:%0A    raise RuntimeError('cannot import binary BPA module')%0A%0A# Try to find the coefficients of a Chebyshev polynomial by solving%0A# a Vandermonde system. This test case should exhibit good accuracy for%0A# N less than about 13:%0AN = 12%0Ai = arange(N)%0Aa = 1.0/(i+2)%0AT = chebyt(N-1)%0Af = T(a)%0AV = fliplr(vander(a))%0Ac = array(T)%5B::-1%5D%0A%0Astart = time()%0Ac_solve = bpa_python.bpa(V, f)%0Aend = time()%0A%0Aprint 'Python implementation results:'%0Aprint 'original c = ', c%0Aprint 'solved c   = ', c_solve%0Aprint 'error      = ', abs(c-c_solve)%0Aprint 'time       = ', end-start%0A%0Astart = time()%0Ac_solve = bpa_cython.bpa(V, f)%0Aend = time()%0A%0Aprint 'Cython implementation results:'%0Aprint 'original c = ', c%0Aprint 'solved c   = ', c_solve%0Aprint 'error      = ', abs(c-c_solve)%0Aprint 'time       = ', end-start%0A

Add BPA demo.