* of any interest to the user of the library. */
/*
- * GiNaC Copyright (C) 1999-2003 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2004 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
class dunno {};
// some compilers (e.g. cygwin) define a macro log2, causing confusion
-#ifndef log2
-unsigned log2(unsigned n);
+#ifdef log2
+#undef log2
#endif
+unsigned log2(unsigned n);
+
/** Compare two pointers (just to establish some sort of canonical order).
* @return -1, 0, or 1 */
template <class T>
// Helper macros for class implementations (mostly useful for trivial classes)
#define DEFAULT_CTOR(classname) \
-classname::classname() : inherited(TINFO_##classname) {}
+classname::classname() : inherited(TINFO_##classname) { setflag(status_flags::evaluated | status_flags::expanded); }
#define DEFAULT_UNARCHIVE(classname) \
ex classname::unarchive(const archive_node &n, lst &sym_lst) \
}
#define DEFAULT_PRINT(classname, text) \
-void classname::print(const print_context & c, unsigned level) const \
+void classname::do_print(const print_context & c, unsigned level) const \
{ \
- if (is_a<print_tree>(c)) \
- inherited::print(c, level); \
- else \
- c.s << text; \
+ c.s << text; \
}
#define DEFAULT_PRINT_LATEX(classname, text, latex) \
-void classname::print(const print_context & c, unsigned level) const \
+DEFAULT_PRINT(classname, text) \
+void classname::do_print_latex(const print_latex & c, unsigned level) const \
{ \
- if (is_a<print_tree>(c)) \
- inherited::print(c, level); \
- else if (is_a<print_latex>(c)) \
- c.s << latex; \
- else \
- c.s << text; \
+ c.s << latex; \
}
} // namespace GiNaC