X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=ginac%2Foperators.h;h=7805e888e986ffb8bc3bbbcbdb12a8af1b2f50a5;hp=7ccd39f69bf17cdcafe665281bc28f0be0811229;hb=2434f1642f8c07b6981e617773276c0e57532600;hpb=a8507b8af1c08d9b27d98d57f95c7ca1a8671e27 diff --git a/ginac/operators.h b/ginac/operators.h index 7ccd39f6..7805e888 100644 --- a/ginac/operators.h +++ b/ginac/operators.h @@ -1,8 +1,9 @@ /** @file operators.h * - * Interface to GiNaC's overloaded operators. - * - * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany + * Interface to GiNaC's overloaded operators. */ + +/* + * GiNaC Copyright (C) 1999-2001 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 @@ -22,100 +23,68 @@ #ifndef __GINAC_OPERATORS_H__ #define __GINAC_OPERATORS_H__ -#include +#include -// 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 +namespace GiNaC { -/* +class ex; +class numeric; +class relational; -// 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 - -// 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 - -*/ +// 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); +const ex operator+(const ex & lh); +const ex operator-(const ex & lh); -numeric operator+(numeric const & lh); -numeric operator-(numeric const & lh); +const numeric operator+(const numeric & lh); +const numeric operator-(const numeric & 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); +// 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 & rh); +numeric& operator--(numeric & rh); +const numeric operator++(numeric & lh, int); +const numeric operator--(numeric & lh, int); -// 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); - -// 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); - -*/ +// 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); +std::ostream & operator<<(std::ostream & os, const ex & e); +std::istream & operator>>(std::istream & is, ex & e); + +} // namespace GiNaC #endif // ndef __GINAC_OPERATORS_H__