61 inherited::read_archive(n, sym_lst);
64 throw (std::runtime_error(
"unknown relational operator in archive"));
73 inherited::archive(n);
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);
181 const ex & subsed_lh =
lh.subs(m, options);
182 const ex & subsed_rh =
rh.subs(m, options);
185 return relational(subsed_lh, subsed_rh,
o).subs_one_level(m, options);
192 return lh.eval_ncmul(v);
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);
241 return lh.return_type();
247 return lh.return_type_tinfo();
253 unsigned lhash =
lh.gethash();
254 unsigned rhash =
rh.gethash();
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...
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
bool info(unsigned inf) const
int compare(const ex &other) const
@ 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.
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)
container< std::list > lst
std::map< ex, ex, ex_is_less > exmap
const T & ex_to(const ex &e)
Return a reference to the basic-derived class T object embedded in an expression.
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.
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 ls GINAC_BIND_UNARCHIVER)(lst)
Specialization of container::info() for lst.
print_func< print_context >(&varidx::do_print). print_func< print_latex >(&varidx
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)
bool is_exactly_a(const basic &obj)
Check if obj is a T, not including base classes.
std::vector< ex > exvector
Makes the interface to the underlying bignum package available.
Interface to GiNaC's overloaded operators.
#define GINAC_IMPLEMENT_REGISTERED_CLASS_OPT(classname, supername, options)
Macro for inclusion in the implementation of each registered class.
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...