ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Thu, 19 Aug 2010 02:16:26 +0200Short Cython Example In A Notebook Cell?https://ask.sagemath.org/question/7559/short-cython-example-in-a-notebook-cell/What's the best way to integrate (new) cython code into your notebook?Wed, 18 Aug 2010 23:11:58 +0200https://ask.sagemath.org/question/7559/short-cython-example-in-a-notebook-cell/Answer by William Stein for <p>What's the best way to integrate (new) cython code into your notebook?</p>
https://ask.sagemath.org/question/7559/short-cython-example-in-a-notebook-cell/?answer=11388#post-id-11388This question is extremely open ended and not very specific, so I'm not sure how to answer.
One point, is that you use %cython to create a notebook cell that is evaluated using Cython.
Do you have a more specific question about using Cython with the Sage notebook?Wed, 18 Aug 2010 23:13:47 +0200https://ask.sagemath.org/question/7559/short-cython-example-in-a-notebook-cell/?answer=11388#post-id-11388Comment by ccanonc for <p>This question is extremely open ended and not very specific, so I'm not sure how to answer.</p>
<p>One point, is that you use %cython to create a notebook cell that is evaluated using Cython.</p>
<p>Do you have a more specific question about using Cython with the Sage notebook?</p>
https://ask.sagemath.org/question/7559/short-cython-example-in-a-notebook-cell/?comment=23087#post-id-23087A short example (notebook/cell-based) on the cython.org homepage would be great.Thu, 19 Aug 2010 01:23:40 +0200https://ask.sagemath.org/question/7559/short-cython-example-in-a-notebook-cell/?comment=23087#post-id-23087Comment by ccanonc for <p>This question is extremely open ended and not very specific, so I'm not sure how to answer.</p>
<p>One point, is that you use %cython to create a notebook cell that is evaluated using Cython.</p>
<p>Do you have a more specific question about using Cython with the Sage notebook?</p>
https://ask.sagemath.org/question/7559/short-cython-example-in-a-notebook-cell/?comment=23092#post-id-23092Thanks, I hadn't seen the %cython directive before. I didn't see cython in the language pull-down, and the docs I've found so far are command-line oriented. I was hoping for a small notebook example. I googled it, but didn't see what I was looking for.Wed, 18 Aug 2010 23:23:00 +0200https://ask.sagemath.org/question/7559/short-cython-example-in-a-notebook-cell/?comment=23092#post-id-23092Answer by Jason Grout for <p>What's the best way to integrate (new) cython code into your notebook?</p>
https://ask.sagemath.org/question/7559/short-cython-example-in-a-notebook-cell/?answer=11375#post-id-11375There are lots of examples if you search sagenb.org for "%cython": [Here is the search][1]
A particularly nice example is [here](http://sagenb.org/home/pub/2046/)
[1]: http://sagenb.org/pub/?typ=pub&search=%25cythonThu, 19 Aug 2010 02:16:26 +0200https://ask.sagemath.org/question/7559/short-cython-example-in-a-notebook-cell/?answer=11375#post-id-11375Answer by cswiercz for <p>What's the best way to integrate (new) cython code into your notebook?</p>
https://ask.sagemath.org/question/7559/short-cython-example-in-a-notebook-cell/?answer=11391#post-id-11391If you don't have any specific questions then here's an example I made of using Cython in the Sage Notebook to perform fast matrix multiplication: (Note that I'm just re-implementing the naive algorithm using various stages of Python->Cython conversion.)
<a href="http://uw.sagenb.org/home/pub/19/">http://uw.sagenb.org/home/pub/19/</a>
It's based on a talk made by one of the lead Cython developers. Also, the Cython <a href="http://docs.cython.org/">documentation</a> is excellent and most, if not all, of the language elements work naturally in the notebook environment.
Thu, 19 Aug 2010 01:39:02 +0200https://ask.sagemath.org/question/7559/short-cython-example-in-a-notebook-cell/?answer=11391#post-id-11391Comment by ccanonc for <p>If you don't have any specific questions then here's an example I made of using Cython in the Sage Notebook to perform fast matrix multiplication: (Note that I'm just re-implementing the naive algorithm using various stages of Python->Cython conversion.)</p>
<p><a href="http://uw.sagenb.org/home/pub/19/">http://uw.sagenb.org/home/pub/19/</a></p>
<p>It's based on a talk made by one of the lead Cython developers. Also, the Cython <a href="http://docs.cython.org/">documentation</a> is excellent and most, if not all, of the language elements work naturally in the notebook environment.</p>
https://ask.sagemath.org/question/7559/short-cython-example-in-a-notebook-cell/?comment=23084#post-id-23084Thanks very much for the notebook-oriented links. I'd issue thumbs up if not for my karma.Thu, 19 Aug 2010 01:53:01 +0200https://ask.sagemath.org/question/7559/short-cython-example-in-a-notebook-cell/?comment=23084#post-id-23084Comment by cswiercz for <p>If you don't have any specific questions then here's an example I made of using Cython in the Sage Notebook to perform fast matrix multiplication: (Note that I'm just re-implementing the naive algorithm using various stages of Python->Cython conversion.)</p>
<p><a href="http://uw.sagenb.org/home/pub/19/">http://uw.sagenb.org/home/pub/19/</a></p>
<p>It's based on a talk made by one of the lead Cython developers. Also, the Cython <a href="http://docs.cython.org/">documentation</a> is excellent and most, if not all, of the language elements work naturally in the notebook environment.</p>
https://ask.sagemath.org/question/7559/short-cython-example-in-a-notebook-cell/?comment=23086#post-id-23086I have another one demonstrating Sage/Pylab interfacing: <a href="http://uw.sagenb.org/home/pub/20/">http://uw.sagenb.org/home/pub/20/</a>. This one is also based on a Cython talk.Thu, 19 Aug 2010 01:43:44 +0200https://ask.sagemath.org/question/7559/short-cython-example-in-a-notebook-cell/?comment=23086#post-id-23086