archive/unarchive on functions with a variable number of arguments
Hi all, I came across a problem about the archive and unarchive on functions with a variable number of arguments. for example, the following c++ code produces the output: zeta(10,x) :> 1/93555*Pi^10. it seems that the unarchive just return zeta(10). Best regards! Feng //--- symbol x("x"); ex zx = zeta(10,x); archive ar_out; ar_out.archive_ex(zx, "zx"); ofstream out("tmp.gar"); out << ar_out; out.close(); lst syms = {x}; archive ar_in; ifstream in("tmp.gar"); in >> ar_in; in.close(); cout << zx << " :> " << ar_in.unarchive_ex(syms,"zx") << endl; //---
Dear All, It seems there is indeed an issue with archiving zeta2, since both versions has the same name (it may be similar issues with other overloaded function names). I do not know what is zeta, but I am attaching a patch fixing it. To have the same printout of the function as before, a new function zeta2_print_dflt() has to be introduced. Best wishes, Vladimir -- Vladimir V. Kisil http://www.maths.leeds.ac.uk/~kisilv/ Book: Geometry of Mobius Transformations http://goo.gl/EaG2Vu Software: Geometry of cycles http://moebinv.sourceforge.net/ Jupyter: https://github.com/vvkisil/MoebInv-notebooks
On Tue, 31 Mar 2020 04:42:05 +0000, Feng Feng <f.feng@outlook.com> said:
FF> Hi all, FF> I came across a problem about the archive and unarchive on FF> functions with a variable number of arguments. for example, the FF> following c++ code produces the output: zeta(10,x) :> FF> 1/93555*Pi^10. it seems that the unarchive just return FF> zeta(10). FF> Best regards! Feng FF> //--- FF> symbol x("x"); ex zx = zeta(10,x); FF> archive ar_out; ar_out.archive_ex(zx, "zx"); ofstream FF> out("tmp.gar"); out << ar_out; out.close(); FF> lst syms = {x}; archive ar_in; ifstream in("tmp.gar"); in >> FF> ar_in; in.close(); FF> cout << zx << " :> " << ar_in.unarchive_ex(syms,"zx") << FF> endl; FF> //--- _______________________________________________ GiNaC-list FF> mailing list GiNaC-list@ginac.de FF> https://www.ginac.de/mailman/listinfo/ginac-list
Hi! On 06.04.20 14:23, Vladimir V. Kisil wrote:
It seems there is indeed an issue with archiving zeta2, since both versions has the same name (it may be similar issues with other overloaded function names). I do not know what is zeta, but I am attaching a patch fixing it. To have the same printout of the function as before, a new function zeta2_print_dflt() has to be introduced.
Thanks a lot for the patch! I think we can do a little bit better in this case: The archive contains the function's number of parameters - after all the parameters are stored in it. So, let's use this information and try a little harder matching the correct overload when reading the archive node. I've committed a fix. Cheers -richy. PS: Vladimir, I can't believe that you don't know what zeta is. :)
Dear Richard, Thanks for properly fixing it. Looking into the matter I also was not able to understand LaTeX printing routine for zeta with two parameters: it outputs \zeta(10) for zeta(10,x). But as I said, I am not familiar with zeta with two arguments to judge the situation. Best wishes, Vladimir -- Vladimir V. Kisil http://www.maths.leeds.ac.uk/~kisilv/ Book: Geometry of Mobius Transformations http://goo.gl/EaG2Vu Software: Geometry of cycles http://moebinv.sourceforge.net/ Jupyter: https://github.com/vvkisil/MoebInv-notebooks
On Wed, 8 Apr 2020 00:13:11 +0200, "Richard B. Kreckel" <kreckel@in.terlu.de> said:
RK> Hi! RK> On 06.04.20 14:23, Vladimir V. Kisil wrote: >> It seems there is indeed an issue with archiving zeta2, since >> both versions has the same name (it may be similar issues with >> other overloaded function names). I do not know what is zeta, but >> I am attaching a patch fixing it. To have the same printout of >> the function as before, a new function zeta2_print_dflt() has to >> be introduced. RK> Thanks a lot for the patch! RK> I think we can do a little bit better in this case: The archive RK> contains the function's number of parameters - after all the RK> parameters are stored in it. So, let's use this information and RK> try a little harder matching the correct overload when reading RK> the archive node. RK> I've committed a fix. RK> Cheers -richy. RK> PS: Vladimir, I can't believe that you don't know what zeta is. RK> :) _______________________________________________ GiNaC-list RK> mailing list GiNaC-list@ginac.de RK> https://www.ginac.de/mailman/listinfo/ginac-list
Hi! Right: function zeta2_print_latex(x, s, c) prints zeta(5,x) as \zeta(5). This must be a bug. I have no idea why this function does that. I guess only Jens Vollinga (on this list) or Stefan Weinzierl (in CC) would know. All my best, -richy. On 08.04.20 08:07, Vladimir V. Kisil wrote:
Dear Richard,
Thanks for properly fixing it. Looking into the matter I also was not able to understand LaTeX printing routine for zeta with two parameters: it outputs \zeta(10) for zeta(10,x). But as I said, I am not familiar with zeta with two arguments to judge the situation.
Best wishes, Vladimir
participants (3)
-
Feng Feng
-
Richard B. Kreckel
-
Vladimir V. Kisil