<br><br><div><span class="gmail_quote">On 6/23/06, <b class="gmail_sendername">Keith Goodman</b> <<a href="mailto:kwgoodman@gmail.com">kwgoodman@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On 6/22/06, Bill Baxter <<a href="mailto:wbaxter@gmail.com">wbaxter@gmail.com</a>> wrote:<br>> On 6/22/06, Ed Schofield <<a href="mailto:schofield@ftw.at">schofield@ftw.at</a>> wrote:<br>><br>> ><br>
> > On 22/06/2006, at 12:40 AM, Bill Baxter wrote:<br>> ><br>> > > Actually I think using mat() (just an alias for the matrix<br>> > > constructor) is a bad way to do it. That mat() (and most others on
<br>> > > that page) should probably be replaced with asmatrix() to avoid the<br>> > > copy.<br>> ><br>> > Perhaps the 'mat' function should become an alias for 'asmatrix'.<br>> > I've thought this for a while.
<br>><br>><br>> That makes sense to me. As far as I know, asmatrix() defaults to calling<br>> the constructor if it can't snarf the memory of the object being passed in.<br>><br>> So, go on, shoot Ed and me down! :-)
<br><br>I can anticipate one problem: the Pirates will want their three-letter<br>abbreviation for asarray.</blockquote><div><br>arr() me maties!<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Will functions like rand and eye always return arrays? Or will there<br>be a day when you can tell numpy that you are working with matrices<br>and then it will return matrices when you call rand, eye, etc?<br></blockquote>
</div><br>I don't disagree there's a need, but you can always make your own:<br><br>def mrand(*vargs): <br> return asmatrix(rand(*vargs))<br clear="all"><br>def meye(N, **kwargs):<br> return asmatrix(eye(N,**kwargs))
<br><br>--bb<br>