]> www.ginac.de Git - ginac.git/commitdiff
- put everything in "GiNaC" namespace
authorChristian Bauer <Christian.Bauer@uni-mainz.de>
Wed, 17 Nov 1999 19:57:49 +0000 (19:57 +0000)
committerChristian Bauer <Christian.Bauer@uni-mainz.de>
Wed, 17 Nov 1999 19:57:49 +0000 (19:57 +0000)
- converted some macros into inline functions
- split debugmsg.h into assertion.h (public) and debugmsg.h (private)

98 files changed:
NEWS
check/check.h
check/differentiation.cpp
check/expand_subs.cpp
check/fcntimer.cpp
check/inifcns_consist.cpp
check/lsolve_onedim.cpp
check/main.cpp
check/matrix_checks.cpp
check/normalization.cpp
check/numeric_consist.cpp
check/numeric_output.cpp
check/paranoia_check.cpp
check/poly_gcd.cpp
check/powerlaws.cpp
check/series_expansion.cpp
configure
configure.in
ginac/Makefile.am
ginac/Makefile.in
ginac/add.cpp
ginac/add.h
ginac/assertion.h [new file with mode: 0644]
ginac/basic.cpp
ginac/basic.h
ginac/clifford.cpp
ginac/clifford.h
ginac/color.cpp
ginac/color.h
ginac/coloridx.cpp
ginac/coloridx.h
ginac/constant.cpp
ginac/constant.h
ginac/container.pl
ginac/debugmsg.h
ginac/diff.cpp
ginac/ex.cpp
ginac/ex.h
ginac/expair.h
ginac/expairseq.cpp
ginac/expairseq.h
ginac/exprseq.cpp
ginac/exprseq.h
ginac/exprseq_suppl.cpp
ginac/fail.cpp
ginac/fail.h
ginac/flags.h
ginac/function.cpp
ginac/function.h
ginac/function.pl
ginac/ginac.h
ginac/idx.cpp
ginac/idx.h
ginac/indexed.cpp
ginac/indexed.h
ginac/inifcns.cpp
ginac/inifcns.h
ginac/inifcns_gamma.cpp
ginac/inifcns_trans.cpp
ginac/isospin.cpp
ginac/isospin.h
ginac/lorentzidx.cpp
ginac/lorentzidx.h
ginac/lst.cpp
ginac/lst.h
ginac/lst_suppl.cpp
ginac/matrix.cpp
ginac/matrix.h
ginac/mul.cpp
ginac/mul.h
ginac/ncmul.cpp
ginac/ncmul.h
ginac/normal.cpp
ginac/normal.h
ginac/numeric.cpp
ginac/numeric.h
ginac/operators.cpp
ginac/operators.h
ginac/power.cpp
ginac/power.h
ginac/print.cpp
ginac/printcsrc.cpp
ginac/printraw.cpp
ginac/printtree.cpp
ginac/relational.cpp
ginac/relational.h
ginac/series.cpp
ginac/series.h
ginac/simp_lor.cpp
ginac/simp_lor.h
ginac/structure.cpp
ginac/structure.h
ginac/structure.pl
ginac/symbol.cpp
ginac/symbol.h
ginac/tinfos.h
ginac/utils.cpp
ginac/utils.h

diff --git a/NEWS b/NEWS
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..7315d32447c3e5105a2c7c1df706eff638fb4cb9 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -0,0 +1 @@
+First release
index 89a093e78f90fd4952af0762feb63e06f0cc3306..0474594efb77ebd31c924013c9d8e3068c8bc048 100644 (file)
@@ -1,7 +1,8 @@
 /** @file check.h
  *
 /** @file check.h
  *
- *  Prototypes for all individual checks.
- *
+ *  Prototypes for all individual checks. */
+
+/*
  *  GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
  *
  *  This program is free software; you can redistribute it and/or modify
  *  GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
  *
  *  This program is free software; you can redistribute it and/or modify
index 8a160180ba437e03c773f43e1ed4e4e712fac2c0..d1051ea9e8cd871ac22bde57709ab7cc87b4867b 100644 (file)
@@ -1,7 +1,8 @@
 /** @file differentiation.cpp
  *
 /** @file differentiation.cpp
  *
- *  Tests for symbolic differentiation, including various functions.
- *
+ *  Tests for symbolic differentiation, including various functions. */
+
+/*
  *  GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
  *
  *  This program is free software; you can redistribute it and/or modify
  *  GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -20,6 +21,7 @@
  */
 
 #include <ginac/ginac.h>
  */
 
 #include <ginac/ginac.h>
+using namespace GiNaC;
 
 static unsigned check_diff(const ex &e, const symbol &x,
                            const ex &d, unsigned nth=1)
 
 static unsigned check_diff(const ex &e, const symbol &x,
                            const ex &d, unsigned nth=1)
index abaea8f18d86684b3179f3b6b6fba790100804d8..b6ff16f074596dfdf60ba0c3b58b5836a80fc404 100644 (file)
@@ -10,8 +10,9 @@
  *     e = (a0 + a1)^200
  *     expand e
  *     substitute a0 by -a1 in e
  *     e = (a0 + a1)^200
  *     expand e
  *     substitute a0 by -a1 in e
- *  after which e should return 0 (without expanding).
- *
+ *  after which e should return 0 (without expanding). */
+
+/*
  *  GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
  *
  *  This program is free software; you can redistribute it and/or modify
  *  GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -31,6 +32,7 @@
 
 
 #include <ginac/ginac.h>
 
 
 #include <ginac/ginac.h>
+using namespace GiNaC;
 
 #define VECSIZE 100
 
 
 #define VECSIZE 100
 
index 152ec67d6745c5b6908f1dcdf253bad4d1c43a66..3ccb31d4cdc5f80791c9b1ce78bdb802904e1b86 100644 (file)
@@ -1,7 +1,8 @@
 /** @file fcntimer.cpp
  *
 /** @file fcntimer.cpp
  *
- *  Function execution timer.
- *
+ *  Function execution timer. */
+
+/*
  *  GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
  *
  *  This program is free software; you can redistribute it and/or modify
  *  GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
  *
  *  This program is free software; you can redistribute it and/or modify
index 5d91a145f3adc53e3f15c75e45abd7fafb6ffe7c..e51625b2fe2e60b74fd08f9ca588556bd81cdc51 100644 (file)
@@ -1,8 +1,9 @@
 /** @file inifcns_consist.cpp
  *
  *  This test routine applies assorted tests on initially known higher level
 /** @file inifcns_consist.cpp
  *
  *  This test routine applies assorted tests on initially known higher level
- *  functions.
- *
+ *  functions. */
+
+/*
  *  GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
  *
  *  This program is free software; you can redistribute it and/or modify
  *  GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -21,6 +22,7 @@
  */
 
 #include <ginac/ginac.h>
  */
 
 #include <ginac/ginac.h>
+using namespace GiNaC;
 
 /* Simple tests on the sine trigonometric function. */
 static unsigned inifcns_consist_sin(void)
 
 /* Simple tests on the sine trigonometric function. */
 static unsigned inifcns_consist_sin(void)
index 5cd3421d2117770c7dff659651d3058de8079f0c..448a16372ba40464ad66f89474a5aa83f9a860ee 100644 (file)
@@ -1,8 +1,9 @@
 /** @file lsolve_onedim.cpp
  *
  * This test routine does some simple checks on solving a polynomial for a
 /** @file lsolve_onedim.cpp
  *
  * This test routine does some simple checks on solving a polynomial for a
- * variable.
- *
+ * variable. */
+
+/*
  *  GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
  *
  *  This program is free software; you can redistribute it and/or modify
  *  GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -21,6 +22,7 @@
  */
 
 #include <ginac/ginac.h>
  */
 
 #include <ginac/ginac.h>
+using namespace GiNaC;
 
 unsigned lsolve_onedim(void)
 {
 
 unsigned lsolve_onedim(void)
 {
index 200c96d6219e5fcff2ad6d9955b6824c702f6413..0171e9c56de84dd0fff035d1b0c0f47d751d92a0 100644 (file)
@@ -1,7 +1,8 @@
 /** @file main.cpp
  *
 /** @file main.cpp
  *
- *  Main program that calls all individual tests.
- *
+ *  Main program that calls all individual tests. */
+
+/*
  *  GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
  *
  *  This program is free software; you can redistribute it and/or modify
  *  GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
  *
  *  This program is free software; you can redistribute it and/or modify
index 4b973ef314cb8297f9e3a1d997fad9351057f7b1..80d8bf95a718d9f2d9b961bb82d8e3c1fd638a0e 100644 (file)
@@ -1,7 +1,8 @@
 /** @file matrix_checks.cpp
  *
 /** @file matrix_checks.cpp
  *
- *  Here we test manipulations on GiNaC's symbolic matrices.
- *
+ *  Here we test manipulations on GiNaC's symbolic matrices. */
+
+/*
  *  GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
  *
  *  This program is free software; you can redistribute it and/or modify
  *  GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -21,6 +22,7 @@
 
 #include <stdexcept>
 #include <ginac/ginac.h>
 
 #include <stdexcept>
 #include <ginac/ginac.h>
+using namespace GiNaC;
 
 static unsigned matrix_determinants(void)
 {
 
 static unsigned matrix_determinants(void)
 {
index 0b79a64cdfb4707d70622a4c26a913a6e2c1ff73..3f814fde3ce124aaacad5a6702d05b208416078c 100644 (file)
@@ -1,7 +1,8 @@
 /** @file normalization.cpp
  *
 /** @file normalization.cpp
  *
- *  Rational function normalization test suite.
- *
+ *  Rational function normalization test suite. */
+
+/*
  *  GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
  *
  *  This program is free software; you can redistribute it and/or modify
  *  GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -20,6 +21,7 @@
  */
 
 #include <ginac/ginac.h>
  */
 
 #include <ginac/ginac.h>
+using namespace GiNaC;
 
 static symbol x("x"), y("y"), z("z");
 
 
 static symbol x("x"), y("y"), z("z");
 
index cd6f81ce09c49a6d9b3be459e7f168048554a92e..6c5fd6be6efbd916655f609163f516812de49cb9 100644 (file)
@@ -1,8 +1,9 @@
 /** @file numeric_consist.cpp
  *
  *  This test routine creates some numbers and check the result of several
 /** @file numeric_consist.cpp
  *
  *  This test routine creates some numbers and check the result of several
- *  boolean tests on these numbers like is_integer() etc...
- *
+ *  boolean tests on these numbers like is_integer() etc... */
+
+/*
  *  GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
  *
  *  This program is free software; you can redistribute it and/or modify
  *  GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -22,6 +23,7 @@
 
 #include <stdlib.h>
 #include <ginac/ginac.h>
 
 #include <stdlib.h>
 #include <ginac/ginac.h>
+using namespace GiNaC;
 
 /* Simple and maybe somewhat pointless consistency tests of assorted tests and
  * conversions. */
 
 /* Simple and maybe somewhat pointless consistency tests of assorted tests and
  * conversions. */
index d138a74f3b221d967cdbc88d5b1cdf659831c201..99f3afdca892527bdac2ead99390d075467ebfb2 100644 (file)
@@ -1,7 +1,8 @@
 /** @file numeric_output.cpp
  *
 /** @file numeric_output.cpp
  *
- *  Test output of numeric types.
- *
+ *  Test output of numeric types. */
+
+/*
  *  GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
  *
  *  This program is free software; you can redistribute it and/or modify
  *  GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -20,6 +21,7 @@
  */
 
 #include <ginac/ginac.h>
  */
 
 #include <ginac/ginac.h>
+using namespace GiNaC;
 
 unsigned numeric_output(void)
 {
 
 unsigned numeric_output(void)
 {
index 228d84653700626b9729e953a937fc9b9adb0491..d84946f20af732802a71d62ed4b588e2212b5e2e 100644 (file)
@@ -3,8 +3,9 @@
  *  This set of tests checks for some of GiNaC's oopses which showed up during
  *  development.  Things were evaluated wrongly and so.  It should not find such
  *  a sick behaviour again.  But since we are paranoic and we want to exclude
  *  This set of tests checks for some of GiNaC's oopses which showed up during
  *  development.  Things were evaluated wrongly and so.  It should not find such
  *  a sick behaviour again.  But since we are paranoic and we want to exclude
- *  that behaviour for good...
- *
+ *  that behaviour for good... */
+
+/*
  *  GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
  *
  *  This program is free software; you can redistribute it and/or modify
  *  GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -23,6 +24,7 @@
  */
 
 #include <ginac/ginac.h>
  */
 
 #include <ginac/ginac.h>
+using namespace GiNaC;
 
 // The very first pair of historic problems had its roots in power.cpp and was
 // finally resolved on April 27th. (Fixing the first on April 23rd actually
 
 // The very first pair of historic problems had its roots in power.cpp and was
 // finally resolved on April 27th. (Fixing the first on April 23rd actually
index 542bc80c8439d8a805b161f138c70e8d21aedadd..484eb2d27c93aebfd8e7224e14693ee8fe1f4aab 100644 (file)
@@ -1,8 +1,9 @@
 /** @file poly_gcd.cpp
  *
  *  Some test with polynomial GCD calculations. See also the checks for
 /** @file poly_gcd.cpp
  *
  *  Some test with polynomial GCD calculations. See also the checks for
- *  rational function normalization in normalization.cpp.
- *
+ *  rational function normalization in normalization.cpp. */
+
+/*
  *  GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
  *
  *  This program is free software; you can redistribute it and/or modify
  *  GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -21,6 +22,7 @@
  */
 
 #include <ginac/ginac.h>
  */
 
 #include <ginac/ginac.h>
+using namespace GiNaC;
 
 const int MAX_VARIABLES = 5;
 
 
 const int MAX_VARIABLES = 5;
 
index 2a6382a812688bdda81e43fe82c1456b730503a5..c51bff8e596ef52a7977c68b281161fe87e09ba1 100644 (file)
@@ -1,8 +1,9 @@
 /** @file powerlaws.cpp
  *
  *  Tests for power laws.  You shouldn't try to draw much inspiration from
 /** @file powerlaws.cpp
  *
  *  Tests for power laws.  You shouldn't try to draw much inspiration from
- *  this code, it is a sanity check rather deeply rooted in GiNaC's classes.
- *
+ *  this code, it is a sanity check rather deeply rooted in GiNaC's classes. */
+
+/*
  *  GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
  *
  *  This program is free software; you can redistribute it and/or modify
  *  GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -21,6 +22,7 @@
  */
 
 #include <ginac/ginac.h>
  */
 
 #include <ginac/ginac.h>
+using namespace GiNaC;
 
 static unsigned powerlaws1(void)
 {
 
 static unsigned powerlaws1(void)
 {
index 0f8437b247c94da4fdd2e7f205eb18a4677d454b..292f5b922751d6a832f2a28168192376d6092643 100644 (file)
@@ -1,7 +1,8 @@
 /** @file series_expansion.cpp
  *
 /** @file series_expansion.cpp
  *
- *  Series expansion test (Laurent and Taylor series).
- *
+ *  Series expansion test (Laurent and Taylor series). */
+
+/*
  *  GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
  *
  *  This program is free software; you can redistribute it and/or modify
  *  GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -20,6 +21,7 @@
  */
 
 #include <ginac/ginac.h>
  */
 
 #include <ginac/ginac.h>
+using namespace GiNaC;
 
 static symbol x("x");
 
 
 static symbol x("x");
 
index e7726193e744d9c1fc0a70ecb1b6921343367570..4e2863d6c2ee3ee4b15966c57974ee89f3c60f97 100755 (executable)
--- a/configure
+++ b/configure
 done
 
 
 done
 
 
+for ac_hdr in unistd.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:1870: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 1875 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1880: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out`
+if test -z "$ac_err"; then
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=yes"
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+
+for ac_hdr in readline/readline.h readline/history.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:1910: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 1915 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1920: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out`
+if test -z "$ac_err"; then
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=yes"
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+else
+  echo "$ac_t""no" 1>&6
+fi
+done
+
+echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6
+echo "configure:1947: checking for readline in -lreadline" >&5
+ac_lib_var=`echo readline'_'readline | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lreadline  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 1955 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char readline();
+
+int main() {
+readline()
+; return 0; }
+EOF
+if { (eval echo configure:1969: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_lib=HAVE_LIB`echo readline | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_lib 1
+EOF
+
+  LIBS="-lreadline $LIBS"
+
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+
 
     for ac_hdr in CLN/cln.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
 
     for ac_hdr in CLN/cln.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1871: checking for $ac_hdr" >&5
+echo "configure:2002: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1876 "configure"
+#line 2007 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1881: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2012: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -1904,17 +2035,17 @@ for ac_hdr in cln.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1908: checking for $ac_hdr" >&5
+echo "configure:2039: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1913 "configure"
+#line 2044 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1918: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2049: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -1949,7 +2080,7 @@ done
 
 
     echo $ac_n "checking how to link with libcln""... $ac_c" 1>&6
 
 
     echo $ac_n "checking how to link with libcln""... $ac_c" 1>&6
-echo "configure:1953: checking how to link with libcln" >&5
+echo "configure:2084: checking how to link with libcln" >&5
     saved_LIBS="${LIBS}"
     if eval "test \"`echo '$''{'ginac_cv_lib_cln_link'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
     saved_LIBS="${LIBS}"
     if eval "test \"`echo '$''{'ginac_cv_lib_cln_link'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1958,14 +2089,14 @@ else
         case "${ac_cv_header_CLN_cln_h}" in
         "yes")
             cat > conftest.$ac_ext <<EOF
         case "${ac_cv_header_CLN_cln_h}" in
         "yes")
             cat > conftest.$ac_ext <<EOF
-#line 1962 "configure"
+#line 2093 "configure"
 #include "confdefs.h"
 #include <CLN/cln.h>
 int main() {
 factorial(1);
 ; return 0; }
 EOF
 #include "confdefs.h"
 #include <CLN/cln.h>
 int main() {
 factorial(1);
 ; return 0; }
 EOF
-if { (eval echo configure:1969: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2100: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   ginac_cv_lib_cln_link="-lcln"
 else
   rm -rf conftest*
   ginac_cv_lib_cln_link="-lcln"
 else
@@ -1978,14 +2109,14 @@ rm -f conftest*
             ;;
         *)
             cat > conftest.$ac_ext <<EOF
             ;;
         *)
             cat > conftest.$ac_ext <<EOF
-#line 1982 "configure"
+#line 2113 "configure"
 #include "confdefs.h"
 #include <cln.h>
 int main() {
 factorial(1);
 ; return 0; }
 EOF
 #include "confdefs.h"
 #include <cln.h>
 int main() {
 factorial(1);
 ; return 0; }
 EOF
-if { (eval echo configure:1989: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2120: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   ginac_cv_lib_cln_link="-lcln"
 else
   rm -rf conftest*
   ginac_cv_lib_cln_link="-lcln"
 else
@@ -2006,7 +2137,7 @@ fi
         echo "$ac_t""-lcln" 1>&6
         
     echo $ac_n "checking whether libcln behaves sane""... $ac_c" 1>&6
         echo "$ac_t""-lcln" 1>&6
         
     echo $ac_n "checking whether libcln behaves sane""... $ac_c" 1>&6
-echo "configure:2010: checking whether libcln behaves sane" >&5
+echo "configure:2141: checking whether libcln behaves sane" >&5
     if eval "test \"`echo '$''{'ginac_cv_lib_cln_integrity'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
     if eval "test \"`echo '$''{'ginac_cv_lib_cln_integrity'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2017,7 +2148,7 @@ else
   ginac_cv_lib_cln_integrity="guessing sane"
 else
   cat > conftest.$ac_ext <<EOF
   ginac_cv_lib_cln_integrity="guessing sane"
 else
   cat > conftest.$ac_ext <<EOF
-#line 2021 "configure"
+#line 2152 "configure"
 #include "confdefs.h"
 #ifdef __cplusplus
 extern "C" void exit(int);
 #include "confdefs.h"
 #ifdef __cplusplus
 extern "C" void exit(int);
@@ -2028,7 +2159,7 @@ cl_RA q(3); q = q/2; cl_RA p(3); p = p/2;
 if (q+p != 3) return 1; else return 0;
 }
 EOF
 if (q+p != 3) return 1; else return 0;
 }
 EOF
-if { (eval echo configure:2032: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2163: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   ginac_cv_lib_cln_integrity="sane"
 else
 then
   ginac_cv_lib_cln_integrity="sane"
 else
@@ -2046,7 +2177,7 @@ fi
   ginac_cv_lib_cln_integrity="guessing sane"
 else
   cat > conftest.$ac_ext <<EOF
   ginac_cv_lib_cln_integrity="guessing sane"
 else
   cat > conftest.$ac_ext <<EOF
-#line 2050 "configure"
+#line 2181 "configure"
 #include "confdefs.h"
 #ifdef __cplusplus
 extern "C" void exit(int);
 #include "confdefs.h"
 #ifdef __cplusplus
 extern "C" void exit(int);
@@ -2057,7 +2188,7 @@ cl_RA q(3); q = q/2; cl_RA p(3); p = p/2;
 if (q+p != 3) return 1; else return 0;
 }
 EOF
 if (q+p != 3) return 1; else return 0;
 }
 EOF
-if { (eval echo configure:2061: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2192: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   ginac_cv_lib_cln_integrity="sane"
 else
 then
   ginac_cv_lib_cln_integrity="sane"
 else
@@ -2102,137 +2233,6 @@ fi
     esac
 
 
     esac
 
 
-for ac_hdr in unistd.h
-do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2110: checking for $ac_hdr" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 2115 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2120: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
-else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
-fi
-rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
-EOF
-else
-  echo "$ac_t""no" 1>&6
-fi
-done
-
-for ac_hdr in readline/readline.h readline/history.h
-do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2150: checking for $ac_hdr" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  cat > conftest.$ac_ext <<EOF
-#line 2155 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2160: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
-if test -z "$ac_err"; then
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=yes"
-else
-  echo "$ac_err" >&5
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_header_$ac_safe=no"
-fi
-rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
-EOF
-else
-  echo "$ac_t""no" 1>&6
-fi
-done
-
-echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6
-echo "configure:2187: checking for readline in -lreadline" >&5
-ac_lib_var=`echo readline'_'readline | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  ac_save_LIBS="$LIBS"
-LIBS="-lreadline  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 2195 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char readline();
-
-int main() {
-readline()
-; return 0; }
-EOF
-if { (eval echo configure:2209: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-    ac_tr_lib=HAVE_LIB`echo readline | sed -e 's/[^a-zA-Z0-9_]/_/g' \
-    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
-  cat >> confdefs.h <<EOF
-#define $ac_tr_lib 1
-EOF
-
-  LIBS="-lreadline $LIBS"
-
-else
-  echo "$ac_t""no" 1>&6
-fi
-
-
 # Extract the first word of "doxygen", so it can be a program name with args.
 set dummy doxygen; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
 # Extract the first word of "doxygen", so it can be a program name with args.
 set dummy doxygen; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
index 74227d16761854f3370c02afb5f20c631d89215b..066d4f2eac782108ff0ea008b1637c926145dfcd 100644 (file)
@@ -75,15 +75,15 @@ dnl enough so trying the .h-style headers is a waste of time.
 AC_CHECK_HEADERS(iostream vector map string list typeinfo iterator strstream stdexcept algorithm, ,
     AC_MSG_ERROR(need to have ANSI compliant headers))
 
 AC_CHECK_HEADERS(iostream vector map string list typeinfo iterator strstream stdexcept algorithm, ,
     AC_MSG_ERROR(need to have ANSI compliant headers))
 
-dnl We need to have Bruno Haible's CLN installed (macros are in aclocal.m4):
-GINAC_CHECK_CLN_H
-GINAC_CHECK_LIBCLN
-
 dnl Check for stuff needed for building the GiNaC interactive shell (ginsh):
 AC_CHECK_HEADERS(unistd.h)
 AC_CHECK_HEADERS(readline/readline.h readline/history.h)
 AC_CHECK_LIB(readline, readline)
 
 dnl Check for stuff needed for building the GiNaC interactive shell (ginsh):
 AC_CHECK_HEADERS(unistd.h)
 AC_CHECK_HEADERS(readline/readline.h readline/history.h)
 AC_CHECK_LIB(readline, readline)
 
+dnl We need to have Bruno Haible's CLN installed (macros are in acinclude.m4):
+GINAC_CHECK_CLN_H
+GINAC_CHECK_LIBCLN
+
 dnl Check for utilities needed by the different kinds of documentation.
 dnl Documantation needs only be built when extending it, so never mind if it
 dnl cannot find those helpers:
 dnl Check for utilities needed by the different kinds of documentation.
 dnl Documantation needs only be built when extending it, so never mind if it
 dnl cannot find those helpers:
index e56226c88c5a1d1e840bf42b7ff6b495769a1765..9d8ed38eb45f3523eb563aed5f88dad6afcc0c2e 100644 (file)
@@ -7,12 +7,22 @@ libginac_la_SOURCES = add.cpp basic.cpp constant.cpp diff.cpp ex.cpp \
   printcsrc.cpp relational.cpp symbol.cpp utils.cpp series.cpp ncmul.cpp \
   clifford.cpp structure.cpp color.cpp indexed.cpp idx.cpp isospin.cpp \
   exprseq_suppl.cpp lst.cpp lst_suppl.cpp simp_lor.cpp coloridx.cpp \
   printcsrc.cpp relational.cpp symbol.cpp utils.cpp series.cpp ncmul.cpp \
   clifford.cpp structure.cpp color.cpp indexed.cpp idx.cpp isospin.cpp \
   exprseq_suppl.cpp lst.cpp lst_suppl.cpp simp_lor.cpp coloridx.cpp \
-  lorentzidx.cpp utils.h
+  lorentzidx.cpp debugmsg.h utils.h
 libginac_la_LDFLAGS = -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
   -release $(LT_RELEASE)
 ginacincludedir = $(includedir)/ginac
 ginacinclude_HEADERS = ginac.h add.h basic.h clifford.h color.h coloridx.h \
 libginac_la_LDFLAGS = -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
   -release $(LT_RELEASE)
 ginacincludedir = $(includedir)/ginac
 ginacinclude_HEADERS = ginac.h add.h basic.h clifford.h color.h coloridx.h \
-  constant.h debugmsg.h ex.h expair.h expairseq.h exprseq.h fail.h flags.h \
-  function.h idx.h indexed.h inifcns.h isospin.h lorentzidx.h lst.h matrix.h \
-  mul.h ncmul.h normal.h numeric.h operators.h power.h relational.h series.h \
-  simp_lor.h structure.h symbol.h tinfos.h
+  constant.h ex.h expair.h expairseq.h exprseq.h fail.h flags.h function.h \
+  idx.h indexed.h inifcns.h isospin.h lorentzidx.h lst.h matrix.h mul.h \
+  ncmul.h normal.h numeric.h operators.h power.h relational.h series.h \
+  simp_lor.h structure.h symbol.h tinfos.h assertion.h
+
+# Files which are generated by perl scripts
+function.h function.cpp: function.pl
+       perl function.pl
+
+lst.h lst.cpp: container.pl
+       perl container.pl lst
+
+exprseq.h exprseq.cpp: container.pl
+       perl container.pl exprseq
index 7144b92876e2e57f5fd35b0cec81b28342283a30..c697f07ab083339fdac04956ef9ed79cb6e21c5d 100644 (file)
@@ -101,15 +101,15 @@ libginac_la_SOURCES = add.cpp basic.cpp constant.cpp diff.cpp ex.cpp \
   printcsrc.cpp relational.cpp symbol.cpp utils.cpp series.cpp ncmul.cpp \
   clifford.cpp structure.cpp color.cpp indexed.cpp idx.cpp isospin.cpp \
   exprseq_suppl.cpp lst.cpp lst_suppl.cpp simp_lor.cpp coloridx.cpp \
   printcsrc.cpp relational.cpp symbol.cpp utils.cpp series.cpp ncmul.cpp \
   clifford.cpp structure.cpp color.cpp indexed.cpp idx.cpp isospin.cpp \
   exprseq_suppl.cpp lst.cpp lst_suppl.cpp simp_lor.cpp coloridx.cpp \
-  lorentzidx.cpp utils.h
+  lorentzidx.cpp debugmsg.h utils.h
 libginac_la_LDFLAGS = -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
   -release $(LT_RELEASE)
 ginacincludedir = $(includedir)/ginac
 ginacinclude_HEADERS = ginac.h add.h basic.h clifford.h color.h coloridx.h \
 libginac_la_LDFLAGS = -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) \
   -release $(LT_RELEASE)
 ginacincludedir = $(includedir)/ginac
 ginacinclude_HEADERS = ginac.h add.h basic.h clifford.h color.h coloridx.h \
-  constant.h debugmsg.h ex.h expair.h expairseq.h exprseq.h fail.h flags.h \
-  function.h idx.h indexed.h inifcns.h isospin.h lorentzidx.h lst.h matrix.h \
-  mul.h ncmul.h normal.h numeric.h operators.h power.h relational.h series.h \
-  simp_lor.h structure.h symbol.h tinfos.h
+  constant.h ex.h expair.h expairseq.h exprseq.h fail.h flags.h function.h \
+  idx.h indexed.h inifcns.h isospin.h lorentzidx.h lst.h matrix.h mul.h \
+  ncmul.h normal.h numeric.h operators.h power.h relational.h series.h \
+  simp_lor.h structure.h symbol.h tinfos.h assertion.h
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
 CONFIG_HEADER = ../config.h
 CONFIG_CLEAN_FILES = 
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
 CONFIG_HEADER = ../config.h
 CONFIG_CLEAN_FILES = 
@@ -391,6 +391,16 @@ installdirs mostlyclean-generic distclean-generic clean-generic \
 maintainer-clean-generic clean mostlyclean distclean maintainer-clean
 
 
 maintainer-clean-generic clean mostlyclean distclean maintainer-clean
 
 
+# Files which are generated by perl scripts
+function.h function.cpp: function.pl
+       perl function.pl
+
+lst.h lst.cpp: container.pl
+       perl container.pl lst
+
+exprseq.h exprseq.cpp: container.pl
+       perl container.pl exprseq
+
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
 .NOEXPORT:
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
 .NOEXPORT:
index 2f3beb13b9d79517a4f763eb36c5fd278c2c6a3d..0f25d2dc7a444a29fa11d513dad89ea6e896cc14 100644 (file)
@@ -25,6 +25,9 @@
 
 #include "add.h"
 #include "mul.h"
 
 #include "add.h"
 #include "mul.h"
+#include "debugmsg.h"
+
+namespace GiNaC {
 
 //////////
 // default constructor, destructor, copy constructor assignment operator and helpers
 
 //////////
 // default constructor, destructor, copy constructor assignment operator and helpers
@@ -420,9 +423,9 @@ ex add::eval(int level) const
 
 exvector add::get_indices(void) const
 {
 
 exvector add::get_indices(void) const
 {
-    // all terms in the sum should have the same indices (compatible tensors)
-    // however this is not checked, since there is no function yet which
-    // compares indices (idxvector can be unsorted) !!!!!!!!!!!
+    // FIXME: all terms in the sum should have the same indices (compatible
+    // tensors) however this is not checked, since there is no function yet
+    // which compares indices (idxvector can be unsorted)
     if (seq.size()==0) {
         return exvector();
     }
     if (seq.size()==0) {
         return exvector();
     }
@@ -650,5 +653,4 @@ unsigned add::precedence=40;
 const add some_add;
 type_info const & typeid_add=typeid(some_add);
 
 const add some_add;
 type_info const & typeid_add=typeid(some_add);
 
-
-
+} // namespace GiNaC
index 0545bcd2e1fd9d3710ce01e01054ee1bdadafff7..f471741b95464d5539283ae7158a498d31c8a76a 100644 (file)
@@ -25,6 +25,8 @@
 
 #include <ginac/expairseq.h>
 
 
 #include <ginac/expairseq.h>
 
+namespace GiNaC {
+
 /** Sum of expressions. */
 class add : public expairseq
 {
 /** Sum of expressions. */
 class add : public expairseq
 {
@@ -106,6 +108,12 @@ protected:
 extern const add some_add;
 extern type_info const & typeid_add;
 
 extern const add some_add;
 extern type_info const & typeid_add;
 
-#define ex_to_add(X) static_cast<add const &>(*(X).bp)
+// utility functions
+inline const add &ex_to_add(const ex &e)
+{
+       return static_cast<const add &>(*e.bp);
+}
+
+} // namespace GiNaC
 
 #endif // ndef __GINAC_ADD_H__
 
 #endif // ndef __GINAC_ADD_H__
diff --git a/ginac/assertion.h b/ginac/assertion.h
new file mode 100644 (file)
index 0000000..39bb4f4
--- /dev/null
@@ -0,0 +1,34 @@
+/** @file assertion.h
+ *
+ *  Assertion macro definition. */
+
+/*
+ *  GiNaC Copyright (C) 1999 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
+ */
+
+#ifndef __GINAC_ASSERTION_H__
+#define __GINAC_ASSERTION_H__
+
+#include <assert.h>
+
+#if defined(DO_GINAC_ASSERT) && !defined(ASSERT)
+#define ASSERT(X) assert(X)
+#else
+#define ASSERT(X) ((void)0)
+#endif
+
+#endif // ndef __GINAC_ASSERTION_H__
index 097ec5749196d599a04e2d55eadbd5aa7b6f2333..1c8814d44f89bb8d50579551cbb3a01382916402 100644 (file)
@@ -32,6 +32,9 @@
 #include "lst.h"
 #include "ncmul.h"
 #include "utils.h"
 #include "lst.h"
 #include "ncmul.h"
 #include "utils.h"
+#include "debugmsg.h"
+
+namespace GiNaC {
 
 //////////
 // default constructor, destructor, copy constructor assignment operator and helpers
 
 //////////
 // default constructor, destructor, copy constructor assignment operator and helpers
@@ -413,3 +416,5 @@ type_info const & typeid_basic=typeid(some_basic);
 //////////
 
 int max_recursion_level=1024;
 //////////
 
 int max_recursion_level=1024;
+
+} // namespace GiNaC
index a376855d6f7454747d3b09c60a2cef6b8965a227..f397b778e15d0492d0a139854c3bbf91f9e7cb7b 100644 (file)
@@ -29,7 +29,9 @@
 
 #include <ginac/flags.h>
 #include <ginac/tinfos.h>
 
 #include <ginac/flags.h>
 #include <ginac/tinfos.h>
-#include <ginac/debugmsg.h>
+#include <ginac/assertion.h>
+
+namespace GiNaC {
 
 class basic;
 class ex;
 
 class basic;
 class ex;
@@ -55,8 +57,6 @@ public:
 #ifdef INLINE_BASIC_CONSTRUCTORS
     : tinfo_key(TINFO_basic), flags(0), refcount(0)
     {
 #ifdef INLINE_BASIC_CONSTRUCTORS
     : tinfo_key(TINFO_basic), flags(0), refcount(0)
     {
-        debugmsg("basic default constructor",LOGLEVEL_CONSTRUCT);
-        // nothing to do
     }
 #else
 ;
     }
 #else
 ;
@@ -65,7 +65,6 @@ public:
     virtual ~basic()
 #ifdef INLINE_BASIC_CONSTRUCTORS
     {
     virtual ~basic()
 #ifdef INLINE_BASIC_CONSTRUCTORS
     {
-        debugmsg("basic destructor",LOGLEVEL_DESTRUCT);
         destroy(0);
         ASSERT((!(flags & status_flags::dynallocated))||(refcount==0));
     }
         destroy(0);
         ASSERT((!(flags & status_flags::dynallocated))||(refcount==0));
     }
@@ -76,7 +75,6 @@ public:
     basic(basic const & other)
 #ifdef INLINE_BASIC_CONSTRUCTORS
     {
     basic(basic const & other)
 #ifdef INLINE_BASIC_CONSTRUCTORS
     {
-        debugmsg("basic copy constructor",LOGLEVEL_CONSTRUCT);
         copy(other);
     }
 #else
         copy(other);
     }
 #else
@@ -99,8 +97,6 @@ protected:
 #ifdef INLINE_BASIC_CONSTRUCTORS
     : tinfo_key(ti), flags(0), refcount(0)
     {
 #ifdef INLINE_BASIC_CONSTRUCTORS
     : tinfo_key(ti), flags(0), refcount(0)
     {
-        debugmsg("basic constructor with tinfo_key",LOGLEVEL_CONSTRUCT);
-        // nothing to do
     }
 #else
 ;
     }
 #else
 ;
@@ -183,21 +179,18 @@ extern type_info const & typeid_basic;
 extern int max_recursion_level;
 
 // convenience macros
 extern int max_recursion_level;
 
 // convenience macros
-
 #define is_of_type(OBJ,TYPE) \
 #define is_of_type(OBJ,TYPE) \
-    (dynamic_cast<TYPE *>(const_cast<basic *>(&OBJ))!=0)
+    (dynamic_cast<TYPE *>(const_cast<GiNaC::basic *>(&OBJ))!=0)
 
 #define is_exactly_of_type(OBJ,TYPE) \
 
 #define is_exactly_of_type(OBJ,TYPE) \
-    ((OBJ).tinfo()==TINFO_##TYPE)
+    ((OBJ).tinfo()==GiNaC::TINFO_##TYPE)
 
 #define is_ex_of_type(OBJ,TYPE) \
 
 #define is_ex_of_type(OBJ,TYPE) \
-    (dynamic_cast<TYPE *>(const_cast<basic *>((OBJ).bp))!=0)
+    (dynamic_cast<TYPE *>(const_cast<GiNaC::basic *>((OBJ).bp))!=0)
 
 #define is_ex_exactly_of_type(OBJ,TYPE) \
 
 #define is_ex_exactly_of_type(OBJ,TYPE) \
-    ((*(OBJ).bp).tinfo()==TINFO_##TYPE)
+    ((*(OBJ).bp).tinfo()==GiNaC::TINFO_##TYPE)
 
 
-#define are_ex_trivially_equal(EX1,EX2) \
-    ((EX1).bp==(EX2).bp)
 
 // global functions
 
 
 // global functions
 
@@ -232,4 +225,6 @@ inline unsigned golden_ratio_hash(unsigned n)
 #endif
 }
 
 #endif
 }
 
+} // namespace GiNaC
+
 #endif // ndef __GINAC_BASIC_H__
 #endif // ndef __GINAC_BASIC_H__
index d16f1fe52cf7a49bf312252986fed4f1be082472..e60ced049b7fdc8bd397882fd8fb98ec803837ca 100644 (file)
@@ -27,6 +27,9 @@
 #include "ex.h"
 #include "ncmul.h"
 #include "utils.h"
 #include "ex.h"
 #include "ncmul.h"
 #include "utils.h"
+#include "debugmsg.h"
+
+namespace GiNaC {
 
 //////////
 // default constructor, destructor, copy constructor assignment operator and helpers
 
 //////////
 // default constructor, destructor, copy constructor assignment operator and helpers
@@ -208,3 +211,4 @@ unsigned clifford::next_serial=0;
 const clifford some_clifford;
 type_info const & typeid_clifford=typeid(some_clifford);
 
 const clifford some_clifford;
 type_info const & typeid_clifford=typeid(some_clifford);
 
+} // namespace GiNaC
index 36a1ff9bf3d0e1c46b7647aec49e24d6abaa42e7..49a3613b13f9424f68f143d98735655b89a88592 100644 (file)
@@ -25,6 +25,9 @@
 
 #include <string>
 #include <ginac/indexed.h>
 
 #include <string>
 #include <ginac/indexed.h>
+#include <ginac/ex.h>
+
+namespace GiNaC {
 
 /** Base class for clifford object */
 class clifford : public indexed
 
 /** Base class for clifford object */
 class clifford : public indexed
@@ -81,10 +84,12 @@ private:
 extern const clifford some_clifford;
 extern type_info const & typeid_clifford;
 
 extern const clifford some_clifford;
 extern type_info const & typeid_clifford;
 
-// macros
+// utility functions
+inline const clifford &ex_to_clifford(const ex &e)
+{
+       return static_cast<const clifford &>(*e.bp);
+}
 
 
-#define ex_to_clifford(X) static_cast<clifford const &>(*(X).bp)
+} // namespace GiNaC
 
 #endif // ndef __GINAC_CLIFFORD_H__
 
 #endif // ndef __GINAC_CLIFFORD_H__
-
-
index 33dc647cfbe3bba70a7984372c1d41546a34f533..3ac2d1f218daf1a37cd6c79e2c018e4a5411060c 100644 (file)
@@ -33,6 +33,9 @@
 #include "ncmul.h"
 #include "numeric.h"
 #include "relational.h"
 #include "ncmul.h"
 #include "numeric.h"
 #include "relational.h"
+#include "debugmsg.h"
+
+namespace GiNaC {
 
 //////////
 // default constructor, destructor, copy constructor assignment operator and helpers
 
 //////////
 // default constructor, destructor, copy constructor assignment operator and helpers
@@ -746,7 +749,7 @@ ex color_trace_of_one_representation_label(exvector const & v)
 
     v2.push_back(color_T(summation_index)); // don't care about the representation_label
     
 
     v2.push_back(color_T(summation_index)); // don't care about the representation_label
     
-    // check this formula for SU(N) with N!=3 !!!!!!!!!
+    // FIXME: check this formula for SU(N) with N!=3
     return numeric(1)/numeric(2*COLOR_THREE)*color_delta8(next_to_last_index,last_index)
            % color_trace_of_one_representation_label(v1)
           +numeric(1)/numeric(2)*color_h(next_to_last_index,last_index,summation_index)
     return numeric(1)/numeric(2*COLOR_THREE)*color_delta8(next_to_last_index,last_index)
            % color_trace_of_one_representation_label(v1)
           +numeric(1)/numeric(2)*color_h(next_to_last_index,last_index,summation_index)
@@ -858,7 +861,7 @@ ex simplify_pure_color_string(ex const & e)
         }
     }
     
         }
     }
     
-    // TODO: higher contractions!!!!!!!!!!!!!
+    // FIXME: higher contractions
     
     return e;
 }
     
     return e;
 }
@@ -962,15 +965,4 @@ void append_exvector_to_exvector(exvector & dest, exvector const & source)
     }
 }
 
     }
 }
 
-
-
-
-
-
-
-
-
-
-
-
-
+} // namespace GiNaC
index 877e7de5f9cf2f1fb8490bf4eb9c73262791021e..a6f8ea599e7b3a2ea709e42040b57c2345f860e0 100644 (file)
 #include <string>
 #include <vector>
 #include <ginac/indexed.h>
 #include <string>
 #include <vector>
 #include <ginac/indexed.h>
+#include <ginac/ex.h>
 
 
-#define MAX_REPRESENTATION_LABELS 4
-#define COLOR_EIGHT 8 // N*N-1
-#define COLOR_THREE 3 // N
+namespace GiNaC {
+
+const int MAX_REPRESENTATION_LABELS = 4;
+const int COLOR_EIGHT = 8; // N*N-1
+const int COLOR_THREE = 3; // N
 
 /** Base class for color object */
 class color : public indexed
 
 /** Base class for color object */
 class color : public indexed
@@ -125,10 +128,16 @@ protected:
 extern const color some_color;
 extern type_info const & typeid_color;
 
 extern const color some_color;
 extern type_info const & typeid_color;
 
-// macros
+// global functions
+inline const color &ex_to_color(const ex &e)
+{
+       return static_cast<const color &>(*e.bp);
+}
 
 
-#define ex_to_color(X) static_cast<color const &>(*(X).bp)
-#define ex_to_nonconst_color(X) static_cast<color &>(*(X).bp)
+inline color &ex_to_nonconst_color(const ex &e)
+{
+       return static_cast<color &>(*e.bp);
+}
 
 color color_ONE(unsigned const rl=0);
 color color_T(ex const & a, unsigned const rl=0);
 
 color color_ONE(unsigned const rl=0);
 color color_T(ex const & a, unsigned const rl=0);
@@ -153,6 +162,6 @@ ex brute_force_sum_color_indices(ex const & e);
 
 void append_exvector_to_exvector(exvector & dest, exvector const & source);
 
 
 void append_exvector_to_exvector(exvector & dest, exvector const & source);
 
-#endif // ndef __GINAC_COLOR_H__
-
+} // namespace GiNaC
 
 
+#endif // ndef __GINAC_COLOR_H__
index 523c0d2a9abc6cc078d156e9b1bbce8f1a1eaf2f..dc8eed7d9c35533c574ff5a90187d4a8ec337ace 100644 (file)
@@ -24,6 +24,9 @@
 
 #include "coloridx.h"
 #include "utils.h"
 
 #include "coloridx.h"
 #include "utils.h"
+#include "debugmsg.h"
+
+namespace GiNaC {
 
 //////////
 // default constructor, destructor, copy constructor assignment operator and helpers
 
 //////////
 // default constructor, destructor, copy constructor assignment operator and helpers
@@ -210,5 +213,4 @@ bool coloridx::info(unsigned inf) const
 const coloridx some_coloridx;
 type_info const & typeid_coloridx=typeid(some_coloridx);
 
 const coloridx some_coloridx;
 type_info const & typeid_coloridx=typeid(some_coloridx);
 
-
-
+} // namespace GiNaC
index 1753b429be3b9694d05baa82ab3d2ed39baa480d..7861c899cb9242cac9f118ab3cbbb47fcc3a52b0 100644 (file)
@@ -26,6 +26,9 @@
 #include <string>
 #include <vector>
 #include <ginac/idx.h>
 #include <string>
 #include <vector>
 #include <ginac/idx.h>
+#include <ginac/ex.h>
+
+namespace GiNaC {
 
 class coloridx : public idx
 {
 
 class coloridx : public idx
 {
@@ -73,8 +76,12 @@ public:
 extern const coloridx some_coloridx;
 extern type_info const & typeid_coloridx;
 
 extern const coloridx some_coloridx;
 extern type_info const & typeid_coloridx;
 
-// macros
+// utility functions
+inline const coloridx &ex_to_coloridx(const ex &e)
+{
+       return static_cast<const coloridx &>(*e.bp);
+}
 
 
-#define ex_to_coloridx(X) (static_cast<coloridx const &>(*(X).bp))
+} // namespace GiNaC
 
 #endif // ndef __GINAC_COLORIDX_H__
 
 #endif // ndef __GINAC_COLORIDX_H__
index 4e866eaf0d857b57b29f1ab21e7fbe9b5dc88ab9..30ccb88787588eb19745ace8ee09ee604e45af63 100644 (file)
@@ -26,6 +26,9 @@
 #include "constant.h"
 #include "numeric.h"
 #include "ex.h"
 #include "constant.h"
 #include "numeric.h"
 #include "ex.h"
+#include "debugmsg.h"
+
+namespace GiNaC {
 
 //////////
 // default constructor, destructor, copy constructor assignment operator and helpers
 
 //////////
 // default constructor, destructor, copy constructor assignment operator and helpers
@@ -161,3 +164,5 @@ const constant EulerGamma("EulerGamma", EulerGammaEvalf);
 /** Euler's constant. (0.57721...)  Sometimes called Euler-Mascheroni constant.
  *  Diverts straight into CLN for evalf(). */
 const constant Catalan("Catalan", CatalanEvalf);
 /** Euler's constant. (0.57721...)  Sometimes called Euler-Mascheroni constant.
  *  Diverts straight into CLN for evalf(). */
 const constant Catalan("Catalan", CatalanEvalf);
+
+} // namespace GiNaC
index c5c90c035c3b5c97d357998b4c4c4d5436333a14..89cb7ebae83576c0d1e02cf0c33666e9ddbf30ab 100644 (file)
@@ -26,6 +26,8 @@
 #include <string>
 #include <ginac/basic.h>
 
 #include <string>
 #include <ginac/basic.h>
 
+namespace GiNaC {
+
 /** This class holds constants, symbols with specific numerical value. Each
  *  object of this class must either provide their own function to evaluate it
  *  to class numeric or provide the constant as a numeric (if it's an exact
 /** This class holds constants, symbols with specific numerical value. Each
  *  object of this class must either provide their own function to evaluate it
  *  to class numeric or provide the constant as a numeric (if it's an exact
@@ -88,4 +90,6 @@ extern const constant Pi;
 extern const constant Catalan;
 extern const constant EulerGamma;
 
 extern const constant Catalan;
 extern const constant EulerGamma;
 
+} // namespace GiNaC
+
 #endif // ndef __GINAC_CONSTANT_H__
 #endif // ndef __GINAC_CONSTANT_H__
index 4f838e6802ced17bc7569c602b0fd0a99193525f..7a7b3e9dbe262faa684998b4eb3c778827acfa42 100755 (executable)
@@ -89,7 +89,9 @@ END_OF_LET_OP_IMPLEMENTATION
 $interface=<<END_OF_INTERFACE;
 /** \@file ${CONTAINER}.h
  *
 $interface=<<END_OF_INTERFACE;
 /** \@file ${CONTAINER}.h
  *
- *  Definition of GiNaC's ${CONTAINER}. 
+ *  Definition of GiNaC's ${CONTAINER}. */
+
+/*
  *  This file was generated automatically by container.pl.
  *  Please do not modify it directly, edit the perl script instead!
  *  container.pl options: \$CONTAINER=${CONTAINER}
  *  This file was generated automatically by container.pl.
  *  Please do not modify it directly, edit the perl script instead!
  *  container.pl options: \$CONTAINER=${CONTAINER}
@@ -122,6 +124,9 @@ $interface=<<END_OF_INTERFACE;
 
 #include <${STLHEADER}>
 #include <ginac/basic.h>
 
 #include <${STLHEADER}>
 #include <ginac/basic.h>
+#include <ginac/ex.h>
+
+namespace GiNaC {
 
 typedef ${STLHEADER}<ex> ${STLT};
 
 
 typedef ${STLHEADER}<ex> ${STLT};
 
@@ -212,9 +217,13 @@ protected:
 extern const ${CONTAINER} some_${CONTAINER};
 extern type_info const & typeid_${CONTAINER};
 
 extern const ${CONTAINER} some_${CONTAINER};
 extern type_info const & typeid_${CONTAINER};
 
-// macros
+// utility functions
+inline const ${CONTAINER} &ex_to_${CONTAINER}(const ex &e)
+{
+    return static_cast<const ${CONTAINER} &>(*e.bp);
+}
 
 
-#define ex_to_${CONTAINER}(X) (static_cast<${CONTAINER} const &>(*(X).bp))
+} // namespace GiNaC
 
 #endif // ndef __GINAC_${CONTAINER_UC}_H__
 
 
 #endif // ndef __GINAC_${CONTAINER_UC}_H__
 
@@ -223,7 +232,9 @@ END_OF_INTERFACE
 $implementation=<<END_OF_IMPLEMENTATION;
 /** \@file ${CONTAINER}.cpp
  *
 $implementation=<<END_OF_IMPLEMENTATION;
 /** \@file ${CONTAINER}.cpp
  *
- *  Implementation of GiNaC's ${CONTAINER}. 
+ *  Implementation of GiNaC's ${CONTAINER}. */
+
+/*
  *  This file was generated automatically by container.pl.
  *  Please do not modify it directly, edit the perl script instead!
  *  container.pl options: \$CONTAINER=${CONTAINER}
  *  This file was generated automatically by container.pl.
  *  Please do not modify it directly, edit the perl script instead!
  *  container.pl options: \$CONTAINER=${CONTAINER}
@@ -256,6 +267,9 @@ $implementation=<<END_OF_IMPLEMENTATION;
 
 #include "${CONTAINER}.h"
 #include "ex.h"
 
 #include "${CONTAINER}.h"
 #include "ex.h"
+#include "debugmsg.h"
+
+namespace GiNaC {
 
 ${RESERVE_IMPLEMENTATION}
 
 
 ${RESERVE_IMPLEMENTATION}
 
@@ -833,6 +847,8 @@ unsigned ${CONTAINER}::precedence=10;
 const ${CONTAINER} some_${CONTAINER};
 type_info const & typeid_${CONTAINER}=typeid(some_${CONTAINER});
 
 const ${CONTAINER} some_${CONTAINER};
 type_info const & typeid_${CONTAINER}=typeid(some_${CONTAINER});
 
+} // namespace GiNaC
+
 END_OF_IMPLEMENTATION
 
 print "Creating interface file ${CONTAINER}.h...";
 END_OF_IMPLEMENTATION
 
 print "Creating interface file ${CONTAINER}.h...";
index 13bd156850d8c39aba3e181237fd6746c8d799e5..24d0f7e90a06153f582b38a4310d994a608a7c4d 100644 (file)
@@ -23,6 +23,8 @@
 #ifndef __GINAC_DEBUGMSG_H__
 #define __GINAC_DEBUGMSG_H__
 
 #ifndef __GINAC_DEBUGMSG_H__
 #define __GINAC_DEBUGMSG_H__
 
+#include <iostream>
+
 #ifdef _DEBUG
 #define VERBOSE
 #define DOASSERT (VERBOSE||DEBUG)
 #ifdef _DEBUG
 #define VERBOSE
 #define DOASSERT (VERBOSE||DEBUG)
 #define LOGLEVEL_ALL                0xffff
 
 #define LOGMASK (LOGLEVEL_PRINT)
 #define LOGLEVEL_ALL                0xffff
 
 #define LOGMASK (LOGLEVEL_PRINT)
-// #define LOGMASK (LOGLEVEL_PRINT | LOGLEVEL_ASSIGNMENT | LOGLEVEL_OPERATOR | LOGLEVEL_DUPLICATE | LOGLEVEL_OPERATOR | LOGLEVEL_MEMBER_FUNCTION | LOGLEVEL_NONMEMBER_FUNCTION )
-
-#include <assert.h>
-#include <iostream>
+// #define LOGMASK (LOGLEVEL_PRINT | LOGLEVEL_ASSIGNMENT | LOGLEVEL_OPERATOR | LOGLEVEL_DUPLICATE | LOGLEVEL_OPERATOR | LOGLEVEL_MEMBER_FUNCTION | LOGLEVEL_NONMEMBER_FUNCTION)
 
 #ifdef VERBOSE
 #define debugmsg(msg, loglevel) if ((loglevel) & ~LOGMASK) clog << (msg) << endl;
 
 #ifdef VERBOSE
 #define debugmsg(msg, loglevel) if ((loglevel) & ~LOGMASK) clog << (msg) << endl;
 #define debugmsg(msg, loglevel)
 #endif // def VERBOSE
 
 #define debugmsg(msg, loglevel)
 #endif // def VERBOSE
 
-#ifdef DOASSERT
-#define ASSERT(X) assert(X)
-#else
-#define ASSERT(X) ((void)0)
-#endif
-
 #endif // ndef __GINAC_DEBUGMSG_H__
 #endif // ndef __GINAC_DEBUGMSG_H__
index dec8dc7d590fce307de4fe0136e4bab5ed33b836..167d4939fe5fe5a510db386b164f9f292382bfec 100644 (file)
@@ -37,6 +37,8 @@
 #include "series.h"
 #include "symbol.h"
 
 #include "series.h"
 #include "symbol.h"
 
+namespace GiNaC {
+
 /** Default implementation of ex::diff(). It prints and error message and returns a fail object.
  *  @see ex::diff */
 ex basic::diff(symbol const & s) const
 /** Default implementation of ex::diff(). It prints and error message and returns a fail object.
  *  @see ex::diff */
 ex basic::diff(symbol const & s) const
@@ -198,7 +200,7 @@ ex series::diff(symbol const & s) const
         epvector new_seq;
         epvector::const_iterator it = seq.begin(), itend = seq.end();
         
         epvector new_seq;
         epvector::const_iterator it = seq.begin(), itend = seq.end();
         
-        //!! coeff might depend on var
+        // FIXME: coeff might depend on var
         while (it != itend) {
             if (is_order_function(it->rest)) {
                 new_seq.push_back(expair(it->rest, it->coeff - 1));
         while (it != itend) {
             if (is_order_function(it->rest)) {
                 new_seq.push_back(expair(it->rest, it->coeff - 1));
@@ -237,3 +239,5 @@ ex ex::diff(symbol const & s, unsigned nth) const
     }
     return ndiff;
 }
     }
     return ndiff;
 }
+
+} // namespace GiNaC
index 147cd97ffd6144a3edf9abaea61081f6f31d16f2..e036af535de486405856f3f99d6d95e600ba8fb9 100644 (file)
@@ -28,6 +28,9 @@
 #include "ncmul.h"
 #include "numeric.h"
 #include "power.h"
 #include "ncmul.h"
 #include "numeric.h"
 #include "power.h"
+#include "debugmsg.h"
+
+namespace GiNaC {
 
 //////////
 // default constructor, destructor, copy constructor assignment operator and helpers
 
 //////////
 // default constructor, destructor, copy constructor assignment operator and helpers
@@ -511,3 +514,4 @@ ex const & exMINUSHALF(void)
     return *eMINUSHALF;
 }
 
     return *eMINUSHALF;
 }
 
+} // namespace GiNaC
index de54e7c9cee14adfa183b193bd80dfcbbb19c8de..0de91a17dd414f0f19549b90bd3c52553c7b22e9 100644 (file)
@@ -27,6 +27,8 @@
 #include <ginac/basic.h>
 #include <ginac/operators.h>
 
 #include <ginac/basic.h>
 #include <ginac/operators.h>
 
+namespace GiNaC {
+
 class ex;
 class expand_options;
 class status_flags;
 class ex;
 class expand_options;
 class status_flags;
@@ -63,7 +65,6 @@ public:
 #ifdef INLINE_EX_CONSTRUCTORS
     : bp(exZERO().bp)
         {
 #ifdef INLINE_EX_CONSTRUCTORS
     : bp(exZERO().bp)
         {
-            debugmsg("ex default constructor",LOGLEVEL_CONSTRUCT);
             ASSERT(exZERO().bp!=0);
             ASSERT(exZERO().bp->flags & status_flags::dynallocated);
             ASSERT(bp!=0);
             ASSERT(exZERO().bp!=0);
             ASSERT(exZERO().bp->flags & status_flags::dynallocated);
             ASSERT(bp!=0);
@@ -76,7 +77,6 @@ public:
     ~ex()
 #ifdef INLINE_EX_CONSTRUCTORS
         {
     ~ex()
 #ifdef INLINE_EX_CONSTRUCTORS
         {
-            debugmsg("ex destructor",LOGLEVEL_DESTRUCT);
             ASSERT(bp!=0);
             ASSERT(bp->flags & status_flags::dynallocated);
             if (--bp->refcount == 0) {
             ASSERT(bp!=0);
             ASSERT(bp->flags & status_flags::dynallocated);
             if (--bp->refcount == 0) {
@@ -91,7 +91,6 @@ public:
 #ifdef INLINE_EX_CONSTRUCTORS
     : bp(other.bp)
         {
 #ifdef INLINE_EX_CONSTRUCTORS
     : bp(other.bp)
         {
-            debugmsg("ex copy constructor",LOGLEVEL_CONSTRUCT);
             ASSERT(bp!=0);
             ASSERT((bp->flags) & status_flags::dynallocated);
             ++bp->refcount;
             ASSERT(bp!=0);
             ASSERT((bp->flags) & status_flags::dynallocated);
             ++bp->refcount;
@@ -103,7 +102,6 @@ public:
     ex const & operator=(ex const & other)
 #ifdef INLINE_EX_CONSTRUCTORS
         {
     ex const & operator=(ex const & other)
 #ifdef INLINE_EX_CONSTRUCTORS
         {
-            debugmsg("ex operator=",LOGLEVEL_ASSIGNMENT);
             ASSERT(bp!=0);
             ASSERT(bp->flags & status_flags::dynallocated);
             ASSERT(other.bp!=0);
             ASSERT(bp!=0);
             ASSERT(bp->flags & status_flags::dynallocated);
             ASSERT(other.bp!=0);
@@ -125,7 +123,6 @@ public:
     ex(basic const & other)
 #ifdef INLINE_EX_CONSTRUCTORS
     {
     ex(basic const & other)
 #ifdef INLINE_EX_CONSTRUCTORS
     {
-        debugmsg("ex constructor from basic",LOGLEVEL_CONSTRUCT);
         construct_from_basic(other);
     }
 #else
         construct_from_basic(other);
     }
 #else
@@ -230,9 +227,14 @@ private:
 
 public:
     basic *bp;
 
 public:
     basic *bp;
-
 };
 
 };
 
+// utility functions
+inline bool are_ex_trivially_equal(const ex &e1, const ex &e2)
+{
+       return e1.bp == e2.bp;
+}
+
 // wrapper functions around member functions
 inline int nops(ex const & thisex)
 { return thisex.nops(); }
 // wrapper functions around member functions
 inline int nops(ex const & thisex)
 { return thisex.nops(); }
@@ -282,4 +284,6 @@ inline ex subs(ex const & thisex, lst const & ls, lst const & lr)
 inline void swap(ex & e1, ex & e2)
 { e1.swap(e2); }
 
 inline void swap(ex & e1, ex & e2)
 { e1.swap(e2); }
 
+} // namespace GiNaC
+
 #endif // ndef __GINAC_EX_H__
 #endif // ndef __GINAC_EX_H__
index a066382a6a42bba6bb2dbb39201ac773d59c0a88..0a9867750ade0ca86a456bbf78de604f47f83ced 100644 (file)
@@ -26,6 +26,8 @@
 #include <ginac/ex.h>
 #include <ginac/numeric.h>
 
 #include <ginac/ex.h>
 #include <ginac/numeric.h>
 
+namespace GiNaC {
+
 /** A pair of expressions.
  *  This similar to, but slightly extended STL's pair<> but we need to account
  *  for methods like .compare() */
 /** A pair of expressions.
  *  This similar to, but slightly extended STL's pair<> but we need to account
  *  for methods like .compare() */
@@ -195,4 +197,6 @@ public:
     }
 };
 
     }
 };
 
+} // namespace GiNaC
+
 #endif // ndef __GINAC_EXPAIR_H__
 #endif // ndef __GINAC_EXPAIR_H__
index f9347e0b364961378a21421f6f8e40121770ea7c..f74be45e84da27a15e273ea8a14df0ee70d044a9 100644 (file)
 
 #include "expairseq.h"
 #include "lst.h"
 
 #include "expairseq.h"
 #include "lst.h"
+#include "debugmsg.h"
+
+namespace GiNaC {
 
 #ifdef EXPAIRSEQ_USE_HASHTAB
 
 #ifdef EXPAIRSEQ_USE_HASHTAB
-#error "!!!!!!!!TODO: expair_needs_further_processing not yet implemented for hashtabs, sorry. A.F."
+#error "FIXME: expair_needs_further_processing not yet implemented for hashtabs, sorry. A.F."
 #endif // def EXPAIRSEQ_USE_HASHTAB
 
 //////////
 #endif // def EXPAIRSEQ_USE_HASHTAB
 
 //////////
@@ -1623,3 +1626,4 @@ unsigned expairseq::hashtabfactor=1;
 const expairseq some_expairseq;
 type_info const & typeid_expairseq=typeid(some_expairseq);
 
 const expairseq some_expairseq;
 type_info const & typeid_expairseq=typeid(some_expairseq);
 
+} // namespace GiNaC
index 55be7cfd1bc25d8e7d0bc40fee15ed84e938bdb8..a14cecaac00d5bddf852f430d0ee5673243a68d1 100644 (file)
@@ -27,6 +27,8 @@
 #include <list>
 #include <ginac/expair.h>
 
 #include <list>
 #include <ginac/expair.h>
 
+namespace GiNaC {
+
 //#define EXPAIRSEQ_USE_HASHTAB
 
 typedef vector<expair> epvector;
 //#define EXPAIRSEQ_USE_HASHTAB
 
 typedef vector<expair> epvector;
@@ -34,7 +36,6 @@ typedef epvector::iterator epviter;
 
 inline void iter_swap(epvector::iterator it1, epvector::iterator it2)
 {
 
 inline void iter_swap(epvector::iterator it1, epvector::iterator it2)
 {
-    debugmsg("iter_swap epvector",LOGLEVEL_NONMEMBER_FUNCTION);
     (*it1).rest.swap((*it2).rest);
     (*it1).coeff.swap((*it2).coeff);
 }
     (*it1).rest.swap((*it2).rest);
     (*it1).coeff.swap((*it2).coeff);
 }
@@ -59,11 +60,9 @@ public:
         , hashtabsize(0)
 #endif // def EXPAIRSEQ_USE_HASHTAB
         {
         , hashtabsize(0)
 #endif // def EXPAIRSEQ_USE_HASHTAB
         {
-            debugmsg("expairseq default constructor",LOGLEVEL_CONSTRUCT);
         }
     ~expairseq()
         {
         }
     ~expairseq()
         {
-            debugmsg("expairseq destructor",LOGLEVEL_DESTRUCT);
             destroy(0);
         }
     expairseq(expairseq const & other);
             destroy(0);
         }
     expairseq(expairseq const & other);
@@ -189,6 +188,12 @@ protected:
 extern const expairseq some_expairseq;
 extern type_info const & typeid_expairseq;
 
 extern const expairseq some_expairseq;
 extern type_info const & typeid_expairseq;
 
-#define ex_to_expairseq(X) static_cast<expairseq const &>(*(X).bp)
+// utility functions
+inline const expairseq &ex_to_expairseq(const ex &e)
+{
+       return static_cast<const expairseq &>(*e.bp);
+}
+
+} // namespace GiNaC
 
 #endif // ndef __GINAC_EXPAIRSEQ_H__
 
 #endif // ndef __GINAC_EXPAIRSEQ_H__
index 329701557540e4f7ab80a5bfdd15874f4ce7ee71..e8d6406b06da6e5ed7f74a8e82cd8a0f5b754c8d 100644 (file)
@@ -1,6 +1,8 @@
 /** @file exprseq.cpp
  *
 /** @file exprseq.cpp
  *
- *  Implementation of GiNaC's exprseq. 
+ *  Implementation of GiNaC's exprseq. */
+
+/*
  *  This file was generated automatically by container.pl.
  *  Please do not modify it directly, edit the perl script instead!
  *  container.pl options: $CONTAINER=exprseq
  *  This file was generated automatically by container.pl.
  *  Please do not modify it directly, edit the perl script instead!
  *  container.pl options: $CONTAINER=exprseq
@@ -9,9 +11,8 @@
  *                        $prepend=0
  *                        $let_op=0
  *                        $open_bracket=(
  *                        $prepend=0
  *                        $let_op=0
  *                        $open_bracket=(
- *                        $close_bracket=) */
-
-/*
+ *                        $close_bracket=)
+ *
  *  GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
  *
  *  This program is free software; you can redistribute it and/or modify
  *  GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -34,6 +35,9 @@
 
 #include "exprseq.h"
 #include "ex.h"
 
 #include "exprseq.h"
 #include "ex.h"
+#include "debugmsg.h"
+
+namespace GiNaC {
 
 #define RESERVE(s,size) (s).reserve(size)
 
 
 #define RESERVE(s,size) (s).reserve(size)
 
@@ -611,3 +615,5 @@ unsigned exprseq::precedence=10;
 const exprseq some_exprseq;
 type_info const & typeid_exprseq=typeid(some_exprseq);
 
 const exprseq some_exprseq;
 type_info const & typeid_exprseq=typeid(some_exprseq);
 
+} // namespace GiNaC
+
index 179cfbde767e83d6357838eb7c5a151a73ab3766..59f6821f2a1b6f0c93521774e9b3956f88c7c67a 100644 (file)
@@ -1,6 +1,8 @@
 /** @file exprseq.h
  *
 /** @file exprseq.h
  *
- *  Definition of GiNaC's exprseq. 
+ *  Definition of GiNaC's exprseq. */
+
+/*
  *  This file was generated automatically by container.pl.
  *  Please do not modify it directly, edit the perl script instead!
  *  container.pl options: $CONTAINER=exprseq
  *  This file was generated automatically by container.pl.
  *  Please do not modify it directly, edit the perl script instead!
  *  container.pl options: $CONTAINER=exprseq
@@ -9,9 +11,8 @@
  *                        $prepend=0
  *                        $let_op=0
  *                        $open_bracket=(
  *                        $prepend=0
  *                        $let_op=0
  *                        $open_bracket=(
- *                        $close_bracket=) */
-
-/*
+ *                        $close_bracket=)
+ *
  *  GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
  *
  *  This program is free software; you can redistribute it and/or modify
  *  GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -34,6 +35,9 @@
 
 #include <vector>
 #include <ginac/basic.h>
 
 #include <vector>
 #include <ginac/basic.h>
+#include <ginac/ex.h>
+
+namespace GiNaC {
 
 typedef vector<ex> exvector;
 
 
 typedef vector<ex> exvector;
 
@@ -124,9 +128,13 @@ protected:
 extern const exprseq some_exprseq;
 extern type_info const & typeid_exprseq;
 
 extern const exprseq some_exprseq;
 extern type_info const & typeid_exprseq;
 
-// macros
+// utility functions
+inline const exprseq &ex_to_exprseq(const ex &e)
+{
+    return static_cast<const exprseq &>(*e.bp);
+}
 
 
-#define ex_to_exprseq(X) (static_cast<exprseq const &>(*(X).bp))
+} // namespace GiNaC
 
 #endif // ndef __GINAC_EXPRSEQ_H__
 
 
 #endif // ndef __GINAC_EXPRSEQ_H__
 
index f4355d79a03baa820ed4ef6a8e2bf33ccbe3fcdd..5e96830dbf94b6879968e58fcdb26ef3617c08f2 100644 (file)
@@ -24,6 +24,8 @@
 #include "exprseq.h"
 #include "ex.h"
 
 #include "exprseq.h"
 #include "ex.h"
 
+namespace GiNaC {
+
 bool exprseq::info(unsigned inf) const
 {
     if (inf==info_flags::exprseq) return 1;
 bool exprseq::info(unsigned inf) const
 {
     if (inf==info_flags::exprseq) return 1;
@@ -38,3 +40,4 @@ ex & exprseq::let_op(int const i)
     return seq[i];
 }
 
     return seq[i];
 }
 
+} // namespace GiNaC
index 3dc847b9e296dd2b44b0d929ce4c92f7f134fd7f..e5800a388c629a669841427bae8c9ac37fa5ce1a 100644 (file)
@@ -22,6 +22,9 @@
  */
 
 #include "fail.h"
  */
 
 #include "fail.h"
+#include "debugmsg.h"
+
+namespace GiNaC {
 
 //////////
 // default constructor, destructor, copy constructor assignment operator and helpers
 
 //////////
 // default constructor, destructor, copy constructor assignment operator and helpers
@@ -120,3 +123,4 @@ int fail::compare_same_type(basic const & other) const
 const fail some_fail;
 type_info const & typeid_fail=typeid(some_fail);
 
 const fail some_fail;
 type_info const & typeid_fail=typeid(some_fail);
 
+} // namespace GiNaC
index 2fc383ef747c66ba1b4c956065e86e387a81cc6b..7edc7b1bd842f972c1a2d3b3f739bec6c22cc010 100644 (file)
@@ -26,6 +26,8 @@
 
 #include <ginac/basic.h>
 
 
 #include <ginac/basic.h>
 
+namespace GiNaC {
+
 class fail : public basic
 {
 // member functions
 class fail : public basic
 {
 // member functions
@@ -67,6 +69,6 @@ protected:
 extern const fail some_fail;
 extern type_info const & typeid_fail;
 
 extern const fail some_fail;
 extern type_info const & typeid_fail;
 
-#endif // ndef __GINAC_FAIL_H__
-
+} // namespace GiNaC
 
 
+#endif // ndef __GINAC_FAIL_H__
index 2057baa219f72dcb6475e7174510a32001a026e4..90f4e38d992960961613eba7d8d52f3ffd063552 100644 (file)
@@ -23,6 +23,8 @@
 #ifndef __GINAC_FLAGS_H__
 #define __GINAC_FLAGS_H__
 
 #ifndef __GINAC_FLAGS_H__
 #define __GINAC_FLAGS_H__
 
+namespace GiNaC {
+
 class expand_options {
 public:
     enum { expand_trigonometric      = 0x0001
 class expand_options {
 public:
     enum { expand_trigonometric      = 0x0001
@@ -112,4 +114,6 @@ public:
        };
 };
 
        };
 };
 
+} // namespace GiNaC
+
 #endif // ndef __GINAC_FLAGS_H__
 #endif // ndef __GINAC_FLAGS_H__
index 1870dedd7424d7bd6ae3cb28f23b44a7ae306d2c..d85320663c64078d92339421e791b7d152f70977 100644 (file)
@@ -1,12 +1,12 @@
 /** @file function.cpp
  *
 /** @file function.cpp
  *
- *  Implementation of class function.
- *
- *  This file was generated automatically by function.pl.
- *  Please do not modify it directly, edit the perl script instead!
- *  function.pl options: $maxargs=10 */
+ *  Implementation of class function. */
 
 /*
 
 /*
+ *  This file was generated automatically by function.pl.
+ *  Please do not modify it directly, edit the perl script instead!
+ *  function.pl options: $maxargs=10
+ *
  *  GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
  *
  *  This program is free software; you can redistribute it and/or modify
  *  GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -29,6 +29,9 @@
 
 #include "function.h"
 #include "ex.h"
 
 #include "function.h"
 #include "ex.h"
+#include "debugmsg.h"
+
+namespace GiNaC {
 
 //////////
 // default constructor, destructor, copy constructor assignment operator and helpers
 
 //////////
 // default constructor, destructor, copy constructor assignment operator and helpers
@@ -607,3 +610,5 @@ unsigned function::register_new(char const * nm, eval_funcp_10 e,
 const function some_function;
 type_info const & typeid_function=typeid(some_function);
 
 const function some_function;
 type_info const & typeid_function=typeid(some_function);
 
+} // namespace GiNaC
+
index 4666e1776bfbb4cad2bc307dd130469f2542e6b1..f4350a11133499c2632b8bac1a252eb43d059414 100644 (file)
@@ -1,12 +1,12 @@
 /** @file function.h
  *
 /** @file function.h
  *
- *  Interface to abstract class function (new function concept).
- *
- *  This file was generated automatically by function.pl.
- *  Please do not modify it directly, edit the perl script instead!
- *  function.pl options: $maxargs=10 */
+ *  Interface to abstract class function (new function concept). */
 
 /*
 
 /*
+ *  This file was generated automatically by function.pl.
+ *  Please do not modify it directly, edit the perl script instead!
+ *  function.pl options: $maxargs=10
+ *
  *  GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
  *
  *  This program is free software; you can redistribute it and/or modify
  *  GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
  *
  *  This program is free software; you can redistribute it and/or modify
 #include <vector>
 #include <ginac/exprseq.h>
 
 #include <vector>
 #include <ginac/exprseq.h>
 
-class function;
-
 // the following lines have been generated for max. 10 parameters
 #define DECLARE_FUNCTION_1P(NAME) \
 extern unsigned function_index_##NAME; \
 // the following lines have been generated for max. 10 parameters
 #define DECLARE_FUNCTION_1P(NAME) \
 extern unsigned function_index_##NAME; \
-inline function NAME(ex const & p1) { \
-    return function(function_index_##NAME, p1); \
+inline GiNaC::function NAME(GiNaC::ex const & p1) { \
+    return GiNaC::function(function_index_##NAME, p1); \
 }
 
 #define DECLARE_FUNCTION_2P(NAME) \
 extern unsigned function_index_##NAME; \
 }
 
 #define DECLARE_FUNCTION_2P(NAME) \
 extern unsigned function_index_##NAME; \
-inline function NAME(ex const & p1, ex const & p2) { \
-    return function(function_index_##NAME, p1, p2); \
+inline GiNaC::function NAME(GiNaC::ex const & p1, GiNaC::ex const & p2) { \
+    return GiNaC::function(function_index_##NAME, p1, p2); \
 }
 
 #define DECLARE_FUNCTION_3P(NAME) \
 extern unsigned function_index_##NAME; \
 }
 
 #define DECLARE_FUNCTION_3P(NAME) \
 extern unsigned function_index_##NAME; \
-inline function NAME(ex const & p1, ex const & p2, ex const & p3) { \
-    return function(function_index_##NAME, p1, p2, p3); \
+inline GiNaC::function NAME(GiNaC::ex const & p1, GiNaC::ex const & p2, GiNaC::ex const & p3) { \
+    return GiNaC::function(function_index_##NAME, p1, p2, p3); \
 }
 
 #define DECLARE_FUNCTION_4P(NAME) \
 extern unsigned function_index_##NAME; \
 }
 
 #define DECLARE_FUNCTION_4P(NAME) \
 extern unsigned function_index_##NAME; \
-inline function NAME(ex const & p1, ex const & p2, ex const & p3, ex const & p4) { \
-    return function(function_index_##NAME, p1, p2, p3, p4); \
+inline GiNaC::function NAME(GiNaC::ex const & p1, GiNaC::ex const & p2, GiNaC::ex const & p3, GiNaC::ex const & p4) { \
+    return GiNaC::function(function_index_##NAME, p1, p2, p3, p4); \
 }
 
 #define DECLARE_FUNCTION_5P(NAME) \
 extern unsigned function_index_##NAME; \
 }
 
 #define DECLARE_FUNCTION_5P(NAME) \
 extern unsigned function_index_##NAME; \
-inline function NAME(ex const & p1, ex const & p2, ex const & p3, ex const & p4, ex const & p5) { \
-    return function(function_index_##NAME, p1, p2, p3, p4, p5); \
+inline GiNaC::function NAME(GiNaC::ex const & p1, GiNaC::ex const & p2, GiNaC::ex const & p3, GiNaC::ex const & p4, GiNaC::ex const & p5) { \
+    return GiNaC::function(function_index_##NAME, p1, p2, p3, p4, p5); \
 }
 
 #define DECLARE_FUNCTION_6P(NAME) \
 extern unsigned function_index_##NAME; \
 }
 
 #define DECLARE_FUNCTION_6P(NAME) \
 extern unsigned function_index_##NAME; \
-inline function NAME(ex const & p1, ex const & p2, ex const & p3, ex const & p4, ex const & p5, ex const & p6) { \
-    return function(function_index_##NAME, p1, p2, p3, p4, p5, p6); \
+inline GiNaC::function NAME(GiNaC::ex const & p1, GiNaC::ex const & p2, GiNaC::ex const & p3, GiNaC::ex const & p4, GiNaC::ex const & p5, GiNaC::ex const & p6) { \
+    return GiNaC::function(function_index_##NAME, p1, p2, p3, p4, p5, p6); \
 }
 
 #define DECLARE_FUNCTION_7P(NAME) \
 extern unsigned function_index_##NAME; \
 }
 
 #define DECLARE_FUNCTION_7P(NAME) \
 extern unsigned function_index_##NAME; \
-inline function NAME(ex const & p1, ex const & p2, ex const & p3, ex const & p4, ex const & p5, ex const & p6, ex const & p7) { \
-    return function(function_index_##NAME, p1, p2, p3, p4, p5, p6, p7); \
+inline GiNaC::function NAME(GiNaC::ex const & p1, GiNaC::ex const & p2, GiNaC::ex const & p3, GiNaC::ex const & p4, GiNaC::ex const & p5, GiNaC::ex const & p6, GiNaC::ex const & p7) { \
+    return GiNaC::function(function_index_##NAME, p1, p2, p3, p4, p5, p6, p7); \
 }
 
 #define DECLARE_FUNCTION_8P(NAME) \
 extern unsigned function_index_##NAME; \
 }
 
 #define DECLARE_FUNCTION_8P(NAME) \
 extern unsigned function_index_##NAME; \
-inline function NAME(ex const & p1, ex const & p2, ex const & p3, ex const & p4, ex const & p5, ex const & p6, ex const & p7, ex const & p8) { \
-    return function(function_index_##NAME, p1, p2, p3, p4, p5, p6, p7, p8); \
+inline GiNaC::function NAME(GiNaC::ex const & p1, GiNaC::ex const & p2, GiNaC::ex const & p3, GiNaC::ex const & p4, GiNaC::ex const & p5, GiNaC::ex const & p6, GiNaC::ex const & p7, GiNaC::ex const & p8) { \
+    return GiNaC::function(function_index_##NAME, p1, p2, p3, p4, p5, p6, p7, p8); \
 }
 
 #define DECLARE_FUNCTION_9P(NAME) \
 extern unsigned function_index_##NAME; \
 }
 
 #define DECLARE_FUNCTION_9P(NAME) \
 extern unsigned function_index_##NAME; \
-inline function NAME(ex const & p1, ex const & p2, ex const & p3, ex const & p4, ex const & p5, ex const & p6, ex const & p7, ex const & p8, ex const & p9) { \
-    return function(function_index_##NAME, p1, p2, p3, p4, p5, p6, p7, p8, p9); \
+inline GiNaC::function NAME(GiNaC::ex const & p1, GiNaC::ex const & p2, GiNaC::ex const & p3, GiNaC::ex const & p4, GiNaC::ex const & p5, GiNaC::ex const & p6, GiNaC::ex const & p7, GiNaC::ex const & p8, GiNaC::ex const & p9) { \
+    return GiNaC::function(function_index_##NAME, p1, p2, p3, p4, p5, p6, p7, p8, p9); \
 }
 
 #define DECLARE_FUNCTION_10P(NAME) \
 extern unsigned function_index_##NAME; \
 }
 
 #define DECLARE_FUNCTION_10P(NAME) \
 extern unsigned function_index_##NAME; \
-inline function NAME(ex const & p1, ex const & p2, ex const & p3, ex const & p4, ex const & p5, ex const & p6, ex const & p7, ex const & p8, ex const & p9, ex const & p10) { \
-    return function(function_index_##NAME, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10); \
+inline GiNaC::function NAME(GiNaC::ex const & p1, GiNaC::ex const & p2, GiNaC::ex const & p3, GiNaC::ex const & p4, GiNaC::ex const & p5, GiNaC::ex const & p6, GiNaC::ex const & p7, GiNaC::ex const & p8, GiNaC::ex const & p9, GiNaC::ex const & p10) { \
+    return GiNaC::function(function_index_##NAME, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10); \
 }
 
 
 // end of generated lines
 
 #define REGISTER_FUNCTION(NAME,E,EF,D,S) \
 }
 
 
 // end of generated lines
 
 #define REGISTER_FUNCTION(NAME,E,EF,D,S) \
-unsigned function_index_##NAME=function::register_new(#NAME,E,EF,D,S);
+unsigned function_index_##NAME=GiNaC::function::register_new(#NAME,E,EF,D,S);
 
 #define BEGIN_TYPECHECK \
 bool automatic_typecheck=true;
 
 #define BEGIN_TYPECHECK \
 bool automatic_typecheck=true;
@@ -109,7 +107,7 @@ if (!is_ex_exactly_of_type(VAR,TYPE)) { \
 } else
 
 #define TYPECHECK_INTEGER(VAR) \
 } else
 
 #define TYPECHECK_INTEGER(VAR) \
-if (!(VAR).info(info_flags::integer)) { \
+if (!(VAR).info(GiNaC::info_flags::integer)) { \
     automatic_typecheck=false; \
 } else
 
     automatic_typecheck=false; \
 } else
 
@@ -119,6 +117,10 @@ if (!automatic_typecheck) { \
     return RV.hold(); \
 }
 
     return RV.hold(); \
 }
 
+namespace GiNaC {
+
+class function;
+
 typedef ex (* eval_funcp)();
 typedef ex (* evalf_funcp)();
 typedef ex (* diff_funcp)();
 typedef ex (* eval_funcp)();
 typedef ex (* evalf_funcp)();
 typedef ex (* diff_funcp)();
@@ -281,11 +283,14 @@ protected:
 // utility macros
 
 #define is_ex_the_function(OBJ, FUNCNAME) \
 // utility macros
 
 #define is_ex_the_function(OBJ, FUNCNAME) \
-    (is_ex_exactly_of_type(OBJ, function) && static_cast<function *>(OBJ.bp)->getserial() == function_index_##FUNCNAME)
+    (is_ex_exactly_of_type(OBJ, function) && static_cast<GiNaC::function *>(OBJ.bp)->getserial() == function_index_##FUNCNAME)
 
 // global constants
 
 extern const function some_function;
 extern type_info const & typeid_function;
 
 
 // global constants
 
 extern const function some_function;
 extern type_info const & typeid_function;
 
+} // namespace GiNaC
+
 #endif // ndef __GINAC_FUNCTION_H__
 #endif // ndef __GINAC_FUNCTION_H__
+
index 1a1fcbaaf073dac967107b31cf929ab2431755f0..7167d984a20a45d41c9b66f0fcf6dec2b3f641d8 100755 (executable)
@@ -32,11 +32,11 @@ sub generate {
 }
 
 $declare_function_macro=generate(
 }
 
 $declare_function_macro=generate(
-    <<'END_OF_DECLARE_FUNCTION_MACRO','ex const & p${N}','p${N}');
+    <<'END_OF_DECLARE_FUNCTION_MACRO','GiNaC::ex const & p${N}','p${N}');
 #define DECLARE_FUNCTION_${N}P(NAME) \\
 extern unsigned function_index_##NAME; \\
 #define DECLARE_FUNCTION_${N}P(NAME) \\
 extern unsigned function_index_##NAME; \\
-inline function NAME(${SEQ1}) { \\
-    return function(function_index_##NAME, ${SEQ2}); \\
+inline GiNaC::function NAME(${SEQ1}) { \\
+    return GiNaC::function(function_index_##NAME, ${SEQ2}); \\
 }
 
 END_OF_DECLARE_FUNCTION_MACRO
 }
 
 END_OF_DECLARE_FUNCTION_MACRO
@@ -119,8 +119,9 @@ END_OF_REGISTER_NEW_IMPLEMENTATION
 $interface=<<END_OF_INTERFACE;
 /** \@file function.h
  *
 $interface=<<END_OF_INTERFACE;
 /** \@file function.h
  *
- *  Interface to abstract class function (new function concept).
- *
+ *  Interface to abstract class function (new function concept). */
+
+/*
  *  This file was generated automatically by function.pl.
  *  Please do not modify it directly, edit the perl script instead!
  *  function.pl options: \$maxargs=${maxargs}
  *  This file was generated automatically by function.pl.
  *  Please do not modify it directly, edit the perl script instead!
  *  function.pl options: \$maxargs=${maxargs}
@@ -149,14 +150,12 @@ $interface=<<END_OF_INTERFACE;
 #include <vector>
 #include <ginac/exprseq.h>
 
 #include <vector>
 #include <ginac/exprseq.h>
 
-class function;
-
 // the following lines have been generated for max. ${maxargs} parameters
 $declare_function_macro
 // end of generated lines
 
 #define REGISTER_FUNCTION(NAME,E,EF,D,S) \\
 // the following lines have been generated for max. ${maxargs} parameters
 $declare_function_macro
 // end of generated lines
 
 #define REGISTER_FUNCTION(NAME,E,EF,D,S) \\
-unsigned function_index_##NAME=function::register_new(#NAME,E,EF,D,S);
+unsigned function_index_##NAME=GiNaC::function::register_new(#NAME,E,EF,D,S);
 
 #define BEGIN_TYPECHECK \\
 bool automatic_typecheck=true;
 
 #define BEGIN_TYPECHECK \\
 bool automatic_typecheck=true;
@@ -167,7 +166,7 @@ if (!is_ex_exactly_of_type(VAR,TYPE)) { \\
 } else
 
 #define TYPECHECK_INTEGER(VAR) \\
 } else
 
 #define TYPECHECK_INTEGER(VAR) \\
-if (!(VAR).info(info_flags::integer)) { \\
+if (!(VAR).info(GiNaC::info_flags::integer)) { \\
     automatic_typecheck=false; \\
 } else
 
     automatic_typecheck=false; \\
 } else
 
@@ -177,6 +176,10 @@ if (!automatic_typecheck) { \\
     return RV.hold(); \\
 }
 
     return RV.hold(); \\
 }
 
+namespace GiNaC {
+
+class function;
+
 typedef ex (* eval_funcp)();
 typedef ex (* evalf_funcp)();
 typedef ex (* diff_funcp)();
 typedef ex (* eval_funcp)();
 typedef ex (* evalf_funcp)();
 typedef ex (* diff_funcp)();
@@ -269,13 +272,15 @@ protected:
 // utility macros
 
 #define is_ex_the_function(OBJ, FUNCNAME) \\
 // utility macros
 
 #define is_ex_the_function(OBJ, FUNCNAME) \\
-    (is_ex_exactly_of_type(OBJ, function) && static_cast<function *>(OBJ.bp)->getserial() == function_index_##FUNCNAME)
+    (is_ex_exactly_of_type(OBJ, function) && static_cast<GiNaC::function *>(OBJ.bp)->getserial() == function_index_##FUNCNAME)
 
 // global constants
 
 extern const function some_function;
 extern type_info const & typeid_function;
 
 
 // global constants
 
 extern const function some_function;
 extern type_info const & typeid_function;
 
+} // namespace GiNaC
+
 #endif // ndef __GINAC_FUNCTION_H__
 
 END_OF_INTERFACE
 #endif // ndef __GINAC_FUNCTION_H__
 
 END_OF_INTERFACE
@@ -283,8 +288,9 @@ END_OF_INTERFACE
 $implementation=<<END_OF_IMPLEMENTATION;
 /** \@file function.cpp
  *
 $implementation=<<END_OF_IMPLEMENTATION;
 /** \@file function.cpp
  *
- *  Implementation of class function.
- *
+ *  Implementation of class function. */
+
+/*
  *  This file was generated automatically by function.pl.
  *  Please do not modify it directly, edit the perl script instead!
  *  function.pl options: \$maxargs=${maxargs}
  *  This file was generated automatically by function.pl.
  *  Please do not modify it directly, edit the perl script instead!
  *  function.pl options: \$maxargs=${maxargs}
@@ -311,6 +317,9 @@ $implementation=<<END_OF_IMPLEMENTATION;
 
 #include "function.h"
 #include "ex.h"
 
 #include "function.h"
 #include "ex.h"
+#include "debugmsg.h"
+
+namespace GiNaC {
 
 //////////
 // default constructor, destructor, copy constructor assignment operator and helpers
 
 //////////
 // default constructor, destructor, copy constructor assignment operator and helpers
@@ -629,6 +638,8 @@ $register_new_implementation
 const function some_function;
 type_info const & typeid_function=typeid(some_function);
 
 const function some_function;
 type_info const & typeid_function=typeid(some_function);
 
+} // namespace GiNaC
+
 END_OF_IMPLEMENTATION
 
 print "Creating interface file function.h...";
 END_OF_IMPLEMENTATION
 
 print "Creating interface file function.h...";
index c9661091b629610eb064ae563d9481f61320b51c..23864bc21fd959a718ef0cf6ff140c2e85398cff 100644 (file)
@@ -60,6 +60,6 @@
 #include <ginac/isospin.h>
 #include <ginac/lorentzidx.h>
 #include <ginac/simp_lor.h>
 #include <ginac/isospin.h>
 #include <ginac/lorentzidx.h>
 #include <ginac/simp_lor.h>
-#endif /* ndef GINAC_BASE_ONLY */
+#endif // ndef GINAC_BASE_ONLY
 
 
-#endif /* ndef __GINAC_H__ */
+#endif // ndef __GINAC_H__
index 8de753c1a94a087718644f254a1d7e1f646504b4..26e91ff87f7444bfb40d6d3300389d6fc8214034 100644 (file)
@@ -27,6 +27,9 @@
 #include "lst.h"
 #include "relational.h"
 #include "utils.h"
 #include "lst.h"
 #include "relational.h"
 #include "utils.h"
+#include "debugmsg.h"
+
+namespace GiNaC {
 
 //////////
 // default constructor, destructor, copy constructor assignment operator and helpers
 
 //////////
 // default constructor, destructor, copy constructor assignment operator and helpers
@@ -443,6 +446,4 @@ ex subs_indices(ex const & e, exvector const & idxv_subs,
     return res;
 }
 
     return res;
 }
 
-
-
-
+} // namespace GiNaC
index 2faced84ad9f152fa3938aaa5739aac37a138c64..fa0b8ce35f952170fe926e62ea9e7d33f636a804 100644 (file)
@@ -26,6 +26,9 @@
 #include <string>
 #include <vector>
 #include <ginac/basic.h>
 #include <string>
 #include <vector>
 #include <ginac/basic.h>
+#include <ginac/ex.h>
+
+namespace GiNaC {
 
 class idx : public basic
 {
 
 class idx : public basic
 {
@@ -89,11 +92,13 @@ protected:
 extern const idx some_idx;
 extern type_info const & typeid_idx;
 
 extern const idx some_idx;
 extern type_info const & typeid_idx;
 
-// macros
-
-#define ex_to_idx(X) (static_cast<idx const &>(*(X).bp))
+// utility functions
+inline const idx &ex_to_idx(const ex &e)
+{
+       return static_cast<const idx &>(*e.bp);
+}
 
 
-// other functions
+// global functions
 
 typedef vector<ex> exvector;
 
 
 typedef vector<ex> exvector;
 
@@ -106,4 +111,6 @@ ex subs_indices(ex const & e, exvector const & idxv_contra,
                 exvector const & idxv_co);
 unsigned count_index(ex const & e, ex const & i);
 
                 exvector const & idxv_co);
 unsigned count_index(ex const & e, ex const & i);
 
+} // namespace GiNaC
+
 #endif // ndef __GINAC_IDX_H__
 #endif // ndef __GINAC_IDX_H__
index 0804330bfbc86549a530a51d1ac607449e786d54..48a8c94801c4c7c9bc8a345b0218d57f2e1ed109 100644 (file)
@@ -25,6 +25,9 @@
 #include "indexed.h"
 #include "ex.h"
 #include "idx.h"
 #include "indexed.h"
 #include "ex.h"
 #include "idx.h"
+#include "debugmsg.h"
+
+namespace GiNaC {
 
 //////////
 // default constructor, destructor, copy constructor assignment operator and helpers
 
 //////////
 // default constructor, destructor, copy constructor assignment operator and helpers
@@ -289,3 +292,4 @@ bool indexed::all_of_type_idx(void) const
 const indexed some_indexed;
 type_info const & typeid_indexed=typeid(some_indexed);
 
 const indexed some_indexed;
 type_info const & typeid_indexed=typeid(some_indexed);
 
+} // namespace GiNaC
index 7f13af51bef0439451a090652f67f9d811f996bc..3707e6290184d56d613b135a3ab0c7536a3df1ca 100644 (file)
@@ -26,6 +26,8 @@
 #include <string>
 #include <ginac/exprseq.h>
 
 #include <string>
 #include <ginac/exprseq.h>
 
+namespace GiNaC {
+
 /** Base class for non-commutative indexed objects */
 class indexed : public exprseq
 {
 /** Base class for non-commutative indexed objects */
 class indexed : public exprseq
 {
@@ -86,10 +88,12 @@ protected:
 extern const indexed some_indexed;
 extern type_info const & typeid_indexed;
 
 extern const indexed some_indexed;
 extern type_info const & typeid_indexed;
 
-// macros
+// utility functions
+inline const indexed &ex_to_indexed(const ex &e)
+{
+       return static_cast<const indexed &>(*e.bp);
+}
 
 
-#define ex_to_indexed(X) static_cast<indexed const &>(*(X).bp)
+} // namespace GiNaC
 
 #endif // ndef __GINAC_INDEXED_H__
 
 #endif // ndef __GINAC_INDEXED_H__
-
-
index f9b797ee6eeb7d2297355538a5337cfecf5136a1..5eb4466cc72b710865d8842e4aa935fecdc858f5 100644 (file)
@@ -36,6 +36,8 @@
 #include "series.h"
 #include "symbol.h"
 
 #include "series.h"
 #include "symbol.h"
 
+namespace GiNaC {
+
 //////////
 // dilogarithm
 //////////
 //////////
 // dilogarithm
 //////////
@@ -244,3 +246,5 @@ ex ncpower(ex const &basis, unsigned exponent)
 
     return ncmul(v,1);
 }
 
     return ncmul(v,1);
 }
+
+} // namespace GiNaC
index f4af0cb87465cc6379ea41c89dc16c57125dc658..42f3838919635a98b95f989e98a2d823d68cfe1c 100644 (file)
@@ -26,6 +26,8 @@
 #include <ginac/function.h>
 #include <ginac/ex.h>
 
 #include <ginac/function.h>
 #include <ginac/ex.h>
 
+namespace GiNaC {
+
 /** Sine. */
 DECLARE_FUNCTION_1P(sin)
 
 /** Sine. */
 DECLARE_FUNCTION_1P(sin)
 
@@ -98,4 +100,6 @@ inline bool is_order_function(ex const & e)
        return is_ex_the_function(e, Order);
 }
 
        return is_ex_the_function(e, Order);
 }
 
+} // namespace GiNaC
+
 #endif // ndef __GINAC_INIFCNS_H__
 #endif // ndef __GINAC_INIFCNS_H__
index 34a390ed23e23e1b412609399f926328596570cf..5683fd21328d91133d8f311cd6f8e804d77495fe 100644 (file)
@@ -30,6 +30,8 @@
 #include "power.h"
 #include "symbol.h"
 
 #include "power.h"
 #include "symbol.h"
 
+namespace GiNaC {
+
 //////////
 // gamma function
 //////////
 //////////
 // gamma function
 //////////
@@ -87,12 +89,12 @@ ex gamma_diff(ex const & x, unsigned diff_param)
 {
     ASSERT(diff_param==0);
 
 {
     ASSERT(diff_param==0);
 
-    return power(x, -1);       //!!
+    return power(x, -1);       // FIXME
 }
 
 ex gamma_series(ex const & x, symbol const & s, ex const & point, int order)
 {
 }
 
 ex gamma_series(ex const & x, symbol const & s, ex const & point, int order)
 {
-       //!! Only handle one special case for now...
+       // FIXME: Only handle one special case for now...
        if (x.is_equal(s) && point.is_zero()) {
                ex e = 1 / s - EulerGamma + s * (power(Pi, 2) / 12 + power(EulerGamma, 2) / 2) + Order(power(s, 2));
                return e.series(s, point, order);
        if (x.is_equal(s) && point.is_zero()) {
                ex e = 1 / s - EulerGamma + s * (power(Pi, 2) / 12 + power(EulerGamma, 2) / 2) + Order(power(s, 2));
                return e.series(s, point, order);
@@ -101,3 +103,5 @@ ex gamma_series(ex const & x, symbol const & s, ex const & point, int order)
 }
 
 REGISTER_FUNCTION(gamma, gamma_eval, gamma_evalf, gamma_diff, gamma_series);
 }
 
 REGISTER_FUNCTION(gamma, gamma_eval, gamma_evalf, gamma_diff, gamma_series);
+
+} // namespace GiNaC
index 410657333ec68e4bc97903ffa5782c6c2e754228..e26050a6453d93b45a7128267b0a8dbd9ff7436a 100644 (file)
@@ -30,6 +30,8 @@
 #include "numeric.h"
 #include "power.h"
 
 #include "numeric.h"
 #include "power.h"
 
+namespace GiNaC {
+
 //////////
 // exponential function
 //////////
 //////////
 // exponential function
 //////////
@@ -737,3 +739,5 @@ ex atanh_diff(ex const & x, unsigned diff_param)
 }
 
 REGISTER_FUNCTION(atanh, atanh_eval, atanh_evalf, atanh_diff, NULL);
 }
 
 REGISTER_FUNCTION(atanh, atanh_eval, atanh_evalf, atanh_diff, NULL);
+
+} // namespace GiNaC
index 3cc6b5e12219a0582dbbecb49c27616be027b504..672ea924bf81c60193cbbfb7769d8832a4b9be34 100644 (file)
@@ -27,6 +27,9 @@
 #include "ex.h"
 #include "ncmul.h"
 #include "utils.h"
 #include "ex.h"
 #include "ncmul.h"
 #include "utils.h"
+#include "debugmsg.h"
+
+namespace GiNaC {
 
 //////////
 // default constructor, destructor, copy constructor assignment operator and helpers
 
 //////////
 // default constructor, destructor, copy constructor assignment operator and helpers
@@ -208,3 +211,4 @@ unsigned isospin::next_serial=0;
 const isospin some_isospin;
 type_info const & typeid_isospin=typeid(some_isospin);
 
 const isospin some_isospin;
 type_info const & typeid_isospin=typeid(some_isospin);
 
+} // namespace GiNaC
index 81c96dc39581f137c08f1b850df9453ec5632012..c4d23864ea39989c31df26c5d0776aa4b35a40fe 100644 (file)
@@ -26,6 +26,8 @@
 #include <string>
 #include <ginac/indexed.h>
 
 #include <string>
 #include <ginac/indexed.h>
 
+namespace GiNaC {
+
 /** Base class for isospin object */
 class isospin : public indexed
 {
 /** Base class for isospin object */
 class isospin : public indexed
 {
@@ -81,10 +83,12 @@ private:
 extern const isospin some_isospin;
 extern type_info const & typeid_isospin;
 
 extern const isospin some_isospin;
 extern type_info const & typeid_isospin;
 
-// macros
+// utility functions
+inline const isospin &ex_to_isospin(const ex &e)
+{
+       return static_cast<const isospin &>(*e.bp);
+}
 
 
-#define ex_to_isospin(X) static_cast<isospin const &>(*(X).bp)
+} // namespace GiNaC
 
 #endif // ndef __GINAC_ISOSPIN_H__
 
 #endif // ndef __GINAC_ISOSPIN_H__
-
-
index 3719f15b672a86e0bdb8c002627a9542601cd860..3e69d30d4be37b66c61db6a7d50cf6e914123321 100644 (file)
@@ -24,6 +24,9 @@
 
 #include "lorentzidx.h"
 #include "utils.h"
 
 #include "lorentzidx.h"
 #include "utils.h"
+#include "debugmsg.h"
+
+namespace GiNaC {
 
 //////////
 // default constructor, destructor, copy constructor assignment operator and helpers
 
 //////////
 // default constructor, destructor, copy constructor assignment operator and helpers
@@ -248,5 +251,4 @@ lorentzidx lorentzidx::create_anonymous_representative(void) const
 const lorentzidx some_lorentzidx;
 type_info const & typeid_lorentzidx=typeid(some_lorentzidx);
 
 const lorentzidx some_lorentzidx;
 type_info const & typeid_lorentzidx=typeid(some_lorentzidx);
 
-
-
+} // namespace GiNaC
index 7fc2a05def876c699581f2970f4bc2c2a90f7d9e..1a429021ef9abb0cc2550c0c13143ccbca47b393 100644 (file)
@@ -27,6 +27,8 @@
 #include <vector>
 #include <ginac/idx.h>
 
 #include <vector>
 #include <ginac/idx.h>
 
+namespace GiNaC {
+
 class lorentzidx : public idx
 {
     friend class simp_lor;
 class lorentzidx : public idx
 {
     friend class simp_lor;
@@ -81,8 +83,12 @@ protected:
 extern const lorentzidx some_lorentzidx;
 extern type_info const & typeid_lorentzidx;
 
 extern const lorentzidx some_lorentzidx;
 extern type_info const & typeid_lorentzidx;
 
-// macros
+// utility functions
+inline const lorentzidx &ex_to_lorentzidx(const ex &e)
+{
+       return static_cast<const lorentzidx &>(*e.bp);
+}
 
 
-#define ex_to_lorentzidx(X) (static_cast<lorentzidx const &>(*(X).bp))
+} // namespace GiNaC
 
 #endif // ndef __GINAC_LORENTZIDX_H__
 
 #endif // ndef __GINAC_LORENTZIDX_H__
index b05c48aa068abc57d8dcd8e1d42b0a77c4ec322d..a71f5dda9f00ab54a68e837b827e972e01c75a49 100644 (file)
@@ -1,6 +1,8 @@
 /** @file lst.cpp
  *
 /** @file lst.cpp
  *
- *  Implementation of GiNaC's lst. 
+ *  Implementation of GiNaC's lst. */
+
+/*
  *  This file was generated automatically by container.pl.
  *  Please do not modify it directly, edit the perl script instead!
  *  container.pl options: $CONTAINER=lst
  *  This file was generated automatically by container.pl.
  *  Please do not modify it directly, edit the perl script instead!
  *  container.pl options: $CONTAINER=lst
@@ -9,9 +11,8 @@
  *                        $prepend=1
  *                        $let_op=1
  *                        $open_bracket=[
  *                        $prepend=1
  *                        $let_op=1
  *                        $open_bracket=[
- *                        $close_bracket=] */
-
-/*
+ *                        $close_bracket=]
+ *
  *  GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
  *
  *  This program is free software; you can redistribute it and/or modify
  *  GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -34,6 +35,9 @@
 
 #include "lst.h"
 #include "ex.h"
 
 #include "lst.h"
 #include "ex.h"
+#include "debugmsg.h"
+
+namespace GiNaC {
 
 #define RESERVE(s,size) // no reserve needed for list
 
 
 #define RESERVE(s,size) // no reserve needed for list
 
@@ -628,3 +632,5 @@ unsigned lst::precedence=10;
 const lst some_lst;
 type_info const & typeid_lst=typeid(some_lst);
 
 const lst some_lst;
 type_info const & typeid_lst=typeid(some_lst);
 
+} // namespace GiNaC
+
index beeb9a3daee69b7f14c82f049381265ca538135c..901638e5b8c72411b8d26078c7dcaf903b002392 100644 (file)
@@ -1,6 +1,8 @@
 /** @file lst.h
  *
 /** @file lst.h
  *
- *  Definition of GiNaC's lst. 
+ *  Definition of GiNaC's lst. */
+
+/*
  *  This file was generated automatically by container.pl.
  *  Please do not modify it directly, edit the perl script instead!
  *  container.pl options: $CONTAINER=lst
  *  This file was generated automatically by container.pl.
  *  Please do not modify it directly, edit the perl script instead!
  *  container.pl options: $CONTAINER=lst
@@ -9,9 +11,8 @@
  *                        $prepend=1
  *                        $let_op=1
  *                        $open_bracket=[
  *                        $prepend=1
  *                        $let_op=1
  *                        $open_bracket=[
- *                        $close_bracket=] */
-
-/*
+ *                        $close_bracket=]
+ *
  *  GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
  *
  *  This program is free software; you can redistribute it and/or modify
  *  GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -34,6 +35,9 @@
 
 #include <list>
 #include <ginac/basic.h>
 
 #include <list>
 #include <ginac/basic.h>
+#include <ginac/ex.h>
+
+namespace GiNaC {
 
 typedef list<ex> exlist;
 
 
 typedef list<ex> exlist;
 
@@ -125,9 +129,13 @@ protected:
 extern const lst some_lst;
 extern type_info const & typeid_lst;
 
 extern const lst some_lst;
 extern type_info const & typeid_lst;
 
-// macros
+// utility functions
+inline const lst &ex_to_lst(const ex &e)
+{
+    return static_cast<const lst &>(*e.bp);
+}
 
 
-#define ex_to_lst(X) (static_cast<lst const &>(*(X).bp))
+} // namespace GiNaC
 
 #endif // ndef __GINAC_LST_H__
 
 
 #endif // ndef __GINAC_LST_H__
 
index 71463df7135af932fec5f52f17e29af677769f6a..927a503ce9c620d71d1331fa4703b1327c035a94 100644 (file)
 
 #include "lst.h"
 
 
 #include "lst.h"
 
+namespace GiNaC {
+
 bool lst::info(unsigned inf) const
 {
     if (inf==info_flags::list) return 1;
     return basic::info(inf);
 }
 
 bool lst::info(unsigned inf) const
 {
     if (inf==info_flags::list) return 1;
     return basic::info(inf);
 }
 
-
+} // namespace GiNaC
index 34d5f2f93c008a0deeac8aeaf0e4aff64992ed18..3fd31fcb739791425b6ae41a17fc008ad5bb98e9 100644 (file)
@@ -24,6 +24,9 @@
 #include <stdexcept>
 
 #include "matrix.h"
 #include <stdexcept>
 
 #include "matrix.h"
+#include "debugmsg.h"
+
+namespace GiNaC {
 
 //////////
 // default constructor, destructor, copy constructor, assignment operator
 
 //////////
 // default constructor, destructor, copy constructor, assignment operator
@@ -868,3 +871,5 @@ int matrix::pivot(int ro)
 
 const matrix some_matrix;
 type_info const & typeid_matrix=typeid(some_matrix);
 
 const matrix some_matrix;
 type_info const & typeid_matrix=typeid(some_matrix);
+
+} // namespace GiNaC
index 235fbda4905fdcb0f387a061d3b41ee07d6eb8fc..769647cacdeede3685ec276e804e774c814783b0 100644 (file)
@@ -27,6 +27,8 @@
 #include <ginac/basic.h>
 #include <ginac/ex.h>
 
 #include <ginac/basic.h>
 #include <ginac/ex.h>
 
+namespace GiNaC {
+
 /** Symbolic matrices. */
 class matrix : public basic
 {
 /** Symbolic matrices. */
 class matrix : public basic
 {
@@ -144,8 +146,12 @@ inline ex charpoly(matrix const & m, ex const & lambda)
 inline matrix inverse(matrix const & m)
 { return m.inverse(); }
 
 inline matrix inverse(matrix const & m)
 { return m.inverse(); }
 
-// macros
+// utility functions
+inline const matrix &ex_to_matrix(const ex &e)
+{
+       return static_cast<const matrix &>(*e.bp);
+}
 
 
-#define ex_to_matrix(X) (static_cast<matrix const &>(*(X).bp))
+} // namespace GiNaC
 
 #endif // ndef __GINAC_MATRIX_H__
 
 #endif // ndef __GINAC_MATRIX_H__
index e3cbd78a1575a33a897540e319d7a8c89de754c9..5054fb06af5871d5e04bd5ab6a61198dda2817b1 100644 (file)
@@ -26,6 +26,9 @@
 #include "mul.h"
 #include "add.h"
 #include "power.h"
 #include "mul.h"
 #include "add.h"
 #include "power.h"
+#include "debugmsg.h"
+
+namespace GiNaC {
 
 //////////
 // default constructor, destructor, copy constructor assignment operator and helpers
 
 //////////
 // default constructor, destructor, copy constructor assignment operator and helpers
@@ -1011,4 +1014,4 @@ unsigned mul::precedence=50;
 const mul some_mul;
 type_info const & typeid_mul=typeid(some_mul);
 
 const mul some_mul;
 type_info const & typeid_mul=typeid(some_mul);
 
-
+} // namespace GiNaC
index 46b3791e40c3243e72726002ceba69b1833b59b4..4e5a6e63846c10703c06d6d5742671fdc55bef8a 100644 (file)
@@ -25,6 +25,8 @@
 
 #include <ginac/expairseq.h>
 
 
 #include <ginac/expairseq.h>
 
+namespace GiNaC {
+
 /** Product of expressions. */
 class mul : public expairseq
 {
 /** Product of expressions. */
 class mul : public expairseq
 {
@@ -113,6 +115,12 @@ protected:
 extern const mul some_mul;
 extern type_info const & typeid_mul;
 
 extern const mul some_mul;
 extern type_info const & typeid_mul;
 
-#define ex_to_mul(X) static_cast<mul const &>(*(X).bp)
+// utility functions
+inline const mul &ex_to_mul(const ex &e)
+{
+       return static_cast<const mul &>(*e.bp);
+}
+
+} // namespace GiNaC
 
 #endif // ndef __GINAC_MUL_H__
 
 #endif // ndef __GINAC_MUL_H__
index 74c395460017d3a43d8f1040305191aeb23fbb26..7d2364e2e6107650473707347fa48b524087786a 100644 (file)
@@ -28,6 +28,9 @@
 #include "ex.h"
 #include "add.h"
 #include "mul.h"
 #include "ex.h"
 #include "add.h"
 #include "mul.h"
+#include "debugmsg.h"
+
+namespace GiNaC {
 
 //////////
 // default constructor, destructor, copy constructor assignment operator and helpers
 
 //////////
 // default constructor, destructor, copy constructor assignment operator and helpers
@@ -588,4 +591,4 @@ ex simplified_ncmul(exvector const & v)
                                    status_flags::evaluated);
 }
 
                                    status_flags::evaluated);
 }
 
-
+} // namespace GiNaC
index 458c5ecc159e6fa79b34da327e5b94751b3f4b1d..03b47ca7ae119c9337a31045f0c509469265ba7b 100644 (file)
@@ -25,6 +25,8 @@
 
 #include <ginac/exprseq.h>
 
 
 #include <ginac/exprseq.h>
 
+namespace GiNaC {
+
 /** Non-commutative product of expressions. */
 class ncmul : public exprseq
 {
 /** Non-commutative product of expressions. */
 class ncmul : public exprseq
 {
@@ -106,7 +108,12 @@ extern type_info const & typeid_ncmul;
 ex nonsimplified_ncmul(exvector const & v);
 ex simplified_ncmul(exvector const & v);
 
 ex nonsimplified_ncmul(exvector const & v);
 ex simplified_ncmul(exvector const & v);
 
-#define ex_to_ncmul(X) static_cast<ncmul const &>(*(X).bp)
+// utility functions
+inline const ncmul &ex_to_ncmul(const ex &e)
+{
+       return static_cast <const ncmul &>(*e.bp);
+}
+
+} // namespace GiNaC
 
 #endif // ndef __GINAC_NCMUL_H__
 
 #endif // ndef __GINAC_NCMUL_H__
-
index 65c810980816a921c583b5d9b5c812b0f38b3ebd..82fcaf848dd250ea14106dab40a9b0d87b40edf2 100644 (file)
@@ -25,6 +25,8 @@
  */
 
 #include <stdexcept>
  */
 
 #include <stdexcept>
+#include <algorithm>
+#include <map>
 
 #include "normal.h"
 #include "basic.h"
 
 #include "normal.h"
 #include "basic.h"
@@ -44,6 +46,8 @@
 #include "series.h"
 #include "symbol.h"
 
 #include "series.h"
 #include "symbol.h"
 
+namespace GiNaC {
+
 // If comparing expressions (ex::compare()) is fast, you can set this to 1.
 // Some routines like quo(), rem() and gcd() will then return a quick answer
 // when they are called with two identical arguments.
 // If comparing expressions (ex::compare()) is fast, you can set this to 1.
 // Some routines like quo(), rem() and gcd() will then return a quick answer
 // when they are called with two identical arguments.
@@ -82,8 +86,6 @@ static bool get_first_symbol(const ex &e, const symbol *&x)
  *  Statistical information about symbols in polynomials
  */
 
  *  Statistical information about symbols in polynomials
  */
 
-#include <algorithm>
-
 /** This structure holds information about the highest and lowest degrees
  *  in which a symbol appears in two multivariate polynomials "a" and "b".
  *  A vector of these structures with information about all symbols in
 /** This structure holds information about the highest and lowest degrees
  *  in which a symbol appears in two multivariate polynomials "a" and "b".
  *  A vector of these structures with information about all symbols in
@@ -489,8 +491,6 @@ bool divide(const ex &a, const ex &b, ex &q, bool check_args)
  *  Remembering
  */
 
  *  Remembering
  */
 
-#include <map>
-
 typedef pair<ex, ex> ex2;
 typedef pair<ex, bool> exbool;
 
 typedef pair<ex, ex> ex2;
 typedef pair<ex, bool> exbool;
 
@@ -908,7 +908,7 @@ ex basic::smod(const numeric &xi) const
 
 ex numeric::smod(const numeric &xi) const
 {
 
 ex numeric::smod(const numeric &xi) const
 {
-    return ::smod(*this, xi);
+    return GiNaC::smod(*this, xi);
 }
 
 ex add::smod(const numeric &xi) const
 }
 
 ex add::smod(const numeric &xi) const
@@ -919,13 +919,13 @@ ex add::smod(const numeric &xi) const
     epvector::const_iterator itend = seq.end();
     while (it != itend) {
         ASSERT(!is_ex_exactly_of_type(it->rest,numeric));
     epvector::const_iterator itend = seq.end();
     while (it != itend) {
         ASSERT(!is_ex_exactly_of_type(it->rest,numeric));
-        numeric coeff = ::smod(ex_to_numeric(it->coeff), xi);
+        numeric coeff = GiNaC::smod(ex_to_numeric(it->coeff), xi);
         if (!coeff.is_zero())
             newseq.push_back(expair(it->rest, coeff));
         it++;
     }
     ASSERT(is_ex_exactly_of_type(overall_coeff,numeric));
         if (!coeff.is_zero())
             newseq.push_back(expair(it->rest, coeff));
         it++;
     }
     ASSERT(is_ex_exactly_of_type(overall_coeff,numeric));
-    numeric coeff = ::smod(ex_to_numeric(overall_coeff), xi);
+    numeric coeff = GiNaC::smod(ex_to_numeric(overall_coeff), xi);
     return (new add(newseq,coeff))->setflag(status_flags::dynallocated);
 }
 
     return (new add(newseq,coeff))->setflag(status_flags::dynallocated);
 }
 
@@ -941,7 +941,7 @@ ex mul::smod(const numeric &xi) const
 #endif // def DOASSERT
     mul * mulcopyp=new mul(*this);
     ASSERT(is_ex_exactly_of_type(overall_coeff,numeric));
 #endif // def DOASSERT
     mul * mulcopyp=new mul(*this);
     ASSERT(is_ex_exactly_of_type(overall_coeff,numeric));
-    mulcopyp->overall_coeff=::smod(ex_to_numeric(overall_coeff),xi);
+    mulcopyp->overall_coeff = GiNaC::smod(ex_to_numeric(overall_coeff),xi);
     mulcopyp->clearflag(status_flags::evaluated);
     mulcopyp->clearflag(status_flags::hash_calculated);
     return mulcopyp->setflag(status_flags::dynallocated);
     mulcopyp->clearflag(status_flags::evaluated);
     mulcopyp->clearflag(status_flags::hash_calculated);
     return mulcopyp->setflag(status_flags::dynallocated);
@@ -1484,3 +1484,5 @@ ex ex::normal(int level) const
     else
         return e;
 }
     else
         return e;
 }
+
+} // namespace GiNaC
index 879e0d4d452cfec697c630f58d7e47024d7187c1..0fa3a4418b4f4876cbedb70fa4ab0ac09c28b3cc 100644 (file)
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#ifndef NORMAL_H
-#define NORMAL_H
+#ifndef __GINAC_NORMAL_H__
+#define __GINAC_NORMAL_H__
+
+namespace GiNaC {
 
 class ex;
 class symbol;
 
 class ex;
 class symbol;
@@ -48,4 +50,6 @@ extern ex lcm(const ex &a, const ex &b, bool check_args = true);
 // Square-free factorization of a polynomial a(x)
 extern ex sqrfree(const ex &a, const symbol &x);
 
 // Square-free factorization of a polynomial a(x)
 extern ex sqrfree(const ex &a, const symbol &x);
 
-#endif
+} // namespace GiNaC
+
+#endif // ndef __GINAC_NORMAL_H__
index 126a4b25f4e1ece391e80de05f9698f54f673ff5..8609740e70d34a65af7e74311004a820aed78663 100644 (file)
@@ -30,6 +30,7 @@
 #include "numeric.h"
 #include "ex.h"
 #include "config.h"
 #include "numeric.h"
 #include "ex.h"
 #include "config.h"
+#include "debugmsg.h"
 
 // CLN should not pollute the global namespace, hence we include it here
 // instead of in some header file where it would propagate to other parts:
 
 // CLN should not pollute the global namespace, hence we include it here
 // instead of in some header file where it would propagate to other parts:
@@ -39,6 +40,8 @@
 #include <cln.h>
 #endif
 
 #include <cln.h>
 #endif
 
+namespace GiNaC {
+
 // linker has no problems finding text symbols for numerator or denominator
 //#define SANE_LINKER
 
 // linker has no problems finding text symbols for numerator or denominator
 //#define SANE_LINKER
 
@@ -851,7 +854,7 @@ const numeric some_numeric;
 type_info const & typeid_numeric=typeid(some_numeric);
 /** Imaginary unit.  This is not a constant but a numeric since we are
  *  natively handing complex numbers anyways. */
 type_info const & typeid_numeric=typeid(some_numeric);
 /** Imaginary unit.  This is not a constant but a numeric since we are
  *  natively handing complex numbers anyways. */
-const numeric I = (complex(cl_I(0),cl_I(1)));
+const numeric I = numeric(complex(cl_I(0),cl_I(1)));
 
 //////////
 // global functions
 
 //////////
 // global functions
@@ -904,7 +907,7 @@ numeric const & numHALF(void)
  *  @return  arbitrary precision numerical exp(x). */
 numeric exp(numeric const & x)
 {
  *  @return  arbitrary precision numerical exp(x). */
 numeric exp(numeric const & x)
 {
-    return exp(*x.value);  // -> CLN
+    return ::exp(*x.value);  // -> CLN
 }
 
 /** Natural logarithm.
 }
 
 /** Natural logarithm.
@@ -916,7 +919,7 @@ numeric log(numeric const & z)
 {
     if (z.is_zero())
         throw (std::overflow_error("log(): logarithmic singularity"));
 {
     if (z.is_zero())
         throw (std::overflow_error("log(): logarithmic singularity"));
-    return log(*z.value);  // -> CLN
+    return ::log(*z.value);  // -> CLN
 }
 
 /** Numeric sine (trigonometric function).
 }
 
 /** Numeric sine (trigonometric function).
@@ -924,7 +927,7 @@ numeric log(numeric const & z)
  *  @return  arbitrary precision numerical sin(x). */
 numeric sin(numeric const & x)
 {
  *  @return  arbitrary precision numerical sin(x). */
 numeric sin(numeric const & x)
 {
-    return sin(*x.value);  // -> CLN
+    return ::sin(*x.value);  // -> CLN
 }
 
 /** Numeric cosine (trigonometric function).
 }
 
 /** Numeric cosine (trigonometric function).
@@ -932,7 +935,7 @@ numeric sin(numeric const & x)
  *  @return  arbitrary precision numerical cos(x). */
 numeric cos(numeric const & x)
 {
  *  @return  arbitrary precision numerical cos(x). */
 numeric cos(numeric const & x)
 {
-    return cos(*x.value);  // -> CLN
+    return ::cos(*x.value);  // -> CLN
 }
     
 /** Numeric tangent (trigonometric function).
 }
     
 /** Numeric tangent (trigonometric function).
@@ -940,7 +943,7 @@ numeric cos(numeric const & x)
  *  @return  arbitrary precision numerical tan(x). */
 numeric tan(numeric const & x)
 {
  *  @return  arbitrary precision numerical tan(x). */
 numeric tan(numeric const & x)
 {
-    return tan(*x.value);  // -> CLN
+    return ::tan(*x.value);  // -> CLN
 }
     
 /** Numeric inverse sine (trigonometric function).
 }
     
 /** Numeric inverse sine (trigonometric function).
@@ -948,7 +951,7 @@ numeric tan(numeric const & x)
  *  @return  arbitrary precision numerical asin(x). */
 numeric asin(numeric const & x)
 {
  *  @return  arbitrary precision numerical asin(x). */
 numeric asin(numeric const & x)
 {
-    return asin(*x.value);  // -> CLN
+    return ::asin(*x.value);  // -> CLN
 }
     
 /** Numeric inverse cosine (trigonometric function).
 }
     
 /** Numeric inverse cosine (trigonometric function).
@@ -956,7 +959,7 @@ numeric asin(numeric const & x)
  *  @return  arbitrary precision numerical acos(x). */
 numeric acos(numeric const & x)
 {
  *  @return  arbitrary precision numerical acos(x). */
 numeric acos(numeric const & x)
 {
-    return acos(*x.value);  // -> CLN
+    return ::acos(*x.value);  // -> CLN
 }
     
 /** Arcustangents.
 }
     
 /** Arcustangents.
@@ -970,7 +973,7 @@ numeric atan(numeric const & x)
         x.real().is_zero() &&
         !abs(x.imag()).is_equal(numONE()))
         throw (std::overflow_error("atan(): logarithmic singularity"));
         x.real().is_zero() &&
         !abs(x.imag()).is_equal(numONE()))
         throw (std::overflow_error("atan(): logarithmic singularity"));
-    return atan(*x.value);  // -> CLN
+    return ::atan(*x.value);  // -> CLN
 }
 
 /** Arcustangents.
 }
 
 /** Arcustangents.
@@ -981,7 +984,7 @@ numeric atan(numeric const & x)
 numeric atan(numeric const & y, numeric const & x)
 {
     if (x.is_real() && y.is_real())
 numeric atan(numeric const & y, numeric const & x)
 {
     if (x.is_real() && y.is_real())
-        return atan(realpart(*x.value), realpart(*y.value));  // -> CLN
+        return ::atan(realpart(*x.value), realpart(*y.value));  // -> CLN
     else
         throw (std::invalid_argument("numeric::atan(): complex argument"));        
 }
     else
         throw (std::invalid_argument("numeric::atan(): complex argument"));        
 }
@@ -991,7 +994,7 @@ numeric atan(numeric const & y, numeric const & x)
  *  @return  arbitrary precision numerical sinh(x). */
 numeric sinh(numeric const & x)
 {
  *  @return  arbitrary precision numerical sinh(x). */
 numeric sinh(numeric const & x)
 {
-    return sinh(*x.value);  // -> CLN
+    return ::sinh(*x.value);  // -> CLN
 }
 
 /** Numeric hyperbolic cosine (trigonometric function).
 }
 
 /** Numeric hyperbolic cosine (trigonometric function).
@@ -999,7 +1002,7 @@ numeric sinh(numeric const & x)
  *  @return  arbitrary precision numerical cosh(x). */
 numeric cosh(numeric const & x)
 {
  *  @return  arbitrary precision numerical cosh(x). */
 numeric cosh(numeric const & x)
 {
-    return cosh(*x.value);  // -> CLN
+    return ::cosh(*x.value);  // -> CLN
 }
     
 /** Numeric hyperbolic tangent (trigonometric function).
 }
     
 /** Numeric hyperbolic tangent (trigonometric function).
@@ -1007,7 +1010,7 @@ numeric cosh(numeric const & x)
  *  @return  arbitrary precision numerical tanh(x). */
 numeric tanh(numeric const & x)
 {
  *  @return  arbitrary precision numerical tanh(x). */
 numeric tanh(numeric const & x)
 {
-    return tanh(*x.value);  // -> CLN
+    return ::tanh(*x.value);  // -> CLN
 }
     
 /** Numeric inverse hyperbolic sine (trigonometric function).
 }
     
 /** Numeric inverse hyperbolic sine (trigonometric function).
@@ -1015,7 +1018,7 @@ numeric tanh(numeric const & x)
  *  @return  arbitrary precision numerical asinh(x). */
 numeric asinh(numeric const & x)
 {
  *  @return  arbitrary precision numerical asinh(x). */
 numeric asinh(numeric const & x)
 {
-    return asinh(*x.value);  // -> CLN
+    return ::asinh(*x.value);  // -> CLN
 }
 
 /** Numeric inverse hyperbolic cosine (trigonometric function).
 }
 
 /** Numeric inverse hyperbolic cosine (trigonometric function).
@@ -1023,7 +1026,7 @@ numeric asinh(numeric const & x)
  *  @return  arbitrary precision numerical acosh(x). */
 numeric acosh(numeric const & x)
 {
  *  @return  arbitrary precision numerical acosh(x). */
 numeric acosh(numeric const & x)
 {
-    return acosh(*x.value);  // -> CLN
+    return ::acosh(*x.value);  // -> CLN
 }
 
 /** Numeric inverse hyperbolic tangent (trigonometric function).
 }
 
 /** Numeric inverse hyperbolic tangent (trigonometric function).
@@ -1031,7 +1034,7 @@ numeric acosh(numeric const & x)
  *  @return  arbitrary precision numerical atanh(x). */
 numeric atanh(numeric const & x)
 {
  *  @return  arbitrary precision numerical atanh(x). */
 numeric atanh(numeric const & x)
 {
-    return atanh(*x.value);  // -> CLN
+    return ::atanh(*x.value);  // -> CLN
 }
 
 /** The gamma function.
 }
 
 /** The gamma function.
@@ -1051,7 +1054,7 @@ numeric factorial(numeric const & nn)
         throw (std::range_error("numeric::factorial(): argument must be integer >= 0"));
     }
     
         throw (std::range_error("numeric::factorial(): argument must be integer >= 0"));
     }
     
-    return numeric(factorial(nn.to_int()));  // -> CLN
+    return numeric(::factorial(nn.to_int()));  // -> CLN
 }
 
 /** The double factorial combinatorial function.  (Scarcely used, but still
 }
 
 /** The double factorial combinatorial function.  (Scarcely used, but still
@@ -1123,7 +1126,7 @@ numeric doublefactorial(numeric const & nn)
 numeric binomial(numeric const & n, numeric const & k)
 {
     if (n.is_nonneg_integer() && k.is_nonneg_integer()) {
 numeric binomial(numeric const & n, numeric const & k)
 {
     if (n.is_nonneg_integer() && k.is_nonneg_integer()) {
-        return numeric(binomial(n.to_int(),k.to_int()));  // -> CLN
+        return numeric(::binomial(n.to_int(),k.to_int()));  // -> CLN
     } else {
         // should really be gamma(n+1)/(gamma(r+1)/gamma(n-r+1)
         return numeric(0);
     } else {
         // should really be gamma(n+1)/(gamma(r+1)/gamma(n-r+1)
         return numeric(0);
@@ -1134,7 +1137,7 @@ numeric binomial(numeric const & n, numeric const & k)
 /** Absolute value. */
 numeric abs(numeric const & x)
 {
 /** Absolute value. */
 numeric abs(numeric const & x)
 {
-    return abs(*x.value);  // -> CLN
+    return ::abs(*x.value);  // -> CLN
 }
 
 /** Modulus (in positive representation).
 }
 
 /** Modulus (in positive representation).
@@ -1147,7 +1150,7 @@ numeric abs(numeric const & x)
 numeric mod(numeric const & a, numeric const & b)
 {
     if (a.is_integer() && b.is_integer()) {
 numeric mod(numeric const & a, numeric const & b)
 {
     if (a.is_integer() && b.is_integer()) {
-        return mod(The(cl_I)(*a.value), The(cl_I)(*b.value));  // -> CLN
+        return ::mod(The(cl_I)(*a.value), The(cl_I)(*b.value));  // -> CLN
     }
     else {
         return numZERO();  // Throw?
     }
     else {
         return numZERO();  // Throw?
@@ -1162,7 +1165,7 @@ numeric smod(numeric const & a, numeric const & b)
 {
     if (a.is_integer() && b.is_integer()) {
         cl_I b2 = The(cl_I)(ceiling1(The(cl_I)(*b.value) / 2)) - 1;
 {
     if (a.is_integer() && b.is_integer()) {
         cl_I b2 = The(cl_I)(ceiling1(The(cl_I)(*b.value) / 2)) - 1;
-        return mod(The(cl_I)(*a.value) + b2, The(cl_I)(*b.value)) - b2;
+        return ::mod(The(cl_I)(*a.value) + b2, The(cl_I)(*b.value)) - b2;
     } else {
         return numZERO();  // Throw?
     }
     } else {
         return numZERO();  // Throw?
     }
@@ -1177,7 +1180,7 @@ numeric smod(numeric const & a, numeric const & b)
 numeric irem(numeric const & a, numeric const & b)
 {
     if (a.is_integer() && b.is_integer()) {
 numeric irem(numeric const & a, numeric const & b)
 {
     if (a.is_integer() && b.is_integer()) {
-        return rem(The(cl_I)(*a.value), The(cl_I)(*b.value));  // -> CLN
+        return ::rem(The(cl_I)(*a.value), The(cl_I)(*b.value));  // -> CLN
     }
     else {
         return numZERO();  // Throw?
     }
     else {
         return numZERO();  // Throw?
@@ -1245,7 +1248,7 @@ numeric iquo(numeric const & a, numeric const & b, numeric & r)
  *  where imag(z)>0. */
 numeric sqrt(numeric const & z)
 {
  *  where imag(z)>0. */
 numeric sqrt(numeric const & z)
 {
-    return sqrt(*z.value);  // -> CLN
+    return ::sqrt(*z.value);  // -> CLN
 }
 
 /** Integer numeric square root. */
 }
 
 /** Integer numeric square root. */
@@ -1253,7 +1256,7 @@ numeric isqrt(numeric const & x)
 {
        if (x.is_integer()) {
                cl_I root;
 {
        if (x.is_integer()) {
                cl_I root;
-               isqrt(The(cl_I)(*x.value), &root);      // -> CLN
+               ::isqrt(The(cl_I)(*x.value), &root);    // -> CLN
                return root;
        } else
                return numZERO();  // Throw?
                return root;
        } else
                return numZERO();  // Throw?
@@ -1266,7 +1269,7 @@ numeric isqrt(numeric const & x)
 numeric gcd(numeric const & a, numeric const & b)
 {
     if (a.is_integer() && b.is_integer())
 numeric gcd(numeric const & a, numeric const & b)
 {
     if (a.is_integer() && b.is_integer())
-        return gcd(The(cl_I)(*a.value), The(cl_I)(*b.value));  // -> CLN
+        return ::gcd(The(cl_I)(*a.value), The(cl_I)(*b.value));        // -> CLN
     else
         return numONE();
 }
     else
         return numONE();
 }
@@ -1278,7 +1281,7 @@ numeric gcd(numeric const & a, numeric const & b)
 numeric lcm(numeric const & a, numeric const & b)
 {
     if (a.is_integer() && b.is_integer())
 numeric lcm(numeric const & a, numeric const & b)
 {
     if (a.is_integer() && b.is_integer())
-        return lcm(The(cl_I)(*a.value), The(cl_I)(*b.value));  // -> CLN
+        return ::lcm(The(cl_I)(*a.value), The(cl_I)(*b.value));        // -> CLN
     else
         return *a.value * *b.value;
 }
     else
         return *a.value * *b.value;
 }
@@ -1344,3 +1347,5 @@ bool _numeric_digits::too_late = false;
 /** Accuracy in decimal digits.  Only object of this type!  Can be set using
  *  assignment from C++ unsigned ints and evaluated like any built-in type. */
 _numeric_digits Digits;
 /** Accuracy in decimal digits.  Only object of this type!  Can be set using
  *  assignment from C++ unsigned ints and evaluated like any built-in type. */
 _numeric_digits Digits;
+
+} // namespace GiNaC
index 01e2ad60677aeef26b725a9fd0aaa787d17fc186..a460d09989bf5db363c923da2bf6c85ff9718923 100644 (file)
 
 #include <strstream>
 #include <ginac/basic.h>
 
 #include <strstream>
 #include <ginac/basic.h>
-
-#define HASHVALUE_NUMERIC 0x80000001U
+#include <ginac/ex.h>
 
 class cl_N;     // We want to include cln.h only in numeric.cpp in order to 
                 // avoid namespace pollution and keep compile-time low.
 
 
 class cl_N;     // We want to include cln.h only in numeric.cpp in order to 
                 // avoid namespace pollution and keep compile-time low.
 
+namespace GiNaC {
+
+#define HASHVALUE_NUMERIC 0x80000001U
+
 /** This class is used to instantiate a global object Digits which
  *  behaves just like Maple's Digits.  We need an object rather than a
  *  dumber basic type since as a side-effect we let it change
 /** This class is used to instantiate a global object Digits which
  *  behaves just like Maple's Digits.  We need an object rather than a
  *  dumber basic type since as a side-effect we let it change
@@ -318,7 +321,12 @@ ex PiEvalf(void);
 ex EulerGammaEvalf(void);
 ex CatalanEvalf(void);
 
 ex EulerGammaEvalf(void);
 ex CatalanEvalf(void);
 
-#define ex_to_numeric(X) static_cast<numeric const &>(*(X).bp)
+// utility functions
+inline const numeric &ex_to_numeric(const ex &e)
+{
+       return static_cast<const numeric &>(*e.bp);
+}
 
 
+} // namespace GiNaC
 
 #endif // ndef __GINAC_NUMERIC_H__
 
 #endif // ndef __GINAC_NUMERIC_H__
index 6ccc7a8151b1f100755445fc907c0b8b0932e9dd..d9882c0e235f5ba5c36e22461c7dc4e1c27e2c38 100644 (file)
@@ -29,6 +29,9 @@
 #include "numeric.h"
 #include "power.h"
 #include "relational.h"
 #include "numeric.h"
 #include "power.h"
 #include "relational.h"
+#include "debugmsg.h"
+
+namespace GiNaC {
 
 // binary arithmetic operators ex with ex
 
 
 // binary arithmetic operators ex with ex
 
@@ -403,3 +406,4 @@ istream & operator>>(istream & is, ex & e)
     throw(std::logic_error("input from streams not yet implemented"));
 }
 
     throw(std::logic_error("input from streams not yet implemented"));
 }
 
+} // namespace GiNaC
index cc354d867dede87d958c0d9e2d7c5768a0add71a..4c95a55164a81adf4b7c67325a009b3361b74346 100644 (file)
@@ -25,6 +25,8 @@
 
 #include <iostream>
 
 
 #include <iostream>
 
+namespace GiNaC {
+
 class ex;
 class numeric;
 class relational;
 class ex;
 class numeric;
 class relational;
@@ -123,4 +125,6 @@ relational operator>=(numeric const & lh, ex const & rh);
 ostream & operator<<(ostream & os, ex const & e);
 istream & operator>>(istream & is, ex & e);
 
 ostream & operator<<(ostream & os, ex const & e);
 istream & operator>>(istream & is, ex & e);
 
+} // namespace GiNaC
+
 #endif // ndef __GINAC_OPERATORS_H__
 #endif // ndef __GINAC_OPERATORS_H__
index a459150dbe4d5a692bf0a47e05ee13e8285f97a8..36b5c8b46f634547f04ebade72e72f1d17e9c7a9 100644 (file)
@@ -31,6 +31,9 @@
 #include "numeric.h"
 #include "relational.h"
 #include "symbol.h"
 #include "numeric.h"
 #include "relational.h"
 #include "symbol.h"
+#include "debugmsg.h"
+
+namespace GiNaC {
 
 typedef vector<int> intvector;
 
 
 typedef vector<int> intvector;
 
@@ -510,7 +513,7 @@ ex power::expand_add(add const & a, int const n) const
         cout << "end term" << endl;
         */
 
         cout << "end term" << endl;
         */
 
-        // TODO: optimize!!!!!!!!
+        // TODO: optimize this
         sum.push_back((new mul(term))->setflag(status_flags::dynallocated));
         
         // increment k[]
         sum.push_back((new mul(term))->setflag(status_flags::dynallocated));
         
         // increment k[]
@@ -717,3 +720,5 @@ unsigned power::precedence=60;
 
 const power some_power;
 type_info const & typeid_power=typeid(some_power);
 
 const power some_power;
 type_info const & typeid_power=typeid(some_power);
+
+} // namespace GiNaC
index 37ce802260c31dc1bc0ede5c806034cbbd10bc9c..3d9ae57433dbe44c41eeca88aa559e55638651f2 100644 (file)
@@ -26,6 +26,8 @@
 #include <ginac/basic.h>
 #include <ginac/ex.h>
 
 #include <ginac/basic.h>
 #include <ginac/ex.h>
 
+namespace GiNaC {
+
 class numeric;
 class add;
 
 class numeric;
 class add;
 
@@ -103,7 +105,11 @@ protected:
 extern const power some_power;
 extern type_info const & typeid_power;
 
 extern const power some_power;
 extern type_info const & typeid_power;
 
-#define ex_to_power(X) static_cast<power const &>(*(X).bp)
+// utility functions
+inline const power &ex_to_power(const ex &e)
+{
+       return static_cast<const power &>(*e.bp);
+}
 
 // wrapper functions
 
 
 // wrapper functions
 
@@ -119,5 +125,6 @@ inline ex pow(ex const & b, ex const & e)
 inline ex sqrt(ex const & a)
 { return power(a,exHALF()); }
 
 inline ex sqrt(ex const & a)
 { return power(a,exHALF()); }
 
-#endif // ndef __GINAC_POWER_H__
+} // namespace GiNaC
 
 
+#endif // ndef __GINAC_POWER_H__
index f75ad933ee29517f15b9959cfa57282886ac6e0b..899c21b0d02aacb85ce45e83056460a8f9f94606 100644 (file)
@@ -39,6 +39,9 @@
 #include "relational.h"
 #include "series.h"
 #include "symbol.h"
 #include "relational.h"
 #include "series.h"
 #include "symbol.h"
+#include "debugmsg.h"
+
+namespace GiNaC {
 
 void ex::print(ostream & os, unsigned upper_precedence) const
 {
 
 void ex::print(ostream & os, unsigned upper_precedence) const
 {
@@ -318,3 +321,5 @@ void matrix::print(ostream & os, unsigned upper_precedence) const
     }
     os << m[row*col-1] << "]] ]]";
 }
     }
     os << m[row*col-1] << "]] ]]";
 }
+
+} // namespace GiNaC
index 543035eb4418dbec23f2e3419c1068e179c4a5e7..a162ad8a98217aab5531720d20cfdcefdfd31aef 100644 (file)
@@ -37,6 +37,9 @@
 #include "relational.h"
 #include "series.h"
 #include "symbol.h"
 #include "relational.h"
 #include "series.h"
 #include "symbol.h"
+#include "debugmsg.h"
+
+namespace GiNaC {
 
 /** Print expression as a C++ statement. The output looks like
  *  "<type> <var_name> = <expression>;". The "type" parameter has an effect
 
 /** Print expression as a C++ statement. The output looks like
  *  "<type> <var_name> = <expression>;". The "type" parameter has an effect
@@ -326,3 +329,5 @@ void relational::printcsrc(ostream & os, unsigned type, unsigned upper_precedenc
     if (precedence <= upper_precedence)
                os << ")";
 }
     if (precedence <= upper_precedence)
                os << ")";
 }
+
+} // namespace GiNaC
index d1aac63e1e5c86ea1be6f95248ae10612b774260..7c66c1bb7b86a52078f1e6ffba90a32479470065 100644 (file)
@@ -43,6 +43,9 @@
 #include "relational.h"
 #include "series.h"
 #include "symbol.h"
 #include "relational.h"
 #include "series.h"
 #include "symbol.h"
+#include "debugmsg.h"
+
+namespace GiNaC {
 
 void ex::printraw(ostream & os) const
 {
 
 void ex::printraw(ostream & os) const
 {
@@ -221,3 +224,5 @@ void matrix::printraw(ostream & os) const
     }
     os << m[row*col-1] << "))";
 }
     }
     os << m[row*col-1] << "))";
 }
+
+} // namespace GiNaC
index 38706f6975d8c6e6de5627c987d1d0da1b4bd2f3..a7b09723aedbb8df704accc513ebd8a0648f7919 100644 (file)
@@ -38,6 +38,9 @@
 #include "relational.h"
 #include "series.h"
 #include "symbol.h"
 #include "relational.h"
 #include "series.h"
 #include "symbol.h"
+#include "debugmsg.h"
+
+namespace GiNaC {
 
 void ex::printtree(ostream & os, unsigned indent) const
 {
 
 void ex::printtree(ostream & os, unsigned indent) const
 {
@@ -178,3 +181,4 @@ void expairseq::printtree(ostream & os, unsigned indent) const
 #endif // def EXPAIRSEQ_USE_HASHTAB
 }
 
 #endif // def EXPAIRSEQ_USE_HASHTAB
 }
 
+} // namespace GiNaC
index 1cce02d977fa5018ae8061759251c8f788711622..f63a297f67d3094c7ad9e6630817c6f504c08525 100644 (file)
@@ -24,6 +24,9 @@
 
 #include "relational.h"
 #include "numeric.h"
 
 #include "relational.h"
 #include "numeric.h"
+#include "debugmsg.h"
+
+namespace GiNaC {
 
 //////////
 // default constructor, destructor, copy constructor assignment operator and helpers
 
 //////////
 // default constructor, destructor, copy constructor assignment operator and helpers
@@ -261,3 +264,4 @@ unsigned relational::precedence=20;
 const relational some_relational;
 type_info const & typeid_relational=typeid(some_relational);
 
 const relational some_relational;
 type_info const & typeid_relational=typeid(some_relational);
 
+} // namespace GiNaC
index 317b1d23523f041e067013ab984bf9af7f3bc56d..7426e19ecea8af712554ba7ba9575fa1fc179e86 100644 (file)
@@ -26,6 +26,8 @@
 #include <ginac/basic.h>
 #include <ginac/ex.h>
 
 #include <ginac/basic.h>
 #include <ginac/ex.h>
 
+namespace GiNaC {
+
 /** This class holds a relation consisting of two expressions and a logical
  *  relation between them. */
 class relational : public basic
 /** This class holds a relation consisting of two expressions and a logical
  *  relation between them. */
 class relational : public basic
@@ -95,8 +97,12 @@ protected:
 extern const relational some_relational;
 extern type_info const & typeid_relational;
 
 extern const relational some_relational;
 extern type_info const & typeid_relational;
 
-#define ex_to_relational(X) static_cast<relational const &>(*(X).bp)
-
-#endif // ndef __GINAC_RELATIONAL_H__
+// utility functions
+inline const relational &ex_to_relational(const ex &e)
+{
+       return static_cast<const relational &>(*e.bp);
+}
 
 
+} // namespace GiNaC
 
 
+#endif // ndef __GINAC_RELATIONAL_H__
index 6002d95b2c86f4c62ea7da70554f54ac251cc8a7..5822825fe4e70502e251022f01b1fe4b8e07ee10 100644 (file)
@@ -28,6 +28,9 @@
 #include "power.h"
 #include "relational.h"
 #include "symbol.h"
 #include "power.h"
 #include "relational.h"
 #include "symbol.h"
+#include "debugmsg.h"
+
+namespace GiNaC {
 
 
 /*
 
 
 /*
@@ -632,3 +635,5 @@ ex ex::series(symbol const &s, ex const &point, int order) const
 // Global constants
 const series some_series;
 type_info const & typeid_series = typeid(some_series);
 // Global constants
 const series some_series;
 type_info const & typeid_series = typeid(some_series);
+
+} // namespace GiNaC
index 4a757b0a3a951da6bdf5bc28a9624d7007ab84c2..7b4e095f19accbf30a571c97038f767672b687ec 100644 (file)
@@ -26,6 +26,8 @@
 #include <ginac/basic.h>
 #include <ginac/expairseq.h>
 
 #include <ginac/basic.h>
 #include <ginac/expairseq.h>
 
+namespace GiNaC {
+
 /** This class holds a extended truncated power series (positive and negative
  *  integer powers). It consists of expression coefficients (only non-zero
  *  coefficients are stored), an expansion variable and an expansion point.
 /** This class holds a extended truncated power series (positive and negative
  *  integer powers). It consists of expression coefficients (only non-zero
  *  coefficients are stored), an expansion variable and an expansion point.
@@ -86,7 +88,17 @@ protected:
 extern const series some_series;
 extern type_info const & typeid_series;
 
 extern const series some_series;
 extern type_info const & typeid_series;
 
-#define ex_to_series(X) (static_cast<class series const &>(*(X).bp))
-#define series_to_poly(X) (static_cast<series const &>(*(X).bp).convert_to_poly(true))
+// utility functions
+inline const series &ex_to_series(const ex &e)
+{
+       return static_cast<const series &>(*e.bp);
+}
+
+inline ex series_to_poly(const ex &e)
+{
+       return (static_cast<const series &>(*e.bp).convert_to_poly(true));
+}
+
+} // namespace GiNaC
 
 #endif // ndef __GINAC_SERIES_H__
 
 #endif // ndef __GINAC_SERIES_H__
index ea488dc616b41e6a696ff35635f36ddcfd57b03e..d488e6ddeee58e749403452be5e199a0eb6d8dd2 100644 (file)
@@ -32,6 +32,9 @@
 #include "ex.h"
 #include "mul.h"
 #include "symbol.h"
 #include "ex.h"
 #include "mul.h"
 #include "symbol.h"
+#include "debugmsg.h"
+
+namespace GiNaC {
 
 //////////
 // default constructor, destructor, copy constructor assignment operator and helpers
 
 //////////
 // default constructor, destructor, copy constructor assignment operator and helpers
@@ -510,5 +513,4 @@ spmapkey scalar_products::make_key(simp_lor const & v1, simp_lor const & v2)
     return spmapkey(strstrpair(v1.name,v2.name),anon);
 }
 
     return spmapkey(strstrpair(v1.name,v2.name),anon);
 }
 
-
-
+} // namespace GiNaC
index a3971bf411ee8728a60b0c459ee24b894e67341a..643a6d91f5d49ce51fb70fc7c87d77823ebd34c8 100644 (file)
@@ -31,6 +31,8 @@
 #include <ginac/indexed.h>
 #include <ginac/lorentzidx.h>
 
 #include <ginac/indexed.h>
 #include <ginac/lorentzidx.h>
 
+namespace GiNaC {
+
 typedef pair<string,string> strstrpair;
 typedef pair<strstrpair,lorentzidx> spmapkey;
 
 typedef pair<string,string> strstrpair;
 typedef pair<strstrpair,lorentzidx> spmapkey;
 
@@ -151,10 +153,16 @@ protected:
 extern const simp_lor some_simp_lor;
 extern type_info const & typeid_simp_lor;
 
 extern const simp_lor some_simp_lor;
 extern type_info const & typeid_simp_lor;
 
-// macros
+// utility functions
+inline const simp_lor &ex_to_simp_lor(const ex &e)
+{
+       return static_cast<const simp_lor &>(*e.bp);
+}
 
 
-#define ex_to_simp_lor(X) static_cast<simp_lor const &>(*(X).bp)
-#define ex_to_nonconst_simp_lor(X) static_cast<simp_lor &>(*(X).bp)
+inline simp_lor &ex_to_nonconst_simp_lor(const ex &e)
+{
+       return static_cast<simp_lor &>(*e.bp);
+}
 
 simp_lor lor_g(ex const & mu, ex const & nu);
 simp_lor lor_vec(string const & n, ex const & mu);
 
 simp_lor lor_g(ex const & mu, ex const & nu);
 simp_lor lor_vec(string const & n, ex const & mu);
@@ -162,6 +170,6 @@ ex simplify_simp_lor_mul(ex const & m, scalar_products const & sp);
 ex simplify_simp_lor(ex const & e, scalar_products const & sp);
 ex Dim(void);
 
 ex simplify_simp_lor(ex const & e, scalar_products const & sp);
 ex Dim(void);
 
-#endif // ndef _SIMP__GINAC_LOR_H__
-
+} // namespace GiNaC
 
 
+#endif // ndef _SIMP__GINAC_LOR_H__
index dd939c90811d2bef5c1791df29ae4fc77a6b5c07..55ec58289144ab5f398c54188b2bef930f708bdd 100644 (file)
@@ -23,6 +23,9 @@
 #include <string>
 
 #include "structure.h"
 #include <string>
 
 #include "structure.h"
+#include "debugmsg.h"
+
+namespace GiNaC {
 
 //////////
 // default constructor, destructor, copy constructor assignment operator and helpers
 
 //////////
 // default constructor, destructor, copy constructor assignment operator and helpers
@@ -172,3 +175,4 @@ unsigned structure::register_new(char const * nm)
 const structure some_structure;
 type_info const & typeid_structure=typeid(some_structure);
 
 const structure some_structure;
 type_info const & typeid_structure=typeid(some_structure);
 
+} // namespace GiNaC
index c14a17c8d6d5a5bb5146fcf236bfdbd638b1b489..3478887507c11b20067c606650cd1cc14e25703a 100644 (file)
@@ -25,6 +25,8 @@
 
 #include <ginac/basic.h>
 
 
 #include <ginac/basic.h>
 
+namespace GiNaC {
+
 struct registered_structure_info {
     char const * name;
 };
 struct registered_structure_info {
     char const * name;
 };
@@ -82,5 +84,6 @@ public:
 extern const structure some_structure;
 extern type_info const & typeid_structure;
 
 extern const structure some_structure;
 extern type_info const & typeid_structure;
 
-#endif // ndef __GINAC_STRUCTURE_H__
+} // namespace GiNaC
 
 
+#endif // ndef __GINAC_STRUCTURE_H__
index de365edee5308bedadb123fe83593a6727607f55..b6137d0b41f57c2ddec32b254b9d07d621215377 100755 (executable)
@@ -119,7 +119,9 @@ $types_ok_statements=generate(
 $interface=<<END_OF_INTERFACE;
 /** \@file ${STRUCTURE}.h
  *
 $interface=<<END_OF_INTERFACE;
 /** \@file ${STRUCTURE}.h
  *
- *  Definition of GiNaC's user defined structure ${STRUCTURE}. 
+ *  Definition of GiNaC's user defined structure ${STRUCTURE}. */
+
+/*
  *  This file was generated automatically by structure.pl.
  *  Please do not modify it directly, edit the perl script instead!
  *
  *  This file was generated automatically by structure.pl.
  *  Please do not modify it directly, edit the perl script instead!
  *
@@ -146,7 +148,9 @@ ${input_structure}
 #ifndef __GINAC_${STRUCTURE_UC}_H__
 #define __GINAC_${STRUCTURE_UC}_H__
 
 #ifndef __GINAC_${STRUCTURE_UC}_H__
 #define __GINAC_${STRUCTURE_UC}_H__
 
-#include <ginac/ginac.h>
+#include <ginac/structure.h>
+
+namespace GiNaC {
 
 class ${STRUCTURE} : public structure
 {
 
 class ${STRUCTURE} : public structure
 {
@@ -211,6 +215,8 @@ extern const unsigned tinfo_${STRUCTURE};
 
 #define ex_to_${STRUCTURE}(X) (static_cast<${STRUCTURE} const &>(*(X).bp))
 
 
 #define ex_to_${STRUCTURE}(X) (static_cast<${STRUCTURE} const &>(*(X).bp))
 
+} // namespace GiNaC
+
 #endif // ndef _${STRUCTURE_UC}_H_
 
 END_OF_INTERFACE
 #endif // ndef _${STRUCTURE_UC}_H_
 
 END_OF_INTERFACE
@@ -218,7 +224,9 @@ END_OF_INTERFACE
 $implementation=<<END_OF_IMPLEMENTATION;
 /** \@file ${STRUCTURE}.cpp
  *
 $implementation=<<END_OF_IMPLEMENTATION;
 /** \@file ${STRUCTURE}.cpp
  *
- *  Implementation of GiNaC's user defined structure ${STRUCTURE}. 
+ *  Implementation of GiNaC's user defined structure ${STRUCTURE}. */
+
+/*
  *  This file was generated automatically by STRUCTURE.pl.
  *  Please do not modify it directly, edit the perl script instead!
  *
  *  This file was generated automatically by STRUCTURE.pl.
  *  Please do not modify it directly, edit the perl script instead!
  *
@@ -244,7 +252,9 @@ ${input_structure}
 
 #include <iostream>
 
 
 #include <iostream>
 
-#include "ginac.h"
+#include "${STRUCTURE}.h"
+
+namespace GiNaC {
 
 //////////
 // default constructor, destructor, copy constructor assignment operator and helpers
 
 //////////
 // default constructor, destructor, copy constructor assignment operator and helpers
@@ -498,6 +508,8 @@ const ${STRUCTURE} some_${STRUCTURE};
 type_info const & typeid_${STRUCTURE}=typeid(some_${STRUCTURE});
 const unsigned tinfo_${STRUCTURE}=structure::register_new("${STRUCTURE}");
 
 type_info const & typeid_${STRUCTURE}=typeid(some_${STRUCTURE});
 const unsigned tinfo_${STRUCTURE}=structure::register_new("${STRUCTURE}");
 
+} // namespace GiNaC
+
 END_OF_IMPLEMENTATION
 
 print "Creating interface file ${STRUCTURE}.h...";
 END_OF_IMPLEMENTATION
 
 print "Creating interface file ${STRUCTURE}.h...";
index f84d98cbe996bd9237f46b54012b7e7e7f1baede..2d42b5af8047055e5d005df9431258de7046e0fd 100644 (file)
@@ -27,6 +27,9 @@
 #include "lst.h"
 #include "utils.h"
 #include "idx.h"
 #include "lst.h"
 #include "utils.h"
 #include "idx.h"
+#include "debugmsg.h"
+
+namespace GiNaC {
 
 //////////
 // default constructor, destructor, copy constructor assignment operator and helpers
 
 //////////
 // default constructor, destructor, copy constructor assignment operator and helpers
@@ -277,3 +280,5 @@ type_info const & typeid_symbol=typeid(some_symbol);
 symbol::assigned_ex_info::assigned_ex_info(void) : is_assigned(0), refcount(1)
 {
 }
 symbol::assigned_ex_info::assigned_ex_info(void) : is_assigned(0), refcount(1)
 {
 }
+
+} // namespace GiNaC
index ade8d776d8a56312012e0de9f80ccf62a0f04384..9905f3c861efe501dd2a365ed795f98bbf36427a 100644 (file)
@@ -27,6 +27,8 @@
 #include <ginac/basic.h>
 #include <ginac/ex.h>
 
 #include <ginac/basic.h>
 #include <ginac/ex.h>
 
+namespace GiNaC {
+
 /** Basic CAS symbol.  It has a name because it must know how to output itself.
  *  It may be assigned an expression, but this feature is only intended for
  *  programs like 'ginsh' that want to associate symbols with expressions.
 /** Basic CAS symbol.  It has a name because it must know how to output itself.
  *  It may be assigned an expression, but this feature is only intended for
  *  programs like 'ginsh' that want to associate symbols with expressions.
@@ -109,9 +111,11 @@ private:
 extern const symbol some_symbol;
 extern type_info const & typeid_symbol;
 
 extern const symbol some_symbol;
 extern type_info const & typeid_symbol;
 
-// macros
-
-#define ex_to_symbol(X) static_cast<symbol const &>(*(X).bp)
+// utility functions
+inline const symbol &ex_to_symbol(const ex &e)
+{
+       return static_cast<const symbol &>(*e.bp);
+}
 
 // wrapper functions around member functions
 inline void unassign(symbol & symarg)
 
 // wrapper functions around member functions
 inline void unassign(symbol & symarg)
@@ -123,4 +127,6 @@ inline int degree(symbol const & a, symbol const & s)
 inline int ldegree(symbol const & a, symbol const & s)
 { return a.ldegree(s); }
 
 inline int ldegree(symbol const & a, symbol const & s)
 { return a.ldegree(s); }
 
+} // namespace GiNaC
+
 #endif // ndef __GINAC_SYMBOL_H__
 #endif // ndef __GINAC_SYMBOL_H__
index 5a70aeed453c96e51e21e3d317ddf6e85d942e0e..2c807b124b6ba504f5a41300c6388d0191a744bd 100644 (file)
 #ifndef __GINAC_TINFOS_H__
 #define __GINAC_TINFOS_H__
 
 #ifndef __GINAC_TINFOS_H__
 #define __GINAC_TINFOS_H__
 
-#define TINFO_basic        0x00000001U
+namespace GiNaC {
 
 
-#define TINFO_expairseq    0x00010001U
-#define TINFO_add          0x00011001U
-#define TINFO_mul          0x00011002U
+const unsigned TINFO_basic        = 0x00000001U;
 
 
-#define TINFO_symbol       0x00020001U
-#define TINFO_constant     0x00021001U
+const unsigned TINFO_expairseq    = 0x00010001U;
+const unsigned TINFO_add          = 0x00011001U;
+const unsigned TINFO_mul          = 0x00011002U;
 
 
-#define TINFO_exprseq      0x00030001U
-#define TINFO_function     0x00031001U
-#define TINFO_ncmul        0x00031002U
+const unsigned TINFO_symbol       = 0x00020001U;
+const unsigned TINFO_constant     = 0x00021001U;
 
 
-#define TINFO_lst          0x00040001U
+const unsigned TINFO_exprseq      = 0x00030001U;
+const unsigned TINFO_function     = 0x00031001U;
+const unsigned TINFO_ncmul        = 0x00031002U;
 
 
-#define TINFO_matrix       0x00050001U
+const unsigned TINFO_lst          = 0x00040001U;
 
 
-#define TINFO_power        0x00060001U
+const unsigned TINFO_matrix       = 0x00050001U;
 
 
-#define TINFO_relational   0x00070001U
+const unsigned TINFO_power        = 0x00060001U;
 
 
-#define TINFO_fail         0x00080001U
+const unsigned TINFO_relational   = 0x00070001U;
 
 
-#define TINFO_numeric      0x00090001U
+const unsigned TINFO_fail         = 0x00080001U;
 
 
-#define TINFO_series       0x000a0001U
+const unsigned TINFO_numeric      = 0x00090001U;
 
 
-#define TINFO_indexed      0x000b0001U
-#define TINFO_algebra      0x000b1001U
-#define TINFO_clifford     0x000b1101U
-#define TINFO_color        0x000b1201U
-#define TINFO_isospin      0x000b1301U
-#define TINFO_simp_lor     0x000b1401U
+const unsigned TINFO_series       = 0x000a0001U;
 
 
-#define TINFO_structure    0x000c0001U
-// reserved up to          0x000cffffU
+const unsigned TINFO_indexed      = 0x000b0001U;
+const unsigned TINFO_algebra      = 0x000b1001U;
+const unsigned TINFO_clifford     = 0x000b1101U;
+const unsigned TINFO_color        = 0x000b1201U;
+const unsigned TINFO_isospin      = 0x000b1301U;
+const unsigned TINFO_simp_lor     = 0x000b1401U;
+
+const unsigned TINFO_structure    = 0x000c0001U;
+// reserved up to                   0x000cffffU
 // for user defined structures
 
 // for user defined structures
 
-#define TINFO_idx          0x000d0001U
-#define TINFO_coloridx     0x000d1001U
-#define TINFO_lorentzidx   0x000d1002U
+const unsigned TINFO_idx          = 0x000d0001U;
+const unsigned TINFO_coloridx     = 0x000d1001U;
+const unsigned TINFO_lorentzidx   = 0x000d1002U;
+
+} // namespace GiNaC
 
 #endif // ndef __GINAC_TINFOS_H__
 
 #endif // ndef __GINAC_TINFOS_H__
index 0689d3e7e2f1c110f104e8f9dba732d273309a47..446377b219ecbd7c4d7d6c6b14ff3f0af82cf552 100644 (file)
@@ -22,6 +22,8 @@
 
 #include "utils.h"
 
 
 #include "utils.h"
 
+namespace GiNaC {
+
 unsigned log2(unsigned n)
 {
     unsigned k;
 unsigned log2(unsigned n)
 {
     unsigned k;
@@ -113,6 +115,4 @@ int compare_pointers(void const * a, void const * b)
 // private
 // none
 
 // private
 // none
 
-
-
-
+} // namespace GiNaC
index b78d46a32f04c91cd5826f32f36bc02551ffb28c..edde75fcde3ff071cd7e8ed4b88bcfc9a6840d99 100644 (file)
@@ -27,6 +27,8 @@
 #include <string>
 #include "config.h"
 
 #include <string>
 #include "config.h"
 
+namespace GiNaC {
+
 template<class T>
 string ToString(T const & t)
 {
 template<class T>
 string ToString(T const & t)
 {
@@ -39,9 +41,6 @@ unsigned log2(unsigned n);
 
 int compare_pointers(void const * a, void const * b);
 
 
 int compare_pointers(void const * a, void const * b);
 
-#define DYNCONSTCAST(FINALTYPE,BASICTYPE,EXPRESSION) \
-    dynamic_cast<FINALTYPE>(const_cast<BASICTYPE>(EXPRESSION))
-
 // modified from stl_algo.h: always do com(*first1,*first2) instead of comp(*first2,*first1)
 template <class InputIterator1, class InputIterator2, class OutputIterator,
           class Compare>
 // modified from stl_algo.h: always do com(*first1,*first2) instead of comp(*first2,*first1)
 template <class InputIterator1, class InputIterator2, class OutputIterator,
           class Compare>
@@ -90,4 +89,6 @@ OutputIterator mymerge3(InputIterator1 first1, InputIterator1 last1,
   }
 }
 
   }
 }
 
+} // namespace GiNaC
+
 #endif // ndef __GINAC_UTILS_H__
 #endif // ndef __GINAC_UTILS_H__