X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=ginac%2Fpseries.cpp;h=0f29e5f547698e08323e31525f6dc451a4ec49cc;hp=b12c8297353dbc48323c2bdf409c7690c17d7349;hb=0a41902fc56d32309e21412c877305403b3b74c3;hpb=ad51b1d1be1d78d4895aa140037f2d3be578d3fe diff --git a/ginac/pseries.cpp b/ginac/pseries.cpp index b12c8297..0f29e5f5 100644 --- a/ginac/pseries.cpp +++ b/ginac/pseries.cpp @@ -56,13 +56,13 @@ pseries::~pseries() destroy(false); } -pseries::pseries(pseries const &other) +pseries::pseries(const pseries &other) { debugmsg("pseries copy constructor", LOGLEVEL_CONSTRUCT); copy(other); } -pseries const &pseries::operator=(pseries const & other) +const pseries &pseries::operator=(const pseries & other) { debugmsg("pseries operator=", LOGLEVEL_ASSIGNMENT); if (this != &other) { @@ -72,7 +72,7 @@ pseries const &pseries::operator=(pseries const & other) return *this; } -void pseries::copy(pseries const &other) +void pseries::copy(const pseries &other) { inherited::copy(other); seq = other.seq; @@ -101,7 +101,7 @@ void pseries::destroy(bool call_parent) * @param point_ expansion point * @param ops_ vector of {coefficient, power} pairs (coefficient must not be zero) * @return newly constructed pseries */ -pseries::pseries(ex const &var_, ex const &point_, epvector const &ops_) +pseries::pseries(const ex &var_, const ex &point_, const epvector &ops_) : basic(TINFO_pseries), seq(ops_), var(var_), point(point_) { debugmsg("pseries constructor from ex,ex,epvector", LOGLEVEL_CONSTRUCT); @@ -162,13 +162,13 @@ basic *pseries::duplicate() const void pseries::print(ostream &os, unsigned upper_precedence) const { - debugmsg("symbol print", LOGLEVEL_PRINT); - convert_to_poly().print(os, upper_precedence); + debugmsg("pseries print", LOGLEVEL_PRINT); + convert_to_poly().print(os, upper_precedence); } void pseries::printraw(ostream &os) const { - debugmsg("symbol printraw", LOGLEVEL_PRINT); + debugmsg("pseries printraw", LOGLEVEL_PRINT); os << "pseries(" << var << ";" << point << ";"; for (epvector::const_iterator i=seq.begin(); i!=seq.end(); i++) { os << "(" << (*i).rest << "," << (*i).coeff << "),"; @@ -178,14 +178,14 @@ void pseries::printraw(ostream &os) const unsigned pseries::nops(void) const { - return seq.size(); + return seq.size(); } ex pseries::op(int i) const { - if (i < 0 || i >= seq.size()) - throw (std::out_of_range("op() out of range")); - return seq[i].rest * power(var - point, seq[i].coeff); + if (i < 0 || unsigned(i) >= seq.size()) + throw (std::out_of_range("op() out of range")); + return seq[i].rest * power(var - point, seq[i].coeff); } ex &pseries::let_op(int i) @@ -193,7 +193,7 @@ ex &pseries::let_op(int i) throw (std::logic_error("let_op not defined for pseries")); } -int pseries::degree(symbol const &s) const +int pseries::degree(const symbol &s) const { if (var.is_equal(s)) { // Return last exponent @@ -216,7 +216,7 @@ int pseries::degree(symbol const &s) const } } -int pseries::ldegree(symbol const &s) const +int pseries::ldegree(const symbol &s) const { if (var.is_equal(s)) { // Return first exponent @@ -239,7 +239,7 @@ int pseries::ldegree(symbol const &s) const } } -ex pseries::coeff(symbol const &s, int const n) const +ex pseries::coeff(const symbol &s, int n) const { if (var.is_equal(s)) { epvector::const_iterator it = seq.begin(), itend = seq.end(); @@ -278,7 +278,7 @@ ex pseries::evalf(int level) const return convert_to_poly().evalf(level); } -ex pseries::subs(lst const & ls, lst const & lr) const +ex pseries::subs(const lst & ls, const lst & lr) const { // If expansion variable is being substituted, convert the series to a // polynomial and do the substitution there because the result might @@ -329,7 +329,7 @@ ex pseries::convert_to_poly(bool no_order) const /** Default implementation of ex::series(). This performs Taylor expansion. * @see ex::series */ -ex basic::series(symbol const & s, ex const & point, int order) const +ex basic::series(const symbol & s, const ex & point, int order) const { epvector seq; numeric fac(1); @@ -361,7 +361,7 @@ ex basic::series(symbol const & s, ex const & point, int order) const /** Implementation of ex::series() for symbols. * @see ex::series */ -ex symbol::series(symbol const & s, ex const & point, int order) const +ex symbol::series(const symbol & s, const ex & point, int order) const { epvector seq; if (is_equal(s)) { @@ -377,8 +377,8 @@ ex symbol::series(symbol const & s, ex const & point, int order) const } -/** Add one series object to another, producing a pseries object that represents - * the sum. +/** Add one series object to another, producing a pseries object that + * represents the sum. * * @param other pseries object to add with * @return the sum as a pseries */ @@ -454,7 +454,7 @@ ex pseries::add_series(const pseries &other) const /** Implementation of ex::series() for sums. This performs series addition when * adding pseries objects. * @see ex::series */ -ex add::series(symbol const & s, ex const & point, int order) const +ex add::series(const symbol & s, const ex & point, int order) const { ex acc; // Series accumulator @@ -480,8 +480,8 @@ ex add::series(symbol const & s, ex const & point, int order) const } -/** Multiply a pseries object with a numeric constant, producing a pseries object - * that represents the product. +/** Multiply a pseries object with a numeric constant, producing a pseries + * object that represents the product. * * @param other constant to multiply with * @return the product as a pseries */ @@ -559,7 +559,7 @@ ex pseries::mul_series(const pseries &other) const /** Implementation of ex::series() for product. This performs series * multiplication when multiplying series. * @see ex::series */ -ex mul::series(symbol const & s, ex const & point, int order) const +ex mul::series(const symbol & s, const ex & point, int order) const { ex acc; // Series accumulator @@ -639,7 +639,7 @@ ex pseries::power_const(const numeric &p, int deg) const /** Implementation of ex::series() for powers. This performs Laurent expansion * of reciprocals of series at singularities. * @see ex::series */ -ex power::series(symbol const & s, ex const & point, int order) const +ex power::series(const symbol & s, const ex & point, int order) const { ex e; if (!is_ex_exactly_of_type(basis, pseries)) { @@ -672,7 +672,7 @@ ex power::series(symbol const & s, ex const & point, int order) const * @param point expansion point * @param order truncation order of series calculations * @return an expression holding a pseries object */ -ex ex::series(symbol const &s, ex const &point, int order) const +ex ex::series(const symbol &s, const ex &point, int order) const { GINAC_ASSERT(bp!=0); return bp->series(s, point, order); @@ -681,7 +681,7 @@ ex ex::series(symbol const &s, ex const &point, int order) const // Global constants const pseries some_pseries; -type_info const & typeid_pseries = typeid(some_pseries); +const type_info & typeid_pseries = typeid(some_pseries); #ifndef NO_GINAC_NAMESPACE } // namespace GiNaC