]> www.ginac.de Git - ginac.git/blobdiff - ginac/operators.h
* zeta(n,x) is now zetaderiv(n,s)
[ginac.git] / ginac / operators.h
index dfd985f5af54dd746399acde67f2fffc10fc16aa..33e1c3e650275984cb7b671cddda05e29c501cdf 100644 (file)
  *
  *  Interface to GiNaC's overloaded operators. */
 
-#ifndef _OPERATORS_H_
-#define _OPERATORS_H_
-
-#include <iostream>
-#include "basic.h"
-#include "ex.h"
-#include "numeric.h"
-#include "relational.h"
-
+/*
+ *  GiNaC Copyright (C) 1999-2003 Johannes Gutenberg University Mainz, Germany
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
 
-// binary arithmetic operators ex with ex
-ex operator+(ex const & lh, ex const & rh);
-ex operator-(ex const & lh, ex const & rh);
-ex operator*(ex const & lh, ex const & rh);
-ex operator/(ex const & lh, ex const & rh);
-ex operator%(ex const & lh, ex const & rh); // non-commutative multiplication
+#ifndef __GINAC_OPERATORS_H__
+#define __GINAC_OPERATORS_H__
 
-/*
+#include <iosfwd>
 
-// binary arithmetic operators ex with numeric
-ex operator+(ex const & lh, numeric const & rh);
-ex operator-(ex const & lh, numeric const & rh);
-ex operator*(ex const & lh, numeric const & rh);
-ex operator/(ex const & lh, numeric const & rh);
-ex operator%(ex const & lh, numeric const & rh); // non-commutative multiplication
+namespace GiNaC {
 
-// binary arithmetic operators numeric with ex
-ex operator+(numeric const & lh, ex const & rh);
-ex operator-(numeric const & lh, ex const & rh);
-ex operator*(numeric const & lh, ex const & rh);
-ex operator/(numeric const & lh, ex const & rh);
-ex operator%(numeric const & lh, ex const & rh); // non-commutative multiplication
+class ex;
+class numeric;
+class relational;
 
-*/
+// binary arithmetic operators ex with ex
+const ex operator+(const ex & lh, const ex & rh);
+const ex operator-(const ex & lh, const ex & rh);
+const ex operator*(const ex & lh, const ex & rh);
+const ex operator/(const ex & lh, const ex & rh);
 
 // binary arithmetic operators numeric with numeric
-numeric operator+(numeric const & lh, numeric const & rh);
-numeric operator-(numeric const & lh, numeric const & rh);
-numeric operator*(numeric const & lh, numeric const & rh);
-numeric operator/(numeric const & lh, numeric const & rh);
+const numeric operator+(const numeric & lh, const numeric & rh);
+const numeric operator-(const numeric & lh, const numeric & rh);
+const numeric operator*(const numeric & lh, const numeric & rh);
+const numeric operator/(const numeric & lh, const numeric & rh);
 
 // binary arithmetic assignment operators with ex
-ex const & operator+=(ex & lh, ex const & rh);
-ex const & operator-=(ex & lh, ex const & rh);
-ex const & operator*=(ex & lh, ex const & rh);
-ex const & operator/=(ex & lh, ex const & rh);
-ex const & operator%=(ex & lh, ex const & rh); // non-commutative multiplication
-
-/*
-  
-// binary arithmetic assignment operators with numeric
-ex const & operator+=(ex & lh, numeric const & rh);
-ex const & operator-=(ex & lh, numeric const & rh);
-ex const & operator*=(ex & lh, numeric const & rh);
-ex const & operator/=(ex & lh, numeric const & rh);
-ex const & operator%=(ex & lh, numeric const & rh); // non-commutative multiplication
-
-*/
+ex & operator+=(ex & lh, const ex & rh);
+ex & operator-=(ex & lh, const ex & rh);
+ex & operator*=(ex & lh, const ex & rh);
+ex & operator/=(ex & lh, const ex & rh);
 
 // binary arithmetic assignment operators with numeric
-numeric const & operator+=(numeric & lh, numeric const & rh);
-numeric const & operator-=(numeric & lh, numeric const & rh);
-numeric const & operator*=(numeric & lh, numeric const & rh);
-numeric const & operator/=(numeric & lh, numeric const & rh);
+numeric & operator+=(numeric & lh, const numeric & rh);
+numeric & operator-=(numeric & lh, const numeric & rh);
+numeric & operator*=(numeric & lh, const numeric & rh);
+numeric & operator/=(numeric & lh, const numeric & rh);
 
 // unary operators
-ex operator+(ex const & lh);
-ex operator-(ex const & lh);
-
-numeric operator+(numeric const & lh);
-numeric operator-(numeric const & lh);
-
-// binary relational operators ex with ex
-relational operator==(ex const & lh, ex const & rh);
-relational operator!=(ex const & lh, ex const & rh);
-relational operator<(ex const & lh, ex const & rh);
-relational operator<=(ex const & lh, ex const & rh);
-relational operator>(ex const & lh, ex const & rh);
-relational operator>=(ex const & lh, ex const & rh);
+const ex operator+(const ex & lh);
+const ex operator-(const ex & lh);
 
-/*
+const numeric operator+(const numeric & lh);
+const numeric operator-(const numeric & lh);
 
-// binary relational operators ex with numeric
-relational operator==(ex const & lh, numeric const & rh);
-relational operator!=(ex const & lh, numeric const & rh);
-relational operator<(ex const & lh, numeric const & rh);
-relational operator<=(ex const & lh, numeric const & rh);
-relational operator>(ex const & lh, numeric const & rh);
-relational operator>=(ex const & lh, numeric const & rh);
+// increment / decrement operators
+ex & operator++(ex & rh);
+ex & operator--(ex & rh);
+const ex operator++(ex & lh, int);
+const ex operator--(ex & lh, int);
 
-// binary relational operators numeric with ex
-relational operator==(numeric const & lh, ex const & rh);
-relational operator!=(numeric const & lh, ex const & rh);
-relational operator<(numeric const & lh, ex const & rh);
-relational operator<=(numeric const & lh, ex const & rh);
-relational operator>(numeric const & lh, ex const & rh);
-relational operator>=(numeric const & lh, ex const & rh);
+numeric& operator++(numeric & rh);
+numeric& operator--(numeric & rh);
+const numeric operator++(numeric & lh, int);
+const numeric operator--(numeric & lh, int);
 
-*/
+// binary relational operators ex with ex
+const relational operator==(const ex & lh, const ex & rh);
+const relational operator!=(const ex & lh, const ex & rh);
+const relational operator<(const ex & lh, const ex & rh);
+const relational operator<=(const ex & lh, const ex & rh);
+const relational operator>(const ex & lh, const ex & rh);
+const relational operator>=(const ex & lh, const ex & rh);
 
 // input/output stream operators
-ostream & operator<<(ostream & os, ex const & e);
-istream & operator>>(istream & is, ex & e);
-
-#endif // ndef _OPERATORS_H_
-
+std::ostream & operator<<(std::ostream & os, const ex & e);
+std::istream & operator>>(std::istream & is, ex & e);
+
+// input/output stream manipulators
+std::ostream & dflt(std::ostream & os);
+std::ostream & latex(std::ostream & os);
+std::ostream & python(std::ostream & os);
+std::ostream & python_repr(std::ostream & os);
+std::ostream & tree(std::ostream & os);
+std::ostream & csrc(std::ostream & os); // same as csrc_double
+std::ostream & csrc_float(std::ostream & os);
+std::ostream & csrc_double(std::ostream & os);
+std::ostream & csrc_cl_N(std::ostream & os);
+
+std::ostream & index_dimensions(std::ostream & os);
+std::ostream & no_index_dimensions(std::ostream & os);
+
+} // namespace GiNaC
+
+#endif // ndef __GINAC_OPERATORS_H__