X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=ginac%2Fpseries.h;h=26c27306250a03a03177764962efc32734349cfc;hp=72586eaf96648cdff54627260afc8a1cc08c766d;hb=dbd9c306a74f1cb258c0d15a346b973b39deaad2;hpb=b9cd4b49ffbfbf3e1c36a2b594ec3148a5baca64;ds=sidebyside diff --git a/ginac/pseries.h b/ginac/pseries.h index 72586eaf..26c27306 100644 --- a/ginac/pseries.h +++ b/ginac/pseries.h @@ -3,7 +3,7 @@ * Interface to class for extended truncated power series. */ /* - * GiNaC Copyright (C) 1999-2001 Johannes Gutenberg University Mainz, Germany + * GiNaC Copyright (C) 1999-2003 Johannes Gutenberg University Mainz, Germany * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -101,16 +101,13 @@ protected: ex point; }; -/** Return a reference to the pseries object embedded in an expression. - * The result is undefined if the expression does not contain a pseries - * object at its top level. - * - * @param e expression - * @return reference to pseries object - * @see is_ex_of_type */ -inline const pseries &ex_to_pseries(const ex &e) + +// utility functions + +/** Specialization of is_exactly_a(obj) for pseries objects. */ +template<> inline bool is_exactly_a(const basic & obj) { - return static_cast(*e.bp); + return obj.tinfo()==TINFO_pseries; } /** Convert the pseries object embedded in an expression to an ordinary @@ -119,11 +116,11 @@ inline const pseries &ex_to_pseries(const ex &e) * * @param e expression * @return polynomial expression - * @see is_ex_of_type + * @see is_a<> * @see pseries::convert_to_poly */ inline ex series_to_poly(const ex &e) { - return (static_cast(*e.bp).convert_to_poly(true)); + return (ex_to(e).convert_to_poly(true)); } inline bool is_terminating(const pseries & s)