[Numpy-discussion] matrix default to column vector?

Robert Kern robert.kern at gmail.com
Sat Jun 6 17:06:11 EDT 2009


On Sat, Jun 6, 2009 at 16:00, Alan G Isaac <aisaac at american.edu> wrote:
> On 6/6/2009 4:30 PM Robert Kern apparently wrote:
>> The old idea of introducing RowVector and ColumnVector would help
>> here. If x were a ColumnVector and A a Matrix, then you can introduce
>> the following rules:
>>
>> x.T is a RowVector
>> RowVector * ColumnVector is a scalar
>> RowVector * Matrix is a RowVector
>> Matrix * ColumnVector is a ColumnVector
>
>
> To me, a "row vector" is just a matrix with a single row,
> and a "column vector" is just a matrix with a single column.
> Calling them "vectors" is rather redundant, since matrices
> are also vectors (i.e., belong to a vector space).
>
> I think the core of the row-vector/column-vector proposal
> is really the idea that we could have 1d objects that
> also have an "orientation" for the purposes of certain
> operations. But then why not just use matrices, which
> automatically provide that "orientation"?

Because (x.T * x) where x is an (n,1) matrix and * is matrix
multiplication (i.e. MM(n,1) -> MM(1,1)) is not the same thing as the
inner product of a vector (RR^n -> RR). Please see the post I was
responding to for the motivation.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
  -- Umberto Eco



More information about the NumPy-Discussion mailing list