[SciPy-user] assign to diagonal values?

william ratcliff william.ratcliff at gmail.com
Thu Jan 31 03:35:19 EST 2008


Just curious--is it safe to use the assert statement for anything beyond
debugging in case someone actually runs with optimization?

Cheers,
William

On Jan 31, 2008 3:00 AM, Mclean Edwards <mcleane at math.ubc.ca> wrote:

>
> To make up for my earlier response, I have coded a small timer routine
> that generates a 1000x1000 uniformly random matrix with values between 0
> and 1 (using cvxopt), then tests the code suggested 10 000 times each
> with randomly generated diagonal vectors.
>
> I have a slow system, but the averaged results are:
>
> 0.8 seconds to run David's striding code (in place modification)
>
> 6 seconds to run Anne's code
>
> 18 seconds to run a for-loop
>
> This is an impressive speed up.
>
> For smaller matrices (100x100) there is still one order of magnitude
> between for-next loops and the suggested setdiag.
>
> Code available upon request (requires cvxopt).
>
> Cheers,
>
> Mclean
> _______________________________________________
> SciPy-user mailing list
> SciPy-user at scipy.org
> http://projects.scipy.org/mailman/listinfo/scipy-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20080131/6a7fd607/attachment.html>


More information about the SciPy-User mailing list