So, I'm trying to learn how to write Pyrex code. So far, I've been able to fit some functions into existing files, but creating new files and modules to Sage has been difficult...
I'm moving polynomials to sage.rings.polynomial because there are getting to be a fair number of files for polynomials. I'm then creating a padics folder inside there. I'm also creating a padics folder in sage/matrix. In addition to moving some files around, I'm writing new matrix and polynomial classes. The polynomial class is pure Python, and I think I have it mostly working. The matrix class however... Does anyone know where I can find some tips on writing .pxd files? What do I need to include, import, cimport, from blah cimport, cdef, cdef extern, etc. Also, I'm trying to add a function to the Matrix_integer_dense class and getting an error embedding the pyrex code. I've included the .pxd file below (I moved the arrow to where it actually points to for those of us without fixed-width fonts). If anybody could point out what I'm doing wrong, I'd appreciate it. David include "../ext/cdefs.pxi" cimport matrix_dense cimport sage.rings.integer from sage.rings.integer cimport Integer cdef extern from "../ext/multi_modular.h": ctypedef unsigned long mod_int cdef class Matrix_integer_dense(matrix_dense.Matrix_dense): cdef char _initialized cdef mpz_t *_entries cdef mpz_t **_matrix cdef object _pivots cdef int mpz_height(self, mpz_t height) except -1 cdef _mod_int_c(self, mod_int modulus) cdef _zero_out_matrix(self) cdef _new_unitialized_matrix(self, Py_ssize_t nrows, Py_ssize_t ncols) cdef _pickle_version0(self) cdef _unpickle_version0(self, data) cdef _init_linbox(self) cdef void reduce_entry_unsafe(self, Py_ssize_t i, Py_ssize_t j, Integer modulus^): ------------------------------------------------------------ /Users/roed/Math/sage/devel/sage-padics/sage/matrix/matrix_integer_dense.pxd:24:84: C function definition not allowed here --~--~---------~--~----~------------~-------~--~----~ 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://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/ -~----------~----~----~----~------~----~------~--~---