patch for pseries.

Chris Dams chrisd at sci.kun.nl
Tue Jun 15 16:43:38 CEST 2004


Dear GiNaCers,

Some more changes for pseries. I think most of them do not need
explaination.

Best,
Chrsi
-------------- next part --------------
Index: pseries.cpp
===================================================================
RCS file: /home/cvs/GiNaC/ginac/pseries.cpp,v
retrieving revision 1.78
diff -r1.78 pseries.cpp
884c884
< 	deg = deg - p.to_int()*ldeg;
---
> 	deg = deg - (p*ldeg).to_int();
960c960
< 	if (!must_expand_basis && !basis.subs(r, subs_options::no_pattern).is_zero())
---
> 	if (!must_expand_basis && !basis.subs(r, subs_options::no_pattern).is_zero() && !is_a<add>(basis))
975c975
< 	int intexp = ex_to<numeric>(exponent).to_int();
---
> 	numeric numexp = ex_to<numeric>(exponent);
987c987,989
< 	ex e = basis.series(r, order + real_ldegree*(1-intexp), options);
---
> 	if(!(real_ldegree*numexp).is_integer())
> 		throw std::runtime_error("pseries::power_const(): trying to assemble a Puiseux series");
> 	ex e = basis.series(r, (order + real_ldegree*(1-numexp)).to_int(), options);
991c993
< 		result = ex_to<pseries>(e).power_const(intexp, order);
---
> 		result = ex_to<pseries>(e).power_const(numexp, order);


More information about the GiNaC-devel mailing list