Segmentation fault when importing sympy
I have uploaded my terminal saved output.
I was previously working with python 2.6. I updated to 2.7 a few days back.
I was re-installing gmpy for 2.7 when this happened. Sympy no longer imports. I can import gmpy, but importing sympy gives a segmentation fault.
What seems to be the cause of this ?
I know that this is something to do with C. Maybe some problem in Cython. But I don't understand how installing gmpy could cause this.
Waiting for a solution,
Sherjil Ozair
--
You received this message because you are subscribed to the Google Groups "sympy" group.
To post to this group, send email to sympy-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to sympy+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/sympy?hl=en.
Last login: Wed Jun 1 13:57:48 on console
Mac:~ sherjilozair$ cd sympy
Mac:sympy sherjilozair$ open sympy/matrices/DOKMatrix.py
Mac:sympy sherjilozair$ open sympy/matrices/matrices.py
Mac:sympy sherjilozair$ bin/isympy
Leopard libedit detected.
IPython console for SymPy 0.6.7-git (Python 2.7.1) (ground types: python)
These commands were executed:
>>> from __future__ import division
>>> from sympy import *
>>> x, y, z, t = symbols('x y z t')
>>> k, m, n = symbols('k m n', integer=True)
>>> f, g, h = symbols('f g h', cls=Function)
>>> from line_profiler import LineProfiler as LP
Documentation can be found at http://www.sympy.org
In [1]: exit(0
...: y
------------------------------------------------------------
File "<ipython console>", line 2
y
^
SyntaxError: invalid syntax
exit() Do you really want to exit ([y]/n)? y
Exiting ...
Mac:sympy sherjilozair$ bin/isympy
Leopard libedit detected.
IPython console for SymPy 0.6.7-git (Python 2.7.1) (ground types: python)
These commands were executed:
>>> from __future__ import division
>>> from sympy import *
>>> x, y, z, t = symbols('x y z t')
>>> k, m, n = symbols('k m n', integer=True)
>>> f, g, h = symbols('f g h', cls=Function)
>>> from line_profiler import LineProfiler as LP
Documentation can be found at http://www.sympy.org
In [1]: test(10,2)
[[(0, 0), (0, 1)], [(1, 1)], [(2, 2), (2, 3)], [(3, 3), (3, 4)], [(4, 4), (4, 5), (4, 6)], [(5, 5), (5, 6), (5, 7)], [(6, 6), (6, 7)], [(7, 7)], [(8, 8), (8, 9)], []]
[[(0, 0), (0, 1)], [(1, 1)], [(2, 2), (2, 3)], [(3, 3), (3, 4)], [(4, 4), (4, 5), (4, 6)], [(5, 5), (5, 6), (5, 7)], [(6, 6), (6, 7)], [(7, 7)], [(8, 8), (8, 9)], [(9, 9)]]
Out[1]:
⎛⎡1.0 0 0 0 0 0 0 0 0
⎜⎢
⎜⎢1.0 1.0 0 0 0 0 0 0 0
⎜⎢
⎜⎢ 0 0 1.0 0 0 0 0 0 0
⎜⎢
⎜⎢ 0 0 1.0 1.0 0 0 0 0 0
⎜⎢
⎜⎢ 0 0 0 1.0 1.41421356237 0 0 0 0
⎜⎢
⎜⎢ 0 0 0 0 0.707106781187 1.22474487139 0 0 0
⎜⎢
⎜⎢ 0 0 0 0 0.707106781187 1.22474487139 1.0 0 0
⎜⎢
⎜⎢ 0 0 0 0 0 0.816496580928 1.0 0.57735026919 0
⎜⎢
⎜⎢ 0 0 0 0 0 0 0 0 1.0
⎜⎢
⎝⎣ 0 0 0 0 0 0 0 0 1.0
0 ⎤, ⎡24⎤, ⎡ 22.0 ⎤, ⎡ -2.0 ⎤⎞
⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
0 ⎥ ⎢2 ⎥ ⎢ 2.0 ⎥ ⎢ 22.0 ⎥⎟
⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
0 ⎥ ⎢74⎥ ⎢101.113999428062 ⎥ ⎢27.1139994280625 ⎥⎟
⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
0 ⎥ ⎢42⎥ ⎢-27.1139994280625⎥ ⎢ 32.0 ⎥⎟
⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
0 ⎥ ⎢37⎥ ⎢69.1139994280625 ⎥ ⎢33.6279559129498 ⎥⎟
⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
0 ⎥ ⎢15⎥ ⎢-14.677778404966 ⎥ ⎢15.8944438456019 ⎥⎟
⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
0 ⎥ ⎢76⎥ ⎢-71.2243186433545⎥ ⎢-116.329874797753⎥⎟
⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
0 ⎥ ⎢85⎥ ⎢147.224318643355 ⎥ ⎢-83.208674526624 ⎥⎟
⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
0 ⎥ ⎢31⎥ ⎢ -1.0 ⎥ ⎢ -32.0 ⎥⎟
⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
1.0⎦ ⎣32⎦ ⎣ 32.0 ⎦ ⎣ -1.0 ⎦⎠
In [2]:
In [2]: test(10,2)
[[(0, 0), (0, 1), (0, 2)], [(1, 1), (1, 2), (1, 3)], [(2, 2), (2, 3)], [(3, 3), (3, 4)], [(4, 4)], [(5, 5), (5, 6)], [(6, 6)], [(7, 7)], [(8, 8)], []]
[[(0, 0), (0, 1), (0, 2)], [(1, 1), (1, 2), (1, 3)], [(2, 2), (2, 3)], [(3, 3), (3, 4)], [(4, 4)], [(5, 5), (5, 6)], [(6, 6)], [(7, 7)], [(8, 8)], [(9, 9)]]
Out[2]:
⎛⎡1.41421356237 0 0 0 0 0 0 0 0
⎜⎢
⎜⎢0.707106781187 1.22474487139 0 0 0 0 0 0 0
⎜⎢
⎜⎢0.707106781187 1.22474487139 1.0 0 0 0 0 0 0
⎜⎢
⎜⎢ 0 0.816496580928 1.0 1.15470053838 0 0 0 0 0
⎜⎢
⎜⎢ 0 0 0 0.866025403784 0.5 0 0 0 0
⎜⎢
⎜⎢ 0 0 0 0 0 1.0 0 0 0
⎜⎢
⎜⎢ 0 0 0 0 0 1.0 1.0 0 0
⎜⎢
⎜⎢ 0 0 0 0 0 0 0 1.0 0
⎜⎢
⎜⎢ 0 0 0 0 0 0 0 0 1.0
⎜⎢
⎝⎣ 0 0 0 0 0 0 0 0 0
0 ⎤, ⎡26⎤, ⎡-38.2314467095627⎤, ⎡-80.0674304458078⎤⎞
⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
0 ⎥ ⎢58⎥ ⎢-13.5810204797008⎥ ⎢-101.667000403682⎥⎟
⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
0 ⎥ ⎢28⎥ ⎢126.813466520527 ⎥ ⎢55.1464661168451 ⎥⎟
⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
0 ⎥ ⎢21⎥ ⎢-98.8134665205267⎥ ⎢-19.3753532570308⎥⎟
⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
0 ⎥ ⎢78⎥ ⎢ 156.0 ⎥ ⎢-85.5749722427792⎥⎟
⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
0 ⎥ ⎢13⎥ ⎢ -6.0 ⎥ ⎢ -19.0 ⎥⎟
⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
0 ⎥ ⎢19⎥ ⎢ 19.0 ⎥ ⎢ -6.0 ⎥⎟
⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
0 ⎥ ⎢42⎥ ⎢ 42.0 ⎥ ⎢ 0 ⎥⎟
⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
0 ⎥ ⎢84⎥ ⎢ 84.0 ⎥ ⎢ 0 ⎥⎟
⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
1.0⎦ ⎣70⎦ ⎣ 70.0 ⎦ ⎣ 0 ⎦⎠
In [3]: exit()
Do you really want to exit ([y]/n)? y
Exiting ...
Mac:sympy sherjilozair$ bin/isympy
Leopard libedit detected.
IPython console for SymPy 0.6.7-git (Python 2.7.1) (ground types: python)
These commands were executed:
>>> from __future__ import division
>>> from sympy import *
>>> x, y, z, t = symbols('x y z t')
>>> k, m, n = symbols('k m n', integer=True)
>>> f, g, h = symbols('f g h', cls=Function)
>>> from line_profiler import LineProfiler as LP
Documentation can be found at http://www.sympy.org
In [1]: test(10,2)
[[(0, 0), (0, 1)], [(1, 1), (1, 2)], [(2, 2)], [(3, 3)], [(4, 4)], [(5, 5), (5, 6)], [(6, 6), (6, 7), (6, 8)], [(7, 7), (7, 8), (7, 9)], [(8, 8), (8, 9)], []]
[[(0, 0), (0, 1)], [(1, 1), (1, 2)], [(2, 2)], [(3, 3)], [(4, 4)], [(5, 5), (5, 6)], [(6, 6), (6, 7), (6, 8)], [(7, 7), (7, 8), (7, 9)], [(8, 8), (8, 9)], [(9, 9)]]
Out[1]:
⎛⎡1.41421356237 0.707106781187 0 0 0 0 0 0 0 0 ⎤, ⎡21⎤, ⎡57.7012332833643 ⎤, ⎡ 0 ⎤⎞
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
⎜⎢ 0 1.22474487139 0.816496580928 0 0 0 0 0 0 0 ⎥ ⎢11⎥ ⎢-85.7039817568937⎥ ⎢ 0 ⎥⎟
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
⎜⎢ 0 0 0.57735026919 0 0 0 0 0 0 0 ⎥ ⎢82⎥ ⎢142.028166220648 ⎥ ⎢-1.4210854715202e-14⎥⎟
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
⎜⎢ 0 0 0 1.0 0 0 0 0 0 0 ⎥ ⎢93⎥ ⎢ 93.0 ⎥ ⎢ 0 ⎥⎟
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
⎜⎢ 0 0 0 0 1.0 0 0 0 0 0 ⎥ ⎢36⎥ ⎢ 36.0 ⎥ ⎢ 0 ⎥⎟
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
⎜⎢ 0 0 0 0 0 1.0 1.0 0 0 0 ⎥ ⎢60⎥ ⎢-26.1573611671676⎥ ⎢ 0 ⎥⎟
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
⎜⎢ 0 0 0 0 0 0 1.41421356237 0.707106781187 0.707106781187 0 ⎥ ⎢99⎥ ⎢86.1573611671676 ⎥ ⎢ 0 ⎥⎟
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
⎜⎢ 0 0 0 0 0 0 0 1.22474487139 1.22474487139 0.816496580928⎥ ⎢17⎥ ⎢-25.0255473566437⎥ ⎢ 0 ⎥⎟
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
⎜⎢ 0 0 0 0 0 0 0 0 1.0 1.0 ⎥ ⎢62⎥ ⎢-7.28203230275507⎥ ⎢ 0 ⎥⎟
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
⎝⎣ 0 0 0 0 0 0 0 0 0 0.57735026919 ⎦ ⎣40⎦ ⎣69.2820323027551 ⎦ ⎣ 0 ⎦⎠
In [2]: test(10,2)
[[(0, 0), (0, 1)], [(1, 1)], [(2, 2), (2, 3)], [(3, 3), (3, 4)], [(4, 4)], [(5, 5), (5, 6)], [(6, 6), (6, 7), (6, 8)], [(7, 7), (7, 8)], [(8, 8), (8, 9)], []]
[[(0, 0), (0, 1)], [(1, 1)], [(2, 2), (2, 3)], [(3, 3), (3, 4)], [(4, 4)], [(5, 5), (5, 6)], [(6, 6), (6, 7), (6, 8)], [(7, 7), (7, 8)], [(8, 8), (8, 9)], [(9, 9)]]
Out[2]:
⎛⎡1.0 1.0 0 0 0 0 0 0 0 0 ⎤, ⎡51⎤, ⎡ -5.0 ⎤, ⎡ 0 ⎤⎞
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
⎜⎢ 0 1.0 0 0 0 0 0 0 0 0 ⎥ ⎢56⎥ ⎢ 56.0 ⎥ ⎢ 0 ⎥⎟
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
⎜⎢ 0 0 1.0 1.0 0 0 0 0 0 0 ⎥ ⎢59⎥ ⎢102.133513652379 ⎥ ⎢-7.105427357601e-15⎥⎟
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
⎜⎢ 0 0 0 1.41421356237 0.707106781187 0 0 0 0 0 ⎥ ⎢16⎥ ⎢-43.1335136523794⎥ ⎢ 0 ⎥⎟
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
⎜⎢ 0 0 0 0 0.707106781187 0 0 0 0 0 ⎥ ⎢77⎥ ⎢108.894444302728 ⎥ ⎢ 0 ⎥⎟
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
⎜⎢ 0 0 0 0 0 1.41421356237 0.707106781187 0 0 0 ⎥ ⎢93⎥ ⎢70.3847107013467 ⎥ ⎢ 0 ⎥⎟
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
⎜⎢ 0 0 0 0 0 0 1.22474487139 0.816496580928 0.816496580928 0 ⎥ ⎢41⎥ ⎢-9.24756010199555⎥ ⎢ 0 ⎥⎟
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
⎜⎢ 0 0 0 0 0 0 0 0.57735026919 0.57735026919 0 ⎥ ⎢37⎥ ⎢52.0858798800485 ⎥ ⎢-7.105427357601e-15⎥⎟
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
⎜⎢ 0 0 0 0 0 0 0 0 1.0 1.0⎥ ⎢34⎥ ⎢ 12.0 ⎥ ⎢ 0 ⎥⎟
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
⎝⎣ 0 0 0 0 0 0 0 0 0 1.0⎦ ⎣22⎦ ⎣ 22.0 ⎦ ⎣ 0 ⎦⎠
In [3]: test(10,2)
[[(0, 0)], [(1, 1), (1, 2)], [(2, 2), (2, 3)], [(3, 3), (3, 4)], [(4, 4), (4, 5)], [(5, 5), (5, 6)], [(6, 6), (6, 7), (6, 8)], [(7, 7), (7, 8)], [(8, 8), (8, 9)], []]
[[(0, 0)], [(1, 1), (1, 2)], [(2, 2), (2, 3)], [(3, 3), (3, 4)], [(4, 4), (4, 5)], [(5, 5), (5, 6)], [(6, 6), (6, 7), (6, 8)], [(7, 7), (7, 8)], [(8, 8), (8, 9)], [(9, 9)]]
Out[3]:
⎛⎡1.0 0 0 0 0 0 0 0 0 0 ⎤, ⎡3 ⎤, ⎡ 3.0 ⎤, ⎡ 0 ⎤⎞
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
⎜⎢ 0 1.0 1.0 0 0 0 0 0 0 0 ⎥ ⎢80⎥ ⎢110.085347938571 ⎥ ⎢ 0 ⎥⎟
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
⎜⎢ 0 0 1.0 1.0 0 0 0 0 0 0 ⎥ ⎢76⎥ ⎢-30.0853479385711⎥ ⎢ 0 ⎥⎟
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
⎜⎢ 0 0 0 1.0 1.0 0 0 0 0 0 ⎥ ⎢56⎥ ⎢106.085347938571 ⎥ ⎢ 0 ⎥⎟
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
⎜⎢ 0 0 0 0 1.0 1.0 0 0 0 0 ⎥ ⎢55⎥ ⎢-50.0853479385711⎥ ⎢ 0 ⎥⎟
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
⎜⎢ 0 0 0 0 0 1.0 1.0 0 0 0 ⎥ ⎢37⎥ ⎢105.085347938571 ⎥ ⎢ 0 ⎥⎟
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
⎜⎢ 0 0 0 0 0 0 1.41421356237 1.41421356237 0.707106781187 0 ⎥ ⎢44⎥ ⎢-68.0853479385711⎥ ⎢ 0 ⎥⎟
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
⎜⎢ 0 0 0 0 0 0 0 1.0 1.0 0 ⎥ ⎢76⎥ ⎢122.396092621558 ⎥ ⎢ 0 ⎥⎟
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
⎜⎢ 0 0 0 0 0 0 0 0 1.22474487139 0.816496580928⎥ ⎢45⎥ ⎢-46.3960926215585⎥ ⎢-7.105427357601e-15⎥⎟
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
⎝⎣ 0 0 0 0 0 0 0 0 0 0.57735026919 ⎦ ⎣72⎦ ⎣124.707658144959 ⎦ ⎣ 0 ⎦⎠
In [4]: test(10,2)
[[(0, 0), (0, 1)], [(1, 1)], [(2, 2), (2, 3)], [(3, 3), (3, 4)], [(4, 4), (4, 5)], [(5, 5), (5, 6), (5, 7)], [(6, 6), (6, 7), (6, 8)], [(7, 7), (7, 8)], [(8, 8)], []]
[[(0, 0), (0, 1)], [(1, 1)], [(2, 2), (2, 3)], [(3, 3), (3, 4)], [(4, 4), (4, 5)], [(5, 5), (5, 6), (5, 7)], [(6, 6), (6, 7), (6, 8)], [(7, 7), (7, 8)], [(8, 8)], [(9, 9)]]
Out[4]:
⎛⎡1.41421356237 0.707106781187 0 0 0 0 0 0 0 0 ⎤, ⎡19⎤, ⎡-50.9116882454314⎤, ⎡0⎤⎞
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
⎜⎢ 0 0.707106781187 0 0 0 0 0 0 0 0 ⎥ ⎢91⎥ ⎢128.693434175952 ⎥ ⎢0⎥⎟
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
⎜⎢ 0 0 1.0 1.0 0 0 0 0 0 0 ⎥ ⎢84⎥ ⎢14.5474939548301 ⎥ ⎢0⎥⎟
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
⎜⎢ 0 0 0 1.0 1.0 0 0 0 0 0 ⎥ ⎢89⎥ ⎢69.4525060451699 ⎥ ⎢0⎥⎟
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
⎜⎢ 0 0 0 0 1.0 1.0 0 0 0 0 ⎥ ⎢72⎥ ⎢19.5474939548301 ⎥ ⎢0⎥⎟
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
⎜⎢ 0 0 0 0 0 1.41421356237 0.707106781187 0.707106781187 0 0 ⎥ ⎢66⎥ ⎢52.4525060451699 ⎥ ⎢0⎥⎟
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
⎜⎢ 0 0 0 0 0 0 1.22474487139 1.22474487139 0.816496580928 0 ⎥ ⎢82⎥ ⎢31.2125379409681 ⎥ ⎢0⎥⎟
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
⎜⎢ 0 0 0 0 0 0 0 1.0 1.0 0 ⎥ ⎢75⎥ ⎢-42.7794549146836⎥ ⎢0⎥⎟
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
⎜⎢ 0 0 0 0 0 0 0 0 0.57735026919 0 ⎥ ⎢68⎥ ⎢117.779454914684 ⎥ ⎢0⎥⎟
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
⎝⎣ 0 0 0 0 0 0 0 0 0 1.0⎦ ⎣4 ⎦ ⎣ 4.0 ⎦ ⎣0⎦⎠
In [5]: test(10,2)
[[(0, 0), (0, 1)], [(1, 1), (1, 2)], [(2, 2)], [(3, 3), (3, 4), (3, 5)], [(4, 4), (4, 5), (4, 6)], [(5, 5), (5, 6)], [(6, 6), (6, 7)], [(7, 7), (7, 8), (7, 9)], [(8, 8), (8, 9)], []]
[[(0, 0), (0, 1)], [(1, 1), (1, 2)], [(2, 2)], [(3, 3), (3, 4), (3, 5)], [(4, 4), (4, 5), (4, 6)], [(5, 5), (5, 6)], [(6, 6), (6, 7)], [(7, 7), (7, 8), (7, 9)], [(8, 8), (8, 9)], [(9, 9)]]
Out[5]:
⎛⎡1.0 1.0 0 0 0 0 0 0 0 0 ⎤, ⎡16⎤, ⎡32.9705627484771 ⎤, ⎡ 0 ⎤⎞
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
⎜⎢ 0 1.41421356237 0.707106781187 0 0 0 0 0 0 0 ⎥ ⎢14⎥ ⎢-16.9705627484771⎥ ⎢ 0 ⎥⎟
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
⎜⎢ 0 0 0.707106781187 0 0 0 0 0 0 0 ⎥ ⎢38⎥ ⎢53.7401153701776 ⎥ ⎢ 0 ⎥⎟
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
⎜⎢ 0 0 0 1.41421356237 1.41421356237 0.707106781187 0 0 0 0 ⎥ ⎢89⎥ ⎢142.379725676967 ⎥ ⎢1.4210854715202e-14⎥⎟
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
⎜⎢ 0 0 0 0 1.0 1.0 1.0 0 0 0 ⎥ ⎢1 ⎥ ⎢-143.086832458153⎥ ⎢ 0 ⎥⎟
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
⎜⎢ 0 0 0 0 0 0.707106781187 3.14018491737e-16 0 0 0 ⎥ ⎢90⎥ ⎢127.279220613579 ⎥ ⎢ 0 ⎥⎟
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
⎜⎢ 0 0 0 0 0 0 1.0 1.0 0 0 ⎥ ⎢26⎥ ⎢16.8076118445749 ⎥ ⎢ 0 ⎥⎟
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
⎜⎢ 0 0 0 0 0 0 0 1.41421356237 0.707106781187 0.707106781187⎥ ⎢80⎥ ⎢9.19238815542512 ⎥ ⎢ 0 ⎥⎟
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
⎜⎢ 0 0 0 0 0 0 0 0 0.707106781187 0.707106781187⎥ ⎢67⎥ ⎢62.7523086789974 ⎥ ⎢ 0 ⎥⎟
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
⎝⎣ 0 0 0 0 0 0 0 0 0 1.0 ⎦ ⎣32⎦ ⎣ 32.0 ⎦ ⎣ 0 ⎦⎠
In [6]: test(10,2)
[[(0, 0), (0, 1)], [(1, 1), (1, 2)], [(2, 2), (2, 3)], [(3, 3), (3, 4), (3, 5)], [(4, 4), (4, 5)], [(5, 5), (5, 6)], [(6, 6), (6, 7)], [(7, 7)], [(8, 8), (8, 9)], []]
[[(0, 0), (0, 1)], [(1, 1), (1, 2)], [(2, 2), (2, 3)], [(3, 3), (3, 4), (3, 5)], [(4, 4), (4, 5)], [(5, 5), (5, 6)], [(6, 6), (6, 7)], [(7, 7)], [(8, 8), (8, 9)], [(9, 9)]]
Out[6]:
⎛⎡1.0 1.0 0 0 0 0 0 0 0 0 ⎤, ⎡94⎤, ⎡63.9011676327696 ⎤, ⎡ 0 ⎤⎞
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
⎜⎢ 0 1.0 1.0 0 0 0 0 0 0 0 ⎥ ⎢38⎥ ⎢30.0988323672304 ⎥ ⎢ 0 ⎥⎟
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
⎜⎢ 0 0 1.41421356237 0.707106781187 0 0 0 0 0 0 ⎥ ⎢36⎥ ⎢7.90116763276961 ⎥ ⎢ 0 ⎥⎟
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
⎜⎢ 0 0 0 1.22474487139 0.816496580928 0.816496580928 0 0 0 0 ⎥ ⎢43⎥ ⎢35.1093529798922 ⎥ ⎢ 7.105427357601e-15 ⎥⎟
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
⎜⎢ 0 0 0 0 0.57735026919 0.57735026919 0 0 0 0 ⎥ ⎢0 ⎥ ⎢-84.6339766375866⎥ ⎢ 0 ⎥⎟
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
⎜⎢ 0 0 0 0 0 1.41421356237 0.707106781187 0 0 0 ⎥ ⎢91⎥ ⎢84.6339766375866 ⎥ ⎢ 0 ⎥⎟
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
⎜⎢ 0 0 0 0 0 0 1.22474487139 0.816496580928 0 0 ⎥ ⎢79⎥ ⎢-40.5745190992216⎥ ⎢ 0 ⎥⎟
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
⎜⎢ 0 0 0 0 0 0 0 0.57735026919 0 0 ⎥ ⎢91⎥ ⎢157.616623488768 ⎥ ⎢-1.4210854715202e-14⎥⎟
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
⎜⎢ 0 0 0 0 0 0 0 0 1.0 1.0⎥ ⎢89⎥ ⎢ 68.0 ⎥ ⎢ 0 ⎥⎟
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
⎝⎣ 0 0 0 0 0 0 0 0 0 1.0⎦ ⎣21⎦ ⎣ 21.0 ⎦ ⎣ 0 ⎦⎠
In [7]: test(10,2)
[[(0, 0), (0, 1), (0, 2)], [(1, 1), (1, 2)], [(2, 2)], [(3, 3), (3, 4), (3, 5)], [(4, 4), (4, 5)], [(5, 5), (5, 6)], [(6, 6), (6, 7)], [(7, 7), (7, 8)], [(8, 8), (8, 9)], []]
[[(0, 0), (0, 1), (0, 2)], [(1, 1), (1, 2)], [(2, 2)], [(3, 3), (3, 4), (3, 5)], [(4, 4), (4, 5)], [(5, 5), (5, 6)], [(6, 6), (6, 7)], [(7, 7), (7, 8)], [(8, 8), (8, 9)], [(9, 9)]]
Out[7]:
⎛⎡1.41421356237 0.707106781187 0.707106781187 0 0 0 0 0 0 0 ⎤, ⎡47⎤, ⎡9.89949493661167 ⎤, ⎡ 0
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢
⎜⎢ 0 0.707106781187 0.707106781187 0 0 0 0 0 0 0 ⎥ ⎢33⎥ ⎢1.66904755831213 ⎥ ⎢ 0
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢
⎜⎢ 0 0 1.0 0 0 0 0 0 0 0 ⎥ ⎢45⎥ ⎢ 45.0 ⎥ ⎢ 0
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢
⎜⎢ 0 0 0 1.41421356237 1.41421356237 0.707106781187 0 0 0 0 ⎥ ⎢30⎥ ⎢-63.9590351084259⎥ ⎢ 0
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢
⎜⎢ 0 0 0 0 1.0 1.0 0 0 0 0 ⎥ ⎢77⎥ ⎢93.3444770880447 ⎥ ⎢ 0
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢
⎜⎢ 0 0 0 0 0 1.22474487139 0.816496580928 0 0 0 ⎥ ⎢37⎥ ⎢-16.3444770880447⎥ ⎢ 0
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢
⎜⎢ 0 0 0 0 0 0 1.15470053838 0.866025403784 0 0 ⎥ ⎢99⎥ ⎢69.8322758735559 ⎥ ⎢1.42108547152
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢
⎜⎢ 0 0 0 0 0 0 0 1.11803398875 0.894427191 0 ⎥ ⎢59⎥ ⎢21.2056521348048 ⎥ ⎢ 0
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢
⎜⎢ 0 0 0 0 0 0 0 0 1.09544511501 0.912870929175⎥ ⎢79⎥ ⎢39.4569401677378 ⎥ ⎢ 0
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢
⎝⎣ 0 0 0 0 0 0 0 0 0 0.408248290464⎦ ⎣16⎦ ⎣39.1918358845308 ⎦ ⎣ 0
⎤⎞
⎥⎟
⎥⎟
⎥⎟
⎥⎟
⎥⎟
⎥⎟
⎥⎟
⎥⎟
⎥⎟
⎥⎟
⎥⎟
02e-14⎥⎟
⎥⎟
⎥⎟
⎥⎟
⎥⎟
⎥⎟
⎦⎠
In [8]: test(10,2)
[[(0, 0)], [(1, 1)], [(2, 2)], [(3, 3)], [(4, 4)], [(5, 5), (5, 6)], [(6, 6), (6, 7)], [(7, 7)], [(8, 8), (8, 9)], []]
[[(0, 0)], [(1, 1)], [(2, 2)], [(3, 3)], [(4, 4)], [(5, 5), (5, 6)], [(6, 6), (6, 7)], [(7, 7)], [(8, 8), (8, 9)], [(9, 9)]]
Out[8]:
⎛⎡1.0 0 0 0 0 0 0 0 0 0 ⎤, ⎡69⎤, ⎡ 69.0 ⎤, ⎡0⎤⎞
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
⎜⎢ 0 1.0 0 0 0 0 0 0 0 0 ⎥ ⎢42⎥ ⎢ 42.0 ⎥ ⎢0⎥⎟
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
⎜⎢ 0 0 1.0 0 0 0 0 0 0 0 ⎥ ⎢53⎥ ⎢ 53.0 ⎥ ⎢0⎥⎟
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
⎜⎢ 0 0 0 1.0 0 0 0 0 0 0 ⎥ ⎢74⎥ ⎢ 74.0 ⎥ ⎢0⎥⎟
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
⎜⎢ 0 0 0 0 1.0 0 0 0 0 0 ⎥ ⎢72⎥ ⎢ 72.0 ⎥ ⎢0⎥⎟
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
⎜⎢ 0 0 0 0 0 1.0 1.0 0 0 0 ⎥ ⎢93⎥ ⎢78.857864376269 ⎥ ⎢0⎥⎟
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
⎜⎢ 0 0 0 0 0 0 1.41421356237 0.707106781187 0 0 ⎥ ⎢60⎥ ⎢14.142135623731 ⎥ ⎢0⎥⎟
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
⎜⎢ 0 0 0 0 0 0 0 0.707106781187 0 0 ⎥ ⎢40⎥ ⎢56.5685424949238⎥ ⎢0⎥⎟
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
⎜⎢ 0 0 0 0 0 0 0 0 1.0 1.0⎥ ⎢47⎥ ⎢ 41.0 ⎥ ⎢0⎥⎟
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
⎝⎣ 0 0 0 0 0 0 0 0 0 1.0⎦ ⎣6 ⎦ ⎣ 6.0 ⎦ ⎣0⎦⎠
In [9]: test(10,2)
[[(0, 0)], [(1, 1), (1, 2), (1, 3)], [(2, 2), (2, 3)], [(3, 3), (3, 4)], [(4, 4), (4, 5), (4, 6)], [(5, 5), (5, 6)], [(6, 6), (6, 7)], [(7, 7), (7, 8)], [(8, 8), (8, 9)], []]
[[(0, 0)], [(1, 1), (1, 2), (1, 3)], [(2, 2), (2, 3)], [(3, 3), (3, 4)], [(4, 4), (4, 5), (4, 6)], [(5, 5), (5, 6)], [(6, 6), (6, 7)], [(7, 7), (7, 8)], [(8, 8), (8, 9)], [(9, 9)]]
Out[9]:
⎛⎡1.0 0 0 0 0 0 0 0 0 0 ⎤, ⎡55⎤, ⎡ 55.0 ⎤, ⎡ 0 ⎤
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥
⎜⎢ 0 1.41421356237 0.707106781187 0.707106781187 0 0 0 0 0 0 ⎥ ⎢31⎥ ⎢2.12132034355965 ⎥ ⎢ 3.5527136788005e-15 ⎥
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥
⎜⎢ 0 0 0.707106781187 0.707106781187 0 0 0 0 0 0 ⎥ ⎢28⎥ ⎢-25.9821500713158⎥ ⎢ 0 ⎥
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥
⎜⎢ 0 0 0 1.41421356237 0.707106781187 0 0 0 0 0 ⎥ ⎢61⎥ ⎢65.5801298177625 ⎥ ⎢ 0 ⎥
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥
⎜⎢ 0 0 0 0 1.22474487139 0.816496580928 0.816496580928 0 0 0 ⎥ ⎢3 ⎥ ⎢-44.8932323307662⎥ ⎢ 0 ⎥
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥
⎜⎢ 0 0 0 0 0 0.57735026919 0.57735026919 0 0 0 ⎥ ⎢41⎥ ⎢23.5949469498016 ⎥ ⎢ 0 ⎥
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥
⎜⎢ 0 0 0 0 0 0 1.0 1.0 0 0 ⎥ ⎢82⎥ ⎢47.4191361605224 ⎥ ⎢ 0 ⎥
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥
⎜⎢ 0 0 0 0 0 0 0 1.41421356237 0.707106781187 0 ⎥ ⎢84⎥ ⎢34.5808638394776 ⎥ ⎢ 0 ⎥
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥
⎜⎢ 0 0 0 0 0 0 0 0 1.22474487139 0.816496580928⎥ ⎢82⎥ ⎢49.6322115603848 ⎥ ⎢ 0 ⎥
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥
⎝⎣ 0 0 0 0 0 0 0 0 0 0.57735026919 ⎦ ⎣15⎦ ⎣25.9807621135332 ⎦ ⎣-1.77635683940025e-15⎦
⎞
⎟
⎟
⎟
⎟
⎟
⎟
⎟
⎟
⎟
⎟
⎟
⎟
⎟
⎟
⎟
⎟
⎟
⎠
In [10]: test(10,2)
[[(0, 0), (0, 1), (0, 2)], [(1, 1), (1, 2), (1, 3)], [(2, 2), (2, 3)], [(3, 3), (3, 4)], [(4, 4), (4, 5)], [(5, 5), (5, 6), (5, 7)], [(6, 6), (6, 7)], [(7, 7), (7, 8)], [(8, 8), (8, 9)], []]
[[(0, 0), (0, 1), (0, 2)], [(1, 1), (1, 2), (1, 3)], [(2, 2), (2, 3)], [(3, 3), (3, 4)], [(4, 4), (4, 5)], [(5, 5), (5, 6), (5, 7)], [(6, 6), (6, 7)], [(7, 7), (7, 8)], [(8, 8), (8, 9)], [(9, 9)]]
Out[10]:
⎛⎡1.41421356237 1.41421356237 0.707106781187 0 0 0 0 0 0 0 ⎤, ⎡23⎤, ⎡34.7405270082535 ⎤, ⎡3.55271367880
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢
⎜⎢ 0 1.0 1.0 1.0 0 0 0 0 0 0 ⎥ ⎢35⎥ ⎢-34.604606019187 ⎥ ⎢7.10542735760
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢
⎜⎢ 0 0 1.22474487139 0.816496580928 0 0 0 0 0 0 ⎥ ⎢70⎥ ⎢32.2550699564483 ⎥ ⎢ 0
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢
⎜⎢ 0 0 0 1.15470053838 0.866025403784 0 0 0 0 0 ⎥ ⎢14⎥ ⎢37.3495360627387 ⎥ ⎢ 0
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢
⎜⎢ 0 0 0 0 1.11803398875 0.894427191 0 0 0 0 ⎥ ⎢28⎥ ⎢-33.6335738796755⎥ ⎢-7.1054273576
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢
⎜⎢ 0 0 0 0 0 1.09544511501 0.912870929175 0.912870929175 0 0 ⎥ ⎢96⎥ ⎢73.3469190345914 ⎥ ⎢2.84217094304
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢
⎜⎢ 0 0 0 0 0 0 0.408248290464 0.408248290464 0 0 ⎥ ⎢7 ⎥ ⎢-14.7322514569581⎥ ⎢ 0
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢
⎜⎢ 0 0 0 0 0 0 0 1.0 1.0 0 ⎥ ⎢34⎥ ⎢31.8786796564403 ⎥ ⎢ 0
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢
⎜⎢ 0 0 0 0 0 0 0 0 1.41421356237 0.707106781187⎥ ⎢76⎥ ⎢2.12132034355965 ⎥ ⎢ 0
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢
⎝⎣ 0 0 0 0 0 0 0 0 0 0.707106781187⎦ ⎣73⎦ ⎣103.237590053236 ⎦ ⎣ 0
05e-15⎤⎞
⎥⎟
1e-15 ⎥⎟
⎥⎟
⎥⎟
⎥⎟
⎥⎟
⎥⎟
01e-15⎥⎟
⎥⎟
04e-14⎥⎟
⎥⎟
⎥⎟
⎥⎟
⎥⎟
⎥⎟
⎥⎟
⎥⎟
⎦⎠
In [11]: test(10,2)
[[(0, 0), (0, 1), (0, 2)], [(1, 1), (1, 2), (1, 3)], [(2, 2), (2, 3)], [(3, 3), (3, 4)], [(4, 4), (4, 5)], [(5, 5)], [(6, 6), (6, 7), (6, 8)], [(7, 7), (7, 8)], [(8, 8), (8, 9)], []]
[[(0, 0), (0, 1), (0, 2)], [(1, 1), (1, 2), (1, 3)], [(2, 2), (2, 3)], [(3, 3), (3, 4)], [(4, 4), (4, 5)], [(5, 5)], [(6, 6), (6, 7), (6, 8)], [(7, 7), (7, 8)], [(8, 8), (8, 9)], [(9, 9)]]
Out[11]:
⎛⎡1.41421356237 1.41421356237 0.707106781187 0 0 0 0 0 0 0 ⎤, ⎡29⎤, ⎡35.7420981475157 ⎤, ⎡ 0
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢
⎜⎢ 0 1.0 1.0 1.0 0 0 0 0 0 0 ⎥ ⎢57⎥ ⎢-21.9840712452585⎥ ⎢ 0
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢
⎜⎢ 0 0 1.22474487139 0.816496580928 0 0 0 0 0 0 ⎥ ⎢70⎥ ⎢13.4961395043054 ⎥ ⎢ 0
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢
⎜⎢ 0 0 0 1.15470053838 0.866025403784 0 0 0 0 0 ⎥ ⎢64⎥ ⎢65.4879317409531 ⎥ ⎢ 0
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢
⎜⎢ 0 0 0 0 1.11803398875 0.894427191 0 0 0 0 ⎥ ⎢83⎥ ⎢-13.4164078649987⎥ ⎢ 0
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢
⎜⎢ 0 0 0 0 0 0.4472135955 0 0 0 0 ⎥ ⎢49⎥ ⎢ 109.56733089749 ⎥ ⎢ 7.105427357601
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢
⎜⎢ 0 0 0 0 0 0 1.41421356237 1.41421356237 0.707106781187 0 ⎥ ⎢46⎥ ⎢-1.08218726341437⎥ ⎢ 0
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢
⎜⎢ 0 0 0 0 0 0 0 1.0 1.0 0 ⎥ ⎢7 ⎥ ⎢60.2181983959911 ⎥ ⎢ 0
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢
⎜⎢ 0 0 0 0 0 0 0 0 1.22474487139 0.816496580928⎥ ⎢72⎥ ⎢-53.2181983959912⎥ ⎢ 0
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢
⎝⎣ 0 0 0 0 0 0 0 0 0 0.57735026919 ⎦ ⎣97⎦ ⎣168.008928334181 ⎦ ⎣-1.421085471520
⎤⎞
⎥⎟
⎥⎟
⎥⎟
⎥⎟
⎥⎟
⎥⎟
⎥⎟
⎥⎟
⎥⎟
e-15 ⎥⎟
⎥⎟
⎥⎟
⎥⎟
⎥⎟
⎥⎟
⎥⎟
⎥⎟
2e-14⎦⎠
In [12]: test(10,2)
[[(0, 0)], [(1, 1), (1, 2), (1, 3)], [(2, 2), (2, 3)], [(3, 3), (3, 4)], [(4, 4), (4, 5)], [(5, 5)], [(6, 6), (6, 7), (6, 8)], [(7, 7), (7, 8)], [(8, 8)], []]
[[(0, 0)], [(1, 1), (1, 2), (1, 3)], [(2, 2), (2, 3)], [(3, 3), (3, 4)], [(4, 4), (4, 5)], [(5, 5)], [(6, 6), (6, 7), (6, 8)], [(7, 7), (7, 8)], [(8, 8)], [(9, 9)]]
Out[12]:
⎛⎡1.0 0 0 0 0 0 0 0 0 0 ⎤, ⎡14⎤, ⎡ 14.0 ⎤, ⎡0⎤⎞
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
⎜⎢ 0 1.41421356237 0.707106781187 0.707106781187 0 0 0 0 0 0 ⎥ ⎢70⎥ ⎢-7.07106781186547⎥ ⎢0⎥⎟
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
⎜⎢ 0 0 0.707106781187 0.707106781187 0 0 0 0 0 0 ⎥ ⎢80⎥ ⎢90.9530766177731 ⎥ ⎢0⎥⎟
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
⎜⎢ 0 0 0 1.41421356237 0.707106781187 0 0 0 0 0 ⎥ ⎢20⎥ ⎢22.1840083720745 ⎥ ⎢0⎥⎟
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
⎜⎢ 0 0 0 0 1.22474487139 0.816496580928 0 0 0 0 ⎥ ⎢10⎥ ⎢-16.083745496687 ⎥ ⎢0⎥⎟
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
⎜⎢ 0 0 0 0 0 0.57735026919 0 0 0 0 ⎥ ⎢21⎥ ⎢36.3730669589464 ⎥ ⎢0⎥⎟
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
⎜⎢ 0 0 0 0 0 0 1.41421356237 0.707106781187 0.707106781187 0 ⎥ ⎢85⎥ ⎢-7.07106781186546⎥ ⎢0⎥⎟
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
⎜⎢ 0 0 0 0 0 0 0 0.707106781187 0.707106781187 0 ⎥ ⎢95⎥ ⎢ 89.350288425444 ⎥ ⎢0⎥⎟
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
⎜⎢ 0 0 0 0 0 0 0 0 1.0 0 ⎥ ⎢45⎥ ⎢ 45.0 ⎥ ⎢0⎥⎟
⎜⎢ ⎥ ⎢ ⎥ ⎢ ⎥ ⎢ ⎥⎟
⎝⎣ 0 0 0 0 0 0 0 0 0 1.0⎦ ⎣83⎦ ⎣ 83.0 ⎦ ⎣0⎦⎠
In [13]: %timeit sum(i**2 for i in xrange(100))
100000 loops, best of 3: 12.4 us per loop
In [14]: a = [Integer(i) for i in xrange(100)]
In [15]: %timeit sum(i**2 for i in a)
1000 loops, best of 3: 1.43 ms per loop
In [16]: import gmpy
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
/Users/sherjilozair/sympy/<ipython console> in <module>()
ImportError: No module named gmpy
In [17]: exit()
Do you really want to exit ([y]/n)? y
Exiting ...
Mac:sympy sherjilozair$ cd ~/Downloads/gmpy
gmpy/ gmpy-1.14/ gmpy-1.14.zip gmpy-sources-101.zip
Mac:sympy sherjilozair$ cd ~/Downloads/gmpy-1.14
Mac:gmpy-1.14 sherjilozair$ ls
PKG-INFO changes.txt lgpl-2.1.txt mutable_mpz.txt setup.py test win_x64_sdk_build.txt
README doc mac_build.txt setes.py src test3 windows_build.txt
Mac:gmpy-1.14 sherjilozair$ python setup.py install
running install
running build
running build_ext
building 'gmpy' extension
creating build
creating build/temp.macosx-10.6-intel-2.7
creating build/temp.macosx-10.6-intel-2.7/src
gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -O2 -DNDEBUG -g -O3 -I./src -I/usr/local/include -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/gmpy.c -o build/temp.macosx-10.6-intel-2.7/src/gmpy.o
creating build/lib.macosx-10.6-intel-2.7
gcc-4.2 -arch i386 -arch x86_64 -isysroot / -g -bundle -undefined dynamic_lookup -arch i386 -arch x86_64 -isysroot / -g build/temp.macosx-10.6-intel-2.7/src/gmpy.o -L/usr/local/lib -lgmp -o build/lib.macosx-10.6-intel-2.7/gmpy.so
ld: warning: in /usr/local/lib/libgmp.dylib, file is not of required architecture
running install_lib
copying build/lib.macosx-10.6-intel-2.7/gmpy.so -> /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages
running install_egg_info
Writing /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/gmpy-1.14-py2.7.egg-info
Mac:gmpy-1.14 sherjilozair$ cd ~
Mac:~ sherjilozair$ cd sympy
Mac:sympy sherjilozair$ bin/isympy
Segmentation fault
Mac:sympy sherjilozair$ bin/isympy
Segmentation fault
Mac:sympy sherjilozair$ cd ~/Downloads/
Mac:Downloads sherjilozair$ cd gmpy2-2.0.0a1
Mac:gmpy2-2.0.0a1 sherjilozair$ ls
PKG-INFO build.vc10 changes.txt lgpl-2.1.txt setup.py test win_x64_sdk_build.txt
README build.vc9 doc mac_build.txt src test3 windows_build.txt
Mac:gmpy2-2.0.0a1 sherjilozair$ sudo python setup.py install
Password:
running install
running build
running build_ext
building 'gmpy2' extension
creating build
creating build/temp.macosx-10.6-intel-2.7
creating build/temp.macosx-10.6-intel-2.7/src
gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -O2 -DNDEBUG -g -O3 -I./src -I/usr/local/include -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/gmpy2.c -o build/temp.macosx-10.6-intel-2.7/src/gmpy2.o
src/gmpy2.c:313: error: ‘MPFR_RNDN’ undeclared here (not in a function)
src/gmpy2.c: In function ‘Pympf2Pympz’:
src/gmpy2.c:952: error: void value not ignored as it ought to be
src/gmpy2.c: In function ‘Pympf2Pyxmpz’:
src/gmpy2.c:974: error: void value not ignored as it ought to be
src/gmpy2.c: In function ‘Pympf2binary’:
src/gmpy2.c:1782: error: ‘mpfr_exp_t’ undeclared (first use in this function)
src/gmpy2.c:1782: error: (Each undeclared identifier is reported only once
src/gmpy2.c:1782: error: for each function it appears in.)
src/gmpy2.c:1782: error: expected ‘;’ before ‘the_exp’
src/gmpy2.c:1806: error: ‘the_exp’ undeclared (first use in this function)
src/gmpy2.c: In function ‘Pympf_ascii’:
src/gmpy2.c:2197: error: ‘mpfr_exp_t’ undeclared (first use in this function)
src/gmpy2.c:2197: error: expected ‘;’ before ‘the_exp’
src/gmpy2.c:2265: error: ‘the_exp’ undeclared (first use in this function)
In file included from src/gmpy2.c:3391:
src/gmpy_misc.c: In function ‘Pygmpy_set_rounding’:
src/gmpy_misc.c:516: error: ‘MPFR_RNDZ’ undeclared (first use in this function)
src/gmpy_misc.c:518: error: ‘MPFR_RNDU’ undeclared (first use in this function)
src/gmpy_misc.c:520: error: ‘MPFR_RNDD’ undeclared (first use in this function)
src/gmpy_misc.c:522: error: ‘MPFR_RNDA’ undeclared (first use in this function)
In file included from src/gmpy2.c:3397:
src/gmpy_basic.c: In function ‘Pympany_floordiv’:
src/gmpy_basic.c:741: error: ‘MPFR_RNDD’ undeclared (first use in this function)
src/gmpy_basic.c: In function ‘Pympany_rem’:
src/gmpy_basic.c:1346: error: ‘MPFR_RNDD’ undeclared (first use in this function)
src/gmpy_basic.c: In function ‘Pympany_divmod’:
src/gmpy_basic.c:1573: error: ‘MPFR_RNDD’ undeclared (first use in this function)
src/gmpy2.c: In function ‘initgmpy2’:
src/gmpy2.c:4625: error: ‘MPFR_RNDZ’ undeclared (first use in this function)
src/gmpy2.c:4626: error: ‘MPFR_RNDU’ undeclared (first use in this function)
src/gmpy2.c:4627: error: ‘MPFR_RNDD’ undeclared (first use in this function)
src/gmpy2.c:4628: error: ‘MPFR_RNDA’ undeclared (first use in this function)
src/gmpy2.c:313: error: ‘MPFR_RNDN’ undeclared here (not in a function)
src/gmpy2.c: In function ‘Pympf2Pympz’:
src/gmpy2.c:952: error: void value not ignored as it ought to be
src/gmpy2.c: In function ‘Pympf2Pyxmpz’:
src/gmpy2.c:974: error: void value not ignored as it ought to be
src/gmpy2.c: In function ‘Pympf2binary’:
src/gmpy2.c:1782: error: ‘mpfr_exp_t’ undeclared (first use in this function)
src/gmpy2.c:1782: error: (Each undeclared identifier is reported only once
src/gmpy2.c:1782: error: for each function it appears in.)
src/gmpy2.c:1782: error: expected ‘;’ before ‘the_exp’
src/gmpy2.c:1806: error: ‘the_exp’ undeclared (first use in this function)
src/gmpy2.c: In function ‘Pympf_ascii’:
src/gmpy2.c:2197: error: ‘mpfr_exp_t’ undeclared (first use in this function)
src/gmpy2.c:2197: error: expected ‘;’ before ‘the_exp’
src/gmpy2.c:2265: error: ‘the_exp’ undeclared (first use in this function)
In file included from src/gmpy2.c:3391:
src/gmpy_misc.c: In function ‘Pygmpy_set_rounding’:
src/gmpy_misc.c:516: error: ‘MPFR_RNDZ’ undeclared (first use in this function)
src/gmpy_misc.c:518: error: ‘MPFR_RNDU’ undeclared (first use in this function)
src/gmpy_misc.c:520: error: ‘MPFR_RNDD’ undeclared (first use in this function)
src/gmpy_misc.c:522: error: ‘MPFR_RNDA’ undeclared (first use in this function)
In file included from src/gmpy2.c:3397:
src/gmpy_basic.c: In function ‘Pympany_floordiv’:
src/gmpy_basic.c:741: error: ‘MPFR_RNDD’ undeclared (first use in this function)
src/gmpy_basic.c: In function ‘Pympany_rem’:
src/gmpy_basic.c:1346: error: ‘MPFR_RNDD’ undeclared (first use in this function)
src/gmpy_basic.c: In function ‘Pympany_divmod’:
src/gmpy_basic.c:1573: error: ‘MPFR_RNDD’ undeclared (first use in this function)
src/gmpy2.c: In function ‘initgmpy2’:
src/gmpy2.c:4625: error: ‘MPFR_RNDZ’ undeclared (first use in this function)
src/gmpy2.c:4626: error: ‘MPFR_RNDU’ undeclared (first use in this function)
src/gmpy2.c:4627: error: ‘MPFR_RNDD’ undeclared (first use in this function)
src/gmpy2.c:4628: error: ‘MPFR_RNDA’ undeclared (first use in this function)
lipo: can't figure out the architecture type of: /var/tmp//cc3l5W2L.out
error: command 'gcc-4.2' failed with exit status 1
Mac:gmpy2-2.0.0a1 sherjilozair$ sudo python setup.py install
running install
running build
running build_ext
building 'gmpy2' extension
gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -O2 -DNDEBUG -g -O3 -I./src -I/usr/local/include -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/gmpy2.c -o build/temp.macosx-10.6-intel-2.7/src/gmpy2.o
src/gmpy2.c:313: error: ‘MPFR_RNDN’ undeclared here (not in a function)
src/gmpy2.c: In function ‘Pympf2Pympz’:
src/gmpy2.c:952: error: void value not ignored as it ought to be
src/gmpy2.c: In function ‘Pympf2Pyxmpz’:
src/gmpy2.c:974: error: void value not ignored as it ought to be
src/gmpy2.c: In function ‘Pympf2binary’:
src/gmpy2.c:1782: error: ‘mpfr_exp_t’ undeclared (first use in this function)
src/gmpy2.c:1782: error: (Each undeclared identifier is reported only once
src/gmpy2.c:1782: error: for each function it appears in.)
src/gmpy2.c:1782: error: expected ‘;’ before ‘the_exp’
src/gmpy2.c:1806: error: ‘the_exp’ undeclared (first use in this function)
src/gmpy2.c: In function ‘Pympf_ascii’:
src/gmpy2.c:2197: error: ‘mpfr_exp_t’ undeclared (first use in this function)
src/gmpy2.c:2197: error: expected ‘;’ before ‘the_exp’
src/gmpy2.c:2265: error: ‘the_exp’ undeclared (first use in this function)
In file included from src/gmpy2.c:3391:
src/gmpy_misc.c: In function ‘Pygmpy_set_rounding’:
src/gmpy_misc.c:516: error: ‘MPFR_RNDZ’ undeclared (first use in this function)
src/gmpy_misc.c:518: error: ‘MPFR_RNDU’ undeclared (first use in this function)
src/gmpy_misc.c:520: error: ‘MPFR_RNDD’ undeclared (first use in this function)
src/gmpy_misc.c:522: error: ‘MPFR_RNDA’ undeclared (first use in this function)
In file included from src/gmpy2.c:3397:
src/gmpy_basic.c: In function ‘Pympany_floordiv’:
src/gmpy_basic.c:741: error: ‘MPFR_RNDD’ undeclared (first use in this function)
src/gmpy_basic.c: In function ‘Pympany_rem’:
src/gmpy_basic.c:1346: error: ‘MPFR_RNDD’ undeclared (first use in this function)
src/gmpy_basic.c: In function ‘Pympany_divmod’:
src/gmpy_basic.c:1573: error: ‘MPFR_RNDD’ undeclared (first use in this function)
src/gmpy2.c: In function ‘initgmpy2’:
src/gmpy2.c:4625: error: ‘MPFR_RNDZ’ undeclared (first use in this function)
src/gmpy2.c:4626: error: ‘MPFR_RNDU’ undeclared (first use in this function)
src/gmpy2.c:4627: error: ‘MPFR_RNDD’ undeclared (first use in this function)
src/gmpy2.c:4628: error: ‘MPFR_RNDA’ undeclared (first use in this function)
src/gmpy2.c:313: error: ‘MPFR_RNDN’ undeclared here (not in a function)
src/gmpy2.c: In function ‘Pympf2Pympz’:
src/gmpy2.c:952: error: void value not ignored as it ought to be
src/gmpy2.c: In function ‘Pympf2Pyxmpz’:
src/gmpy2.c:974: error: void value not ignored as it ought to be
src/gmpy2.c: In function ‘Pympf2binary’:
src/gmpy2.c:1782: error: ‘mpfr_exp_t’ undeclared (first use in this function)
src/gmpy2.c:1782: error: (Each undeclared identifier is reported only once
src/gmpy2.c:1782: error: for each function it appears in.)
src/gmpy2.c:1782: error: expected ‘;’ before ‘the_exp’
src/gmpy2.c:1806: error: ‘the_exp’ undeclared (first use in this function)
src/gmpy2.c: In function ‘Pympf_ascii’:
src/gmpy2.c:2197: error: ‘mpfr_exp_t’ undeclared (first use in this function)
src/gmpy2.c:2197: error: expected ‘;’ before ‘the_exp’
src/gmpy2.c:2265: error: ‘the_exp’ undeclared (first use in this function)
In file included from src/gmpy2.c:3391:
src/gmpy_misc.c: In function ‘Pygmpy_set_rounding’:
src/gmpy_misc.c:516: error: ‘MPFR_RNDZ’ undeclared (first use in this function)
src/gmpy_misc.c:518: error: ‘MPFR_RNDU’ undeclared (first use in this function)
src/gmpy_misc.c:520: error: ‘MPFR_RNDD’ undeclared (first use in this function)
src/gmpy_misc.c:522: error: ‘MPFR_RNDA’ undeclared (first use in this function)
In file included from src/gmpy2.c:3397:
src/gmpy_basic.c: In function ‘Pympany_floordiv’:
src/gmpy_basic.c:741: error: ‘MPFR_RNDD’ undeclared (first use in this function)
src/gmpy_basic.c: In function ‘Pympany_rem’:
src/gmpy_basic.c:1346: error: ‘MPFR_RNDD’ undeclared (first use in this function)
src/gmpy_basic.c: In function ‘Pympany_divmod’:
src/gmpy_basic.c:1573: error: ‘MPFR_RNDD’ undeclared (first use in this function)
src/gmpy2.c: In function ‘initgmpy2’:
src/gmpy2.c:4625: error: ‘MPFR_RNDZ’ undeclared (first use in this function)
src/gmpy2.c:4626: error: ‘MPFR_RNDU’ undeclared (first use in this function)
src/gmpy2.c:4627: error: ‘MPFR_RNDD’ undeclared (first use in this function)
src/gmpy2.c:4628: error: ‘MPFR_RNDA’ undeclared (first use in this function)
lipo: can't figure out the architecture type of: /var/tmp//ccUN0ax0.out
error: command 'gcc-4.2' failed with exit status 1
Mac:gmpy2-2.0.0a1 sherjilozair$ ~/sympy/bin/isympy
Segmentation fault
Mac:gmpy2-2.0.0a1 sherjilozair$ cd ..
Mac:Downloads sherjilozair$ cd gmpy
gmpy/ gmpy-1.14/ gmpy-1.14 (1).zip gmpy-1.14 2/ gmpy-1.14.zip gmpy-sources-101.zip gmpy2-2.0.0a1/ gmpy2-2.0.0a1.zip
Mac:Downloads sherjilozair$ cd gmpy
gmpy/ gmpy-1.14/ gmpy-1.14 (1).zip gmpy-1.14 2/ gmpy-1.14.zip gmpy-sources-101.zip gmpy2-2.0.0a1/ gmpy2-2.0.0a1.zip
Mac:Downloads sherjilozair$ cd gmpy-1.14
gmpy-1.14/ gmpy-1.14 (1).zip gmpy-1.14 2/ gmpy-1.14.zip
Mac:Downloads sherjilozair$ cd gmpy-1.14
gmpy-1.14/ gmpy-1.14 (1).zip gmpy-1.14 2/ gmpy-1.14.zip
Mac:Downloads sherjilozair$ cd gmpy-1.14
Mac:gmpy-1.14 sherjilozair$ ls
PKG-INFO build doc mac_build.txt setes.py src test3 windows_build.txt
README changes.txt lgpl-2.1.txt mutable_mpz.txt setup.py test win_x64_sdk_build.txt
Mac:gmpy-1.14 sherjilozair$ sudo python setup.py install
running install
running build
running build_ext
running install_lib
running install_egg_info
Removing /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/gmpy-1.14-py2.7.egg-info
Writing /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/gmpy-1.14-py2.7.egg-info
Mac:gmpy-1.14 sherjilozair$ ~/sympy/bin/isympy
Segmentation fault
Mac:gmpy-1.14 sherjilozair$ python
Python 2.7.1 (r271:86882M, Nov 30 2010, 10:35:34)
[GCC 4.2.1 (Apple Inc. build 5664)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import gmpy
>>> gmpy.mpz(123)
mpz(123)
>>> exit()
Mac:gmpy-1.14 sherjilozair$ ipython
Leopard libedit detected.
Python 2.7.1 (r271:86882M, Nov 30 2010, 10:35:34)
Type "copyright", "credits" or "license" for more information.
IPython 0.10.2 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object'. ?object also works, ?? prints more.
In [1]: exit()
Do you really want to exit ([y]/n)? y
Mac:gmpy-1.14 sherjilozair$ python
Python 2.7.1 (r271:86882M, Nov 30 2010, 10:35:34)
[GCC 4.2.1 (Apple Inc. build 5664)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from sympy import *
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named sympy
>>> exit()
Mac:gmpy-1.14 sherjilozair$ cd ~/sympy
Mac:sympy sherjilozair$ python
Python 2.7.1 (r271:86882M, Nov 30 2010, 10:35:34)
[GCC 4.2.1 (Apple Inc. build 5664)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from sympy import *
Segmentation fault
Mac:sympy sherjilozair$
Mac:sympy sherjilozair$
Mac:sympy sherjilozair$
Mac:sympy sherjilozair$ python
Python 2.7.1 (r271:86882M, Nov 30 2010, 10:35:34)
[GCC 4.2.1 (Apple Inc. build 5664)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from sympy.matrices import Matrix
Segmentation fault
Mac:sympy sherjilozair$ python