Re: [sage-support] Re: sage graph -- why is c_graph so slow??

2011-12-25 Thread Nathann Cohen
Hell ! Thanks for looking into this. I believe that I stayed within Sage's library when I wrote my test code. You did ! My mistake ! But you actually call strongly_connected_components_digraph instead of strongly_connected_components, which mean the function is spending most of its

Re: [sage-support] Re: sage graph -- why is c_graph so slow??

2011-12-25 Thread Nathann Cohen
Oh yes, and something else about your benchmark : try to avoid using rand methods when you are doing one, especially when you test such low-level methods, because often the rand() method represents an important part of the time. The best would be to compute all the random number you need in a

[sage-support] Re: sage graph -- why is c_graph so slow??

2011-12-25 Thread entropy
Hi Nathann, Thank you for the timely updates! I agree with you about the calls to random. I can move those out of the timing portion. I suspected that the passage to the backend was probably responsible for the slow speed of the add/remove edge/vertices calls. The cost of method calls is overhead

Re: [sage-support] Help with plotting from Mathematica using SageTeX

2011-12-25 Thread Dan Drake
On Sat, 24 Dec 2011 at 10:27AM -0800, Sony wrote: \documentclass{article} \usepackage{sagetex} \begin{document} \begin{sagesilent} mathematica('myplot = Plot[Sin[x], {x, 0, 2 Pi}]') mathematica('Export[%s/example3.eps, myplot]'%os.getcwd()) \end{sagesilent} \includegraphics{example3}