## Glas :## Re: [glas] arithmetic operations |

**From:** Wolfgang Bangerth (*bangerth_at_[hidden]*)

**Date:** 2005-10-27 13:04:18

**Next message:**Toon Knapen: "Re: [glas] arithmetic operations"**Previous message:**Theodore Papadopoulo: "Re: [glas] arithmetic operations"**Maybe in reply to:**Karl Meerbergen: "[glas] arithmetic operations"**Next in thread:**Toon Knapen: "Re: [glas] arithmetic operations"**Reply:**Toon Knapen: "Re: [glas] arithmetic operations"

> I quite like this approach, because the collection inherits operations

> from the value_type in a very intuitive way. (I repeat myself, so I

> really like it, don't I ;-) )

I'm with Theodore, I don't like your approach. The product between two

vectors is almost uniformly understood to be the scalar product. Likewise,

the product between a matrix and a vector is the matrix-vector product,

whereas in your reading it doesn't have a meaning at all. I would

therefore like to dissent from your opinion, I find it unintuitive. It is

also the case that existing linear algebra implementations (at least in

C++) have traditionally interpreted operations to hold on the entire

object, not elementwise.

The entrywise operations, if needed, are certainly best implemented using

function calls. After all, it is quite a rare operation in linear algebra

to actually form a vector that is the element-wise product of two other

vectors, whereas forming a scalar product is a fairly common operation.

Best

Wolfgang

-------------------------------------------------------------------------

Wolfgang Bangerth email: bangerth_at_[hidden]

www: http://www.math.tamu.edu/~bangerth/

**Next message:**Toon Knapen: "Re: [glas] arithmetic operations"**Previous message:**Theodore Papadopoulo: "Re: [glas] arithmetic operations"**Maybe in reply to:**Karl Meerbergen: "[glas] arithmetic operations"**Next in thread:**Toon Knapen: "Re: [glas] arithmetic operations"**Reply:**Toon Knapen: "Re: [glas] arithmetic operations"