]> www.ginac.de Git - ginac.git/blobdiff - ginac/basic.cpp
- carried on with felonious plot about making ex::bp private.
[ginac.git] / ginac / basic.cpp
index 8d60fcfcc0b708e7ea202a1f4257ee8fcb5e3ae3..1aff2e16671edfbd530c06dd6e0392ee35902b01 100644 (file)
@@ -101,12 +101,6 @@ void basic::archive(archive_node &n) const
        n.add_string("class", class_name());
 }
 
-//////////
-// functions overriding virtual functions from bases classes
-//////////
-
-// none
-
 //////////
 // new virtual functions which can be overridden by derived classes
 //////////
@@ -202,9 +196,9 @@ ex & basic::let_op(int i)
 
 ex basic::operator[](const ex & index) const
 {
-       if (is_exactly_of_type(*index.bp,numeric))
-               return op(static_cast<const numeric &>(*index.bp).to_int());
-       
+       if (is_ex_exactly_of_type(index,numeric))
+               return op(ex_to<numeric>(index).to_int());
+
        throw(std::invalid_argument("non-numeric indices not supported by this type"));
 }
 
@@ -311,7 +305,7 @@ ex basic::collect(const ex & s, bool distributed) const
                                // Increment counters
                                int n = num - 1;
                                while (true) {
-                                       si[n].cnt++;
+                                       ++si[n].cnt;
                                        if (si[n].cnt <= si[n].deg) {
                                                // Update coefficients
                                                ex c;
@@ -351,7 +345,7 @@ done:               delete[] si;
        return x + (*this - x).expand();
 }
 
-/** Perform automatic non-interruptive symbolic evaluation on expression. */
+/** Perform automatic non-interruptive term rewriting rules. */
 ex basic::eval(int level) const
 {
        // There is nothing to do for basic objects: