[Numpy-discussion] Linear algebra functions on empty arrays

josef.pktd at gmail.com josef.pktd at gmail.com
Mon Sep 15 07:07:11 EDT 2014


On Mon, Sep 15, 2014 at 5:48 AM, Sebastian Berg
<sebastian at sipsolutions.net> wrote:
> Hey all,
>
> for https://github.com/numpy/numpy/pull/3861/files I would like to allow
> 0-sized dimensions for generalized ufuncs, meaning that the gufunc has
> to be able to handle this, but also that it *can* handle it at all.
> However lapack does not support this, so it needs some explicit fixing.
> Also some of the linalg functions currently explicitly allow and others
> explicitly disallow empty arrays.
>
> For example the QR and eigvals does not allow it, but on the other hand
> solve explicitly does (most probably never did, simply because lapack
> does not). So I am wondering if there is some convention for this, or
> what convention we should implement.

What does an empty square matrix/array look like?

np.linalg.solve   can have empty rhs, but shape of empty lhs, `a`, is ?

If I do a QR(arr)  with arr.shape=(0, 5), what is R supposed to be ?


I just wrote some loops over linalg.qr, but I always initialized explicitly.

I didn't manage to figure out how empty arrays would be useful.

If an empty square matrix can only only be of shape (0, 0), then it's
no use (in my applications).


Josef


>
> Regards,
>
> Sebastian
>
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>



More information about the NumPy-Discussion mailing list