There are tons of examples of things in the sage library: just look for .pyx
files.  In particular, many of the matrix files are written in cython: look
in sage.matrix.

For loops, use the syntax:
cdef Py_ssize_t i
cdef long n = 17
for i from 0 <= i < n:
    do_stuff()

Hope this helps.
David

On Fri, Mar 7, 2008 at 9:52 PM, Vincent <[EMAIL PROTECTED]> wrote:

>
> I would like to implement some Bayesian routines using Cython. I have
> looked at some of the Cython examples but they don't really provide
> enough information for a newbie like me. As a starting point i'd like
> to implement bootstrapping of OLS parameter standard errors. That
> would give me an idea of how to implement (1) linear algebra in
> Cython, i assume by calling routines from Numpy in some way, (2)
> random number generators for sampling, and (3) running loops.
>
> I anyone has any (simple) examples of how to do something like this in
> Cython i'd love to see them. Also, if there are better ways to do this
> than through Cython i'd luv to hear your suggestions.
>
> Thanks,
>
> Vincent
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to