Boost logo

Glas :

Re: [glas] arithmetic operations

From: Andrew Lumsdaine (lums_at_[hidden])
Date: 2005-10-28 08:14:46


On Oct 28, 2005, at 2:23 AM, Karl Meerbergen wrote:
>
> It makes sense to use * for a product. But what does it mean for a
> vector? inner product, outer product, element wise product? And why
> prefer one to another?

I think we are agreeing here (?) -- my point is that * has no
mathematical meaning for vectors -- i.e., there is no mathematical
notion of a product between two vectors -- and hence, we should not
overload the meaning of operator* to be something new and
un-mathematical.

> To make the choice easier, we could assume that a vector is a column
> (as
> is always the case in linear algebra). In this case
> trans(x)*y = dot product
> x*trans(y) = outer product
> herm(x)*y = hermitian inner product
>
> This is probably the closest we can get to linear algebra notation.

Right. I think these all make perfect sense mathematically. I wasn't
suggesting to leave out the use of * altogether, but rather to use it
only in the ways that make sense mathematically. And to have it always
mean the same thing.