[GiNaC-list] Substitution and re-evaluation

Vladimir V. Kisil V.Kisil at leeds.ac.uk
Wed Nov 10 11:30:56 CET 2021


	Dear Gregor,

	Just a quick question: did you re-implement eval() method for
  your class?

  Best wishes,
  Vladimir
-- 
Vladimir V. Kisil                 http://www.maths.leeds.ac.uk/~kisilv/
  Book:      Geometry of Mobius Maps       https://doi.org/10.1142/p835
  Soft:      Geometry of cycles         http://moebinv.sourceforge.net/
  Jupyter notebooks:       https://github.com/vvkisil/MoebInv-notebooks
>>>>> On Wed, 10 Nov 2021 09:47:17 +0100, Gregor Kälin <kaelingre at gmail.com> said:

    GK> Hi,

    GK> I'm extending GiNaC by some new classes and ran into a problem
    GK> with subs and eval. My class, representing an integral, inherits
    GK> from basic and is essentially a container class containing
    GK> several ex's itself. The subs method, inherited from basic,
    GK> works as expected for the substitution step, but does not
    GK> re-evaluate the expression (i.e. the eval function of my class
    GK> is not called after the substitution happened). The tutorial
    GK> states "All GiNaC methods that transform expressions, like
    GK> subs() or normal(), automatically re-evaluate their results."
    GK> and, hence, I would expect that the default subs method of the
    GK> basic class calls eval somewhere in the process.  Is this a bug
    GK> in basic::subs or am I supposed to take care of a re-evaluation
    GK> of my custom classes myself (i.e. essentially overriding subs
    GK> and calling eval explicitly in the process)?  Looking into the
    GK> source code (I'm on commit 9197695fc, ginac version 1.8.1-1) I'd
    GK> expect a call to eval on line 628 of basic.cpp after all
    GK> operands have been substituted, and before subs_one_level is
    GK> called.

    GK> Best,

    GK> Gregor

    GK> _______________________________________________ GiNaC-list
    GK> mailing list GiNaC-list at ginac.de
    GK> https://www.ginac.de/mailman/listinfo/ginac-list


More information about the GiNaC-list mailing list