X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=ginac%2Foperators.h;h=a0fc6b7c852d5df4ed9ce1a77bca9e2d0be0cf11;hp=a60da5d632f38ee7bc037c3bbe9b85771d2f5387;hb=1602530f716ba1d425a0667b897182b99c374823;hpb=26741891dadf23162799009b6fd57b4984bd4ce5 diff --git a/ginac/operators.h b/ginac/operators.h index a60da5d6..a0fc6b7c 100644 --- a/ginac/operators.h +++ b/ginac/operators.h @@ -3,7 +3,7 @@ * Interface to GiNaC's overloaded operators. */ /* - * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany + * GiNaC Copyright (C) 1999-2009 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 @@ -17,73 +17,88 @@ * * 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 + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef __GINAC_OPERATORS_H__ -#define __GINAC_OPERATORS_H__ +#ifndef GINAC_OPERATORS_H +#define GINAC_OPERATORS_H -#include +#include -#ifndef NO_GINAC_NAMESPACE namespace GiNaC { -#endif // ndef NO_GINAC_NAMESPACE class ex; class numeric; class relational; // 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 +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 +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); +const ex operator+(const ex & lh); +const ex operator-(const ex & lh); + +const numeric operator+(const numeric & lh); +const numeric operator-(const numeric & lh); + +// increment / decrement operators +ex & operator++(ex & rh); +ex & operator--(ex & rh); +const ex operator++(ex & lh, int); +const ex operator--(ex & lh, int); -numeric operator+(numeric const & lh); -numeric operator-(numeric const & lh); numeric& operator++(numeric & rh); numeric& operator--(numeric & rh); -numeric operator++(numeric & lh, int); -numeric operator--(numeric & lh, int); +const numeric operator++(numeric & lh, int); +const numeric operator--(numeric & lh, int); // 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 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); +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); -#ifndef NO_GINAC_NAMESPACE } // namespace GiNaC -#endif // ndef NO_GINAC_NAMESPACE -#endif // ndef __GINAC_OPERATORS_H__ +#endif // ndef GINAC_OPERATORS_H