53 lh(
lhs), rh(
rhs), o(oper) { }
61 inherited::read_archive(
n, sym_lst);
63 if (!(
n.find_unsigned(
"op", opi)))
64 throw (std::runtime_error(
"unknown relational operator in archive"));
66 n.find_ex(
"lh",
lh, sym_lst);
67 n.find_ex(
"rh",
rh, sym_lst);
73 inherited::archive(
n);
76 n.add_unsigned(
"op",
o);
107 c.s <<
"(INVALID RELATIONAL OPERATOR)";
125 c.s << class_name() <<
'(';
164 return i==0 ?
lh :
rh;
169 const ex &mapped_lh = f(
lh);
170 const ex &mapped_rh = f(
rh);
174 return dynallocate<relational>(mapped_lh, mapped_rh,
o);
207 return (
o < oth.
o) ? -1 : 1;
211 return (
o < oth.
o) ? -1 : 1;
215 return (
o < oth.
o) ? -1 : 1;
219 return (
o < oth.
o) ? -1 : 1;
223 return (
o < oth.
o) ? -1 : 1;
227 return (lcmpval!=0) ? lcmpval :
rh.
compare(oth.
lh);
312 if (!is_exactly_a<numeric>(df))
330 throw(std::logic_error(
"invalid relational operator"));
size_t nops() const override
Number of operands/members.
unsigned return_type() const override
unsigned hashvalue
hash value
int compare(const ex &other) const
ex subs(const exmap &m, unsigned options=0) 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...
bool is_equal(const ex &other) const
const basic & setflag(unsigned f) const
Set some status_flags.
void read_archive(const archive_node &n, lst &syms) override
Read (a.k.a.
ex eval_ncmul(const exvector &v) const
This class holds a relation consisting of two expressions and a logical relation between them...
Archiving of GiNaC expressions.
This class is the ABC (abstract base class) of GiNaC's class hierarchy.
Context for python-parsable output.
bool are_ex_trivially_equal(const ex &e1, const ex &e2)
Compare two objects of class quickly without doing a deep tree traversal.
ex eval_ncmul(const exvector &v) const override
ex subs(const exmap &m, unsigned options=0) const override
Substitute a set of objects by arbitrary expressions.
Interface to several small and furry utilities needed within GiNaC but not of any interest to the use...
bool is_zero(const ex &thisex)
safe_bool make_safe_bool(bool) const
void(safe_bool_helper::* safe_bool)()
relational(const ex &lhs, const ex &rhs, operators oper=equal)
print_func< print_context >(&varidx::do_print). print_func< print_latex >(&varidx
#define GINAC_ASSERT(X)
Assertion macro for checking invariances.
ex subs_one_level(const exmap &m, unsigned options) const
Helper function for subs().
static unsigned make_hash_seed(const std::type_info &tinfo)
We need a hash function which gives different values for objects of different types.
static void print_operator(const print_context &c, relational::operators o)
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
To distinguish between different kinds of non-commutative objects.
unsigned precedence() const override
Return relative operator precedence (for parenthezing output).
std::vector< ex > exvector
std::map< ex, ex, ex_is_less > exmap
Interface to GiNaC's overloaded operators.
Function object for map().
return_type_t return_type_tinfo() const
Base class for print_contexts.
void archive(archive_node &n) const override
Save (a.k.a.
bool match_same_type(const basic &other) const override
Returns true if the attributes of two objects are similar enough for a match.
void do_print_tree(const print_tree &c, unsigned level) const
Tree output to stream.
void do_print_python_repr(const print_python_repr &c, unsigned level) const
void print(const print_context &c, unsigned level=0) const
Print expression to stream.
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.
unsigned rotate_left(unsigned n)
Rotate bits of unsigned value by one bit to the left.
.calchash() has already done its job
ex op(size_t i) const override
Return operand/member at position i.
virtual int compare_same_type(const basic &other) const
Returns order relation between two objects of same type.
unsigned return_type() const
void do_print(const print_context &c, unsigned level) const
Wrapper template for making GiNaC classes out of STL containers.
Interface to relations between expressions.
Makes the interface to the underlying bignum package available.
ex map(map_function &f) const override
Construct new expression by applying the specified function to all sub-expressions (one level only...
.eval() has already done its job
bool info(unsigned inf) const override
Information about the object.
unsigned flags
of type status_flags
GINAC_BIND_UNARCHIVER(add)
return_type_t return_type_tinfo() const override