3 * Interface to relations between expressions.
5 * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 #ifndef __GINAC_RELATIONAL_H__
23 #define __GINAC_RELATIONAL_H__
25 #include <ginac/basic.h>
28 /** This class holds a relation consisting of two expressions and a logical
29 * relation between them. */
30 class relational : public basic
35 enum operators { equal,
45 // default constructor, destructor, copy constructor assignment operator and helpers
49 relational(relational const & other);
50 relational const & operator=(relational const & other);
52 void copy(relational const & other);
53 void destroy(bool call_parent);
57 relational(ex const & lhs, ex const & rhs, operators oper=equal);
59 // functions overriding virtual functions from bases classes
61 basic * duplicate() const;
62 void printraw(ostream & os) const;
63 void print(ostream & os, unsigned upper_precedence=0) const;
64 void printcsrc(ostream & os, unsigned type, unsigned upper_precedence=0) const;
65 bool info(unsigned inf) const;
67 ex & let_op(int const i);
68 ex eval(int level=0) const;
69 ex evalf(int level=0) const;
70 ex simplify_ncmul(exvector const & v) const;
72 int compare_same_type(basic const & other) const;
73 unsigned return_type(void) const;
74 unsigned return_type_tinfo(void) const;
76 // new virtual functions which can be overridden by derived classes
79 // non-virtual functions in this class
81 operator bool(void) const;
89 static unsigned precedence;
94 extern const relational some_relational;
95 extern type_info const & typeid_relational;
97 #define ex_to_relational(X) static_cast<relational const &>(*(X).bp)
99 #endif // ndef __GINAC_RELATIONAL_H__