Hi Aaron,

Thanks for the hints.

I tried Matrix.det() with methods "berkowitz", "bareis" an "det_LU" 
(docstring 
"lu_decomposition" method is wrong)  and still takes forever. 
"lu_decomposition" takes 1 minute, but still it is too much for a diagonal 
matrix.

I also tried using SparseMatrix.eigenvals() with no improvements:
M=(2-x)*SparseMatrix.eye(100)
M.eigenvals()

I tried with SparseMatrix.det() with different methods and I get the error:
S=(2-x-y)*SparseMatrix.eye(100)
S.det()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/pape/sympy/sympy/matrices/matrices.py", line 2435, in det
    return self.det_bareis()
  File "/home/pape/sympy/sympy/matrices/matrices.py", line 2501, in 
det_bareis
    M[i, j] = cancel(D)
  File "/home/pape/sympy/sympy/matrices/immutable.py", line 64, in 
__setitem__
    raise TypeError("Cannot set values of ImmutableMatrix")
TypeError: Cannot set values of ImmutableMatrix


On Friday, September 20, 2013 9:25:01 PM UTC+2, Pablo Puente wrote:
>
> While writing Wester test P22 I see calculating the eigenvalues of a 
> diagonal matrix of dimension 100 takes forever:
>
>   M=(2-x)*eye(100);
>
>   assert M.eigenvals() == {-x + 2: 100}
>
> I see that M.det() also takes forever.
>
> Maybe Matrix.det()  could use a special implementation for big diagonal 
> matrices?
>
> Best Regards
> Pablo
>

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
Visit this group at http://groups.google.com/group/sympy.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to