X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=ginac%2Fsymbol.cpp;h=2f8afc006700e698779b5bd4bb933d21138b1d10;hp=06016984f58f6fb1feeb4bccb9778e20b8d33761;hb=e5e2ac399c225a8c7248e1879e192eba00067538;hpb=4ef4fe159e18c9ef8aa2702875caf56c9e22f0c2 diff --git a/ginac/symbol.cpp b/ginac/symbol.cpp index 06016984..2f8afc00 100644 --- a/ginac/symbol.cpp +++ b/ginac/symbol.cpp @@ -42,18 +42,29 @@ GINAC_IMPLEMENT_REGISTERED_CLASS_OPT(symbol, basic, // default constructor ////////// +// symbol + symbol::symbol() - : inherited(TINFO_symbol), asexinfop(new assigned_ex_info), serial(next_serial++), name(autoname_prefix() + ToString(serial)), TeX_name(name), ret_type(return_types::commutative), ret_type_tinfo(TINFO_symbol), domain(symbol_options::complex) + : inherited(TINFO_symbol), asexinfop(new assigned_ex_info), serial(next_serial++), name(autoname_prefix() + ToString(serial)), TeX_name(name), ret_type(return_types::commutative), ret_type_tinfo(TINFO_symbol), domain(domain::complex) { setflag(status_flags::evaluated | status_flags::expanded); } +// realsymbol + +realsymbol::realsymbol() +{ + domain = domain::real; +} + ////////// // other constructors ////////// // public +// symbol + symbol::symbol(const std::string & initname, unsigned domain) : inherited(TINFO_symbol), asexinfop(new assigned_ex_info), serial(next_serial++), name(initname), TeX_name(default_TeX_name()), ret_type(return_types::commutative), ret_type_tinfo(TINFO_symbol), domain(domain) { @@ -78,6 +89,20 @@ symbol::symbol(const std::string & initname, const std::string & texname, unsign setflag(status_flags::evaluated | status_flags::expanded); } +// realsymbol + +realsymbol::realsymbol(const std::string & initname, unsigned domain) + : symbol(initname, domain) { } + +realsymbol::realsymbol(const std::string & initname, const std::string & texname, unsigned domain) + : symbol(initname, texname, domain) { } + +realsymbol::realsymbol(const std::string & initname, unsigned rt, unsigned rtt, unsigned domain) + : symbol(initname, rt, rtt, domain) { } + +realsymbol::realsymbol(const std::string & initname, const std::string & texname, unsigned rt, unsigned rtt, unsigned domain) + : symbol(initname, texname, rt, rtt, domain) { } + ////////// // archiving ////////// @@ -91,7 +116,7 @@ symbol::symbol(const archive_node &n, lst &sym_lst) if (!n.find_string("TeXname", TeX_name)) TeX_name = default_TeX_name(); if (!n.find_unsigned("domain", domain)) - domain = symbol_options::complex; + domain = domain::complex; if (!n.find_unsigned("return_type", ret_type)) ret_type = return_types::commutative; if (!n.find_unsigned("return_type_tinfo", ret_type_tinfo)) @@ -122,7 +147,7 @@ void symbol::archive(archive_node &n) const n.add_string("name", name); if (TeX_name != default_TeX_name()) n.add_string("TeX_name", TeX_name); - if (domain != symbol_options::complex) + if (domain != domain::complex) n.add_unsigned("domain", domain); if (ret_type != return_types::commutative) n.add_unsigned("return_type", ret_type); @@ -175,7 +200,7 @@ bool symbol::info(unsigned inf) const inf == info_flags::rational_function) return true; if (inf == info_flags::real) - return domain == symbol_options::real; + return domain == domain::real; else return inherited::info(inf); } @@ -198,8 +223,8 @@ ex symbol::eval(int level) const ex symbol::conjugate() const { - if (this->domain == symbol_options::complex) { - return GiNaC::conjugate(*this).hold(); + if (this->domain == domain::complex) { + return GiNaC::conjugate_function(*this).hold(); } else { return *this; }