59 inherited::read_archive(n, sym_lst);
62 throw (std::runtime_error(
"unknown relational operator in archive"));
71 inherited::archive(n);
105 c.
s <<
"(INVALID RELATIONAL OPERATOR)";
123 c.
s << class_name() <<
'(';
162 return i==0 ?
lh :
rh;
167 const ex &mapped_lh = f(
lh);
168 const ex &mapped_rh = f(
rh);
179 const ex & subsed_lh =
lh.
subs(m, options);
180 const ex & subsed_rh =
rh.
subs(m, options);
183 return relational(subsed_lh, subsed_rh,
o).subs_one_level(m, options);
205 return (
o < oth.
o) ? -1 : 1;
209 return (
o < oth.
o) ? -1 : 1;
213 return (
o < oth.
o) ? -1 : 1;
217 return (
o < oth.
o) ? -1 : 1;
221 return (
o < oth.
o) ? -1 : 1;
225 return (lcmpval!=0) ? lcmpval :
rh.
compare(oth.
rh);
250 unsigned v = make_hash_seed(
typeid(*
this));
326 throw(std::logic_error(
"invalid relational operator"));
344 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...
bool find_unsigned(const std::string &name, unsigned &ret, unsigned index=0) const
Retrieve property of type "unsigned" from node.
void add_unsigned(const std::string &name, unsigned value)
Add property of type "unsigned int" to node.
bool find_ex(const std::string &name, ex &ret, lst &sym_lst, unsigned index=0) const
Retrieve property of type "ex" from node.
void add_ex(const std::string &name, const ex &value)
Add property of type "ex" to node.
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.
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.
std::ostream & s
stream to output to
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.
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
void(safe_bool_helper::*) safe_bool()
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)
container< std::list > lst
std::map< ex, ex, ex_is_less > exmap
B & dynallocate(Args &&... args)
Constructs a new (class basic or derived) B object on the heap.
bool are_ex_trivially_equal(const ex &e1, const ex &e2)
Compare two objects of class quickly without doing a deep tree traversal.
attribute_pure const T & ex_to(const ex &e)
Return a reference to the basic-derived class T object embedded in an expression.
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
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)
bool is_exactly_a(const basic &obj)
Check if obj is a T, not including base classes.
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...