On Mar 4, 2010, at 12:26 AM, kstueve wrote:

I believe the speed of c is worthwhile here.

The point of Cython is that it has the same speed as C, but is much easier to use (especially from Python).

And I am not skilled in Cython.

If you already know Python, and especially if you have a working version in Python, than it's probably easier to learn Cython than to debug a C program and call it with pipes. I think this is especially true if you hope to get it refereed and in Sage.

As it is, I don't even know how to see if your code is working or not, and it's a lot more work than pasting it into a notebook cell and playing with it if I had the time. If you suspect the pipes, try running it directly from the command line yourself.

- Robert


On Mar 4, 12:12 am, Robert Bradshaw <rober...@math.washington.edu>
wrote:
On Mar 3, 2010, at 10:50 AM, kstueve wrote:

I've been working more on TOS's Li based pi(x) approximation code.
I've been trying to optimize it in c.  It seems that I need someone
more knowledgeable than myself in c to point out some simple mistake I am making that is preventing the code from giving the correct answer. I tried copying and pasting the li function below into a Sage cell and
"Pythonizing" it, and I got the expected answer, but as is in a c
file, with commands being piped in the command line, I get unexpected results in Sage. I believe that the c li function below is correct-I
think I am just making some sort of simple error in moving data
around.  I have already asked one of my peers in my number theory
class, and we are both stuck.

If it works in Python is there any reason you're not just cythonizing
it? (That would also seem easier than trying to use the subprocess
module, and if you care about speed that could be a lot of overhead
you'll save as well.)

- Robert

--
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

--
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to