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.
rh);
313 if (is_exactly_a<numeric>(df)) {
328 throw(std::logic_error(
"invalid relational operator"));
346 throw(std::logic_error(
"invalid relational operator"));
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
ex subs_one_level(const exmap &m, unsigned options) const
Helper function for subs().
virtual int compare_same_type(const basic &other) const
Returns order relation between two objects of same type.
void do_print_tree(const print_tree &c, unsigned level) const
Tree output to stream.
Wrapper template for making GiNaC classes out of STL containers.
Lightweight wrapper for GiNaC's symbolic objects.
bool is_equal(const ex &other) const
ex eval_ncmul(const exvector &v) const
unsigned return_type() const
return_type_t return_type_tinfo() const
ex subs(const exmap &m, unsigned options=0) const
bool info(unsigned inf) const
int compare(const ex &other) const
void print(const print_context &c, unsigned level=0) const
Print expression to stream.
@ relation_greater_or_equal
Base class for print_contexts.
Context for python-parsable output.
This class holds a relation consisting of two expressions and a logical relation between them.
void read_archive(const archive_node &n, lst &syms) override
Read (a.k.a.
void archive(archive_node &n) const override
Save (a.k.a.
void(safe_bool_helper::* safe_bool)()
safe_bool make_safe_bool(bool) const
relational(const ex &lhs, const ex &rhs, operators oper=equal)
ex op(size_t i) const override
Return operand/member at position i.
ex canonical() const
Returns an equivalent relational with zero right-hand side.
void do_print(const print_context &c, unsigned level) const
unsigned precedence() const override
Return relative operator precedence (for parenthezing output).
return_type_t return_type_tinfo() const override
bool match_same_type(const basic &other) const override
Returns true if the attributes of two objects are similar enough for a match.
unsigned calchash() const override
Compute the hash value of an object and if it makes sense to store it in the objects status_flags,...
unsigned return_type() const override
ex eval_ncmul(const exvector &v) const override
ex map(map_function &f) const override
Construct new expression by applying the specified function to all sub-expressions (one level only,...
void do_print_python_repr(const print_python_repr &c, unsigned level) const
bool info(unsigned inf) const override
Information about the object.
size_t nops() const override
Number of operands/members.
ex subs(const exmap &m, unsigned options=0) const override
Substitute a set of objects by arbitrary expressions.
@ evaluated
.eval() has already done its job
@ hash_calculated
.calchash() has already done its job
bool is_zero(const ex &thisex)
std::map< ex, ex, ex_is_less > exmap
bool are_ex_trivially_equal(const ex &e1, const ex &e2)
Compare two objects of class quickly without doing a deep tree traversal.
print_func< print_context >(&varidx::do_print). print_func< print_latex >(&varidx
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
static unsigned make_hash_seed(const std::type_info &tinfo)
We need a hash function which gives different values for objects of different types.
unsigned rotate_left(unsigned n)
Rotate bits of unsigned value by one bit to the left.
static void print_operator(const print_context &c, relational::operators o)
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.
std::vector< ex > exvector
Makes the interface to the underlying bignum package available.
Interface to GiNaC's overloaded operators.
Interface to relations between expressions.
Function object for map().
To distinguish between different kinds of non-commutative objects.
Interface to several small and furry utilities needed within GiNaC but not of any interest to the use...