59 constant::constant(
const std::string & initname,
evalffunctype efun,
const std::string & texname,
unsigned dm)
60 : name(initname), ef(efun), serial(next_serial++),
domain(dm)
70 : name(initname), ef(nullptr), number(initnumber), serial(next_serial++),
domain(dm)
88 if (
n.find_string(
"name", s)) {
96 throw (std::runtime_error(
"unknown constant '" + s +
"' in archive"));
98 throw (std::runtime_error(
"unnamed constant in archive"));
104 inherited::archive(
n);
105 n.add_string(
"name",
name);
121 c.s << std::string(level,
' ') <<
name <<
" (" << class_name() <<
")" <<
" @" <<
this 122 << std::hex <<
", hash=0x" <<
hashvalue <<
", flags=0x" <<
flags << std::dec
133 c.s << class_name() <<
"('" <<
name <<
"'";
148 return inherited::info(inf);
170 return conjugate_function(*this).hold();
177 return real_part_function(*this).hold();
184 return imag_part_function(*this).hold();
218 const void* typeid_this = (
const void*)
typeid(*this).name();
ex imag_part() const override
void do_print(const print_context &c, unsigned level) const
unsigned hashvalue
hash value
ex PiEvalf()
Floating point evaluation of Archimedes' constant Pi.
const basic & setflag(unsigned f) const
Set some status_flags.
ex EulerEvalf()
Floating point evaluation of Euler's constant gamma.
bool is_equal_same_type(const basic &other) const override
Returns true if two objects of same type are equal.
Interface to GiNaC's constant types and some special constants.
bool info(unsigned inf) const override
Information about the object.
static unsigned next_serial
Archiving of GiNaC expressions.
This class is the ABC (abstract base class) of GiNaC's class hierarchy.
Context for python-parsable output.
This class holds constants, symbols with specific numerical value.
ex conjugate() const override
Interface to several small and furry utilities needed within GiNaC but not of any interest to the use...
unsigned calchash() const override
Compute the hash value of an object and if it makes sense to store it in the objects status_flags...
This class is a wrapper around CLN-numbers within the GiNaC class hierarchy.
Context for latex-parsable output.
void archive(archive_node &n) const override
Save (serialize) the object into archive node.
void do_print_python_repr(const print_python_repr &c, unsigned level) const
print_func< print_context >(&varidx::do_print). print_func< print_latex >(&varidx
const constant Euler("Euler", EulerEvalf, "\amma_E", domain::positive)
Euler's constant.
void do_print_tree(const print_tree &c, unsigned level) const
#define GINAC_ASSERT(X)
Assertion macro for checking invariances.
void read_archive(const archive_node &n, lst &syms) override
Load (deserialize) the object from an archive node.
GINAC_IMPLEMENT_REGISTERED_CLASS_OPT(add, expairseq, print_func< print_context >(&add::do_print). print_func< print_latex >(&add::do_print_latex). print_func< print_csrc >(&add::do_print_csrc). print_func< print_tree >(&add::do_print_tree). print_func< print_python_repr >(&add::do_print_python_repr)) add
ex real_part() const override
bool is_polynomial(const ex &var) const override
Check whether this is a polynomial in the given variables.
unsigned golden_ratio_hash(uintptr_t n)
Truncated multiplication with golden ratio, for computing hash values.
Interface to GiNaC's light-weight expression handles.
Base class for print_contexts.
ex CatalanEvalf()
Floating point evaluation of Catalan's constant.
std::string TeX_name
LaTeX name.
This class stores all properties needed to record/retrieve the state of one object of class basic (or...
Lightweight wrapper for GiNaC's symbolic objects.
ex number
numerical value this constant evalf()s to
const constant Pi("Pi", PiEvalf, "\i", domain::positive)
Pi.
std::string name
printname of this constant
Interface to GiNaC's initially known functions.
unsigned serial
unique serial number for comparison
.calchash() has already done its job
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.
.expand(0) has already done its job (other expand() options ignore this flag)
Makes the interface to the underlying bignum package available.
ex evalf() const override
Evaluate object numerically.
ex derivative(const symbol &s) const override
Implementation of ex::diff() for a constant always returns 0.
constant(const std::string &initname, evalffunctype efun=nullptr, const std::string &texname=std::string(), unsigned domain=domain::complex)
const constant Catalan("Catalan", CatalanEvalf, "G", domain::positive)
Catalan's constant.
.eval() has already done its job
Context for tree-like output for debugging.
unsigned flags
of type status_flags
GINAC_BIND_UNARCHIVER(add)
void do_print_latex(const print_latex &c, unsigned level) const