GINAC_IMPLEMENT_REGISTERED_CLASS_OPT(relational, basic,
print_func<print_context>(&relational::do_print).
- print_func<print_tree>(&basic::do_print_tree).
+ print_func<print_tree>(&relational::do_print_tree).
print_func<print_python_repr>(&relational::do_print_python_repr))
//////////
ex relational::map(map_function & f) const
{
- return (new relational(f(lh), f(rh), o))->setflag(status_flags::dynallocated);
+ const ex &mapped_lh = f(lh);
+ const ex &mapped_rh = f(rh);
+
+ if (!are_ex_trivially_equal(lh, mapped_lh)
+ || !are_ex_trivially_equal(rh, mapped_rh))
+ return (new relational(mapped_lh, mapped_rh, o))->setflag(status_flags::dynallocated);
+ else
+ return *this;
}
ex relational::eval(int level) const