Boost logo

Boost :

From: jhrwalter (walter_at_[hidden])
Date: 2002-01-17 09:58:25

--- In boost_at_y..., Toon Knapen <toon.knapen_at_s...> wrote:
> I noticed that in ublas 'a = 2 * b' works but 'a = b * 2' does
not ?!

Meanwhile we've found two reasons for this restriction. First, as far
as I know multiplication with a scalar is mathematically always
defined as left multiplication for vectors and matrices. Next,
multiplication is left associative in C++ (as Mathias told me ;-), so
if we compare a = 2 * 2 * b to a = 2 * b * 2, the former is always
guaranteed to need fewer operations.



Boost list run by bdawes at, gregod at, cpdaniel at, john at