From fbdd5eefb7188778ca9c04b5bee08223609b880f Mon Sep 17 00:00:00 2001 From: Richard Kreckel Date: Sat, 27 Oct 2001 20:18:51 +0000 Subject: [PATCH] * Headers only include from now on, since that contains all the necessary forward declarations without bringing in the whole big header. --- INSTALL | 2 +- check/checks.cpp | 1 - check/checks.h | 6 ++-- check/exams.cpp | 1 - check/exams.h | 1 + check/genex.cpp | 5 ++-- check/times.cpp | 2 -- check/times.h | 3 +- doc/tutorial/ginac.texi | 35 ++++++++++------------ ginac/Makefile.am | 4 +-- ginac/add.h | 1 - ginac/archive.h | 2 +- ginac/basic.h | 2 -- ginac/clifford.cpp | 5 ++-- ginac/color.cpp | 2 +- ginac/constant.cpp | 1 + ginac/ex.h | 5 ++-- ginac/expair.cpp | 37 ++++++++++++++++++++++++ ginac/expair.h | 8 +----- ginac/expairseq.cpp | 3 +- ginac/fail.cpp | 6 ++-- ginac/fail.h | 2 +- ginac/fderivative.cpp | 2 ++ ginac/function.pl | 1 + ginac/idx.cpp | 2 +- ginac/indexed.cpp | 2 +- ginac/matrix.cpp | 3 +- ginac/mul.cpp | 1 + ginac/normal.cpp | 8 +++--- ginac/operators.h | 2 +- ginac/print.cpp | 64 +++++++++++++++++++++++++++++++++++++++++ ginac/print.h | 36 ++++++++++++----------- ginac/pseries.cpp | 1 + ginac/relational.cpp | 1 + ginac/remember.h | 1 + ginac/structure.cpp | 1 + ginac/symmetry.cpp | 2 +- ginac/tensor.cpp | 1 + ginac/wildcard.cpp | 2 ++ ginsh/ginsh.h | 1 + tools/viewgar.cpp | 7 +++-- 41 files changed, 189 insertions(+), 83 deletions(-) create mode 100644 ginac/expair.cpp create mode 100644 ginac/print.cpp diff --git a/INSTALL b/INSTALL index 721d6a25..d79649f4 100644 --- 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 header written by Magnus Fromreide. It was posted to the gcc-patches mailing list on November 21 2000: . diff --git a/check/checks.cpp b/check/checks.cpp index 6cfeaff8..101ae01b 100644 --- a/check/checks.cpp +++ b/check/checks.cpp @@ -21,7 +21,6 @@ */ #include -#include #include #include "checks.h" diff --git a/check/checks.h b/check/checks.h index a9f2ba9f..a705265d 100644 --- a/check/checks.h +++ b/check/checks.h @@ -23,11 +23,11 @@ #ifndef CHECKS_H #define CHECKS_H -// For rand() and friends: -#include -using namespace std; +#include + #include "config.h" #include "ginac.h" +using namespace std; using namespace GiNaC; // prototypes for the expression generating functions in: diff --git a/check/exams.cpp b/check/exams.cpp index 41097741..a10d8e47 100644 --- a/check/exams.cpp +++ b/check/exams.cpp @@ -21,7 +21,6 @@ */ #include -#include #include "exams.h" diff --git a/check/exams.h b/check/exams.h index 1372cc30..593dd0c0 100644 --- a/check/exams.h +++ b/check/exams.h @@ -23,6 +23,7 @@ #ifndef EXAMS_H #define EXAMS_H +#include #include "ginac.h" using namespace std; using namespace GiNaC; diff --git a/check/genex.cpp b/check/genex.cpp index f4bffb15..8b2c9f50 100644 --- a/check/genex.cpp +++ b/check/genex.cpp @@ -21,10 +21,9 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -// For rand() and friends: -#include - +#include #include "ginac.h" +using namespace std; using namespace GiNaC; /* Create a dense univariate random polynomial in x. diff --git a/check/times.cpp b/check/times.cpp index 7b6858be..ef038f30 100644 --- a/check/times.cpp +++ b/check/times.cpp @@ -21,8 +21,6 @@ */ #include -#include - #include "times.h" int main() diff --git a/check/times.h b/check/times.h index d938d0b0..5fa4ea6a 100644 --- a/check/times.h +++ b/check/times.h @@ -24,7 +24,8 @@ #define CHECKS_H #include -#include +#include +#include #include #include #include "config.h" diff --git a/doc/tutorial/ginac.texi b/doc/tutorial/ginac.texi index 63e1376b..94ec39ee 100644 --- a/doc/tutorial/ginac.texi +++ b/doc/tutorial/ginac.texi @@ -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 #include 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 #include 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 #include using namespace GiNaC; @@ -951,6 +957,7 @@ then on will be stored with a precision matching that number of decimal digits: @example +#include #include 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 #include using namespace std; using namespace GiNaC; @@ -1527,6 +1535,7 @@ not visible in the output. A simple example shall illustrate the concepts: @example +#include #include 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 -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 -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 -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 #include 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 -using namespace std; -using namespace GiNaC; - -int main() @{ symbol x("x"), y("y"); diff --git a/ginac/Makefile.am b/ginac/Makefile.am index 2f2fed07..f0896bd4 100644 --- a/ginac/Makefile.am +++ b/ginac/Makefile.am @@ -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 diff --git a/ginac/add.h b/ginac/add.h index 74000568..94d5c8e5 100644 --- a/ginac/add.h +++ b/ginac/add.h @@ -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 diff --git a/ginac/archive.h b/ginac/archive.h index 012086b5..b6074395 100644 --- a/ginac/archive.h +++ b/ginac/archive.h @@ -25,9 +25,9 @@ #include "ex.h" +#include #include #include -#include namespace GiNaC { diff --git a/ginac/basic.h b/ginac/basic.h index e5c3069d..6320e075 100644 --- a/ginac/basic.h +++ b/ginac/basic.h @@ -23,9 +23,7 @@ #ifndef __GINAC_BASIC_H__ #define __GINAC_BASIC_H__ -#include #include - // CINT needs to work properly with #include diff --git a/ginac/clifford.cpp b/ginac/clifford.cpp index 11f84d0c..b8083e8d 100644 --- a/ginac/clifford.cpp +++ b/ginac/clifford.cpp @@ -20,6 +20,9 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include +#include + #include "clifford.h" #include "ex.h" #include "idx.h" @@ -34,8 +37,6 @@ #include "archive.h" #include "utils.h" -#include - namespace GiNaC { GINAC_IMPLEMENT_REGISTERED_CLASS(clifford, indexed) diff --git a/ginac/color.cpp b/ginac/color.cpp index dd8ee18d..2459a2d4 100644 --- a/ginac/color.cpp +++ b/ginac/color.cpp @@ -20,7 +20,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include +#include #include #include "color.h" diff --git a/ginac/constant.cpp b/ginac/constant.cpp index d6c07409..0cf7c77b 100644 --- a/ginac/constant.cpp +++ b/ginac/constant.cpp @@ -22,6 +22,7 @@ #include #include +#include #include "constant.h" #include "numeric.h" diff --git a/ginac/ex.h b/ginac/ex.h index c76290ff..0bbe1299 100644 --- a/ginac/ex.h +++ b/ginac/ex.h @@ -23,11 +23,12 @@ #ifndef __GINAC_EX_H__ #define __GINAC_EX_H__ +#include +#include + #include "basic.h" #include "operators.h" -#include - 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 index 00000000..61d8e26f --- /dev/null +++ b/ginac/expair.cpp @@ -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 + +#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 diff --git a/ginac/expair.h b/ginac/expair.h index d7a76ca1..3a6c01ca 100644 --- a/ginac/expair.h +++ b/ginac/expair.h @@ -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 diff --git a/ginac/expairseq.cpp b/ginac/expairseq.cpp index f0356536..fee2665c 100644 --- a/ginac/expairseq.cpp +++ b/ginac/expairseq.cpp @@ -20,6 +20,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include #include #include @@ -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()); } diff --git a/ginac/fail.cpp b/ginac/fail.cpp index bbbff1b2..da00eece 100644 --- a/ginac/fail.cpp +++ b/ginac/fail.cpp @@ -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 + #include "fail.h" #include "print.h" #include "archive.h" diff --git a/ginac/fail.h b/ginac/fail.h index 3c514797..125788d5 100644 --- a/ginac/fail.h +++ b/ginac/fail.h @@ -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 diff --git a/ginac/fderivative.cpp b/ginac/fderivative.cpp index cefa165d..57f4ed76 100644 --- a/ginac/fderivative.cpp +++ b/ginac/fderivative.cpp @@ -20,6 +20,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include "fderivative.h" #include "print.h" #include "archive.h" diff --git a/ginac/function.pl b/ginac/function.pl index ad77345d..962b17ef 100755 --- a/ginac/function.pl +++ b/ginac/function.pl @@ -425,6 +425,7 @@ $implementation=< #include #include #include diff --git a/ginac/idx.cpp b/ginac/idx.cpp index be1d9483..74754022 100644 --- a/ginac/idx.cpp +++ b/ginac/idx.cpp @@ -20,8 +20,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include -#include #include "idx.h" #include "symbol.h" diff --git a/ginac/indexed.cpp b/ginac/indexed.cpp index a89fb101..bc474f3d 100644 --- a/ginac/indexed.cpp +++ b/ginac/indexed.cpp @@ -20,8 +20,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include -#include #include "indexed.h" #include "idx.h" diff --git a/ginac/matrix.cpp b/ginac/matrix.cpp index 8afa7b58..3d735fe4 100644 --- a/ginac/matrix.cpp +++ b/ginac/matrix.cpp @@ -20,6 +20,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include #include #include @@ -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 pre_sort; for (std::vector::const_iterator i=c_zeros.begin(); i!=c_zeros.end(); ++i) pre_sort.push_back(i->second); diff --git a/ginac/mul.cpp b/ginac/mul.cpp index 83bebb26..065455ea 100644 --- a/ginac/mul.cpp +++ b/ginac/mul.cpp @@ -20,6 +20,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include #include diff --git a/ginac/normal.cpp b/ginac/normal.cpp index f123be20..4e2feb39 100644 --- a/ginac/normal.cpp +++ b/ginac/normal.cpp @@ -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 diff --git a/ginac/operators.h b/ginac/operators.h index 22d89370..7805e888 100644 --- a/ginac/operators.h +++ b/ginac/operators.h @@ -23,7 +23,7 @@ #ifndef __GINAC_OPERATORS_H__ #define __GINAC_OPERATORS_H__ -#include +#include namespace GiNaC { diff --git a/ginac/print.cpp b/ginac/print.cpp new file mode 100644 index 00000000..bd365cfe --- /dev/null +++ b/ginac/print.cpp @@ -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 + +#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 diff --git a/ginac/print.h b/ginac/print.h index e32238d0..1d99639e 100644 --- a/ginac/print.h +++ b/ginac/print.h @@ -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 +#include #include 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. */ diff --git a/ginac/pseries.cpp b/ginac/pseries.cpp index 50905266..80433824 100644 --- a/ginac/pseries.cpp +++ b/ginac/pseries.cpp @@ -21,6 +21,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include #include "pseries.h" diff --git a/ginac/relational.cpp b/ginac/relational.cpp index 0b807463..d0beb952 100644 --- a/ginac/relational.cpp +++ b/ginac/relational.cpp @@ -20,6 +20,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include #include "relational.h" diff --git a/ginac/remember.h b/ginac/remember.h index f9f12540..2df5f8d4 100644 --- a/ginac/remember.h +++ b/ginac/remember.h @@ -24,6 +24,7 @@ #ifndef __GINAC_REMEMBER_H__ #define __GINAC_REMEMBER_H__ +#include #include #include diff --git a/ginac/structure.cpp b/ginac/structure.cpp index d2edaf86..1122c212 100644 --- a/ginac/structure.cpp +++ b/ginac/structure.cpp @@ -20,6 +20,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include #include "structure.h" diff --git a/ginac/symmetry.cpp b/ginac/symmetry.cpp index 1deb1cfa..ef4278aa 100644 --- a/ginac/symmetry.cpp +++ b/ginac/symmetry.cpp @@ -20,9 +20,9 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include #include -#include #include "symmetry.h" #include "lst.h" diff --git a/ginac/tensor.cpp b/ginac/tensor.cpp index 7ab2ef91..9db3635b 100644 --- a/ginac/tensor.cpp +++ b/ginac/tensor.cpp @@ -20,6 +20,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include #include #include diff --git a/ginac/wildcard.cpp b/ginac/wildcard.cpp index c653d830..37e23e97 100644 --- a/ginac/wildcard.cpp +++ b/ginac/wildcard.cpp @@ -20,6 +20,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include + #include "wildcard.h" #include "print.h" #include "archive.h" diff --git a/ginsh/ginsh.h b/ginsh/ginsh.h index cf2a5827..bfa943fb 100644 --- a/ginsh/ginsh.h +++ b/ginsh/ginsh.h @@ -27,6 +27,7 @@ #include #include +#include #include using namespace std; diff --git a/tools/viewgar.cpp b/tools/viewgar.cpp index 19f27df1..2a3e20ac 100644 --- a/tools/viewgar.cpp +++ b/tools/viewgar.cpp @@ -20,19 +20,20 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include -#include +#include +#include #include #include #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; -- 2.45.0