|
Boost : |
Subject: Re: [boost] linear algebra library... again
From: DE (satan66613_at_[hidden])
Date: 2010-02-04 12:42:01
on 04.02.2010 at 2:06
Thomas Klimpel wrote :
>> matrix<double, symmetric> m1, m2, m;
>> //...
>> m = m1*m2;
> What does this last statement do in case m1 and m2 don't have the
> same size? Does it throw an exception, or does it simply use the
> smaller of the two sizes? Same question for the case that m1*m2 is
> not symmetric, as in the following example:
> m1 =
> 0 1
> 1 0
> m2 =
> 1 0
> 0 2
> m1*m2 =
> 0 2
> 1 0
> Does it throw an exception, or does it silently set
> m=
> 0 2
> 2 0
> (or m=
> 0 1
> 1 0) ?
at this moment it sets the product to be
[0 2]
[2 0]
i must have missed something
thanks for your reply
in fact a product of symmetric matrices is rarely symmetric
i don't know where i got that stuff
(wikipedia says that, given symmetric A and B, A*B is symmetric if A
and B commute; maybe i were misled by this fact)
i'll remove that operation and rewrite documentation
so the example above may be read
m = m1 + m2; //or 'm1 - m2'
fortunately a product of triangular matrices is triangular
-- Pavel
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk