[GiNaC-devel] multiplying a matrix with 0 makes it become a scalar 0
Jens Vollinga
jensv at nikhef.nl
Mon Sep 22 17:32:41 CEST 2008
Hi,
Alexei Sheplyakov schrieb:
>> My only idea at the moment is to check explicitly for matrices in the
>> epvector (mul.cpp lines 428-430) which is kind of stupid.
>
> I don't quite like this idea. This check would slow down evaluation of
> each mul object. In particular, it would slow down evaluation of
> 0*some_huge_expression. I don't think this is acceptable.
I completely agree.
> What about making matrix a stand alone type (as opposed to being subclass
> of basic)? The code dealing with matrices is very different from
> everything else anyway.
Mmmh, have to think about that. It looks like a good idea. But I am not
sure about the implications, yet. In case we do this, the matrix stuff
probably looks like an incomplete copy of one of the many existing LA
packages. Maybe it can be removed completely then and replaced by some
interface code to an existing LA package?
Regards,
Jens
More information about the GiNaC-devel
mailing list