]> www.ginac.de Git - ginac.git/commit
calchash(): work around broken RTTI.
authorAlexei Sheplyakov <varg@metalica.kh.ua>
Mon, 23 Feb 2009 12:08:42 +0000 (14:08 +0200)
committerJens Vollinga <jensv@nikhef.nl>
Wed, 25 Feb 2009 11:46:37 +0000 (12:46 +0100)
commit0256e2fe48a0ecce79c37ac209620ca852b7f11a
tree99444218a9f0895b72dbf6075ccdc2310fc6d8cd
parent75b1f2213aa6dc0e563b8ad6202522a5f40cb5be
calchash(): work around broken RTTI.

Due to the strange (although permitted by the standard) behaviour of C++
RTTI on woe32 calchash() returns different hash values for equal objects.
As a result automatic evaluation gets spectacularly broken:

examining clifford objects.....({1+t,2+x,3+y,4+z}) - ({1+t,2+x,3+y,4+z}) erroneously returned -{1+t,2+x,3+y,4+z}+{1+t,2+x,3+y,4+z} instead of 0
({1+t,2+x,3+y,4+z}) - ({1+t,2+x,3+y,4+z}) erroneously returned -{1+t,2+x,3+y,4+z}+{1+t,2+x,3+y,4+z} instead of 0
.({1+t,2+x,3+y,4+z}) - ({1+t,2+x,3+y,4+z}) erroneously returned -{1+t,2+x,3+y,4+z}+{1+t,2+x,3+y,4+z} instead of 0
({1+t,2+x,3+y,4+z}) - ({1+t,2+x,3+y,4+z}) erroneously returned {1+t,2+x,3+y,4+z}-{1+t,2+x,3+y,4+z} instead of 0
[skipped]
.......FAIL: exam_clifford.exe

This patch works around `features' of woe32 RTTI, so calchash() works
properly.
ginac/Makefile.am
ginac/basic.cpp
ginac/crc32.h [new file with mode: 0644]
ginac/expairseq.cpp
ginac/function.pl
ginac/hash_seed.h [new file with mode: 0644]
ginac/idx.cpp
ginac/relational.cpp
ginac/symbol.cpp
ginac/symmetry.cpp
ginac/wildcard.cpp