]> www.ginac.de Git - ginac.git/blob - ginac/operators.h
47d1b745a3602aba91fda96b891cb337fc5ca5f2
[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 ex operator+(const ex & lh, const ex & rh);
36 ex operator-(const ex & lh, const ex & rh);
37 ex operator*(const ex & lh, const ex & rh);
38 ex operator/(const ex & lh, const ex & rh);
39
40 // binary arithmetic operators numeric with numeric
41 numeric operator+(const numeric & lh, const numeric & rh);
42 numeric operator-(const numeric & lh, const numeric & rh);
43 numeric operator*(const numeric & lh, const numeric & rh);
44 numeric operator/(const numeric & lh, const numeric & rh);
45
46 // binary arithmetic assignment operators with ex
47 const ex & operator+=(ex & lh, const ex & rh);
48 const ex & operator-=(ex & lh, const ex & rh);
49 const ex & operator*=(ex & lh, const ex & rh);
50 const ex & operator/=(ex & lh, const ex & rh);
51
52 // binary arithmetic assignment operators with numeric
53 const numeric & operator+=(numeric & lh, const numeric & rh);
54 const numeric & operator-=(numeric & lh, const numeric & rh);
55 const numeric & operator*=(numeric & lh, const numeric & rh);
56 const numeric & operator/=(numeric & lh, const numeric & rh);
57
58 // unary operators
59 ex operator+(const ex & lh);
60 ex operator-(const ex & lh);
61
62 numeric operator+(const numeric & lh);
63 numeric operator-(const numeric & lh);
64 numeric& operator++(numeric & rh);
65 numeric& operator--(numeric & rh);
66 numeric operator++(numeric & lh, int);
67 numeric operator--(numeric & lh, int);
68
69 // binary relational operators ex with ex
70 relational operator==(const ex & lh, const ex & rh);
71 relational operator!=(const ex & lh, const ex & rh);
72 relational operator<(const ex & lh, const ex & rh);
73 relational operator<=(const ex & lh, const ex & rh);
74 relational operator>(const ex & lh, const ex & rh);
75 relational operator>=(const ex & lh, const ex & rh);
76
77 // input/output stream operators
78 std::ostream & operator<<(std::ostream & os, const ex & e);
79 std::istream & operator>>(std::istream & is, ex & e);
80
81 } // namespace GiNaC
82
83 #endif // ndef __GINAC_OPERATORS_H__