* Implementation of GiNaC's symbolic objects. */
/*
- * GiNaC Copyright (C) 1999-2010 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2015 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
// public
+std::string symbol::get_name() const
+{
+ if (name.empty()) {
+ std::ostringstream s;
+ s << "symbol" << serial;
+ name = s.str();
+ }
+ return name;
+}
+
+// protected
+
void symbol::do_print(const print_context & c, unsigned level) const
{
- if (!name.empty())
- c.s << name;
- else
- c.s << "symbol" << serial;
+ c.s << get_name();
}
void symbol::do_print_latex(const print_latex & c, unsigned level) const