thegooglecodearchive / mpmath

Automatically exported from code.google.com/p/mpmath
Other
0 stars 0 forks source link

left scalar multiplication of an interval matrix fails #240

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Define an interval matrix
>>> A = iv.matrix([[1,2],[3,4]])
2. Left multiply the matrix by a scalar interval
>>> iv.mpf(2)*A

What is the expected output? What do you see instead?
It should give the double of the matrix, but instead it fails and prints the 
following stack trace:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/site-packages/mpmath/ctx_iv.py", line 230, in lop_real
    if not isinstance(t, ctx._types): t = ctx.convert(t)
  File "/usr/lib/python2.7/site-packages/mpmath/ctx_iv.py", line 415, in convert
    assert mpf_le(a, b), "endpoints must be properly ordered"
  File "/usr/lib/python2.7/site-packages/mpmath/libmp/libmpf.py", line 608, in mpf_le
    return mpf_cmp(s, t) <= 0
  File "/usr/lib/python2.7/site-packages/mpmath/libmp/libmpf.py", line 555, in mpf_cmp
    ssign, sman, sexp, sbc = s
TypeError: 'NoneType' object is not iterable

What version of the product are you using? On what operating system?
Fedora 18, python 2.7.3, mpmath 0.17

Please provide any additional information below.

Original issue reported on code.google.com by talc...@gmail.com on 20 Jun 2013 at 5:32

GoogleCodeExporter commented 9 years ago
I forgot to mention, right scalar multiplication works strangely enough.

Original comment by talc...@gmail.com on 20 Jun 2013 at 5:33