Blitz logo

Blitz Support :

From: Navneet Dalal (Navneet.Dalal_at_[hidden])
Date: 2003-11-06 12:26:39


On Fri, 07 Nov 2003 00:42:55 +0800, mctimes <mctimes_at_[hidden]> wrote:

>> Also, TinyVector is a vector. It is upto you to interpret it
>> as row or column vector.
> Take this example, if I am going to take the product of a NxM matrix and
> a vector. For validity, we must make sure the vector is of the size Mx1
> (a column vector). In this case, the vector should be a column vector
> however we can also treated it as a row vector.

I agree. However consider this example:

Let A be a NxN matrix
and x be a N vector and y be another N vector

blitz provides a product function for matrix-vector multiplication:

y = product(A,x); // first argument has to be a Matrix and second argument
can be a vector or matrix.

product(x,A) is not provided (because it is essentially the same thing,
with just result being transposed).

> Consider the product of two vectors V1 and V2. if both vectors are row
> (column) vector, the product should return a scalar. if V1 is of Nx1 and
> V2 is of 1xM, the product should return a NxM matrix.

product (y,x) is not provided. However, if you want to do a scalar
product, you can use dot function i.e.
dot(y,x)

Outer product of two vectors is not provided (resulting in a matrix) but
is trivial to add.

I hope this helps.