[SciPy-dev] small bug(s) in scipy.linalg
Chuck Harris
Chuck.Harris at sdl.usu.edu
Mon Feb 10 10:35:28 CST 2003
What I would like do see is the reduce method take a list of axis
to run over. The n x m L1 matrix norm would then look like
maximum.reduce(a,axis=[-1,-2]). I actually went so far as to start
coding up my own version of Numeric to make this easy, but all that
free time eventually went away. I hope it makes it into Numarray
(hint,hint).
Chuck
> -----Original Message-----
> From: Pearu Peterson [mailto:pearu at cens.ioc.ee]
> Sent: Monday, February 10, 2003 3:28 AM
> To: scipy-dev at scipy.net
> Subject: Re: [SciPy-dev] small bug(s) in scipy.linalg
>
>
>
> On 10 Feb 2003, Alexander Schmolck wrote:
>
> > I think scipy.linalg.basic has a few issues with 1D vectors
> vs row and column
> > vectors (respective shapes: (n,), (1,n), (n,1)). It would
> seem clear to me,
> > for example that `norm` ought to produce exactly the same
> with a 1D vector as
> > with a row vector or column vector. Currently it doesn't,
>
> -1 for considering it as a bug.
>
> For generality, I'd leave to users to decide whether (1,n) or
> (n,1) shaped matrices should regarded as vectors.
>
> It is simple to call norm(ravel(x)) (even if x is (n,) shaped).
> However, if norm() would automatically map x -> ravel(x) for one
> row/column matrix x, as suggested, then this would make
> writing generic
> algorithms harder (check shapes, split program flow, etc).
>
> How about introducing a convenience function
>
> def vnorm(x):
> return norm(ravel(x))
>
> ?
>
> > and the very common case of the 2 norm for a vector is, I think,
> > handled inefficiently.
>
> +1 for fixing this.
>
> Pearu
>
> _______________________________________________
> Scipy-dev mailing list
> Scipy-dev at scipy.net
> http://www.scipy.net/mailman/listinfo/scipy-dev
>
More information about the Scipy-dev
mailing list