
"David Abrahams" <dave@boost-consulting.com> wrote in message news:uoemxdu50.fsf@boost-consulting.com...
Walter Landry <wlandry@ucsd.edu> writes:
David Abrahams <dave@boost-consulting.com> wrote:
* prod should be named operator*; this is a linear algebra library after all.
Actually, operator* can be thought of as either an inner product or an outer product. I'm not familiar with the innards of uBLAS, but that is a problem common to most linear algebra libraries.
IIUC in the domain of linear algebra when mathemeticians write
AB
for 2D matrices A and B, they mean ordinary matrix multiplication (I think inner product) yielding another 2D matrix, and that's what operator* should mean in a linear algebra library. If you want an outer product yielding a 4D matrix I think you're basically outside the domain of linear algebra.
Actually, taking a look at mathworld.wolfram.com and a few other sites, I have reached the tentative conclusion that outer products can only be formed over vectors, not matrices. Matrix multiplication is well-defined and unambiguous, whereas vector multiplication comes in at least four varieties: dot product, cross product (also called the "outer product"), perpendicular dot product, and vector direct product. Hence, it would make sense that operator*(matrix, matrix) would mean "matrix multiplication". However, operator*(vector, vector) is the problem child. Using the most literal symbolism, it seems that it should mean "dot product". It is unfortunate that there is no operatorX in C++, and that such user-defined operators cannot be created. In this case, I don't see a problem with Mr. Virgilio's suggestion to use operator^ for cross product, except possibly precedence rules and/or the fact that there is such a thing as a "wedge product" which uses roughly the same symbol. However, it is not specific to linear algebra, so it shouldn't be a significant problem. Dave --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.710 / Virus Database: 466 - Release Date: 6/23/2004