From: Richard Kreckel Date: Wed, 14 Mar 2001 21:31:28 +0000 (+0000) Subject: * ex.h: add docu. X-Git-Tag: release_0-8-0~27 X-Git-Url: https://ginac.de/ginac.git/tutorial/ginac.git?a=commitdiff_plain;h=51cdfef2f7b38d28ad4228152ae07f78dd2fe7e9;p=ginac.git * ex.h: add docu. * normal.cpp: make sqrfree_yun() static. * basic.cpp (compare): slightly clarify syntax. --- diff --git a/ginac/basic.cpp b/ginac/basic.cpp index a7645ac5..9fc4fa30 100644 --- a/ginac/basic.cpp +++ b/ginac/basic.cpp @@ -371,7 +371,8 @@ ex basic::derivative(const symbol & s) const /** Returns order relation between two objects of same type. This needs to be * implemented by each class. It may never return anything else than 0, * signalling equality, or +1 and -1 signalling inequality and determining - * the canonical ordering. */ + * the canonical ordering. (Perl hackers will wonder why C++ doesn't feature + * the spaceship operator <=> for denoting just this.) */ int basic::compare_same_type(const basic & other) const { return compare_pointers(this, &other); @@ -502,16 +503,18 @@ int basic::compare(const basic & other) const GINAC_ASSERT(typeid(*this)==typeid(other)); - int cmpval = compare_same_type(other); - if ((cmpval!=0) && (hash_this<0x80000000U)) { +// int cmpval = compare_same_type(other); +// if ((cmpval!=0) && (hash_this<0x80000000U)) { // std::cout << "hash collision, same type: " // << *this << " and " << other << std::endl; // this->printraw(std::cout); // std::cout << " and "; // other.printraw(std::cout); // std::cout << std::endl; - } - return cmpval; +// } +// return cmpval; + + return compare_same_type(other); } /** Test for equality. diff --git a/ginac/ex.h b/ginac/ex.h index f2feba73..ce0fe8c1 100644 --- a/ginac/ex.h +++ b/ginac/ex.h @@ -39,7 +39,8 @@ class scalar_products; /** Lightweight wrapper for GiNaC's symbolic objects. Basically all it does is * to hold a pointer to the other objects, manage the reference counting and - * provide methods for manipulation of these objects. */ + * provide methods for manipulation of these objects. (Some people call such + * a thing a proxy class.) */ class ex { friend class basic; diff --git a/ginac/normal.cpp b/ginac/normal.cpp index e9d883f5..334bf95a 100644 --- a/ginac/normal.cpp +++ b/ginac/normal.cpp @@ -1698,7 +1698,7 @@ ex lcm(const ex &a, const ex &b, bool check_args) * polynomial in x. * @param x variable to factor in * @return vector of factors sorted in ascending degree */ -exvector sqrfree_yun(const ex &a, const symbol &x) +static exvector sqrfree_yun(const ex &a, const symbol &x) { int i = 0; exvector res;