From 1602530f716ba1d425a0667b897182b99c374823 Mon Sep 17 00:00:00 2001 From: Jens Vollinga Date: Fri, 6 Feb 2009 16:07:10 +0100 Subject: [PATCH] Prettified source code. - Added copyright and GPL licencing to new files. - Increased year to 2009. - Changed guarding macros in header to uniform pattern without leading or trailing __ (double underscores). - Put includes of system wide header consistently below own includes (help a tiny bit to clarify dependencies). --- check/bugme_chinrem_gcd.cpp | 36 ++++++++++---- check/check_inifcns.cpp | 9 ++-- check/check_lsolve.cpp | 9 ++-- check/check_matrices.cpp | 9 ++-- check/check_numeric.cpp | 9 ++-- check/error_report.h | 31 ++++++++++-- check/exam_archive.cpp | 9 ++-- check/exam_clifford.cpp | 7 +-- check/exam_color.cpp | 7 +-- check/exam_cra.cpp | 34 +++++++++++--- check/exam_differentiation.cpp | 7 +-- check/exam_factor.cpp | 7 +-- check/exam_hashmap.cpp | 7 +-- check/exam_indexed.cpp | 7 +-- check/exam_inifcns.cpp | 7 +-- check/exam_inifcns_nstdsums.cpp | 8 ++-- check/exam_inifcns_nstdsums.h | 22 +++++++++ check/exam_lsolve.cpp | 7 +-- check/exam_matrices.cpp | 9 ++-- check/exam_misc.cpp | 7 +-- check/exam_mod_gcd.cpp | 33 +++++++++++-- check/exam_normalization.cpp | 7 +-- check/exam_numeric.cpp | 8 ++-- check/exam_paranoia.cpp | 7 +-- check/exam_polygcd.cpp | 7 +-- check/exam_powerlaws.cpp | 7 +-- check/exam_pseries.cpp | 7 +-- check/exam_structure.cpp | 6 +-- check/genex.cpp | 7 +-- check/heur_gcd_bug.cpp | 33 ++++++++++--- check/match_bug.cpp | 27 +++++++++-- check/mul_eval_memleak.cpp | 31 ++++++------ check/numeric_archive.cpp | 38 +++++++++++---- check/parser_bugs.cpp | 31 ++++++++++-- check/parser_memleak.cpp | 37 +++++++++++---- check/randomize_serials.cpp | 30 ++++++++++-- check/test_runner.h | 33 +++++++++++-- check/time_antipode.cpp | 17 +++---- check/time_dennyfliegner.cpp | 9 ++-- check/time_fateman_expand.cpp | 7 +-- check/time_gammaseries.cpp | 9 ++-- check/time_hashmap.cpp | 9 ++-- check/time_lw_A.cpp | 9 ++-- check/time_lw_B.cpp | 9 ++-- check/time_lw_C.cpp | 9 ++-- check/time_lw_D.cpp | 9 ++-- check/time_lw_E.cpp | 9 ++-- check/time_lw_F.cpp | 9 ++-- check/time_lw_G.cpp | 9 ++-- check/time_lw_H.cpp | 9 ++-- check/time_lw_IJKL.cpp | 9 ++-- check/time_lw_M1.cpp | 7 +-- check/time_lw_M2.cpp | 7 +-- check/time_lw_N.cpp | 9 ++-- check/time_lw_O.cpp | 9 ++-- check/time_lw_P.cpp | 9 ++-- check/time_lw_Pprime.cpp | 9 ++-- check/time_lw_Q.cpp | 9 ++-- check/time_lw_Qprime.cpp | 9 ++-- check/time_parser.cpp | 40 ++++++++++++---- check/time_toeplitz.cpp | 9 ++-- check/time_uvar_gcd.cpp | 32 +++++++++++-- check/time_vandermonde.cpp | 9 ++-- check/timer.cpp | 8 ++-- check/timer.h | 3 +- doc/tutorial/ginac.texi | 6 +-- ginac/add.cpp | 12 ++--- ginac/add.h | 8 ++-- ginac/archive.cpp | 8 ++-- ginac/archive.h | 11 ++--- ginac/assertion.h | 8 ++-- ginac/basic.cpp | 10 ++-- ginac/basic.h | 24 +++++----- ginac/class_info.h | 16 +++---- ginac/clifford.cpp | 6 +-- ginac/clifford.h | 9 ++-- ginac/color.cpp | 8 ++-- ginac/color.h | 10 ++-- ginac/compiler.h | 28 +++++++++-- ginac/constant.cpp | 10 ++-- ginac/constant.h | 11 +++-- ginac/container.h | 23 +++++---- ginac/ex.cpp | 8 ++-- ginac/ex.h | 17 ++++--- ginac/excompiler.cpp | 23 +++++---- ginac/excompiler.h | 16 +++---- ginac/expair.cpp | 6 +-- ginac/expair.h | 8 ++-- ginac/expairseq.cpp | 13 +++--- ginac/expairseq.h | 20 ++++---- ginac/exprseq.cpp | 2 +- ginac/exprseq.h | 12 ++--- ginac/factor.cpp | 2 +- ginac/factor.h | 12 ++--- ginac/fail.cpp | 6 +-- ginac/fail.h | 8 ++-- ginac/fderivative.cpp | 6 +-- ginac/fderivative.h | 13 +++--- ginac/flags.h | 8 ++-- ginac/function.pl | 17 ++++--- ginac/ginac.h | 8 ++-- ginac/hash_map.h | 13 +++--- ginac/idx.cpp | 10 ++-- ginac/idx.h | 9 ++-- ginac/indexed.cpp | 12 ++--- ginac/indexed.h | 13 +++--- ginac/inifcns.cpp | 8 ++-- ginac/inifcns.h | 8 ++-- ginac/inifcns_gamma.cpp | 8 ++-- ginac/inifcns_nstdsums.cpp | 11 ++--- ginac/inifcns_trans.cpp | 8 ++-- ginac/integral.cpp | 2 +- ginac/integral.h | 8 ++-- ginac/lst.cpp | 2 +- ginac/lst.h | 12 ++--- ginac/matrix.cpp | 16 +++---- ginac/matrix.h | 14 +++--- ginac/mul.cpp | 12 ++--- ginac/mul.h | 8 ++-- ginac/ncmul.cpp | 10 ++-- ginac/ncmul.h | 8 ++-- ginac/normal.cpp | 8 ++-- ginac/normal.h | 8 ++-- ginac/numeric.cpp | 14 +++--- ginac/numeric.h | 14 +++--- ginac/operators.cpp | 8 ++-- ginac/operators.h | 8 ++-- ginac/parser/debug.h | 34 ++++++++++++-- ginac/parser/lexer.cpp | 34 +++++++++++--- ginac/parser/lexer.h | 34 +++++++++++--- ginac/parser/parse_binop_rhs.cpp | 31 ++++++++++-- ginac/parser/parse_context.cpp | 30 ++++++++++-- ginac/parser/parse_context.h | 40 ++++++++++++---- ginac/parser/parser.cpp | 30 ++++++++++-- ginac/parser/parser.h | 35 +++++++++++--- ginac/parser/parser_compat.cpp | 34 +++++++++++--- ginac/polynomial/chinrem_gcd.cpp | 27 +++++++++-- ginac/polynomial/chinrem_gcd.h | 31 ++++++++++-- ginac/polynomial/collect_vargs.cpp | 39 ++++++++++++---- ginac/polynomial/collect_vargs.h | 35 +++++++++++--- ginac/polynomial/cra_garner.cpp | 34 +++++++++++--- ginac/polynomial/cra_garner.h | 34 ++++++++++++-- ginac/polynomial/debug.h | 57 ++++++++++++++++------- ginac/polynomial/divide_in_z_p.cpp | 28 +++++++++-- ginac/polynomial/divide_in_z_p.h | 29 ++++++++++-- ginac/polynomial/euclid_gcd_wrap.h | 28 +++++++++-- ginac/polynomial/eval_point_finder.h | 32 +++++++++++-- ginac/polynomial/eval_uvar.h | 33 ++++++++++--- ginac/polynomial/gcd_euclid.h | 33 ++++++++++--- ginac/polynomial/gcd_uvar.cpp | 29 ++++++++++-- ginac/polynomial/heur_gcd_uvar.h | 34 +++++++++++--- ginac/polynomial/interpolate_padic_uvar.h | 37 +++++++++++---- ginac/polynomial/mgcd.cpp | 29 ++++++++++-- ginac/polynomial/mod_gcd.cpp | 32 +++++++++++-- ginac/polynomial/mod_gcd.h | 35 +++++++++++--- ginac/polynomial/newton_interpolate.h | 32 +++++++++++-- ginac/polynomial/normalize.h | 33 ++++++++++--- ginac/polynomial/optimal_vars_finder.cpp | 35 +++++++++++--- ginac/polynomial/optimal_vars_finder.h | 36 ++++++++++++-- ginac/polynomial/pgcd.cpp | 26 +++++++++-- ginac/polynomial/pgcd.h | 28 +++++++++-- ginac/polynomial/poly_cra.h | 32 +++++++++++-- ginac/polynomial/prem_uvar.h | 35 +++++++++++--- ginac/polynomial/primes_factory.h | 34 +++++++++++--- ginac/polynomial/primpart_content.cpp | 26 +++++++++-- ginac/polynomial/remainder.h | 35 +++++++++++--- ginac/polynomial/ring_traits.h | 34 +++++++++++--- ginac/polynomial/smod_helpers.h | 31 ++++++++++-- ginac/polynomial/sr_gcd_uvar.h | 36 +++++++++++--- ginac/polynomial/upoly.h | 48 +++++++++++++------ ginac/polynomial/upoly_io.cpp | 50 ++++++++++++++------ ginac/polynomial/upoly_io.h | 39 +++++++++++++--- ginac/power.cpp | 12 ++--- ginac/power.h | 8 ++-- ginac/print.cpp | 6 +-- ginac/print.h | 15 +++--- ginac/pseries.cpp | 10 ++-- ginac/pseries.h | 8 ++-- ginac/ptr.h | 13 +++--- ginac/registrar.cpp | 8 ++-- ginac/registrar.h | 18 +++---- ginac/relational.cpp | 8 ++-- ginac/relational.h | 8 ++-- ginac/remember.cpp | 6 +-- ginac/remember.h | 10 ++-- ginac/structure.h | 14 +++--- ginac/symbol.cpp | 10 ++-- ginac/symbol.h | 13 +++--- ginac/symmetry.cpp | 12 ++--- ginac/symmetry.h | 13 +++--- ginac/tensor.cpp | 10 ++-- ginac/tensor.h | 9 ++-- ginac/tostring.h | 8 ++-- ginac/utils.cpp | 2 +- ginac/utils.h | 14 +++--- ginac/wildcard.cpp | 6 +-- ginac/wildcard.h | 9 ++-- ginsh/ginsh.1.in | 2 +- ginsh/ginsh.h | 2 +- ginsh/ginsh_extensions.h | 2 +- ginsh/ginsh_lexer.ll | 2 +- ginsh/ginsh_parser.yy | 4 +- tools/viewgar.1.in | 2 +- tools/viewgar.cpp | 11 ++--- 204 files changed, 2346 insertions(+), 1020 deletions(-) diff --git a/check/bugme_chinrem_gcd.cpp b/check/bugme_chinrem_gcd.cpp index 0b422c2b..aae82213 100644 --- a/check/bugme_chinrem_gcd.cpp +++ b/check/bugme_chinrem_gcd.cpp @@ -1,21 +1,40 @@ -/** - * @file bugme_chinrem_gcd.cpp - * A small program exposing historical bug in poly_cra function. +/** @file bugme_chinrem_gcd.cpp + * + * A small program exposing historical bug in poly_cra function. */ + +/* + * 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 + * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include -#include + #include "ginac.h" + +#include +#include using namespace std; -namespace GiNaC -{ + +namespace GiNaC { extern ex chinrem_gcd(const ex& A, const ex& B); } + using namespace GiNaC; static const std::string p1_srep("\ -936639990-14679334842*x^9-6214147095*x^35+22219362387*x^69-31276301429*x^25+1199649580*x^98+2134905268*x^56+25591410149*x^72+5507703343*x^11+18467021749*x^43+11196778577*x^85+26050790733*x^29-178435747*x^2+1890708440*x^88-561107347*x^13-31038290506*x^51-1330154020*x^15+23467669465*x^59-3966988360*x^16+26794929142*x^38+11598735101*x^75-8608995580*x^3-30174373832*x^46+3580061526*x^91+7814495607*x^20+6624766926*x^78-11990574398*x^54-6863205889*x^33-319408644*x^65-11580405260*x^41-9654281719*x^81+23532819511*x^24-3890383043*x^94+27682281779*x^62+1363904895*x^68-272899085*x^49-933592128*x^97-2954269379*x^28+8432066353*x^36+14038262112*x^71-5474416933*x^84+741141010*x^100+38375274669*x^57-19509035058*x^44-1029159530*x^87+17276957972*x^8+23471621465*x^19-4745283802*x^74-15331409214*x^23-1261023993*x^90+17469329915*x^52-7544450778*x^64+12293848678*x^10-12162845828*x^39+11912265375*x^77-35110566664*x^27-5872201799*x^60+16636451249*x^80-6663332709*x^12+26248623452*x^47+2292551912*x^93-13410537172*x^14+4255578378*x^55+11614165303*x^31-6270990007*x^34-6744628155*x^67+3692350529*x^96-17204774085*x^63-11157075535*x^18+4275663006*x^70+18517327396*x^42+2030662033*x^83-3435911855*x^50-227816977*x^99+4507833875*x-41046742100*x^37+9385606040*x^73-5892518210*x^22+512268187*x^86+9183261708*x^58-2542140060*x^4-19627087954*x^45+142491112*x^89-4846605217*x^26-4503859503*x^30-38388107386*x^32+2123912816*x^5-2508504600*x^76-15282350857*x^53-12217636980*x^40-4828562936*x^79+1788729074*x^6-967823912*x^92+6436149609*x^7+44704228721*x^61+21474090980*x^17+36034512058*x^66+10918084347*x^21+1913801599*x^82+1530941050*x^48-7104898913*x^95"); - static const std::string p2_srep("\ 1882371920+29943249139*x^9-21558061051*x^35+24497174109*x^69+3363043648*x^25+5186524611*x^98-17753230977*x^56+16461882236*x^72+11039962159*x^11-85814533599*x^43-12986831645*x^85+4813620791*x^29-2133682609*x^2+9141433582*x^88-14841292646*x^13+19494168654*x^51-426278523*x^15-18246235652*x^59-12424469513*x^16-14414308862*x^38-16262001424*x^75+1584505491*x^3+6616907060*x^46+9411879011*x^91+7056872613*x^20+29675566382*x^78-48441925739*x^54+12038293769*x^33-22463329638*x^65+21957440404*x^41+26252749471*x^81-28689993421*x^24+1190623161*x^94-3323333429*x^62+778770195*x^68-23673866858*x^49+10263027507*x^97+29115114125*x^28-34230002076*x^36-217623403*x^71-6344703601*x^84+2789684836*x^100-44973929094*x^57-6061422988*x^44+18964048763*x^87+3160532878*x^8-8039690791*x^19-5750277357*x^74+5544486596*x^23+1800283356*x^90-8174921854*x^52+2577247520*x^64-1088265300*x^10+18566882873*x^39+12678193001*x^77-7204610489*x^27+9980611956*x^60+12672890141*x^80+4463462090*x^12-30937311949*x^47-3883570155*x^93+7561875663*x^14-3850452489*x^55+20714527103*x^31-9973372012*x^34+440594870*x^67+10385086102*x^96-20693764726*x^63+11049483001*x^18-11578701274*x^70-5548876327*x^42+20393397488*x^83+20531692560*x^50+1309311388*x^99-7521320830*x-2750892631*x^37-6001481047*x^73+7149046134*x^22+10287410396*x^86+7332053562*x^58-1135211878*x^4-7420079075*x^45+9742202475*x^89-214559874*x^26+29530802947*x^30-2280622009*x^32-4237029618*x^5+13760397067*x^76+18073788685*x^53+2485463829*x^40+1889202286*x^79+8841198971*x^6+13562767020*x^92+110919258*x^7+6961020716*x^61+11700952246*x^17-13528331424*x^66-19801882818*x^21+25061328813*x^82+1553111326*x^48+4638169279*x^95"); @@ -29,4 +48,3 @@ int main(int argc, char** argv) cout << "not found."; return 0; } - diff --git a/check/check_inifcns.cpp b/check/check_inifcns.cpp index 9d493290..0bab8717 100644 --- a/check/check_inifcns.cpp +++ b/check/check_inifcns.cpp @@ -4,7 +4,7 @@ * functions. */ /* - * GiNaC Copyright (C) 1999-2008 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 @@ -21,12 +21,13 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include -#include // rand() #include "ginac.h" -using namespace std; using namespace GiNaC; +#include // for rand() +#include +using namespace std; + /* Some tests on the sine trigonometric function. */ static unsigned inifcns_check_sin() { diff --git a/check/check_lsolve.cpp b/check/check_lsolve.cpp index 226b6c2d..795f157d 100644 --- a/check/check_lsolve.cpp +++ b/check/check_lsolve.cpp @@ -5,7 +5,7 @@ * the underlying symbolic manipulations. */ /* - * GiNaC Copyright (C) 1999-2008 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 @@ -22,12 +22,13 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "ginac.h" +using namespace GiNaC; + +#include // for rand() #include #include -#include // rand() -#include "ginac.h" using namespace std; -using namespace GiNaC; extern const ex dense_univariate_poly(const symbol & x, unsigned degree); diff --git a/check/check_matrices.cpp b/check/check_matrices.cpp index ecabc6f2..1df9d01a 100644 --- a/check/check_matrices.cpp +++ b/check/check_matrices.cpp @@ -5,7 +5,7 @@ * manipulations. */ /* - * GiNaC Copyright (C) 1999-2008 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 @@ -22,12 +22,13 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include -#include // rand(), RAND_MAX #include "ginac.h" -using namespace std; using namespace GiNaC; +#include // for rand(), RAND_MAX +#include +using namespace std; + extern const ex sparse_tree(const symbol & x, const symbol & y, const symbol & z, int level, bool trig = false, bool rational = true, diff --git a/check/check_numeric.cpp b/check/check_numeric.cpp index ec878be2..9360b9cd 100644 --- a/check/check_numeric.cpp +++ b/check/check_numeric.cpp @@ -4,7 +4,7 @@ * tests on these numbers like is_integer() etc... */ /* - * GiNaC Copyright (C) 1999-2008 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 @@ -21,12 +21,13 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include -#include // rand() #include "ginac.h" -using namespace std; using namespace GiNaC; +#include // for rand() +#include +using namespace std; + /* Simple and maybe somewhat pointless consistency tests of assorted tests and * conversions. */ static unsigned check_numeric1() diff --git a/check/error_report.h b/check/error_report.h index 6b2dfe61..759d905b 100644 --- a/check/error_report.h +++ b/check/error_report.h @@ -1,5 +1,29 @@ -#ifndef GINAC_CHECK_ERROR_REPORT_HPP -#define GINAC_CHECK_ERROR_REPORT_HPP +/** @file error_report.h + * + * Macro for additional debugging output. + */ + +/* + * 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 + * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef GINAC_CHECK_ERROR_REPORT_H +#define GINAC_CHECK_ERROR_REPORT_H + #include #include @@ -13,5 +37,4 @@ if (cond) { \ } \ } while (0) -#endif // GINAC_CHECK_ERROR_REPORT_HPP - +#endif // ndef GINAC_CHECK_ERROR_REPORT_H diff --git a/check/exam_archive.cpp b/check/exam_archive.cpp index bdf69955..083f79dd 100644 --- a/check/exam_archive.cpp +++ b/check/exam_archive.cpp @@ -3,7 +3,7 @@ * Here we test GiNaC's archiving system. */ /* - * GiNaC Copyright (C) 1999-2008 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 @@ -20,12 +20,13 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include -#include #include "ginac.h" -using namespace std; using namespace GiNaC; +#include +#include +using namespace std; + unsigned exam_archive() { unsigned result = 0; diff --git a/check/exam_clifford.cpp b/check/exam_clifford.cpp index 68393673..f713e1c5 100644 --- a/check/exam_clifford.cpp +++ b/check/exam_clifford.cpp @@ -3,7 +3,7 @@ * Here we test GiNaC's Clifford algebra objects. */ /* - * GiNaC Copyright (C) 1999-2008 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 @@ -20,11 +20,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include #include "ginac.h" -using namespace std; using namespace GiNaC; +#include +using namespace std; + const numeric half(1, 2); static unsigned check_equal(const ex &e1, const ex &e2) diff --git a/check/exam_color.cpp b/check/exam_color.cpp index 53c72c01..823ee7d8 100644 --- a/check/exam_color.cpp +++ b/check/exam_color.cpp @@ -3,7 +3,7 @@ * Here we test GiNaC's color objects (su(3) Lie algebra). */ /* - * GiNaC Copyright (C) 1999-2008 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 @@ -20,11 +20,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include #include "ginac.h" -using namespace std; using namespace GiNaC; +#include +using namespace std; + static unsigned check_equal(const ex &e1, const ex &e2) { ex e = e1 - e2; diff --git a/check/exam_cra.cpp b/check/exam_cra.cpp index 7ad62c15..f224926d 100644 --- a/check/exam_cra.cpp +++ b/check/exam_cra.cpp @@ -1,14 +1,37 @@ -#include +/** @file exam_cra.cpp + * + * Test of Chinese remainder algorithm. */ + +/* + * 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 + * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "polynomial/cra_garner.h" + #include #include #include #include -#include "polynomial/cra_garner.h" +using namespace cln; +#include +#include #include -#include #include -#include -using namespace cln; +#include using namespace std; /// Generate a sequences of primes p_i such that \prod_i p_i < limit @@ -120,4 +143,3 @@ static void dump(const std::vector& v) std::cerr << v[i] << " "; std::cerr << "]"; } - diff --git a/check/exam_differentiation.cpp b/check/exam_differentiation.cpp index 2b5a5956..caedff21 100644 --- a/check/exam_differentiation.cpp +++ b/check/exam_differentiation.cpp @@ -3,7 +3,7 @@ * Tests for symbolic differentiation, including various functions. */ /* - * GiNaC Copyright (C) 1999-2008 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 @@ -20,11 +20,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include #include "ginac.h" -using namespace std; using namespace GiNaC; +#include +using namespace std; + static unsigned check_diff(const ex &e, const symbol &x, const ex &d, unsigned nth=1) { diff --git a/check/exam_factor.cpp b/check/exam_factor.cpp index 71a63f24..9d03ac4f 100644 --- a/check/exam_factor.cpp +++ b/check/exam_factor.cpp @@ -3,7 +3,7 @@ * Factorization test suite. */ /* - * GiNaC Copyright (C) 1999-2008 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 @@ -20,11 +20,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include #include "ginac.h" -using namespace std; using namespace GiNaC; +#include +using namespace std; + static symbol w("w"), x("x"), y("y"), z("z"); static unsigned check_factor(const ex& e) diff --git a/check/exam_hashmap.cpp b/check/exam_hashmap.cpp index 1aac8c8c..c8540f3e 100644 --- a/check/exam_hashmap.cpp +++ b/check/exam_hashmap.cpp @@ -3,7 +3,7 @@ * Regression tests for the exhashmap<> container. */ /* - * GiNaC Copyright (C) 1999-2008 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 @@ -20,11 +20,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include #include "ginac.h" -using namespace std; using namespace GiNaC; +#include +using namespace std; + unsigned exam_hashmap() { unsigned result = 0; diff --git a/check/exam_indexed.cpp b/check/exam_indexed.cpp index b7c12ba2..ad1c2526 100644 --- a/check/exam_indexed.cpp +++ b/check/exam_indexed.cpp @@ -3,7 +3,7 @@ * Here we test manipulations on GiNaC's indexed objects. */ /* - * GiNaC Copyright (C) 1999-2008 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 @@ -20,11 +20,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include #include "ginac.h" -using namespace std; using namespace GiNaC; +#include +using namespace std; + static unsigned check_equal(const ex &e1, const ex &e2) { ex e = e1 - e2; diff --git a/check/exam_inifcns.cpp b/check/exam_inifcns.cpp index 7d8cb978..9c014a14 100644 --- a/check/exam_inifcns.cpp +++ b/check/exam_inifcns.cpp @@ -4,7 +4,7 @@ * functions. */ /* - * GiNaC Copyright (C) 1999-2008 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 @@ -21,11 +21,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include #include "ginac.h" -using namespace std; using namespace GiNaC; +#include +using namespace std; + /* Assorted tests on other transcendental functions. */ static unsigned inifcns_consist_trans() { diff --git a/check/exam_inifcns_nstdsums.cpp b/check/exam_inifcns_nstdsums.cpp index ec843da3..a99ecca8 100644 --- a/check/exam_inifcns_nstdsums.cpp +++ b/check/exam_inifcns_nstdsums.cpp @@ -4,7 +4,7 @@ * functions. */ /* - * GiNaC Copyright (C) 1999-2008 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 @@ -21,12 +21,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include -#include #include "ginac.h" -using namespace std; using namespace GiNaC; +#include +#include +using namespace std; //////////////////////////////////////////////////////////////////////////////// diff --git a/check/exam_inifcns_nstdsums.h b/check/exam_inifcns_nstdsums.h index c2919573..0c060269 100644 --- a/check/exam_inifcns_nstdsums.h +++ b/check/exam_inifcns_nstdsums.h @@ -1,3 +1,25 @@ +/** @file exam_inifcns_nstdsums.h + * + * Comparison data for the test of polylogarithms. */ + +/* + * 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 + * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + string data[] = { "1", "1", diff --git a/check/exam_lsolve.cpp b/check/exam_lsolve.cpp index b7d27696..2c1c063e 100644 --- a/check/exam_lsolve.cpp +++ b/check/exam_lsolve.cpp @@ -3,7 +3,7 @@ * These exams test solving small linear systems of symbolic equations. */ /* - * GiNaC Copyright (C) 1999-2008 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 @@ -20,11 +20,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include #include "ginac.h" -using namespace std; using namespace GiNaC; +#include +using namespace std; + static unsigned exam_lsolve1() { // A trivial example. diff --git a/check/exam_matrices.cpp b/check/exam_matrices.cpp index 2e14f494..fe927efb 100644 --- a/check/exam_matrices.cpp +++ b/check/exam_matrices.cpp @@ -3,7 +3,7 @@ * Here we examine manipulations on GiNaC's symbolic matrices. */ /* - * GiNaC Copyright (C) 1999-2008 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 @@ -20,12 +20,13 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include -#include #include "ginac.h" -using namespace std; using namespace GiNaC; +#include +#include +using namespace std; + static unsigned matrix_determinants() { unsigned result = 0; diff --git a/check/exam_misc.cpp b/check/exam_misc.cpp index 2d0f29e1..10c3dc46 100644 --- a/check/exam_misc.cpp +++ b/check/exam_misc.cpp @@ -3,7 +3,7 @@ */ /* - * GiNaC Copyright (C) 1999-2008 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 @@ -20,11 +20,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include #include "ginac.h" -using namespace std; using namespace GiNaC; +#include +using namespace std; + #define VECSIZE 30 static unsigned exam_expand_subs() { diff --git a/check/exam_mod_gcd.cpp b/check/exam_mod_gcd.cpp index 60c04ac1..de1faaab 100644 --- a/check/exam_mod_gcd.cpp +++ b/check/exam_mod_gcd.cpp @@ -1,11 +1,35 @@ +/** @file exam_misc.cpp + * + * Testing modular GCD. + */ + +/* + * 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 + * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include +#include +#include +#include + #include "polynomial/upoly.h" #include "polynomial/upoly_io.h" #include "polynomial/mod_gcd.h" #include "ginac.h" -#include -#include -#include -#include using namespace GiNaC; static upoly ex_to_upoly(const ex& e, const symbol& x); @@ -82,4 +106,3 @@ static upoly make_random_upoly(const std::size_t deg) p[deg] = cln::random_I(biggish); return p; } - diff --git a/check/exam_normalization.cpp b/check/exam_normalization.cpp index 6a931db5..a408a930 100644 --- a/check/exam_normalization.cpp +++ b/check/exam_normalization.cpp @@ -3,7 +3,7 @@ * Rational function normalization test suite. */ /* - * GiNaC Copyright (C) 1999-2008 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 @@ -20,11 +20,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include #include "ginac.h" -using namespace std; using namespace GiNaC; +#include +using namespace std; + static symbol w("w"), x("x"), y("y"), z("z"); static unsigned check_normal(const ex &e, const ex &d) diff --git a/check/exam_numeric.cpp b/check/exam_numeric.cpp index 250cb5f0..9c6d66c6 100644 --- a/check/exam_numeric.cpp +++ b/check/exam_numeric.cpp @@ -4,7 +4,7 @@ * tests on these numbers like is_integer() etc... */ /* - * GiNaC Copyright (C) 1999-2008 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 @@ -21,12 +21,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include -#include #include "ginac.h" -using namespace std; using namespace GiNaC; +#include +#include +using namespace std; /* Simple and maybe somewhat pointless consistency tests of assorted tests and * conversions. */ diff --git a/check/exam_paranoia.cpp b/check/exam_paranoia.cpp index f6bed67c..bb68d33e 100644 --- a/check/exam_paranoia.cpp +++ b/check/exam_paranoia.cpp @@ -6,7 +6,7 @@ * these oopses for good, so we run those stupid tests... */ /* - * GiNaC Copyright (C) 1999-2008 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 @@ -23,11 +23,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include #include "ginac.h" -using namespace std; using namespace GiNaC; +#include +using namespace std; + // The very first pair of historic problems had its roots in power.cpp and was // finally resolved on April 27th 1999. (Fixing the first on April 23rd // actually introduced the second.) diff --git a/check/exam_polygcd.cpp b/check/exam_polygcd.cpp index 79d4d5ed..bc4dfe09 100644 --- a/check/exam_polygcd.cpp +++ b/check/exam_polygcd.cpp @@ -4,7 +4,7 @@ * rational function normalization in normalization.cpp. */ /* - * GiNaC Copyright (C) 1999-2008 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 @@ -21,11 +21,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include #include "ginac.h" -using namespace std; using namespace GiNaC; +#include +using namespace std; + const int MAX_VARIABLES = 3; static symbol x("x"), z("z"); diff --git a/check/exam_powerlaws.cpp b/check/exam_powerlaws.cpp index 4977d4f0..91e32d60 100644 --- a/check/exam_powerlaws.cpp +++ b/check/exam_powerlaws.cpp @@ -4,7 +4,7 @@ * this code, it is a sanity check rather deeply rooted in GiNaC's classes. */ /* - * GiNaC Copyright (C) 1999-2008 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 @@ -21,11 +21,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include #include "ginac.h" -using namespace std; using namespace GiNaC; +#include +using namespace std; + static unsigned exam_powerlaws1() { // (x^a)^b = x^(a*b) diff --git a/check/exam_pseries.cpp b/check/exam_pseries.cpp index a3fe7d87..5d3c8d7d 100644 --- a/check/exam_pseries.cpp +++ b/check/exam_pseries.cpp @@ -3,7 +3,7 @@ * Series expansion test (Laurent and Taylor series). */ /* - * GiNaC Copyright (C) 1999-2008 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 @@ -20,11 +20,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include #include "ginac.h" -using namespace std; using namespace GiNaC; +#include +using namespace std; + static symbol x("x"); static unsigned check_series(const ex &e, const ex &point, const ex &d, int order = 8) diff --git a/check/exam_structure.cpp b/check/exam_structure.cpp index 5d835748..84888810 100644 --- a/check/exam_structure.cpp +++ b/check/exam_structure.cpp @@ -3,7 +3,7 @@ * Small test for the structure<> template. */ /* - * GiNaC Copyright (C) 1999-2008 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 @@ -20,11 +20,11 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include #include "ginac.h" -using namespace std; using namespace GiNaC; +#include +using namespace std; struct sprod_s { ex left, right; diff --git a/check/genex.cpp b/check/genex.cpp index 9d44bfe8..b79ef7eb 100644 --- a/check/genex.cpp +++ b/check/genex.cpp @@ -4,7 +4,7 @@ * input in the consistency checks. */ /* - * GiNaC Copyright (C) 1999-2008 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 @@ -21,11 +21,12 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include #include "ginac.h" -using namespace std; using namespace GiNaC; +#include +using namespace std; + /* Create a dense univariate random polynomial in x. * (of the form 9 - 22*a - 17*a^2 + 14*a^3 + 7*a^4 + 7a^5 if degree==5) */ const ex diff --git a/check/heur_gcd_bug.cpp b/check/heur_gcd_bug.cpp index 6fa80602..b4855beb 100644 --- a/check/heur_gcd_bug.cpp +++ b/check/heur_gcd_bug.cpp @@ -1,13 +1,33 @@ -/** - * @file heur_gcd_oops.cpp Check for a bug in heur_gcd(). +/** @file heur_gcd_bug.cpp * - * heur_gcd() did not check if the arguments are integer polynomials - * (and did not convert them to integer polynomials), which lead to - * endless loop or (even worse) wrong result. + * heur_gcd_oops.cpp Check for a bug in heur_gcd(). + * + * heur_gcd() did not check if the arguments are integer polynomials + * (and did not convert them to integer polynomials), which lead to + * endless loop or (even worse) wrong result. */ + +/* + * 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 + * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include + #include "ginac.h" using namespace GiNaC; + +#include using namespace std; int main(int argc, char** argv) @@ -36,4 +56,3 @@ int main(int argc, char** argv) } return 0; } - diff --git a/check/match_bug.cpp b/check/match_bug.cpp index 70e55420..768e95bb 100644 --- a/check/match_bug.cpp +++ b/check/match_bug.cpp @@ -1,11 +1,29 @@ -/** - * @file match_bug.cpp +/** @file match_bug.cpp * - * Check for bug in GiNaC::ex::match() described here: - * http://www.ginac.de/pipermail/ginac-devel/2006-April/000942.html + * Check for bug in GiNaC::ex::match() described here: + * http://www.ginac.de/pipermail/ginac-devel/2006-April/000942.html */ + +/* + * 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 + * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ + #include "ginac.h" #include "error_report.h" + #include using namespace GiNaC; @@ -63,4 +81,3 @@ int main(int argc, char** argv) std::cout << "not found. "; return 0; } - diff --git a/check/mul_eval_memleak.cpp b/check/mul_eval_memleak.cpp index 8bde60c2..a14dd295 100644 --- a/check/mul_eval_memleak.cpp +++ b/check/mul_eval_memleak.cpp @@ -1,19 +1,20 @@ -/** - * @file mul_eval_memleak.cpp Test for memory leak in {mul,power}::eval +/** @file mul_eval_memleak.cpp * - * The bug was introduced by + * mul_eval_memleak.cpp Test for memory leak in {mul,power}::eval * - * commit f418c6ee4d558c852e1fb95533af07a3ae43f409 - * Author: Alexei Sheplyakov - * Date: Wed Jul 11 14:34:42 2007 +0400 - * (it was commited into the official branch as - * commit a602d34c225dceb3e53742a7b3e19a4b5e280485 - * Author: Jens Vollinga - * Date: Wed Jul 11 21:07:40 2007 +0000) + * The bug was introduced by + * + * commit f418c6ee4d558c852e1fb95533af07a3ae43f409 + * Author: Alexei Sheplyakov + * Date: Wed Jul 11 14:34:42 2007 +0400 + * (it was commited into the official branch as + * commit a602d34c225dceb3e53742a7b3e19a4b5e280485 + * Author: Jens Vollinga + * Date: Wed Jul 11 21:07:40 2007 +0000) */ /* - * GiNaC Copyright (C) 1999-2008 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 @@ -30,12 +31,13 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include #include -#include +using namespace GiNaC; + +#include #include +#include using namespace std; -using namespace GiNaC; const unsigned check_mul_eval_memleak(const unsigned N) { @@ -116,4 +118,3 @@ int main(int argc, char** argv) { } return 0; } - diff --git a/check/numeric_archive.cpp b/check/numeric_archive.cpp index 8f69a7b7..3c636754 100644 --- a/check/numeric_archive.cpp +++ b/check/numeric_archive.cpp @@ -1,19 +1,39 @@ -/** - * @file numeric_archive.cpp Check for a bug in numeric::archive +/** @file numeric_archive.cpp * - * numeric::archive used to fail if the real part of a complex number - * is a rational number and the imaginary part is a floating point one. + * Check for a bug in numeric::archive + * + * numeric::archive used to fail if the real part of a complex number + * is a rational number and the imaginary part is a floating point one. */ + +/* + * 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 + * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ + +#include "ginac.h" +using namespace GiNaC; + +#include #include #include -#include -#include #include -#include #include -#include "ginac.h" +#include +#include using namespace cln; -using namespace GiNaC; struct archive_unarchive_check { diff --git a/check/parser_bugs.cpp b/check/parser_bugs.cpp index af32c5ef..051ddaf7 100644 --- a/check/parser_bugs.cpp +++ b/check/parser_bugs.cpp @@ -1,10 +1,32 @@ -/// @file parser_a_b.cpp Check for some silly bugs in the parser. +/** @file parser_bugs.cpp + * + * Check for some silly bugs in the parser. */ + +/* + * 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 + * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + #include "ginac.h" -#include +using namespace GiNaC; + #include -#include #include -using namespace GiNaC; +#include +#include // - a - b was misparsed as -a + b due to a bug in parser::parse_unary_expr() static int check1(std::ostream& err_str) @@ -91,4 +113,3 @@ int main(int argc, char** argv) } return errors; } - diff --git a/check/parser_memleak.cpp b/check/parser_memleak.cpp index f347ce9a..a969e47d 100644 --- a/check/parser_memleak.cpp +++ b/check/parser_memleak.cpp @@ -1,18 +1,39 @@ -/** - * This small program exhibits the memory leak in the ginac_yylex(). - * Run it as +/** @file parser_memleak.cpp * - * valgrind --leak-check=yes ./parser_memleak + * This small program exhibits the memory leak in the ginac_yylex(). + * Run it as * - * or simply + * valgrind --leak-check=yes ./parser_memleak * - * ulimit -v `expr 64 \* 1024` ./parser_memleak + * or simply + * + * ulimit -v `expr 64 \* 1024` ./parser_memleak + */ + +/* + * 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 + * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ + +#include +using namespace GiNaC; + #include #include -#include using namespace std; -using namespace GiNaC; int main(int argc, char** argv) { const symbol x("x"), y("y"); diff --git a/check/randomize_serials.cpp b/check/randomize_serials.cpp index ad29a1ba..3b9e0b6c 100644 --- a/check/randomize_serials.cpp +++ b/check/randomize_serials.cpp @@ -1,8 +1,32 @@ +/** @file randomize_serials.cpp + * + * Utilitiy function used by the benchmarks. + */ + +/* + * 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 + * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "ginac.h" +using namespace GiNaC; + #include #include -#include "ginac.h" using namespace std; -using namespace GiNaC; /** Generate a random amount of symbols and destroy them again immediatly. * This operation effectively makes the serial numbers of all subsequent @@ -27,5 +51,3 @@ void randomify_symbol_serials() symbol("dummy"); } } - - diff --git a/check/test_runner.h b/check/test_runner.h index 3f668a7d..3874262f 100644 --- a/check/test_runner.h +++ b/check/test_runner.h @@ -1,10 +1,34 @@ +/** @file test_runner.h + * + * Utility functions for benchmarking. */ + +/* + * 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 + * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + #ifndef GINAC_CHECK_TEST_RUNNER_H #define GINAC_CHECK_TEST_RUNNER_H -#include + +#include "timer.h" + #include -#include #include -#include "timer.h" +#include +#include template static void run_benchmark(T& benchmark, @@ -63,5 +87,4 @@ static int run_expensive_timings_p() return value; } -#endif // GINAC_CHECK_TEST_RUNNER_H - +#endif // ndef GINAC_CHECK_TEST_RUNNER_H diff --git a/check/time_antipode.cpp b/check/time_antipode.cpp index 171385ea..074ca372 100644 --- a/check/time_antipode.cpp +++ b/check/time_antipode.cpp @@ -16,7 +16,7 @@ */ /* - * GiNaC Copyright (C) 1999-2008 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 @@ -33,16 +33,17 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include -#include -#include +#include "ginac.h" +#include "timer.h" +using namespace GiNaC; + #include -#include +#include #include -#include "timer.h" -#include "ginac.h" +#include +#include +#include using namespace std; -using namespace GiNaC; // whether to run this beast or not: static const bool do_test = true; diff --git a/check/time_dennyfliegner.cpp b/check/time_dennyfliegner.cpp index 07a8938c..bffbb9b2 100644 --- a/check/time_dennyfliegner.cpp +++ b/check/time_dennyfliegner.cpp @@ -7,7 +7,7 @@ * after which e should be just a1^2. */ /* - * GiNaC Copyright (C) 1999-2008 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 @@ -24,13 +24,14 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "ginac.h" +#include "timer.h" +using namespace GiNaC; + #include #include #include -#include "ginac.h" -#include "timer.h" using namespace std; -using namespace GiNaC; static unsigned expand_subs(unsigned size) { diff --git a/check/time_fateman_expand.cpp b/check/time_fateman_expand.cpp index 1a33313d..e689dcdf 100644 --- a/check/time_fateman_expand.cpp +++ b/check/time_fateman_expand.cpp @@ -6,7 +6,7 @@ */ /* - * GiNaC Copyright (C) 1999-2008 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 @@ -23,12 +23,13 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include #include "ginac.h" #include "timer.h" -using namespace std; using namespace GiNaC; +#include +using namespace std; + static unsigned test() { unsigned result = 0; diff --git a/check/time_gammaseries.cpp b/check/time_gammaseries.cpp index e6ffa873..14f4c6c2 100644 --- a/check/time_gammaseries.cpp +++ b/check/time_gammaseries.cpp @@ -3,7 +3,7 @@ * Some timings on series expansion of the Gamma function around a pole. */ /* - * GiNaC Copyright (C) 1999-2008 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 @@ -20,13 +20,14 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include -#include #include "ginac.h" #include "timer.h" -using namespace std; using namespace GiNaC; +#include +#include +using namespace std; + unsigned tgammaseries(unsigned order) { unsigned result = 0; diff --git a/check/time_hashmap.cpp b/check/time_hashmap.cpp index 7ff288c9..d93880b5 100644 --- a/check/time_hashmap.cpp +++ b/check/time_hashmap.cpp @@ -3,7 +3,7 @@ * Timings for exhashmap<> operations. */ /* - * GiNaC Copyright (C) 1999-2008 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 @@ -20,13 +20,14 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include -#include #include "ginac.h" #include "timer.h" -using namespace std; using namespace GiNaC; +#include +#include +using namespace std; + template static void run_timing(unsigned size, double &time_insert, double &time_find, double &time_erase) { diff --git a/check/time_lw_A.cpp b/check/time_lw_A.cpp index 8a68049b..a5bad9c7 100644 --- a/check/time_lw_A.cpp +++ b/check/time_lw_A.cpp @@ -4,7 +4,7 @@ * Lewis and Michael Wester. */ /* - * GiNaC Copyright (C) 1999-2008 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 @@ -21,13 +21,14 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include -#include #include "ginac.h" #include "timer.h" -using namespace std; using namespace GiNaC; +#include +#include +using namespace std; + static unsigned test() { for (int i=1; i<=99; ++i) diff --git a/check/time_lw_B.cpp b/check/time_lw_B.cpp index 2bd497c7..35c93d41 100644 --- a/check/time_lw_B.cpp +++ b/check/time_lw_B.cpp @@ -4,7 +4,7 @@ * Lewis and Michael Wester. */ /* - * GiNaC Copyright (C) 1999-2008 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 @@ -21,13 +21,14 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include -#include #include "ginac.h" #include "timer.h" -using namespace std; using namespace GiNaC; +#include +#include +using namespace std; + static unsigned test() { numeric s; diff --git a/check/time_lw_C.cpp b/check/time_lw_C.cpp index 8bc77db4..c1302372 100644 --- a/check/time_lw_C.cpp +++ b/check/time_lw_C.cpp @@ -4,7 +4,7 @@ * Lewis and Michael Wester. */ /* - * GiNaC Copyright (C) 1999-2008 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 @@ -21,13 +21,14 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include -#include #include "ginac.h" #include "timer.h" -using namespace std; using namespace GiNaC; +#include +#include +using namespace std; + static unsigned test() { numeric x(13*17*31); diff --git a/check/time_lw_D.cpp b/check/time_lw_D.cpp index 5fcc1ae7..797d2cfd 100644 --- a/check/time_lw_D.cpp +++ b/check/time_lw_D.cpp @@ -4,7 +4,7 @@ * Lewis and Michael Wester. */ /* - * GiNaC Copyright (C) 1999-2008 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 @@ -21,13 +21,14 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include -#include #include "ginac.h" #include "timer.h" -using namespace std; using namespace GiNaC; +#include +#include +using namespace std; + static unsigned test() { ex s; diff --git a/check/time_lw_E.cpp b/check/time_lw_E.cpp index ca5c6c7b..4d970b3d 100644 --- a/check/time_lw_E.cpp +++ b/check/time_lw_E.cpp @@ -4,7 +4,7 @@ * Lewis and Michael Wester. */ /* - * GiNaC Copyright (C) 1999-2008 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 @@ -21,13 +21,14 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include -#include #include "ginac.h" #include "timer.h" -using namespace std; using namespace GiNaC; +#include +#include +using namespace std; + static unsigned test() { ex s; diff --git a/check/time_lw_F.cpp b/check/time_lw_F.cpp index 0240aa30..444ed4eb 100644 --- a/check/time_lw_F.cpp +++ b/check/time_lw_F.cpp @@ -4,7 +4,7 @@ * Lewis and Michael Wester. */ /* - * GiNaC Copyright (C) 1999-2008 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 @@ -21,13 +21,14 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include -#include #include "ginac.h" #include "timer.h" -using namespace std; using namespace GiNaC; +#include +#include +using namespace std; + static unsigned test() { symbol x("x"); diff --git a/check/time_lw_G.cpp b/check/time_lw_G.cpp index 5c748ba4..839d582f 100644 --- a/check/time_lw_G.cpp +++ b/check/time_lw_G.cpp @@ -4,7 +4,7 @@ * Lewis and Michael Wester. */ /* - * GiNaC Copyright (C) 1999-2008 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 @@ -21,13 +21,14 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include -#include #include "ginac.h" #include "timer.h" -using namespace std; using namespace GiNaC; +#include +#include +using namespace std; + static unsigned test() { symbol x("x"); diff --git a/check/time_lw_H.cpp b/check/time_lw_H.cpp index ffe59484..7d8044c2 100644 --- a/check/time_lw_H.cpp +++ b/check/time_lw_H.cpp @@ -4,7 +4,7 @@ * Lewis and Michael Wester. */ /* - * GiNaC Copyright (C) 1999-2008 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 @@ -21,13 +21,14 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include -#include #include "ginac.h" #include "timer.h" -using namespace std; using namespace GiNaC; +#include +#include +using namespace std; + static unsigned test(unsigned n) { matrix hilbert(n,n); diff --git a/check/time_lw_IJKL.cpp b/check/time_lw_IJKL.cpp index b2d0f2c9..ae2ef2f2 100644 --- a/check/time_lw_IJKL.cpp +++ b/check/time_lw_IJKL.cpp @@ -4,7 +4,7 @@ * by Robert H. Lewis and Michael Wester. */ /* - * GiNaC Copyright (C) 1999-2008 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 @@ -21,13 +21,14 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include -#include #include "ginac.h" #include "timer.h" -using namespace std; using namespace GiNaC; +#include +#include +using namespace std; + static unsigned test(unsigned n) { unsigned result = 0; diff --git a/check/time_lw_M1.cpp b/check/time_lw_M1.cpp index 0d9cc597..c1c06d00 100644 --- a/check/time_lw_M1.cpp +++ b/check/time_lw_M1.cpp @@ -4,7 +4,7 @@ * Lewis and Michael Wester. */ /* - * GiNaC Copyright (C) 1999-2008 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 @@ -21,12 +21,13 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include #include "ginac.h" #include "timer.h" -using namespace std; using namespace GiNaC; +#include +using namespace std; + static unsigned test() { // Determinant of a sparse matrix that comes up in graph theory: diff --git a/check/time_lw_M2.cpp b/check/time_lw_M2.cpp index d6fea908..2868249b 100644 --- a/check/time_lw_M2.cpp +++ b/check/time_lw_M2.cpp @@ -4,7 +4,7 @@ * Lewis and Michael Wester. */ /* - * GiNaC Copyright (C) 1999-2008 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 @@ -21,12 +21,13 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include #include "ginac.h" #include "timer.h" -using namespace std; using namespace GiNaC; +#include +using namespace std; + static const bool do_test = false; // set to true in order to run this beast static unsigned test() diff --git a/check/time_lw_N.cpp b/check/time_lw_N.cpp index 88453f84..37bc786a 100644 --- a/check/time_lw_N.cpp +++ b/check/time_lw_N.cpp @@ -5,7 +5,7 @@ * Fermat-test). */ /* - * GiNaC Copyright (C) 1999-2008 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 @@ -22,13 +22,14 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include -#include #include "ginac.h" #include "timer.h" -using namespace std; using namespace GiNaC; +#include +#include +using namespace std; + static const bool do_test = false; // set to true in order to run this beast static unsigned test() diff --git a/check/time_lw_O.cpp b/check/time_lw_O.cpp index 2090e6f1..faf5baab 100644 --- a/check/time_lw_O.cpp +++ b/check/time_lw_O.cpp @@ -4,7 +4,7 @@ * Lewis and Michael Wester. */ /* - * GiNaC Copyright (C) 1999-2008 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 @@ -21,13 +21,14 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include -#include #include "ginac.h" #include "timer.h" -using namespace std; using namespace GiNaC; +#include +#include +using namespace std; + static const bool do_test2 = false; // set to true in order to run this beast static const symbol a1("a1"), a2("a2"), a3("a3"), a4("a4"), a5("a5"), a6("a6"); diff --git a/check/time_lw_P.cpp b/check/time_lw_P.cpp index 75e5bc50..ea1b917c 100644 --- a/check/time_lw_P.cpp +++ b/check/time_lw_P.cpp @@ -4,7 +4,7 @@ * Lewis and Michael Wester. */ /* - * GiNaC Copyright (C) 1999-2008 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 @@ -21,13 +21,14 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include -#include #include "ginac.h" #include "timer.h" -using namespace std; using namespace GiNaC; +#include +#include +using namespace std; + static unsigned test() { // This is a pattern that comes up in graph theory: diff --git a/check/time_lw_Pprime.cpp b/check/time_lw_Pprime.cpp index 0b545832..e27f6e24 100644 --- a/check/time_lw_Pprime.cpp +++ b/check/time_lw_Pprime.cpp @@ -4,7 +4,7 @@ * Lewis and Michael Wester. */ /* - * GiNaC Copyright (C) 1999-2008 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 @@ -21,13 +21,14 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include -#include #include "ginac.h" #include "timer.h" -using namespace std; using namespace GiNaC; +#include +#include +using namespace std; + static unsigned test() { // create the matrix from test P... diff --git a/check/time_lw_Q.cpp b/check/time_lw_Q.cpp index b42f5a24..005df9cd 100644 --- a/check/time_lw_Q.cpp +++ b/check/time_lw_Q.cpp @@ -4,7 +4,7 @@ * Lewis and Michael Wester. */ /* - * GiNaC Copyright (C) 1999-2008 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 @@ -21,13 +21,14 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include -#include #include "ginac.h" #include "timer.h" -using namespace std; using namespace GiNaC; +#include +#include +using namespace std; + static const bool do_test = true; // set to true in order to run this beast static unsigned test() diff --git a/check/time_lw_Qprime.cpp b/check/time_lw_Qprime.cpp index b20b7b1f..abdf33f9 100644 --- a/check/time_lw_Qprime.cpp +++ b/check/time_lw_Qprime.cpp @@ -4,7 +4,7 @@ * Lewis and Michael Wester. */ /* - * GiNaC Copyright (C) 1999-2008 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 @@ -21,13 +21,14 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include -#include #include "ginac.h" #include "timer.h" -using namespace std; using namespace GiNaC; +#include +#include +using namespace std; + static const bool do_test = true; // set to true in order to run this beast static unsigned test() diff --git a/check/time_parser.cpp b/check/time_parser.cpp index 4e6081b1..82698891 100644 --- a/check/time_parser.cpp +++ b/check/time_parser.cpp @@ -1,15 +1,39 @@ -#include -#include -#include +/** @file time_parser.cpp + * + * Time the parser. */ + +/* + * 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 + * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "ginac.h" +#include "timer.h" +using namespace GiNaC; + #include #include -#include +#include +#include #include -#include "ginac.h" -#include "timer.h" -extern void randomify_symbol_serials(); +#include +#include using namespace std; -using namespace GiNaC; + +extern void randomify_symbol_serials(); /// make a string "1+x+2*x^2+...+n*x^n" static string prepare_str(const unsigned n, const char x = 'x') diff --git a/check/time_toeplitz.cpp b/check/time_toeplitz.cpp index 813e5214..eb623d9c 100644 --- a/check/time_toeplitz.cpp +++ b/check/time_toeplitz.cpp @@ -6,7 +6,7 @@ */ /* - * GiNaC Copyright (C) 1999-2008 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 @@ -23,13 +23,14 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include -#include #include "ginac.h" #include "timer.h" -using namespace std; using namespace GiNaC; +#include +#include +using namespace std; + static unsigned toeplitz_det(unsigned size) { unsigned result = 0; diff --git a/check/time_uvar_gcd.cpp b/check/time_uvar_gcd.cpp index ca5cc150..79acd122 100644 --- a/check/time_uvar_gcd.cpp +++ b/check/time_uvar_gcd.cpp @@ -1,8 +1,27 @@ -#include -#include -#include -#include "timer.h" +/** @file time_uvar_gcd.cpp + * + * Time the different GCD algorithms. */ + +/* + * 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 + * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + #include "ginac.h" +#include "timer.h" #include "error_report.h" #include "test_runner.h" #include "polynomial/remainder.h" @@ -10,6 +29,10 @@ #include "polynomial/mod_gcd.h" using namespace GiNaC; +#include +#include +#include + static const std::string p1_srep("\ -936639990+26248623452*x^47-30174373832*x^46-19627087954*x^45 \ +23532819511*x^24-15331409214*x^23-5892518210*x^22-2954269379*x^28 \ @@ -1874,4 +1897,3 @@ static upoly make_random_upoly(const std::size_t deg) p[deg] = cln::random_I(biggish); return p; } - diff --git a/check/time_vandermonde.cpp b/check/time_vandermonde.cpp index ce0b286d..1411a21b 100644 --- a/check/time_vandermonde.cpp +++ b/check/time_vandermonde.cpp @@ -7,7 +7,7 @@ */ /* - * GiNaC Copyright (C) 1999-2008 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 @@ -24,13 +24,14 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include -#include #include "ginac.h" #include "timer.h" -using namespace std; using namespace GiNaC; +#include +#include +using namespace std; + static unsigned vandermonde_det(unsigned size) { unsigned result = 0; diff --git a/check/timer.cpp b/check/timer.cpp index 140df2fe..cf1975b8 100644 --- a/check/timer.cpp +++ b/check/timer.cpp @@ -3,7 +3,7 @@ * A simple stop watch class. */ /* - * GiNaC Copyright (C) 1999-2008 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 @@ -20,9 +20,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif #ifdef HAVE_RUSAGE #include #include @@ -31,6 +28,9 @@ #include #endif +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif #include "timer.h" timer::timer() : on(false) diff --git a/check/timer.h b/check/timer.h index ba6ff3f6..89120368 100644 --- a/check/timer.h +++ b/check/timer.h @@ -3,7 +3,7 @@ * A simple stop watch class. */ /* - * GiNaC Copyright (C) 1999-2008 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 @@ -26,6 +26,7 @@ #ifdef HAVE_CONFIG_H #include "config.h" #endif + #ifdef HAVE_RUSAGE #include #else diff --git a/doc/tutorial/ginac.texi b/doc/tutorial/ginac.texi index fe7a2648..8decc6b4 100644 --- a/doc/tutorial/ginac.texi +++ b/doc/tutorial/ginac.texi @@ -24,7 +24,7 @@ This is a tutorial that documents GiNaC @value{VERSION}, an open framework for symbolic computation within the C++ programming language. -Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany +Copyright (C) 1999-2009 Johannes Gutenberg University Mainz, Germany Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice @@ -52,7 +52,7 @@ notice identical to this one. @page @vskip 0pt plus 1filll -Copyright @copyright{} 1999-2008 Johannes Gutenberg University Mainz, Germany +Copyright @copyright{} 1999-2009 Johannes Gutenberg University Mainz, Germany @sp 2 Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice @@ -135,7 +135,7 @@ the near future. @section License The GiNaC framework for symbolic computation within the C++ programming -language is Copyright @copyright{} 1999-2008 Johannes Gutenberg +language is Copyright @copyright{} 1999-2009 Johannes Gutenberg University Mainz, Germany. This program is free software; you can redistribute it and/or diff --git a/ginac/add.cpp b/ginac/add.cpp index 06ada496..4c857044 100644 --- a/ginac/add.cpp +++ b/ginac/add.cpp @@ -3,7 +3,7 @@ * Implementation of GiNaC's sums of expressions. */ /* - * GiNaC Copyright (C) 1999-2008 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 @@ -20,11 +20,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include -#include -#include -#include - #include "add.h" #include "mul.h" #include "archive.h" @@ -34,6 +29,11 @@ #include "clifford.h" #include "ncmul.h" +#include +#include +#include +#include + namespace GiNaC { GINAC_IMPLEMENT_REGISTERED_CLASS_OPT(add, expairseq, diff --git a/ginac/add.h b/ginac/add.h index 0dfd6034..c29dc262 100644 --- a/ginac/add.h +++ b/ginac/add.h @@ -3,7 +3,7 @@ * Interface to GiNaC's sums of expressions. */ /* - * GiNaC Copyright (C) 1999-2008 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 @@ -20,8 +20,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef __GINAC_ADD_H__ -#define __GINAC_ADD_H__ +#ifndef GINAC_ADD_H +#define GINAC_ADD_H #include "expairseq.h" @@ -88,4 +88,4 @@ GINAC_DECLARE_UNARCHIVER(add); } // namespace GiNaC -#endif // ndef __GINAC_ADD_H__ +#endif // ndef GINAC_ADD_H diff --git a/ginac/archive.cpp b/ginac/archive.cpp index 1d65c7a9..f4a59f73 100644 --- a/ginac/archive.cpp +++ b/ginac/archive.cpp @@ -3,7 +3,7 @@ * Archiving of GiNaC expressions. */ /* - * GiNaC Copyright (C) 1999-2008 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 @@ -20,9 +20,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include -#include - #include "archive.h" #include "registrar.h" #include "ex.h" @@ -30,6 +27,9 @@ #include "config.h" #include "tostring.h" +#include +#include + namespace GiNaC { diff --git a/ginac/archive.h b/ginac/archive.h index 5969b00c..152eec49 100644 --- a/ginac/archive.h +++ b/ginac/archive.h @@ -3,7 +3,7 @@ * Archiving of GiNaC expressions. */ /* - * GiNaC Copyright (C) 1999-2008 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 @@ -20,15 +20,15 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef __GINAC_ARCHIVE_H__ -#define __GINAC_ARCHIVE_H__ +#ifndef GINAC_ARCHIVE_H +#define GINAC_ARCHIVE_H #include "ex.h" #include +#include #include #include -#include namespace GiNaC { @@ -337,7 +337,6 @@ private: std::ostream &operator<<(std::ostream &os, const archive &ar); std::istream &operator>>(std::istream &is, archive &ar); - } // namespace GiNaC -#endif // ndef __GINAC_ARCHIVE_H__ +#endif // ndef GINAC_ARCHIVE_H diff --git a/ginac/assertion.h b/ginac/assertion.h index 070ddea2..ea7dd037 100644 --- a/ginac/assertion.h +++ b/ginac/assertion.h @@ -3,7 +3,7 @@ * Assertion macro definition. */ /* - * GiNaC Copyright (C) 1999-2008 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 @@ -20,8 +20,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef __GINAC_ASSERTION_H__ -#define __GINAC_ASSERTION_H__ +#ifndef GINAC_ASSERTION_H +#define GINAC_ASSERTION_H #if !defined(GINAC_ASSERT) #if defined(DO_GINAC_ASSERT) @@ -34,4 +34,4 @@ #endif #endif -#endif // ndef __GINAC_ASSERTION_H__ +#endif // ndef GINAC_ASSERTION_H diff --git a/ginac/basic.cpp b/ginac/basic.cpp index 04f87df1..ff1f7a04 100644 --- a/ginac/basic.cpp +++ b/ginac/basic.cpp @@ -3,7 +3,7 @@ * Implementation of GiNaC's ABC. */ /* - * GiNaC Copyright (C) 1999-2008 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 @@ -20,10 +20,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include -#include -#include - #include "basic.h" #include "ex.h" #include "numeric.h" @@ -39,6 +35,10 @@ #include "utils.h" #include "inifcns.h" +#include +#include +#include + namespace GiNaC { GINAC_IMPLEMENT_REGISTERED_CLASS_OPT(basic, void, diff --git a/ginac/basic.h b/ginac/basic.h index 51e0e909..30abbb59 100644 --- a/ginac/basic.h +++ b/ginac/basic.h @@ -3,7 +3,7 @@ * Interface to GiNaC's ABC. */ /* - * GiNaC Copyright (C) 1999-2008 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 @@ -20,22 +20,22 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef __GINAC_BASIC_H__ -#define __GINAC_BASIC_H__ - -#include // for size_t -#include -#include -#include -#include // for typeid -// CINT needs to work properly with -#include +#ifndef GINAC_BASIC_H +#define GINAC_BASIC_H #include "flags.h" #include "ptr.h" #include "assertion.h" #include "registrar.h" +// CINT needs to work properly with +#include +#include // for size_t +#include +#include +#include // for typeid +#include + namespace GiNaC { class ex; @@ -322,4 +322,4 @@ inline bool is_exactly_a(const basic & obj) } // namespace GiNaC -#endif // ndef __GINAC_BASIC_H__ +#endif // ndef GINAC_BASIC_H diff --git a/ginac/class_info.h b/ginac/class_info.h index c889dfca..a7aa8130 100644 --- a/ginac/class_info.h +++ b/ginac/class_info.h @@ -3,7 +3,7 @@ * Helper templates to provide per-class information for class hierarchies. */ /* - * GiNaC Copyright (C) 1999-2008 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 @@ -20,17 +20,17 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef __GINAC_CLASS_INFO_H__ -#define __GINAC_CLASS_INFO_H__ +#ifndef GINAC_CLASS_INFO_H +#define GINAC_CLASS_INFO_H #include // for size_t #include -#include -#include -#include -#include #include +#include +#include #include +#include +#include namespace GiNaC { @@ -195,4 +195,4 @@ template bool class_info::parents_identified = false; } // namespace GiNaC -#endif // ndef __GINAC_CLASS_INFO_H__ +#endif // ndef GINAC_CLASS_INFO_H diff --git a/ginac/clifford.cpp b/ginac/clifford.cpp index f332c64e..3b4684c2 100644 --- a/ginac/clifford.cpp +++ b/ginac/clifford.cpp @@ -3,7 +3,7 @@ * Implementation of GiNaC's clifford algebra (Dirac gamma) objects. */ /* - * GiNaC Copyright (C) 1999-2008 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 @@ -20,8 +20,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include - #include "clifford.h" #include "ex.h" @@ -40,6 +38,8 @@ #include "archive.h" #include "utils.h" +#include + namespace GiNaC { GINAC_IMPLEMENT_REGISTERED_CLASS_OPT(clifford, indexed, diff --git a/ginac/clifford.h b/ginac/clifford.h index efb9dd66..8b4a88f4 100644 --- a/ginac/clifford.h +++ b/ginac/clifford.h @@ -3,7 +3,7 @@ * Interface to GiNaC's clifford algebra (Dirac gamma) objects. */ /* - * GiNaC Copyright (C) 1999-2008 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 @@ -20,8 +20,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef __GINAC_CLIFFORD_H__ -#define __GINAC_CLIFFORD_H__ +#ifndef GINAC_CLIFFORD_H +#define GINAC_CLIFFORD_H #include "indexed.h" #include "tensor.h" @@ -32,7 +32,6 @@ namespace GiNaC { - /** This class holds an object representing an element of the Clifford * algebra (the Dirac gamma matrices). These objects only carry Lorentz * indices. Spinor indices are hidden. A representation label (an unsigned @@ -361,4 +360,4 @@ ex clifford_moebius_map(const ex & M, const ex & v, const ex & G, unsigned char } // namespace GiNaC -#endif // ndef __GINAC_CLIFFORD_H__ +#endif // ndef GINAC_CLIFFORD_H diff --git a/ginac/color.cpp b/ginac/color.cpp index b1ca9050..2a83458b 100644 --- a/ginac/color.cpp +++ b/ginac/color.cpp @@ -3,7 +3,7 @@ * Implementation of GiNaC's color (SU(3) Lie algebra) objects. */ /* - * GiNaC Copyright (C) 1999-2008 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 @@ -20,9 +20,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include -#include - #include "color.h" #include "idx.h" #include "ncmul.h" @@ -35,6 +32,9 @@ #include "archive.h" #include "utils.h" +#include +#include + namespace GiNaC { GINAC_IMPLEMENT_REGISTERED_CLASS(color, indexed) diff --git a/ginac/color.h b/ginac/color.h index d595cb3e..f253ec51 100644 --- a/ginac/color.h +++ b/ginac/color.h @@ -3,7 +3,7 @@ * Interface to GiNaC's color (SU(3) Lie algebra) objects. */ /* - * GiNaC Copyright (C) 1999-2008 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 @@ -20,8 +20,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef __GINAC_COLOR_H__ -#define __GINAC_COLOR_H__ +#ifndef GINAC_COLOR_H +#define GINAC_COLOR_H #include "indexed.h" #include "tensor.h" @@ -30,7 +30,6 @@ namespace GiNaC { - /** This class holds a generator T_a or the unity element of the Lie algebra * of SU(3), as used for calculations in quantum chromodynamics. A * representation label (an unsigned 8-bit integer) is used to distinguish @@ -192,7 +191,6 @@ ex color_trace(const ex & e, const lst & rll); * @param rl Representation label */ ex color_trace(const ex & e, unsigned char rl = 0); - } // namespace GiNaC -#endif // ndef __GINAC_COLOR_H__ +#endif // ndef GINAC_COLOR_H diff --git a/ginac/compiler.h b/ginac/compiler.h index 66f6e92f..0bdcf025 100644 --- a/ginac/compiler.h +++ b/ginac/compiler.h @@ -1,5 +1,27 @@ -#ifndef GINAC_COMPILER_DEP_HH -#define GINAC_COMPILER_DEP_HH +/** @file compiler.h + * + * Definition of optimizing macros. */ + +/* + * 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 + * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef GINAC_COMPILER_H +#define GINAC_COMPILER_H #ifdef __GNUC__ #define unlikely(cond) __builtin_expect((cond), 0) @@ -9,4 +31,4 @@ #define likely(cond) (cond) #endif -#endif /* GINAC_COMPILER_DEP_HH */ +#endif // ndef GINAC_COMPILER_DEP_H diff --git a/ginac/constant.cpp b/ginac/constant.cpp index 10972b07..c7ef59d5 100644 --- a/ginac/constant.cpp +++ b/ginac/constant.cpp @@ -3,7 +3,7 @@ * Implementation of GiNaC's constant types and some special constants. */ /* - * GiNaC Copyright (C) 1999-2008 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 @@ -20,10 +20,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include -#include -#include - #include "constant.h" #include "numeric.h" #include "ex.h" @@ -31,6 +27,10 @@ #include "utils.h" #include "inifcns.h" +#include +#include +#include + namespace GiNaC { GINAC_IMPLEMENT_REGISTERED_CLASS_OPT(constant, basic, diff --git a/ginac/constant.h b/ginac/constant.h index efbe39e9..2353b32f 100644 --- a/ginac/constant.h +++ b/ginac/constant.h @@ -3,7 +3,7 @@ * Interface to GiNaC's constant types and some special constants. */ /* - * GiNaC Copyright (C) 1999-2008 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 @@ -20,14 +20,15 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef __GINAC_CONSTANT_H__ -#define __GINAC_CONSTANT_H__ +#ifndef GINAC_CONSTANT_H +#define GINAC_CONSTANT_H -#include #include "basic.h" #include "ex.h" #include "archive.h" +#include + namespace GiNaC { typedef ex (*evalffunctype)(); @@ -84,4 +85,4 @@ extern const constant Euler; } // namespace GiNaC -#endif // ndef __GINAC_CONSTANT_H__ +#endif // ndef GINAC_CONSTANT_H diff --git a/ginac/container.h b/ginac/container.h index c1345949..cc03d7d8 100644 --- a/ginac/container.h +++ b/ginac/container.h @@ -3,7 +3,7 @@ * Wrapper template for making GiNaC classes out of STL containers. */ /* - * GiNaC Copyright (C) 1999-2008 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 @@ -20,23 +20,22 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef __GINAC_CONTAINER_H__ -#define __GINAC_CONTAINER_H__ - -#include -#include -#include -#include -#include -#include +#ifndef GINAC_CONTAINER_H +#define GINAC_CONTAINER_H #include "ex.h" #include "print.h" #include "archive.h" #include "assertion.h" -namespace GiNaC { +#include +#include +#include +#include +#include +#include +namespace GiNaC { /** Helper template for encapsulating the reserve() mechanics of STL containers. */ template