]> www.ginac.de Git - ginac.git/blob - ginac/operators.h
* Fix a bitch of a bug where 1<I (and all other relationals) returned true.
[ginac.git] / ginac / operators.h
1 /** @file operators.h
2  *
3  *  Interface to GiNaC's overloaded operators. */
4
5 /*
6  *  GiNaC Copyright (C) 1999-2001 Johannes Gutenberg University Mainz, Germany
7  *
8  *  This program is free software; you can redistribute it and/or modify
9  *  it under the terms of the GNU General Public License as published by
10  *  the Free Software Foundation; either version 2 of the License, or
11  *  (at your option) any later version.
12  *
13  *  This program is distributed in the hope that it will be useful,
14  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  *  GNU General Public License for more details.
17  *
18  *  You should have received a copy of the GNU General Public License
19  *  along with this program; if not, write to the Free Software
20  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
21  */
22
23 #ifndef __GINAC_OPERATORS_H__
24 #define __GINAC_OPERATORS_H__
25
26 #include <iostream>
27
28 namespace GiNaC {
29
30 class ex;
31 class numeric;
32 class relational;
33
34 // binary arithmetic operators ex with ex
35 const ex operator+(const ex & lh, const ex & rh);
36 const ex operator-(const ex & lh, const ex & rh);
37 const ex operator*(const ex & lh, const ex & rh);
38 const ex operator/(const ex & lh, const ex & rh);
39
40 // binary arithmetic operators numeric with numeric
41 const numeric operator+(const numeric & lh, const numeric & rh);
42 const numeric operator-(const numeric & lh, const numeric & rh);
43 const numeric operator*(const numeric & lh, const numeric & rh);
44 const numeric operator/(const numeric & lh, const numeric & rh);
45
46 // binary arithmetic assignment operators with ex
47 ex & operator+=(ex & lh, const ex & rh);
48 ex & operator-=(ex & lh, const ex & rh);
49 ex & operator*=(ex & lh, const ex & rh);
50 ex & operator/=(ex & lh, const ex & rh);
51
52 // binary arithmetic assignment operators with numeric
53 numeric & operator+=(numeric & lh, const numeric & rh);
54 numeric & operator-=(numeric & lh, const numeric & rh);
55 numeric & operator*=(numeric & lh, const numeric & rh);
56 numeric & operator/=(numeric & lh, const numeric & rh);
57
58 // unary operators
59 const ex operator+(const ex & lh);
60 const ex operator-(const ex & lh);
61
62 const numeric operator+(const numeric & lh);
63 const numeric operator-(const numeric & lh);
64
65 // increment / decrement operators
66 ex & operator++(ex & rh);
67 ex & operator--(ex & rh);
68 const ex operator++(ex & lh, int);
69 const ex operator--(ex & lh, int);
70
71 numeric& operator++(numeric & rh);
72 numeric& operator--(numeric & rh);
73 const numeric operator++(numeric & lh, int);
74 const numeric operator--(numeric & lh, int);
75
76 // binary relational operators ex with ex
77 const relational operator==(const ex & lh, const ex & rh);
78 const relational operator!=(const ex & lh, const ex & rh);
79 const relational operator<(const ex & lh, const ex & rh);
80 const relational operator<=(const ex & lh, const ex & rh);
81 const relational operator>(const ex & lh, const ex & rh);
82 const relational operator>=(const ex & lh, const ex & rh);
83
84 // input/output stream operators
85 std::ostream & operator<<(std::ostream & os, const ex & e);
86 std::istream & operator>>(std::istream & is, ex & e);
87
88 } // namespace GiNaC
89
90 #endif // ndef __GINAC_OPERATORS_H__