[GiNaC-devel] Domain of symbol

Vladimir V. Kisil kisilv at maths.leeds.ac.uk
Fri Nov 8 21:57:52 CET 2019


	Dear All,

  Consider the code:

#include <iostream>
#include <ginac/ginac.h>
using namespace std;
using namespace GiNaC;
int main()
{
	for (int i=0; i < 2; ++i)
		(i==0? realsymbol("r") : symbol("s")).dbgprinttree();
	
	return 0;
}

  My expectation would be that it first creates a realsymbol r and then
  a symbol s. However, the actual output of the programme is:

r (symbol) @0x7fff6e472700, serial=1, hash=0x1689b718, flags=0x6, domain=0
s (symbol) @0x7fff6e472700, serial=2, hash=0x1689b718, flags=0x6, domain=0

  That is, in both cases the domain is 0 (complex) and r is not
  recognised as a real symbol.

  Shall this be corrected or did I misunderstand the concept of (A? B : C)
  construct?

  Best wishes,
  Vladimir

PS Another (less important and more disputable) question: do we want the
  debug output for realsymbol/possymbol look like

r (realsymbol) @0x7fff6e472700, serial=1, hash=0x1689b718, flags=0x6, domain=1
p (possymbol) @0x7fff6e472700, serial=1, hash=0x1689b718, flags=0x6, domain=2

  to make the class more visible?
-- 
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 (Colab):         https://github.com/vvkisil/MoebInv-notebooks
  Jupyter (CodeOcean):       https://codeocean.com/capsule/7952650/tree


More information about the GiNaC-devel mailing list