[Numpy-discussion] complex diagonal matrix
list at jsaul.de
Sun Jan 26 04:03:05 CST 2003
* baecker at physik.tu-dresden.de [26.01.2003 11:40]:
> I just wondered if there is a "nicer" way of generating
> a complex diagonal matrix than
> Namely, wouldn't something like
> be nicer?
No, because diag() is supposed to create a diagonal, but *not* to
cast to another type. If you wanted to add that "functionality" to
functions like diag(), you would also have to add it to functions
like reshape() etc., i.e. practically everywhere.
The way it is handled now is reasonably simple and flexible, and
there is really no advantage of your suggestion compared to
More information about the Numpy-discussion