n.add_string("class", class_name());
}
-//////////
-// functions overriding virtual functions from bases classes
-//////////
-
-// none
-
//////////
// new virtual functions which can be overridden by derived classes
//////////
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"));
}
// 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;
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: