We've done some templating before when Cython didn't speak C++ so well and/or 
when C code was involved.

1. sage.rings.polynomials.polynomial_template provides a way to wrap 
univariate polynomials.

It is used by three classes:

polynomial_gf2x
polynomial_zmod_flint
polynomial_zz_pex

2. Matrix_modn_dense_template is used to wrap LinBox's FFLAS for doubles and 
floats.

Both have in common that they do templating C style: write generic code based 
on some defines where these defines are then included in a header.

Cheers,
Martin


On Wednesday 14 May 2014 08:17:44 Jean-Pierre Flori wrote:
> On Wednesday, May 14, 2014 5:09:11 PM UTC+2, Simon King wrote:
> > Hi Jean-Pierre,
> > 
> > On 2014-05-14, Jean-Pierre Flori <jpf...@gmail.com <javascript:>> wrote:
> > > Maybe use Cython C++ template support?
> > > Note that recent Cython version even allows C++ template functions (and
> > 
> > not
> > 
> > > only classes/methods as before).
> > 
> > In the cython version that is included in Sage? And is it possible to
> > write this in plain Cython, or do you just mean that it is possible to
> > wrap
> > C++ code, as in
> > http://docs.cython.org/src/userguide/wrapping_CPlusPlus.html ?
> 
> oops, indeed you would have to wrap C++ code.

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to