[Numpy-discussion] Re: New matvec and vecmat functions

2024-01-24 Thread Marten van Kerkwijk
> Could you please offer some code or math notation to help communicate this? > I am forced to guess at the need. > > The words "matrix" and "vector" are ambiguous. > After all, matrices (of given shape) are a type of vector (i.e., can be added > and scaled.) > So if by "matrix" you mean "2d

[Numpy-discussion] Re: New matvec and vecmat functions

2024-01-24 Thread Marten van Kerkwijk
> FWIW, +1 for matvec & vecmat to complement matmat (erm, matmul). Having a > binop where one argument is a matrix and the other is a > stack/batch of vectors is indeed awkward otherwise, and a dedicated function > to clearly distinguish "two matrices" from "a matrix and a > batch of vectors"

[Numpy-discussion] Re: New matvec and vecmat functions

2024-01-24 Thread Alan
On Wed, Jan 24, 2024 at 2:27 PM Marten van Kerkwijk wrote: > > Why do these belong in NumPy? What is the broad field of application of > these functions? And, > > does a more general concept underpin them? > > Multiplication of a matrix with a vector is about as common as matrix > with matrix or

[Numpy-discussion] Re: New matvec and vecmat functions

2024-01-24 Thread Oscar Benjamin
On Wed, 24 Jan 2024 at 19:29, Marten van Kerkwijk wrote: > > > Why do these belong in NumPy? What is the broad field of application of > > these functions? And, > > does a more general concept underpin them? > > Multiplication of a matrix with a vector is about as common as matrix > with matrix

[Numpy-discussion] Re: New matvec and vecmat functions

2024-01-24 Thread Evgeni Burovski
FWIW, +1 for matvec & vecmat to complement matmat (erm, matmul). Having a binop where one argument is a matrix and the other is a stack/batch of vectors is indeed awkward otherwise, and a dedicated function to clearly distinguish "two matrices" from "a matrix and a batch of vectors" sounds great

[Numpy-discussion] Re: New matvec and vecmat functions

2024-01-24 Thread Marten van Kerkwijk
> Why do these belong in NumPy? What is the broad field of application of these > functions? And, > does a more general concept underpin them? Multiplication of a matrix with a vector is about as common as matrix with matrix or vector with vector, and not currently easy to do for stacks of

[Numpy-discussion] Re: New matvec and vecmat functions

2024-01-24 Thread Alan
Why do these belong in NumPy? What is the broad field of application of these functions? And, does a more general concept underpin them? Thanks, Alan Isaac On Tue, Jan 23, 2024 at 5:17 PM Marten van Kerkwijk wrote: > Hi All, > > I have a PR [1] that adds `np.matvec` and `np.vecmat` gufuncs for

[Numpy-discussion] Re: Proposal to accept NEP 55: Add a UTF-8 variable-width string DType to NumPy

2024-01-24 Thread Ralf Gommers
On Wed, Jan 24, 2024 at 10:43 AM Sebastian Berg wrote: > On Mon, 2024-01-22 at 17:08 -0700, Nathan wrote: > > Hi all, > > > > I propose we accept NEP 55 and merge PR #25347 implementing the NEP > > in time > > for the NumPy 2.0 RC: > > > I really like this work and I think it is a big

[Numpy-discussion] Re: Enhancement: Chebyshev power using DCT

2024-01-24 Thread Charles R Harris
On Wed, Jan 24, 2024 at 6:29 AM Fabio Matti wrote: > Hi, > > In the `numpy.polynomial.chebyshev` module, the function for raising a > Chebyshev polynomial to a power, `chebpow` [1], is essentially implemented > in the following way: > > {{{#!highlight python > def chebpow(c, pow): > """Raise

[Numpy-discussion] Enhancement: Chebyshev power using DCT

2024-01-24 Thread Fabio Matti
Hi, In the `numpy.polynomial.chebyshev` module, the function for raising a Chebyshev polynomial to a power, `chebpow` [1], is essentially implemented in the following way: {{{#!highlight python def chebpow(c, pow): """Raise a Chebyshev series to a power.""" zs =

[Numpy-discussion] Re: Proposal to accept NEP 55: Add a UTF-8 variable-width string DType to NumPy

2024-01-24 Thread Sebastian Berg
On Mon, 2024-01-22 at 17:08 -0700, Nathan wrote: > Hi all, > > I propose we accept NEP 55 and merge PR #25347 implementing the NEP > in time > for the NumPy 2.0 RC: I really like this work and I think it is a big improvement! At this point we probably have to expect some things to be still