[Matrix-SIG] Outer is a method of ufuncs

Oishi, Takahiro Takahiro.Oishi@db.com
Thu, 24 Dec 1998 17:33:17 +0900


Hi,

Thank you very much.
You meant a current MLab.py included in LLNLPython7.tgz or other latest
distribution
is not uptodate, right?
Anyway I got to be able to change and use MLab.py, thanks to your
advise.

I editted to change MLab.py a little, bellow:
MLab.py:
34c34
<   m = equal(subtract.outer(arange(N), arange(M)), -k)
---
>   m = outer(subtract, arange(N), arange(M)).equal(-k)
37c37
<   m = equal(subtract.outer(i, range(M)),-k)
---
>   m = outer(subtract, i, range(M)).equal(-k)
46c46
<   m = subtract.outer(arange(N), arange(M)).greater_equal(-k)
---
>   m = outer(subtract, arange(N), arange(M)).greater_equal(-k)
49c49
<   m = subtract.outer(i, arange(M)).greater_equal(-k)
---
>   m = outer(subtract, i, arange(M)).greater_equal(-k)
155c155
<  return c/sqrt(multiply.outer(d,d))
---
>  return c/sqrt(outer(multiply, d,d))
162,163c162,163
<   sum_cov = sum_cov+multiply.outer(v,v)
<  return (sum_cov-len(m)*multiply.outer(mu,mu))/(len(m)-1)
---
>   sum_cov = sum_cov+outer(multiply, v,v)
>  return (sum_cov-len(m)*outer(multiply,mu,mu))/(len(m)-1)

I think there are better solutions or uptodate MLab.py
Because MLab.py is very convenient for MATLAB and OCTAVE users.

Many thanks,

T.Oishi