]> www.ginac.de Git - ginac.git/commitdiff
* Headers only include <iosfwd> from now on, since that contains all the
authorRichard Kreckel <Richard.Kreckel@uni-mainz.de>
Sat, 27 Oct 2001 20:18:51 +0000 (20:18 +0000)
committerRichard Kreckel <Richard.Kreckel@uni-mainz.de>
Sat, 27 Oct 2001 20:18:51 +0000 (20:18 +0000)
  necessary forward declarations without bringing in the whole big
  <iostream> header.

41 files changed:
INSTALL
check/checks.cpp
check/checks.h
check/exams.cpp
check/exams.h
check/genex.cpp
check/times.cpp
check/times.h
doc/tutorial/ginac.texi
ginac/Makefile.am
ginac/add.h
ginac/archive.h
ginac/basic.h
ginac/clifford.cpp
ginac/color.cpp
ginac/constant.cpp
ginac/ex.h
ginac/expair.cpp [new file with mode: 0644]
ginac/expair.h
ginac/expairseq.cpp
ginac/fail.cpp
ginac/fail.h
ginac/fderivative.cpp
ginac/function.pl
ginac/idx.cpp
ginac/indexed.cpp
ginac/matrix.cpp
ginac/mul.cpp
ginac/normal.cpp
ginac/operators.h
ginac/print.cpp [new file with mode: 0644]
ginac/print.h
ginac/pseries.cpp
ginac/relational.cpp
ginac/remember.h
ginac/structure.cpp
ginac/symmetry.cpp
ginac/tensor.cpp
ginac/wildcard.cpp
ginsh/ginsh.h
tools/viewgar.cpp

diff --git a/INSTALL b/INSTALL
index 721d6a2515f81b555e083bf675b4223adcc1a78c..d79649f4c6ce6df76195c038c407ce4dbb797c02 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -91,7 +91,7 @@ a solution.  GCC-2.95.2 and earlier don't ship with this file.  A
 working implementation has been available since GCC-2.95.3.  GCC-3.0
 and later have an even better, fully standard-conforming
 implementation, by default.  If you are stuck with GCC-2.95.2 or
-earliear and you cannot upgrade your compiler we recommend obtaining
+earlier and you cannot upgrade your compiler we recommend obtaining
 the libstdc++-v2 <sstream> header written by Magnus Fromreide.  It was
 posted to the gcc-patches mailing list on November 21 2000:
 <http://gcc.gnu.org/ml/gcc-patches/2000-11/msg01152.html>.
index 6cfeaff8ab1a3f1e667e119fa5ef3613d4bf75b7..101ae01b626597aa69da44731790e984ad65bece 100644 (file)
@@ -21,7 +21,6 @@
  */
 
 #include <stdexcept>
-#include <iostream>
 #include <time.h>
 
 #include "checks.h"
index a9f2ba9fd1ecadfc559d544bfd32e8723b13f486..a705265d505bd0671ec8f83bac4c96aeecd49d9b 100644 (file)
 #ifndef CHECKS_H
 #define CHECKS_H
 
-// For rand() and friends:
-#include <stdlib.h>
-using namespace std;
+#include <iostream>
+
 #include "config.h"
 #include "ginac.h"
+using namespace std;
 using namespace GiNaC;
 
 // prototypes for the expression generating functions in:
index 41097741b669f103272981ac58de607f3192fa62..a10d8e476e4183a694b082a18f94976519111484 100644 (file)
@@ -21,7 +21,6 @@
  */
 
 #include <stdexcept>
-#include <iostream>
 
 #include "exams.h"
 
index 1372cc30a76fcc3a69bf9b0cf4d3044988c0feb8..593dd0c01cddab5fba403b7a0f5d4d8b6c78ccc4 100644 (file)
@@ -23,6 +23,7 @@
 #ifndef EXAMS_H
 #define EXAMS_H
 
+#include <iostream>
 #include "ginac.h"
 using namespace std;
 using namespace GiNaC;
index f4bffb151a484d5b87129833a9dd634e7f253db5..8b2c9f5091bfa99ece80cb18c0dd606b6bb145db 100644 (file)
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-// For rand() and friends:
-#include <stdlib.h>
-
+#include <cstdlib>
 #include "ginac.h"
+using namespace std;
 using namespace GiNaC;
 
 /* Create a dense univariate random polynomial in x.
index 7b6858be9828b033cfc3ad7e243eadd2c2a0643b..ef038f3089599d7d84a9ba6ac8df217ee2d17f85 100644 (file)
@@ -21,8 +21,6 @@
  */
 
 #include <stdexcept>
-#include <iostream>
-
 #include "times.h"
 
 int main()
index d938d0b09eb53083394422be84bd1c10881eb87d..5fa4ea6a21d4acf88b0ca4f65e9f78d94ca0b773 100644 (file)
@@ -24,7 +24,8 @@
 #define CHECKS_H
 
 #include <sys/resource.h>
-#include <stdlib.h>
+#include <cstdlib>
+#include <iostream>
 #include <sstream>
 #include <vector>
 #include "config.h"
index 63e1376b27a592b88ace0ac0433ebf92487dad19..94ec39eefcdf49d336a901328c99a7f0af9256f2 100644 (file)
@@ -179,6 +179,7 @@ manipulations.  Here is how to generate and print a simple (and rather
 pointless) bivariate polynomial with some large coefficients:
 
 @example
+#include <iostream>
 #include <ginac/ginac.h>
 using namespace std;
 using namespace GiNaC;
@@ -213,6 +214,7 @@ Next, there is a more meaningful C++ program that calls a function which
 generates Hermite polynomials in a specified free variable.
 
 @example
+#include <iostream>
 #include <ginac/ginac.h>
 using namespace std;
 using namespace GiNaC;
@@ -364,6 +366,9 @@ lambda^2-3*lambda+11
 [[1,1],[2,-1]]+2*[[1,3],[-3,2]]
 > evalm(");
 [[3,7],[-4,3]]
+> B = [ [0, 0, a], [b, 1, -b], [-1/a, 0, 0] ];
+> evalm(B^(2^12345));
+[[1,0,0],[0,1,0],[0,0,1]]
 @end example
 
 Multivariate polynomials and rational functions may be expanded,
@@ -913,6 +918,7 @@ It uses construction from C-integer, construction of fractions from two
 integers, construction from C-float and construction from a string:
 
 @example
+#include <iostream>
 #include <ginac/ginac.h>
 using namespace GiNaC;
 
@@ -951,6 +957,7 @@ then on will be stored with a precision matching that number of decimal
 digits:
 
 @example
+#include <iostream>
 #include <ginac/ginac.h>
 using namespace std;
 using namespace GiNaC;
@@ -1002,6 +1009,7 @@ As an example, let's construct some rational number, multiply it with
 some multiple of its denominator and test what comes out:
 
 @example
+#include <iostream>
 #include <ginac/ginac.h>
 using namespace std;
 using namespace GiNaC;
@@ -1527,6 +1535,7 @@ not visible in the output.
 A simple example shall illustrate the concepts:
 
 @example
+#include <iostream>
 #include <ginac/ginac.h>
 using namespace std;
 using namespace GiNaC;
@@ -3448,11 +3457,6 @@ An application is illustrated in the next example, where a multivariate
 polynomial is analyzed:
 
 @example
-#include <ginac/ginac.h>
-using namespace std;
-using namespace GiNaC;
-
-int main()
 @{
     symbol x("x"), y("y");
     ex PolyInp = 4*pow(x,3)*y + 5*x*pow(y,2) + 3*y
@@ -3662,13 +3666,9 @@ symbols afterwards. This algorithm is also available as a separate method
 @code{.to_rational()}, described below.
 
 This means that both expressions @code{t1} and @code{t2} are indeed
-simplified in this little program:
+simplified in this little code snippet:
 
 @example
-#include <ginac/ginac.h>
-using namespace GiNaC;
-
-int main()
 @{
     symbol x("x");
     ex t1 = (pow(x,2) + 2*x + 1)/(x + 1);
@@ -3753,17 +3753,16 @@ polynomial (class @code{add}) knows that its derivative is the sum of
 the derivatives of all the monomials:
 
 @example
-#include <ginac/ginac.h>
-using namespace GiNaC;
-
-int main()
 @{
     symbol x("x"), y("y"), z("z");
     ex P = pow(x, 5) + pow(x, 2) + y;
 
-    cout << P.diff(x,2) << endl;  // 20*x^3 + 2
+    cout << P.diff(x,2) << endl;
+     // -> 20*x^3 + 2
     cout << P.diff(y) << endl;    // 1
+     // -> 1
     cout << P.diff(z) << endl;    // 0
+     // -> 0
 @}
 @end example
 
@@ -5281,6 +5280,7 @@ no copying process is involved. Instead, the copying takes place as soon
 as you try to change the second.  Consider the simple sequence of code:
 
 @example
+#include <iostream>
 #include <ginac/ginac.h>
 using namespace std;
 using namespace GiNaC;
@@ -5313,11 +5313,6 @@ differentiation using the chain-rule should make clear how powerful this
 can be:
 
 @example
-#include <ginac/ginac.h>
-using namespace std;
-using namespace GiNaC;
-
-int main()
 @{
     symbol x("x"), y("y");
 
index 2f2fed079a86915f93701d44ba44309683ec2524..f0896bd4d802447fd52bfc63ca53000829c75eef 100644 (file)
@@ -2,13 +2,13 @@
 
 lib_LTLIBRARIES = libginac.la
 libginac_la_SOURCES = add.cpp archive.cpp basic.cpp constant.cpp ex.cpp \
-  expairseq.cpp exprseq.cpp fail.cpp function.cpp inifcns.cpp \
+  expair.cpp expairseq.cpp exprseq.cpp fail.cpp function.cpp inifcns.cpp \
   inifcns_trans.cpp inifcns_zeta.cpp inifcns_gamma.cpp matrix.cpp mul.cpp \
   normal.cpp numeric.cpp operators.cpp power.cpp registrar.cpp relational.cpp \
   symbol.cpp pseries.cpp utils.cpp ncmul.cpp structure.cpp exprseq_suppl.cpp \
   lst.cpp lst_suppl.cpp input_parser.yy input_lexer.ll input_lexer.h \
   remember.h remember.cpp utils.h idx.cpp indexed.cpp tensor.cpp color.cpp \
-  clifford.cpp wildcard.cpp symmetry.cpp fderivative.cpp tostring.h
+  clifford.cpp wildcard.cpp print.cpp symmetry.cpp fderivative.cpp tostring.h
 libginac_la_LDFLAGS = -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
   -release $(LT_RELEASE)
 ginacincludedir = $(includedir)/ginac
index 7400056859347e02a0413cc343ffd82445f4328e..94d5c8e57bb325c2d14b06a3681d99ecbb2e334e 100644 (file)
@@ -33,7 +33,6 @@ class add : public expairseq
        GINAC_DECLARE_REGISTERED_CLASS(add, expairseq)
        
        friend class mul;
-       friend class ncmul;
        friend class power;
        
        // other constructors
index 012086b5c38b0068792c1ead67366167d7a3a85d..b607439590b2c80fad47ef5a0582d17c9ea89773 100644 (file)
@@ -25,9 +25,9 @@
 
 #include "ex.h"
 
+#include <iosfwd>
 #include <string>
 #include <vector>
-#include <iostream>
 
 namespace GiNaC {
 
index e5c3069d2a09f5cc40fe43b7a7a47a394d5acfec..6320e075ecce3a5f0f2e7d9a806ceeea64f1b8d7 100644 (file)
@@ -23,9 +23,7 @@
 #ifndef __GINAC_BASIC_H__
 #define __GINAC_BASIC_H__
 
-#include <iostream>
 #include <vector>
-
 // CINT needs <algorithm> to work properly with <vector>
 #include <algorithm>
 
index 11f84d0c256e281ad915b3a5b09a7f388e2071fe..b8083e8d9e8723c7d7129c872d301703044b12e5 100644 (file)
@@ -20,6 +20,9 @@
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
+#include <iostream>
+#include <stdexcept>
+
 #include "clifford.h"
 #include "ex.h"
 #include "idx.h"
@@ -34,8 +37,6 @@
 #include "archive.h"
 #include "utils.h"
 
-#include <stdexcept>
-
 namespace GiNaC {
 
 GINAC_IMPLEMENT_REGISTERED_CLASS(clifford, indexed)
index dd8ee18dc3606861efb2c886ef93a91599a9f916..2459a2d4338e40fdaee8d5e3a5c3400ce44e439a 100644 (file)
@@ -20,7 +20,7 @@
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include <algorithm>
+#include <iostream>
 #include <stdexcept>
 
 #include "color.h"
index d6c07409a32d1ed581b6c0cbed444c6161ba9c9b..0cf7c77bbdcf4419d144abdf6c5d006506534700 100644 (file)
@@ -22,6 +22,7 @@
 
 #include <string>
 #include <stdexcept>
+#include <iostream>
 
 #include "constant.h"
 #include "numeric.h"
index c76290ff1ceb0a04a2dbdc21597d1e49ecffa8ca..0bbe12995148187102e48db52e3136de7a6835ee 100644 (file)
 #ifndef __GINAC_EX_H__
 #define __GINAC_EX_H__
 
+#include <iosfwd>
+#include <functional>
+
 #include "basic.h"
 #include "operators.h"
 
-#include <functional>
-
 namespace GiNaC {
 
 /** Helper class to initialize the library.  There must be one static object
diff --git a/ginac/expair.cpp b/ginac/expair.cpp
new file mode 100644 (file)
index 0000000..61d8e26
--- /dev/null
@@ -0,0 +1,37 @@
+/** @file expair.cpp
+ *
+ *  Implementation of expression pairs (building blocks of expairseq). */
+
+/*
+ *  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
+ *  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
+ */
+
+#include <iostream>
+
+#include "expair.h"
+
+namespace GiNaC {
+
+void expair::print(std::ostream & os) const
+{
+       os << "expair:";
+       print_tree c(os);
+       rest.print(c, c.delta_indent);
+       coeff.print(c, c.delta_indent);
+}
+
+} // namespace GiNaC
index d7a76ca1574dc115e831492467748caf85152ab3..3a6c01ca823e29c805df1adac3f7437c743ec432 100644 (file)
@@ -82,13 +82,7 @@ public:
                        return coeff.compare(other.coeff);
        }
        
-       void print(std::ostream & os) const
-       {
-               os << "expair:";
-               print_tree c(os);
-               rest.print(c, c.delta_indent);
-               coeff.print(c, c.delta_indent);
-       }
+       void print(std::ostream & os) const;
        
        /** True if this is of the form (numeric,ex(1)). */
        bool is_canonical_numeric(void) const
index f0356536dd8da6c71abf87fc4593dfab7de9d822..fee2665c322600e58529bf828e5ed0337e0a2e78 100644 (file)
@@ -20,6 +20,7 @@
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
+#include <iostream>
 #include <algorithm>
 #include <string>
 #include <stdexcept>
@@ -1056,7 +1057,7 @@ void expairseq::make_flat(const epvector &v)
 /** Brings this expairseq into a sorted (canonical) form. */
 void expairseq::canonicalize(void)
 {
-       sort(seq.begin(), seq.end(), expair_is_less());
+       std::sort(seq.begin(), seq.end(), expair_is_less());
 }
 
 
index bbbff1b2a270cd068d302947b990d95cbb975dc5..da00eece6a516dd5d21e021b8146a58a968e41fa 100644 (file)
@@ -1,7 +1,7 @@
 /** @file fail.cpp
  *
- *  Implementation of class signaling failure of operation. Considered obsolete
- *  (all of this is replaced by exceptions). */
+ *  Implementation of class signaling failure of operation. Considered
+ *  somewhat obsolete (most of this can be replaced by exceptions). */
 
 /*
  *  GiNaC Copyright (C) 1999-2001 Johannes Gutenberg University Mainz, Germany
@@ -21,6 +21,8 @@
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
+#include <iostream>
+
 #include "fail.h"
 #include "print.h"
 #include "archive.h"
index 3c514797672e95ad6b871f99a4ec832bad9bcd7f..125788d533731f09a6c986754a650c0fcc9904b5 100644 (file)
@@ -1,7 +1,7 @@
 /** @file fail.h
  *
  *  Interface to class signaling failure of operation. Considered obsolete
- *  (all of this is replaced by exceptions). */
+ *  somewhat obsolete (most of this can be replaced by exceptions). */
 
 /*
  *  GiNaC Copyright (C) 1999-2001 Johannes Gutenberg University Mainz, Germany
index cefa165d6e59d9e0ffe882789252dc3dea2066fa..57f4ed764de21e248c94174f306e8afcdafefc7f 100644 (file)
@@ -20,6 +20,8 @@
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
+#include <iostream>
+
 #include "fderivative.h"
 #include "print.h"
 #include "archive.h"
index ad77345da731fe89e9c3cd1acd52f0dc13566a33..962b17efdffb31308549c8852e28aa4f16708d2c 100755 (executable)
@@ -425,6 +425,7 @@ $implementation=<<END_OF_IMPLEMENTATION;
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
+#include <iostream>
 #include <string>
 #include <stdexcept>
 #include <list>
index be1d9483cb2d93d3c10afa7faad3081fa6aa5a25..74754022e63f6f73996404d3e2ea389cd0d2fa5e 100644 (file)
@@ -20,8 +20,8 @@
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
+#include <iostream>
 #include <stdexcept>
-#include <algorithm>
 
 #include "idx.h"
 #include "symbol.h"
index a89fb1011ed42eb2d5882e8e79ba4c101f3cbb55..bc474f3d41e5db31c0ed31859fd281911497c9b4 100644 (file)
@@ -20,8 +20,8 @@
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
+#include <iostream>
 #include <stdexcept>
-#include <algorithm>
 
 #include "indexed.h"
 #include "idx.h"
index 8afa7b58cfc928b20e716100e69a149c75749f96..3d735fe46689aa57fc0d973a0b8588e07f2049f8 100644 (file)
@@ -20,6 +20,7 @@
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
+#include <iostream>
 #include <algorithm>
 #include <map>
 #include <stdexcept>
@@ -776,7 +777,7 @@ ex matrix::determinant(unsigned algo) const
                                                ++acc;
                                c_zeros.push_back(uintpair(acc,c));
                        }
-                       sort(c_zeros.begin(),c_zeros.end());
+                       std::sort(c_zeros.begin(),c_zeros.end());
                        std::vector<unsigned> pre_sort;
                        for (std::vector<uintpair>::const_iterator i=c_zeros.begin(); i!=c_zeros.end(); ++i)
                                pre_sort.push_back(i->second);
index 83bebb2638f3d8f3264fa4f3ba2100fd8329271d..065455eabb62c08b8b0affc9f7e45b24515331e4 100644 (file)
@@ -20,6 +20,7 @@
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
+#include <iostream>
 #include <vector>
 #include <stdexcept>
 
index f123be2060c4fc4451c42f759648768141a7cbf6..4e2feb39a546957438891578486e0b07a2479b7a 100644 (file)
@@ -74,10 +74,10 @@ static int heur_gcd_failed = 0;
 static struct _stat_print {
        _stat_print() {}
        ~_stat_print() {
-               cout << "gcd() called " << gcd_called << " times\n";
-               cout << "sr_gcd() called " << sr_gcd_called << " times\n";
-               cout << "heur_gcd() called " << heur_gcd_called << " times\n";
-               cout << "heur_gcd() failed " << heur_gcd_failed << " times\n";
+               std::cout << "gcd() called " << gcd_called << " times\n";
+               std::cout << "sr_gcd() called " << sr_gcd_called << " times\n";
+               std::cout << "heur_gcd() called " << heur_gcd_called << " times\n";
+               std::cout << "heur_gcd() failed " << heur_gcd_failed << " times\n";
        }
 } stat_print;
 #endif
index 22d89370abdaabf97fc569e7587c5a07a2a145ad..7805e888e986ffb8bc3bbbcbdb12a8af1b2f50a5 100644 (file)
@@ -23,7 +23,7 @@
 #ifndef __GINAC_OPERATORS_H__
 #define __GINAC_OPERATORS_H__
 
-#include <iostream>
+#include <iosfwd>
 
 namespace GiNaC {
 
diff --git a/ginac/print.cpp b/ginac/print.cpp
new file mode 100644 (file)
index 0000000..bd365cf
--- /dev/null
@@ -0,0 +1,64 @@
+/** @file print.cpp
+ *
+ *  Implementation of helper classes for expression output. */
+
+/*
+ *  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
+ *  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
+ */
+
+#include <iostream>
+
+#include "print.h"
+
+namespace GiNaC {
+
+print_context::print_context()
+       : s(std::cout) {}
+print_context::print_context(std::ostream & os)
+       : s(os) {}
+
+print_latex::print_latex()
+       : print_context(std::cout) {}
+print_latex::print_latex(std::ostream & os)
+       : print_context(os) {}
+
+print_tree::print_tree(unsigned d)
+       : print_context(std::cout), delta_indent(d) {}
+print_tree::print_tree(std::ostream & os, unsigned d)
+       : print_context(os), delta_indent(d) {}
+
+print_csrc::print_csrc()
+       : print_context(std::cout) {}
+print_csrc::print_csrc(std::ostream & os)
+       : print_context(os) {}
+
+print_csrc_float::print_csrc_float()
+       : print_csrc(std::cout) {}
+print_csrc_float::print_csrc_float(std::ostream & os)
+       : print_csrc(os) {}
+
+print_csrc_double::print_csrc_double()
+       : print_csrc(std::cout) {}
+print_csrc_double::print_csrc_double(std::ostream & os)
+       : print_csrc(os) {}
+
+print_csrc_cl_N::print_csrc_cl_N()
+       : print_csrc(std::cout) {}
+print_csrc_cl_N::print_csrc_cl_N(std::ostream & os)
+       : print_csrc(os) {}
+
+} // namespace GiNaC
index e32238d0fb3b631cb220be776a6c6aefc63fab6c..1d99639ea38f0f7d4adb9cd6c251584dfad51356 100644 (file)
@@ -1,6 +1,6 @@
 /** @file print.h
  *
- *  Helper classes for expression output. */
+ *  Definition of helper classes for expression output. */
 
 /*
  *  GiNaC Copyright (C) 1999-2001 Johannes Gutenberg University Mainz, Germany
@@ -23,7 +23,7 @@
 #ifndef __GINAC_PRINT_H__
 #define __GINAC_PRINT_H__
 
-#include <iostream>
+#include <iosfwd>
 #include <string>
 
 namespace GiNaC {
@@ -32,9 +32,11 @@ namespace GiNaC {
 class print_context
 {
 public:
-       print_context(std::ostream & os = std::cout) : s(os) {}
-       std::ostream & s; /**< stream to output to */
+       print_context();
+       print_context(std::ostream &);
 
+       std::ostream & s; /**< stream to output to */
+private:
        // dummy virtual function to make the class polymorphic
        virtual void dummy(void) {}
 };
@@ -43,49 +45,49 @@ public:
 class print_latex : public print_context
 {
 public:
-       print_latex(std::ostream & os = std::cout)
-         : print_context(os) {}
+       print_latex();
+       print_latex(std::ostream &);
 };
 
 /** Context for tree-like output for debugging. */
 class print_tree : public print_context
 {
 public:
-       print_tree(std::ostream & os = std::cout, unsigned d = 4)
-         : print_context(os), delta_indent(d) {}
-       unsigned delta_indent; /**< size of indentation step */
+       print_tree(unsigned d = 4);
+       print_tree(std::ostream &, unsigned d = 4);
+       const unsigned delta_indent; /**< size of indentation step */
 };
 
 /** Base context for C source output. */
 class print_csrc : public print_context
 {
 public:
-       print_csrc(std::ostream & os = std::cout)
-         : print_context(os) {}
+       print_csrc();
+       print_csrc(std::ostream &);
 };
 
 /** Context for C source output using float numbers. */
 class print_csrc_float : public print_csrc
 {
 public:
-       print_csrc_float(std::ostream & os = std::cout)
-         : print_csrc(os) {}
+       print_csrc_float();
+       print_csrc_float(std::ostream &);
 };
 
 /** Context for C source output using double numbers. */
 class print_csrc_double : public print_csrc
 {
 public:
-       print_csrc_double(std::ostream & os = std::cout)
-         : print_csrc(os) {}
+       print_csrc_double();
+       print_csrc_double(std::ostream &);
 };
 
 /** Context for C source output using CLN numbers. */
 class print_csrc_cl_N : public print_csrc
 {
 public:
-       print_csrc_cl_N(std::ostream & os = std::cout)
-         : print_csrc(os) {}
+       print_csrc_cl_N();
+       print_csrc_cl_N(std::ostream &);
 };
 
 /** Check if obj is a T, including base classes. */
index 5090526672a60bedf3e2b48908773b581cc10ef8..80433824ed7465e82702958142148a72fac77e27 100644 (file)
@@ -21,6 +21,7 @@
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
+#include <iostream>
 #include <stdexcept>
 
 #include "pseries.h"
index 0b8074633d47d002de7da16780f3318200ef6ff9..d0beb95205e138dbcefae8766077fca089fa67e4 100644 (file)
@@ -20,6 +20,7 @@
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
+#include <iostream>
 #include <stdexcept>
 
 #include "relational.h"
index f9f125406eb31c78a7ead9815b1b9174dd21436b..2df5f8d4f740e793d10cf96c4ee88f59884548ac 100644 (file)
@@ -24,6 +24,7 @@
 #ifndef __GINAC_REMEMBER_H__
 #define __GINAC_REMEMBER_H__
 
+#include <iosfwd>
 #include <vector>
 #include <list>
 
index d2edaf86a2b8dd60d8fd6501278972189a02592e..1122c212e730b0430ab06e82e476e3ef192f2b4e 100644 (file)
@@ -20,6 +20,7 @@
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
+#include <iostream>
 #include <string>
 
 #include "structure.h"
index 1deb1cfad3a1960ce31cb0ca30ada611ce7655ac..ef4278aad8c5db4fa3a668e246e7c5321e8c0e24 100644 (file)
@@ -20,9 +20,9 @@
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
+#include <iostream>
 #include <stdexcept>
 #include <functional>
-#include <algorithm>
 
 #include "symmetry.h"
 #include "lst.h"
index 7ab2ef91cde6f0472b680426eca8fcfa616adde2..9db3635b1e8f7bb0ae31e928aef0dbcea21b72d3 100644 (file)
@@ -20,6 +20,7 @@
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
+#include <iostream>
 #include <stdexcept>
 #include <vector>
 
index c653d830cd75cce8113e5736360aa481b2e021e9..37e23e97e6883715373fa258cbe38446ce68ef2c 100644 (file)
@@ -20,6 +20,8 @@
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
+#include <iostream>
+
 #include "wildcard.h"
 #include "print.h"
 #include "archive.h"
index cf2a5827754c1e75145e23338559ad0d351f0e07..bfa943fb8adbe275cc810673b9eb20024cf9f865 100644 (file)
@@ -27,6 +27,7 @@
 #include <string.h>
 
 #include <map>
+#include <iostream>
 #include <string>
 
 using namespace std;
index 19f27df149762da615bcf25a5743feca05015f1e..2a3e20ac3c08dcd4999816b4c08d29151d9de174 100644 (file)
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include <stdio.h>
-#include <stdlib.h>
+#include <cstdlib>
+#include <iostream>
 #include <fstream>
 #include <stdexcept>
 
 #include "ginac.h"
 
+using namespace std;
 using namespace GiNaC;
 
 int main(int argc, char **argv)
 {
        if (argc < 2) {
-               fprintf(stderr, "Usage: %s [-d] file...\n", argv[0]);
+               cerr << "Usage: " << argv[0] << " [-d] file..." << endl;
                exit(1);
        }
        --argc; ++argv;