typing error in mul.cpp

Chris Dams chrisd at sci.kun.nl
Thu Jun 19 00:59:25 CEST 2003


Hello,

On Wed, 18 Jun 2003, Christian Bauer wrote:

> Some automated checks for the algebraic subs() are desparately needed...

Ok, here is a patch.

Bye,
Chris Dams


-------------- next part --------------
Index: check/exam_misc.cpp
===================================================================
RCS file: /home/cvs/GiNaC/check/exam_misc.cpp,v
retrieving revision 1.10.2.4.2.1
diff -r1.10.2.4.2.1 exam_misc.cpp
245a246,265
> static unsigned exam_subs_algebraic()
> {
> 	unsigned result = 0;
> 	symbol x("x"), y("y");
> 
> 	ex e = ex(x*x*x*y*y).subs(x*y==2, subs_options::subs_algebraic);
> 	if(e != 4*x) {
> 		clog << "(x^3*y^2).subs(x*y==2,subs_options::subs_algebraic) erroneously returned " << e << endl;
> 		++result;
> 	}
> 
> 	e = ex(x*x*x*x*x).subs(x*x==y, subs_options::subs_algebraic);
> 	if(e != y*y*x) {
> 		clog << "x^5.subs(x^2==y,subs_options::subs_algebraic) erroneously returned " << e << endl;
> 		++result;
> 	}
> 	
> 	return result;
> }
> 
259a280
> 	result += exam_subs_algebraic(); cout << '.' << flush;


More information about the GiNaC-devel mailing list