From: Charles R H. <cha...@gm...> - 2006-07-29 17:32:51
|
Hi Sven, On 7/28/06, Sven Schreiber <sve...@gm...> wrote: > > Here's my attempt at summarizing the diag-discussion. <snip> 2) Deprecate the use of diag which is overloaded with making diagonal > matrices as well as getting diagonals. Instead, use the existing > .diagonal() for getting a diagonal, and introduce a new make_diag() > function which could easily work for numpy-arrays and numpy-matrices > alike. This would be my preference, but with functions {get,put}diag. We could also add a method or function asdiag, which would always return a diagonal matrix made from *all* the elements of the matrix taken in order. For (1,n) or (n,1) this would do what you want. For other matrices the result would be something new and probably useless, but at least it wouldn't hurt. Chuck |