[SciPy-dev] weave - type_factories change?

Fernando Perez fperez at pizero.colorado.edu
Wed Mar 6 17:42:48 EST 2002


Hi all,

the following code used to work with weave a few weeks ago:

#-----------------------------------------------------------------------------
# Returning a scalar quantity computed from a Numeric array.
def trace(mat):
    """Return the trace of a matrix.
    """
    nrow,ncol = mat.shape
    code = \
""" 
double tr=0.0;

for(int i=0;i<nrow;++i)
    tr += mat(i,i);
return_val = Py::new_reference_to(Py::Float(tr));
"""
    return weave.inline(code,['mat','nrow','ncol'],
                        type_factories = blitz_type_factories)

Now the type_factories call doesn't work, and blitz_type_factories doesn't 
seem to exist in blitz anymore. I couldn't find what the new syntax is, could 
someone enlighten me please?

Thanks,

f.




More information about the SciPy-Dev mailing list