]> www.ginac.de Git - ginac.git/blob - ginac/operators.h
- revamped indexed objects
[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 ex operator%(const ex & lh, const ex & rh); // non-commutative multiplication
40
41 // binary arithmetic operators numeric with numeric
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 numeric operator/(const numeric & lh, const numeric & rh);
46
47 // binary arithmetic assignment operators with ex
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 const ex & operator/=(ex & lh, const ex & rh);
52 const ex & operator%=(ex & lh, const ex & rh); // non-commutative multiplication
53
54 // binary arithmetic assignment operators with numeric
55 const numeric & operator+=(numeric & lh, const numeric & rh);
56 const numeric & operator-=(numeric & lh, const numeric & rh);
57 const numeric & operator*=(numeric & lh, const numeric & rh);
58 const numeric & operator/=(numeric & lh, const numeric & rh);
59
60 // unary operators
61 ex operator+(const ex & lh);
62 ex operator-(const ex & lh);
63
64 numeric operator+(const numeric & lh);
65 numeric operator-(const numeric & lh);
66 numeric& operator++(numeric & rh);
67 numeric& operator--(numeric & rh);
68 numeric operator++(numeric & lh, int);
69 numeric operator--(numeric & lh, int);
70
71 // binary relational operators ex with ex
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 relational operator>(const ex & lh, const ex & rh);
77 relational operator>=(const ex & lh, const ex & rh);
78
79 // input/output stream operators
80 std::ostream & operator<<(std::ostream & os, const ex & e);
81 std::istream & operator>>(std::istream & is, ex & e);
82
83 } // namespace GiNaC
84
85 #endif // ndef __GINAC_OPERATORS_H__