[GiNaC-devel] problem with dbgprint.

Chris Dams C.Dams at science.ru.nl
Thu Sep 23 16:04:04 CEST 2004


Dear all,

I found out that the program

	#include <iostream>
	#include <ginac/ginac.h>

	using namespace std;
	using namespace GiNaC;

	int main(int argc, char** argv)
	{  symbol x("x");
   	   ex_to<power>(x*x).dbgprint();
   	   return 0;
	}

gives the output

	[power object]

This is because in basic::dbgprint a print_context is constructed from
std::cerr and not a print_dflt. Changing, in basic::dbgprint, the line

	this->print(std::cerr);

into

	this->print(print_dflt(std::cerr));

solves this problem.

Now the output is

	x^2

as expected.

Best,
Chris




More information about the GiNaC-devel mailing list