On 10/29/07, Jaap Spies <[EMAIL PROTECTED]> wrote:
> > Now, instead if the code working like it used to, there will be an overflow,
> > and one will get total nonsense.
> >
>
> In your example the permanent is just the product of the entries.
>
> You deserve to get total nonsense when you try to calculate the permanent
> of matrices of that size! In practice you know that m and n are small ints.
>
> The permanent is a really hard problem. For example the calculation of a 40 x 
> 40
> (0,1)-matrix with the implemented Ryser algorithm will take forever. Let alone
> a general matrix of that size! This best known Ryser algorithm is of time 
> O(n^2*2^n).
> The best we can hope is doing better for certain types of (0,1) matrices.

I am of course well aware of the fact that it would be impractical to
compute permanents of large matrices.  But still, writing code that
overflows and gives nonsense on "impractical input" is bad coding
style.  Especially because such code my give nonsense quite quickly.
This is almost exactly the same situation in spirit as the situation
that leads to people writing insecure code that leads to buffer overflows,
because they don't bother doing proper error checking, since "nobody
would give input like that...".

 -- William

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~----------~----~----~----~------~----~------~--~---

Reply via email to