[Numpy-discussion] Adding gufuncs

Pauli Virtanen pav@iki...
Wed Apr 17 14:09:34 CDT 2013

14.04.2013 18:39, Charles R Harris kirjoitti:
> There is a pull request <https://github.com/numpy/numpy/pull/3220>for
> work adding linear algebra support as generalized ufuncs. The result is
> that many of the linear algebra routines can now be applied to stacks of
> matrices. Another new feature is support for float32 versions of the
> routines. Some work has also gone into porting the current linalg
> package to use the new routines.
> The work isn't finished, the new and old libraries {blas, lapack}_lite
> libraries should probably be united and the error handling could maybe
> use more polish, but I'm inclined to put the PR in at this point.
> Although some things may break, I think it needs to be out there to
> gather feedback and testing.

It's merged:

>>> a = np.array([[[1, 2],
                   [3, 4]],
                  [[1, 2],
                   [2, 1]],
                  [[1, 3],
                   [3, 1]] ])
>>> np.linalg.det(a)
array([-2., -3., -8.])

Pauli Virtanen

More information about the NumPy-Discussion mailing list