I wonder why numpy.norm doesn't call blas norm function by default.
is there any good reason? or it's just not coded?
-Kibeom Kim
On Sun, Mar 6, 2011 at 12:13 PM, Till Stensitzki wrote:
>
> >
> > Moreover, np.linalg.norm is slow compare to blas.
> >
> > Is there a way/plan to fix it?
> >
> > X
>
> Moreover, np.linalg.norm is slow compare to blas.
>
> Is there a way/plan to fix it?
>
> Xavier
>
Have a look at:
http://fseoane.net/blog/2011/computing-the-vector-norm/
greetings
Till
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy
Kahan summation algorithm?
pairwise summation?
Looks like BLAS does not use these algorithms.
I'm curious to know which algo are coded in matlab/scilab.
Another issue is that sum is slow.
Xavier
> for the sum function part,
> It's not a good way to fix but... if you want more accuracy
>
> x=(np.
for the sum function part,
It's not a good way to fix but... if you want more accuracy
x=(np.array([1]*1 + [1e4], dtype=np.float32))
np.sum(x*x)
1.0001e+08
You can sort x from small numbers to bigger numbers before you call sum.
-Kibeom Kim
On Sat, Mar 5, 2011 at 6:27 PM, Xavier Gnata wrot
Hi,
I got this problem in a real life code and it took me some time to
figure out that np.linalg.norm has a terrible numerical behavior.
The problem is nicely described here
http://fseoane.net/blog/2011/computing-the-vector-norm/
numpy/linalg/linalg.py claims to be a "high-level Python interfac