[Numpy-discussion] LA improvements (was: dot function or dot notation, matrices, arrays?)

David Warde-Farley dwf at cs.toronto.edu
Wed Dec 23 13:30:46 EST 2009


On 23-Dec-09, at 10:34 AM, Anne Archibald wrote:

> It's been a little while since I took a really close look at it, but
> I'll try to describe the problems I had. Chiefly I had problems with
> documentation - the only way I could figure out how to build
> additional gufuncs was monkey-see-monkey-do, just copying an existing
> one in an existing file and hoping the build system figured it out. It
> was also not at all clear how to, say, link to LAPACK, let alone
> decide based on input types which arguments to promote and how to call
> out to LAPACK.

I tried to create a new generalized ufunc (a logsumexp to go with  
logaddexp, so as to avoid all the needless exp's and log's that would  
be incurred by logaddexp.reduce) and had exactly the same problem. I  
did get it to build but it was misbehaving (returning an array of the  
same size as the input) and I couldn't figure out quite why. I agree  
that the documentation is lacking, but I think it's (rightly) a low  
priority in the midst of the release candidate.

> The key idea would be that the "linear
> algebra dimensions" would always be the last one(s); this is fairly
> easy to arrange with rollaxis when it isn't already true, would tend
> to reduce copying on input to LAPACK, and is what the gufunc API
> wants.

Would it actually reduce copying if you were using default C-ordered  
arrays? Maybe I'm mistaken but I thought one almost always had to copy  
in order to translate C to Fortran order except for a few functions  
that can take row-ordered stuff.

Otherwise, +1 all the way.

David



More information about the NumPy-Discussion mailing list