[Numpy-discussion] matrix default to column vector?
Alan G Isaac
aisaac at american.edu
Sat Jun 6 15:59:01 EDT 2009
On 6/6/2009 2:58 PM Charles R Harris apparently wrote:
> How about the common expression
> exp((v.t*A*v)/2)
> do you expect a matrix exponential here?
I take your point that there are conveniences
to treating a 1 by 1 matrix as a scalar.
Most matrix programming languages do this, I think.
For sure GAUSS does. The result of x' * A * x
is a "matrix" (it has one row and one column) but
it functions like a scalar (and even more,
since right multiplication by it is also allowed).
While I think this is "wrong", especially in a
language that readily distinguishes scalars
and matrices, I recognize that many others have
found the behavior useful. And I confess that
when I talk about quadratic forms, I do treat
x.T * A * x as if it were scalar.
But just to be clear, how are you proposing to
implement that behavior, if you are?
Alan
More information about the NumPy-Discussion
mailing list