patch for unarchiving

Chris Dams chrisd at sci.kun.nl
Mon Jun 30 15:56:11 CEST 2003


Hello,

I found out that if an add or a mul are unarchived no sorting of terms or
factors occurs. Since the canonical ordering depends on the order in which
symbols are declared and thus may well be different in the archiving and
the unarchiving program, I think this is wrong. A patch is attached that
is supposed to solve this.

Bye,
Chris Dams
-------------- next part --------------
Index: add.cpp
===================================================================
RCS file: /home/cvs/GiNaC/ginac/add.cpp,v
retrieving revision 1.60.2.11.2.2
diff -r1.60.2.11.2.2 add.cpp
98c98,108
< DEFAULT_ARCHIVING(add)
---
> add::add(const archive_node &n, lst &sym_lst) : inherited(n, sym_lst)
> {
> 	canonicalize();
> }
> 
> DEFAULT_UNARCHIVE(add)
> 
> void add::archive(archive_node &n) const
> {
>    inherited::archive(n);
> }
Index: mul.cpp
===================================================================
RCS file: /home/cvs/GiNaC/ginac/mul.cpp,v
retrieving revision 1.66.2.15.2.5
diff -r1.66.2.15.2.5 mul.cpp
115c115,125
< DEFAULT_ARCHIVING(mul)
---
> mul::mul(const archive_node &n, lst &sym_lst) : inherited(n, sym_lst)
> {
>    canonicalize();
> }
> 
> DEFAULT_UNARCHIVE(mul)
> 
> void mul::archive(archive_node &n) const
> {
>    inherited::archive(n);
> }


More information about the GiNaC-devel mailing list