Yes, it should work. Here is a simple example:
from mpmath import mp, iv
A = iv.matrix(3,3)
for i in range(3):
for j in range(3):
value = mp.rand()
error = mp.rand() * 1e-5
A[i,j] = iv.mpf([value-error, value+error])
B = iv.inverse(A)
>>> print iv.norm(A * B - iv.eye(3))
[0.0, 0.0018296896896417072509]
Fredrik
from mpmath import iv
#
# Symmetric interval matrix
#
A = iv.matrix(3,3)
A[0,0] = iv.mpf([1.-0.2,1.+0.2])
A[0,1] = iv.mpf([4.-0.2,4.+0.2])
A[0,2] = iv.mpf([5.-0.2,5.+0.2])
A[1,0] = iv.mpf([4.-0.2,4.+0.2])
A[1,1] = iv.mpf([2.-0.2,2.+0.2])
A[1,2] = iv.mpf([6.-0.2,6.+0.2])
A[2,0] = iv.mpf([5.-0.2,5.+0.2])
A[2,1] = iv.mpf([6.-0.2,6.+0.2])
A[2,2] = iv.mpf([3.-0.2,3.+0.2])
print A
#
# Inverse of a symmetric interval matrix should be symmetric as well
#
inv_A = iv.inverse(A)
print inv_A
> --
> You received this message because you are subscribed to the Google Groups
> "mpmath" group.
> To post to this group, send email to mpm...@googlegroups.com.
> To unsubscribe from this group, send email to
> mpmath+un...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/mpmath?hl=en.
>
>
Not usually. If the input matrix contains large errors, the computed
inverse will have even larger errors, and the symmetricity is likely
to be lost in the process. Interval arithmetic is not really good at
*tightly* preserving error bounds across complex calculations (such as
matrix computations), especially if there is an implied dependency
between multiple variables. For example when setting
A[0,1] = iv.mpf([4.-0.2,4.+0.2])
A[1,0] = iv.mpf([4.-0.2,4.+0.2])
the matrix actually "contains" a matrix where one entry is 3.8 and the
other is 4.2, which is not particularly symmetric. The intervals in
the output cannot be expected to be symmetric even if the input
intervals are, since the order of operations strongly affects the way
errors propagate.
That said, there are probably more sophisticated algorithms for
inverting an interval matrix than the simple LU decomposition used in
mpmath, that might work better in some cases.
Fredrik