55realsymbol::realsymbol() :
symbol() { }
70 name(initname), TeX_name(
"")
76 serial(next_serial++), name(initname), TeX_name(texname)
86 :
symbol(initname, texname) { }
102 inherited::read_archive(
n, sym_lst);
104 std::string tmp_name;
105 n.find_string(
"name", tmp_name);
108 for (
auto & s : sym_lst) {
109 if (is_a<symbol>(s) && (ex_to<symbol>(s).name == tmp_name)) {
110 *
this = ex_to<symbol>(s);
135 inherited::archive(
n);
138 n.add_string(
"name",
name);
179 else if (!
name.empty())
187 c.s << std::string(level,
' ') <<
name <<
" (" << class_name() <<
")" <<
" @" <<
this
189 << std::hex <<
", hash=0x" <<
hashvalue <<
", flags=0x" <<
flags << std::dec
196 c.s << class_name() <<
"('";
226 return inherited::info(inf);
231 return conjugate_function(*this).hold();
236 return real_part_function(*this).hold();
241 return imag_part_function(*this).hold();
299 static std::map<std::string, std::string> standard_names;
300 static bool names_initialized =
false;
301 if (!names_initialized) {
302 standard_names[
"alpha"] = std::string(
"\\alpha");
303 standard_names[
"beta"] = std::string(
"\\beta");;
304 standard_names[
"gamma"] = std::string(
"\\gamma");;
305 standard_names[
"delta"] = std::string(
"\\delta");;
306 standard_names[
"epsilon"] = std::string(
"\\epsilon");
307 standard_names[
"varepsilon"] = std::string(
"\\varepsilon");
308 standard_names[
"zeta"] = std::string(
"\\zeta");
309 standard_names[
"eta" ] = std::string(
"\\eta" );
310 standard_names[
"theta"] = std::string(
"\\theta");
311 standard_names[
"vartheta"] = std::string(
"\\vartheta");
312 standard_names[
"iota"] = std::string(
"\\iota");
313 standard_names[
"kappa"] = std::string(
"\\kappa");
314 standard_names[
"lambda"] = std::string(
"\\lambda");
315 standard_names[
"mu"] = std::string(
"\\mu");
316 standard_names[
"nu"] = std::string(
"\\nu");
317 standard_names[
"xi"] = std::string(
"\\xi");
318 standard_names[
"omicron"] = std::string(
"\\omicron");
319 standard_names[
"pi"] = std::string(
"\\pi");
320 standard_names[
"varpi"] = std::string(
"\\varpi");
321 standard_names[
"rho"] = std::string(
"\\rho");
322 standard_names[
"varrho"] = std::string(
"\\varrho");
323 standard_names[
"sigma"] = std::string(
"\\sigma");
324 standard_names[
"varsigma"] = std::string(
"\\varsigma");
325 standard_names[
"tau"] = std::string(
"\\tau");
326 standard_names[
"upsilon"] = std::string(
"\\upsilon");
327 standard_names[
"phi"] = std::string(
"\\phi");
328 standard_names[
"varphi"] = std::string(
"\\varphi");
329 standard_names[
"chi"] = std::string(
"\\chi");
330 standard_names[
"psi"] = std::string(
"\\psi");
331 standard_names[
"omega"] = std::string(
"\\omega");
332 standard_names[
"Gamma"] = std::string(
"\\Gamma");
333 standard_names[
"Delta"] = std::string(
"\\Delta");
334 standard_names[
"Theta"] = std::string(
"\\Theta");
335 standard_names[
"Lambda"] = std::string(
"\\Lambda");
336 standard_names[
"Xi"] = std::string(
"\\Xi");
337 standard_names[
"Pi"] = std::string(
"\\Pi");
338 standard_names[
"Sigma"] = std::string(
"\\Sigma");
339 standard_names[
"Upsilon"] = std::string(
"\\Upsilon");
340 standard_names[
"Phi"] = std::string(
"\\Phi");
341 standard_names[
"Psi"] = std::string(
"\\Psi");
342 standard_names[
"Omega"] = std::string(
"\\Omega");
343 names_initialized =
true;
345 std::map<std::string, std::string>::const_iterator it = standard_names.find(name);
346 if (it != standard_names.end())
Archiving of GiNaC expressions.
#define GINAC_ASSERT(X)
Assertion macro for checking invariances.
This class stores all properties needed to record/retrieve the state of one object of class basic (or...
This class is the ABC (abstract base class) of GiNaC's class hierarchy.
const basic & setflag(unsigned f) const
Set some status_flags.
unsigned hashvalue
hash value
unsigned flags
of type status_flags
virtual int compare_same_type(const basic &other) const
Returns order relation between two objects of same type.
Wrapper template for making GiNaC classes out of STL containers.
container & append(const ex &b)
Add element at back.
Lightweight wrapper for GiNaC's symbolic objects.
Specialization of symbol to real positive domain.
Base class for print_contexts.
Context for latex-parsable output.
Context for python-parsable output.
Context for tree-like output for debugging.
Specialization of symbol to real domain.
@ expanded
.expand(0) has already done its job (other expand() options ignore this flag)
@ evaluated
.eval() has already done its job
@ dynallocated
heap-allocated (i.e. created by new if we want to be clever and bypass the stack,
@ hash_calculated
.calchash() has already done its job
unsigned serial
unique serial number for comparison
std::string TeX_name
LaTeX name of this symbol.
void read_archive(const archive_node &n, lst &syms) override
Read (a.k.a.
static unsigned next_serial
symbol(const std::string &initname)
bool is_polynomial(const ex &var) const override
Check whether this is a polynomial in the given variables.
virtual unsigned get_domain() const
void do_print_python_repr(const print_python_repr &c, unsigned level) const
bool is_equal_same_type(const basic &other) const override
Returns true if two objects of same type are equal.
std::string get_TeX_name() const
unsigned calchash() const override
Compute the hash value of an object and if it makes sense to store it in the objects status_flags,...
ex real_part() const override
void do_print(const print_context &c, unsigned level) const
void do_print_tree(const print_tree &c, unsigned level) const
ex conjugate() const override
void archive(archive_node &n) const override
Save (a.k.a.
ex derivative(const symbol &s) const override
Implementation of ex::diff() for single differentiation of a symbol.
void do_print_latex(const print_latex &c, unsigned level) const
std::string name
printname of this symbol
bool info(unsigned inf) const override
Information about the object.
std::string get_name() const
ex imag_part() const override
Interface to GiNaC's initially known functions.
Definition of GiNaC's lst.
unsigned golden_ratio_hash(uintptr_t n)
Truncated multiplication with golden ratio, for computing hash values.
static const std::string & get_default_TeX_name(const std::string &name)
Return default TeX name for symbol.
print_func< print_context >(&varidx::do_print). print_func< print_latex >(&varidx
static unsigned make_hash_seed(const std::type_info &tinfo)
We need a hash function which gives different values for objects of different types.
GINAC_IMPLEMENT_REGISTERED_CLASS_OPT_T(lst, basic, print_func< print_context >(&lst::do_print). print_func< print_tree >(&lst::do_print_tree)) template<> bool lst GINAC_BIND_UNARCHIVER(lst)
Specialization of container::info() for lst.
#define GINAC_IMPLEMENT_REGISTERED_CLASS_OPT(classname, supername, options)
Macro for inclusion in the implementation of each registered class.
Interface to GiNaC's symbolic objects.
Interface to several small and furry utilities needed within GiNaC but not of any interest to the use...