From: Richard Kreckel Date: Sun, 30 Jan 2000 23:52:53 +0000 (+0000) Subject: - Renamed flag NO_GINAC_NAMESPACE to NO_NAMESPACE_GINAC because of m4. X-Git-Tag: release_0-5-0~24 X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=commitdiff_plain;h=956eeb82c513a723e864edefa857133282cf692b - Renamed flag NO_GINAC_NAMESPACE to NO_NAMESPACE_GINAC because of m4. - Made configure check for cint and makecint and call makecint to dump out cint/Makefile.cint, which will later be called by cint/Makefile. See configure option --with-cint. - Added some documentation about GiNaC-cint (e.g. a manpage). - All dummies in subdir cint/ are created by cint/dummies.pl now, removed older stuff. --- diff --git a/INSTALL b/INSTALL index 656fd7ef..4555857e 100644 --- a/INSTALL +++ b/INSTALL @@ -1,11 +1,24 @@ Prerequisites ============= -GiNaC requires the CLN library by Bruno Haible, available at - or . -You will also need a good C++ compiler adhering to the ANSI standard (we -used gcc for development so if you have a different compiler you are on -your own). +GiNaC requires the CLN library by Bruno Haible, available at either +one of the following FTP-sites: + * , + * or + * . +You will also need a decent ANSI-compliant C++-compiler. We use +`post-EGCS' GCC, i.e GCC >= 2.95 for development so if you have a +different compiler you are on your own. Note that you may have to use +the same compiler you compiled CLN with because of differing +name-mangling schemes. + +Optionally, GiNaC may work together with Masaharu Goto's C++ +interpreter cint (which requires that you register for commercial +use). You may obtain it from + * . +Install it by following the instructions included in Cint's +distribution before trying to compile GiNaC-cint. (See section +`Working with the Cint C++ interpreter' below.) Installation @@ -60,3 +73,11 @@ To protect you, the "configure" script checks for a feature that was added in V1.0.3 so it won't continue with earlier versions anyhow. Please install CLN properly on your system before continuing with GiNaC. + + +Working with the Cint C++ interpreter +===================================== + +You need to specify + --with-cint=$CINTSYSDIR +... diff --git a/Makefile.am b/Makefile.am index 36a9799c..6470f546 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,5 +1,5 @@ ## Process this file with automake to produce Makefile.in -SUBDIRS = ginac check ginsh tools doc +SUBDIRS = @GINACCINTDIR@ ginac check ginsh tools doc # Requires automake 1.4 AUTOMAKE_OPTIONS = 1.4 diff --git a/Makefile.in b/Makefile.in index 272ac7f6..ab76a59a 100644 --- a/Makefile.in +++ b/Makefile.in @@ -70,6 +70,7 @@ DLLTOOL = @DLLTOOL@ DOXYGEN = @DOXYGEN@ DVIPS = @DVIPS@ FIG2DEV = @FIG2DEV@ +GINACCINTDIR = @GINACCINTDIR@ GINACLIB_BINARY_AGE = @GINACLIB_BINARY_AGE@ GINACLIB_CPPFLAGS = @GINACLIB_CPPFLAGS@ GINACLIB_INTERFACE_AGE = @GINACLIB_INTERFACE_AGE@ @@ -82,6 +83,7 @@ GINSH_LIBS = @GINSH_LIBS@ LATEX = @LATEX@ LD = @LD@ LEX = @LEX@ +LIBGINACCINT = @LIBGINACCINT@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LT_AGE = @LT_AGE@ @@ -101,7 +103,7 @@ TUTORIAL_TARGETS = @TUTORIAL_TARGETS@ VERSION = @VERSION@ YACC = @YACC@ -SUBDIRS = ginac check ginsh tools doc +SUBDIRS = @GINACCINTDIR@ ginac check ginsh tools doc # Requires automake 1.4 AUTOMAKE_OPTIONS = 1.4 @@ -356,7 +358,7 @@ distdir: $(DISTFILES) @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ - cp -pr $$/$$file $(distdir)/$$file; \ + cp -pr $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ diff --git a/NEWS b/NEWS index 2f771148..5ac7e542 100644 --- a/NEWS +++ b/NEWS @@ -1,7 +1,7 @@ This file records noteworthy changes. 0.4.0 (26 November 1999) -* First public release +* First public release. 0.4.1 (13 December 1999) * Series Expansion of Gamma function and some other trigonometric diff --git a/check/Makefile.in b/check/Makefile.in index a830de0e..41fe7c47 100644 --- a/check/Makefile.in +++ b/check/Makefile.in @@ -70,6 +70,7 @@ DLLTOOL = @DLLTOOL@ DOXYGEN = @DOXYGEN@ DVIPS = @DVIPS@ FIG2DEV = @FIG2DEV@ +GINACCINTDIR = @GINACCINTDIR@ GINACLIB_BINARY_AGE = @GINACLIB_BINARY_AGE@ GINACLIB_CPPFLAGS = @GINACLIB_CPPFLAGS@ GINACLIB_INTERFACE_AGE = @GINACLIB_INTERFACE_AGE@ @@ -82,6 +83,7 @@ GINSH_LIBS = @GINSH_LIBS@ LATEX = @LATEX@ LD = @LD@ LEX = @LEX@ +LIBGINACCINT = @LIBGINACCINT@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LT_AGE = @LT_AGE@ @@ -250,7 +252,7 @@ distdir: $(DISTFILES) @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ - cp -pr $$/$$file $(distdir)/$$file; \ + cp -pr $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ diff --git a/check/differentiation.cpp b/check/differentiation.cpp index 5b5f12dc..ad91add8 100644 --- a/check/differentiation.cpp +++ b/check/differentiation.cpp @@ -22,9 +22,9 @@ #include -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC using namespace GiNaC; -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC static unsigned check_diff(const ex &e, const symbol &x, const ex &d, unsigned nth=1) diff --git a/check/expand_subs.cpp b/check/expand_subs.cpp index cf6847a7..4c2236ac 100644 --- a/check/expand_subs.cpp +++ b/check/expand_subs.cpp @@ -33,9 +33,9 @@ #include -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC using namespace GiNaC; -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC #define VECSIZE 100 diff --git a/check/inifcns_consist.cpp b/check/inifcns_consist.cpp index 23c3eb65..34a97b69 100644 --- a/check/inifcns_consist.cpp +++ b/check/inifcns_consist.cpp @@ -23,9 +23,9 @@ #include -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC using namespace GiNaC; -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC /* Some tests on the sine trigonometric function. */ static unsigned inifcns_consist_sin(void) diff --git a/check/lortensor_check.cpp b/check/lortensor_check.cpp index bacd87c2..b8543e4b 100644 --- a/check/lortensor_check.cpp +++ b/check/lortensor_check.cpp @@ -23,9 +23,9 @@ #include #include -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC using namespace GiNaC; -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC static unsigned lortensor_check1(void) { diff --git a/check/lsolve_onedim.cpp b/check/lsolve_onedim.cpp index 997fe144..097a0122 100644 --- a/check/lsolve_onedim.cpp +++ b/check/lsolve_onedim.cpp @@ -23,9 +23,9 @@ #include -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC using namespace GiNaC; -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC unsigned lsolve_onedim(void) { diff --git a/check/matrix_checks.cpp b/check/matrix_checks.cpp index 104a6058..cfc81fa0 100644 --- a/check/matrix_checks.cpp +++ b/check/matrix_checks.cpp @@ -23,9 +23,9 @@ #include #include -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC using namespace GiNaC; -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC static unsigned matrix_determinants(void) { diff --git a/check/normalization.cpp b/check/normalization.cpp index 1c3ac9c7..7144c278 100644 --- a/check/normalization.cpp +++ b/check/normalization.cpp @@ -22,9 +22,9 @@ #include -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC using namespace GiNaC; -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC static symbol x("x"), y("y"), z("z"); diff --git a/check/numeric_consist.cpp b/check/numeric_consist.cpp index 3e581f66..7d836e30 100644 --- a/check/numeric_consist.cpp +++ b/check/numeric_consist.cpp @@ -24,9 +24,9 @@ #include #include -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC using namespace GiNaC; -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC /* Simple and maybe somewhat pointless consistency tests of assorted tests and * conversions. */ diff --git a/check/numeric_output.cpp b/check/numeric_output.cpp index 3682c8e7..f2390d2b 100644 --- a/check/numeric_output.cpp +++ b/check/numeric_output.cpp @@ -22,9 +22,9 @@ #include -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC using namespace GiNaC; -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC unsigned numeric_output(void) { diff --git a/check/paranoia_check.cpp b/check/paranoia_check.cpp index c7c50135..1926ada9 100644 --- a/check/paranoia_check.cpp +++ b/check/paranoia_check.cpp @@ -25,9 +25,9 @@ #include -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC using namespace GiNaC; -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_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 diff --git a/check/poly_gcd.cpp b/check/poly_gcd.cpp index 0d8327a3..1e25add7 100644 --- a/check/poly_gcd.cpp +++ b/check/poly_gcd.cpp @@ -23,9 +23,9 @@ #include -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC using namespace GiNaC; -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC const int MAX_VARIABLES = 5; diff --git a/check/powerlaws.cpp b/check/powerlaws.cpp index d6a896cf..83ea03da 100644 --- a/check/powerlaws.cpp +++ b/check/powerlaws.cpp @@ -23,9 +23,9 @@ #include -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC using namespace GiNaC; -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC static unsigned powerlaws1(void) { diff --git a/check/series_expansion.cpp b/check/series_expansion.cpp index 42170c0b..6d482baa 100644 --- a/check/series_expansion.cpp +++ b/check/series_expansion.cpp @@ -22,9 +22,9 @@ #include -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC using namespace GiNaC; -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC static symbol x("x"); diff --git a/cint/Makefile.am b/cint/Makefile.am new file mode 100644 index 00000000..bc1690f8 --- /dev/null +++ b/cint/Makefile.am @@ -0,0 +1,26 @@ +## Process this file with automake to produce Makefile.in + +bin_PROGRAMS = ginaccint +noinst_LIBRARIES = libginac.a +ginaccint_SOURCES = ginaccint.cpp dummies.cpp dummies.h +man_MANS = ginaccint.1 + +# Build a modified library in the ginac-subdir and put it into the cint-subdir: +libginac.a: + (cd ../ginac && \ + $(MAKE) clean; \ + $(MAKE) CXXFLAGS="$$CXXFLAGS -DNO_NAMESPACE_GINAC" && \ + $(MAKE) install-libLTLIBRARIES prefix=`pwd`/../cint libdir=`pwd`/../cint && \ + $(MAKE) clean) + +ginaccint: libginac.a ginaccint.cpp + $(MAKE) -f Makefile.makecint + +EXTRA_DIST = dummies.pl + +# Files which are generated by perl scripts +$(srcdir)/dummies.h $(srcdir)/dummies.cpp: $(srcdir)/dummies.pl + cd $(srcdir) && perl dummies.pl + +# Force build of headers before compilation +$(srcdir)/ginaccint.cpp: $(srcdir)/dummies.h diff --git a/cint/Makefile.in b/cint/Makefile.in new file mode 100644 index 00000000..6ed89577 --- /dev/null +++ b/cint/Makefile.in @@ -0,0 +1,479 @@ +# Makefile.in generated automatically by automake 1.4 from Makefile.am + +# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = .. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +ARCHIVE_AGE = @ARCHIVE_AGE@ +ARCHIVE_VERSION = @ARCHIVE_VERSION@ +AS = @AS@ +CC = @CC@ +CINT = @CINT@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +DLLTOOL = @DLLTOOL@ +DOXYGEN = @DOXYGEN@ +DVIPS = @DVIPS@ +FIG2DEV = @FIG2DEV@ +GINACCINTDIR = @GINACCINTDIR@ +GINACLIB_BINARY_AGE = @GINACLIB_BINARY_AGE@ +GINACLIB_CPPFLAGS = @GINACLIB_CPPFLAGS@ +GINACLIB_INTERFACE_AGE = @GINACLIB_INTERFACE_AGE@ +GINACLIB_LIBS = @GINACLIB_LIBS@ +GINACLIB_MAJOR_VERSION = @GINACLIB_MAJOR_VERSION@ +GINACLIB_MICRO_VERSION = @GINACLIB_MICRO_VERSION@ +GINACLIB_MINOR_VERSION = @GINACLIB_MINOR_VERSION@ +GINACLIB_VERSION = @GINACLIB_VERSION@ +GINSH_LIBS = @GINSH_LIBS@ +LATEX = @LATEX@ +LD = @LD@ +LEX = @LEX@ +LIBGINACCINT = @LIBGINACCINT@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +LT_AGE = @LT_AGE@ +LT_CURRENT = @LT_CURRENT@ +LT_RELEASE = @LT_RELEASE@ +LT_REVISION = @LT_REVISION@ +MAINT = @MAINT@ +MAKECINT = @MAKECINT@ +MAKEINDEX = @MAKEINDEX@ +MAKEINFO = @MAKEINFO@ +NM = @NM@ +OBJDUMP = @OBJDUMP@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +REFERENCE_TARGETS = @REFERENCE_TARGETS@ +TUTORIAL_TARGETS = @TUTORIAL_TARGETS@ +VERSION = @VERSION@ +YACC = @YACC@ + +bin_PROGRAMS = ginaccint +noinst_LIBRARIES = libginac.a +ginaccint_SOURCES = ginaccint.cpp dummies.cpp dummies.h +man_MANS = ginaccint.1 + +EXTRA_DIST = dummies.pl +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = ../config.h +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) + + +DEFS = @DEFS@ -I. -I$(srcdir) -I.. +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +libginac_a_LIBADD = +libginac_a_SOURCES = libginac.a.c +libginac_a_OBJECTS = libginac.a.o +AR = ar +PROGRAMS = $(bin_PROGRAMS) + +ginaccint_OBJECTS = ginaccint.o dummies.o +ginaccint_LDADD = $(LDADD) +ginaccint_DEPENDENCIES = +ginaccint_LDFLAGS = +CXXFLAGS = @CXXFLAGS@ +CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ +CFLAGS = @CFLAGS@ +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ +man1dir = $(mandir)/man1 +MANS = $(man_MANS) + +NROFF = nroff +DIST_COMMON = Makefile.am Makefile.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP_ENV = --best +DEP_FILES = .deps/dummies.P .deps/ginaccint.P .deps/libginac.a.P +SOURCES = libginac.a.c $(ginaccint_SOURCES) +OBJECTS = libginac.a.o $(ginaccint_OBJECTS) + +all: all-redirect +.SUFFIXES: +.SUFFIXES: .S .c .cpp .lo .o .s +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --gnu cint/Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + + +mostlyclean-noinstLIBRARIES: + +clean-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) + +distclean-noinstLIBRARIES: + +maintainer-clean-noinstLIBRARIES: + +.s.o: + $(COMPILE) -c $< + +.S.o: + $(COMPILE) -c $< + +mostlyclean-compile: + -rm -f *.o core *.core + +clean-compile: + +distclean-compile: + -rm -f *.tab.c + +maintainer-clean-compile: + +.s.lo: + $(LIBTOOL) --mode=compile $(COMPILE) -c $< + +.S.lo: + $(LIBTOOL) --mode=compile $(COMPILE) -c $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + +maintainer-clean-libtool: + +mostlyclean-binPROGRAMS: + +clean-binPROGRAMS: + -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) + +distclean-binPROGRAMS: + +maintainer-clean-binPROGRAMS: + +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(bindir) + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + if test -f $$p; then \ + echo " $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \ + $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ + else :; fi; \ + done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + list='$(bin_PROGRAMS)'; for p in $$list; do \ + rm -f $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ + done +.cpp.o: + $(CXXCOMPILE) -c $< +.cpp.lo: + $(LTCXXCOMPILE) -c $< + +install-man1: + $(mkinstalldirs) $(DESTDIR)$(man1dir) + @list='$(man1_MANS)'; \ + l2='$(man_MANS)'; for i in $$l2; do \ + case "$$i" in \ + *.1*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ + if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ + else file=$$i; fi; \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \ + $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \ + done + +uninstall-man1: + @list='$(man1_MANS)'; \ + l2='$(man_MANS)'; for i in $$l2; do \ + case "$$i" in \ + *.1*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \ + rm -f $(DESTDIR)$(man1dir)/$$inst; \ + done +install-man: $(MANS) + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-man1 +uninstall-man: + @$(NORMAL_UNINSTALL) + $(MAKE) $(AM_MAKEFLAGS) uninstall-man1 + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $$unique $(LISP) + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + +subdir = cint + +distdir: $(DISTFILES) + here=`cd $(top_builddir) && pwd`; \ + top_distdir=`cd $(top_distdir) && pwd`; \ + distdir=`cd $(distdir) && pwd`; \ + cd $(top_srcdir) \ + && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu cint/Makefile + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$d/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done + +DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :) + +-include $(DEP_FILES) + +mostlyclean-depend: + +clean-depend: + +distclean-depend: + -rm -rf .deps + +maintainer-clean-depend: + +%.o: %.c + @echo '$(COMPILE) -c $<'; \ + $(COMPILE) -Wp,-MD,.deps/$(*F).pp -c $< + @-cp .deps/$(*F).pp .deps/$(*F).P; \ + tr ' ' '\012' < .deps/$(*F).pp \ + | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \ + >> .deps/$(*F).P; \ + rm .deps/$(*F).pp + +%.lo: %.c + @echo '$(LTCOMPILE) -c $<'; \ + $(LTCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $< + @-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \ + < .deps/$(*F).pp > .deps/$(*F).P; \ + tr ' ' '\012' < .deps/$(*F).pp \ + | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \ + >> .deps/$(*F).P; \ + rm -f .deps/$(*F).pp + +%.o: %.cpp + @echo '$(CXXCOMPILE) -c $<'; \ + $(CXXCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $< + @-cp .deps/$(*F).pp .deps/$(*F).P; \ + tr ' ' '\012' < .deps/$(*F).pp \ + | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \ + >> .deps/$(*F).P; \ + rm .deps/$(*F).pp + +%.lo: %.cpp + @echo '$(LTCXXCOMPILE) -c $<'; \ + $(LTCXXCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $< + @-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \ + < .deps/$(*F).pp > .deps/$(*F).P; \ + tr ' ' '\012' < .deps/$(*F).pp \ + | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \ + >> .deps/$(*F).P; \ + rm -f .deps/$(*F).pp +info-am: +info: info-am +dvi-am: +dvi: dvi-am +check-am: all-am +check: check-am +installcheck-am: +installcheck: installcheck-am +install-exec-am: install-binPROGRAMS +install-exec: install-exec-am + +install-data-am: install-man +install-data: install-data-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-am +uninstall-am: uninstall-binPROGRAMS uninstall-man +uninstall: uninstall-am +all-am: Makefile $(LIBRARIES) $(PROGRAMS) $(MANS) +all-redirect: all-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: + $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(mandir)/man1 + + +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + +maintainer-clean-generic: +mostlyclean-am: mostlyclean-noinstLIBRARIES mostlyclean-compile \ + mostlyclean-libtool mostlyclean-binPROGRAMS \ + mostlyclean-tags mostlyclean-depend mostlyclean-generic + +mostlyclean: mostlyclean-am + +clean-am: clean-noinstLIBRARIES clean-compile clean-libtool \ + clean-binPROGRAMS clean-tags clean-depend clean-generic \ + mostlyclean-am + +clean: clean-am + +distclean-am: distclean-noinstLIBRARIES distclean-compile \ + distclean-libtool distclean-binPROGRAMS distclean-tags \ + distclean-depend distclean-generic clean-am + -rm -f libtool + +distclean: distclean-am + +maintainer-clean-am: maintainer-clean-noinstLIBRARIES \ + maintainer-clean-compile maintainer-clean-libtool \ + maintainer-clean-binPROGRAMS maintainer-clean-tags \ + maintainer-clean-depend maintainer-clean-generic \ + distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-am + +.PHONY: mostlyclean-noinstLIBRARIES distclean-noinstLIBRARIES \ +clean-noinstLIBRARIES maintainer-clean-noinstLIBRARIES \ +mostlyclean-compile distclean-compile clean-compile \ +maintainer-clean-compile mostlyclean-libtool distclean-libtool \ +clean-libtool maintainer-clean-libtool mostlyclean-binPROGRAMS \ +distclean-binPROGRAMS clean-binPROGRAMS maintainer-clean-binPROGRAMS \ +uninstall-binPROGRAMS install-binPROGRAMS install-man1 uninstall-man1 \ +install-man uninstall-man tags mostlyclean-tags distclean-tags \ +clean-tags maintainer-clean-tags distdir mostlyclean-depend \ +distclean-depend clean-depend maintainer-clean-depend info-am info \ +dvi-am dvi check check-am installcheck-am installcheck install-exec-am \ +install-exec install-data-am install-data install-am install \ +uninstall-am uninstall all-redirect all-am all installdirs \ +mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +# Build a modified library in the ginac-subdir and put it into the cint-subdir: +libginac.a: + (cd ../ginac && \ + $(MAKE) clean; \ + $(MAKE) CXXFLAGS="$$CXXFLAGS -DNO_NAMESPACE_GINAC" && \ + $(MAKE) install-libLTLIBRARIES prefix=`pwd`/../cint libdir=`pwd`/../cint && \ + $(MAKE) clean) + +ginaccint: libginac.a ginaccint.cpp + $(MAKE) -f Makefile.makecint + +# Files which are generated by perl scripts +$(srcdir)/dummies.h $(srcdir)/dummies.cpp: $(srcdir)/dummies.pl + cd $(srcdir) && perl dummies.pl + +# Force build of headers before compilation +$(srcdir)/ginaccint.cpp: $(srcdir)/dummies.h + +# 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: diff --git a/cint/configure b/cint/configure deleted file mode 100755 index ec988b42..00000000 --- a/cint/configure +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/sh - -echo -echo "GiNaCcint configure script" -echo "--------------------------" -echo -echo "Warning: this is not a sophisticated GNU configure script!" -echo -echo "It tests if cint is installed" -echo "What it does NOT check:" -echo " the ginac source files (e.g. ginac.h) must be in ../ginac" -echo " libginac must have been compiled with -D NO_GINAC_NAMESPACE" -echo " libginac.a or libginac.so must be found in ../ginac/.libs" -echo " libcln.a or libcln.so must be in the standard link path" -echo - -if [ X"$CINTSYSDIR"X = "XX" ]; then - echo "ERROR: cint does not seem to be installed (\$CINTSYSDIR not set)" - exit -fi; -echo "ok, cint seems to be installed (\$CINTSYSDIR = $CINTSYSDIR)" - -if [ X`which cint`X = "XX" ]; then - echo "ERROR: cint not in \$PATH" - exit -fi; -echo "ok, cint seems to be in \$PATH" - -makecint -mk Makefile -o ginaccint -m \ - -D OBSCURE_CINT_HACK -D NO_GINAC_NAMESPACE \ - -I .. -I $CINTSYSDIR \ - -m -H ../ginac/ginac.h -H cint_workaround.h \ - -C++ dummy_ginsh.cpp -C++ ginaccint.cpp \ - -l ../ginac/.libs/libginac.a -lcln \ - -cint -M0x10 -echo "ok, makecint has created the Makefile" - -echo -echo "Configuration done. Now type \"make\"." -echo "(please ignore template warnings about 'statement with no effect')" - diff --git a/cint/dummies.cpp b/cint/dummies.cpp new file mode 100644 index 00000000..66d57d9a --- /dev/null +++ b/cint/dummies.cpp @@ -0,0 +1,14 @@ +/* dummies.cpp + * + * Dummies and stubs to overcome certain deficiencies of Cint. + * This file was generated automatically by dummies.pl. + * Please do not modify it directly, edit the perl script instead! + */ + +#include + +#ifndef NO_NAMESPACE_GINAC +using namespace GiNaC; +#endif // ndef NO_NAMESPACE_GINAC + +void ginsh_get_ginac_functions(void) { } diff --git a/cint/dummies.h b/cint/dummies.h new file mode 100644 index 00000000..3f017b46 --- /dev/null +++ b/cint/dummies.h @@ -0,0 +1,583 @@ +/* dummies.h + * + * Dummies and wrappers to overcome certain deficiencies of Cint. + * This file was generated automatically by dummies.pl. + * Please do not modify it directly, edit the perl script instead! + */ + +// fixes for sin(x) +inline ex sin(symbol const & x) { return sin(ex(x)); } +inline ex sin(function const & x) { return sin(ex(x)); } +inline ex sin(constant const & x) { return sin(ex(x)); } +inline ex sin(idx const & x) { return sin(ex(x)); } +inline ex sin(lorentzidx const & x) { return sin(ex(x)); } +inline ex sin(coloridx const & x) { return sin(ex(x)); } + +// fixes for cos(x) +inline ex cos(symbol const & x) { return cos(ex(x)); } +inline ex cos(function const & x) { return cos(ex(x)); } +inline ex cos(constant const & x) { return cos(ex(x)); } +inline ex cos(idx const & x) { return cos(ex(x)); } +inline ex cos(lorentzidx const & x) { return cos(ex(x)); } +inline ex cos(coloridx const & x) { return cos(ex(x)); } + +// fixes for tan(x) +inline ex tan(symbol const & x) { return tan(ex(x)); } +inline ex tan(function const & x) { return tan(ex(x)); } +inline ex tan(constant const & x) { return tan(ex(x)); } +inline ex tan(idx const & x) { return tan(ex(x)); } +inline ex tan(lorentzidx const & x) { return tan(ex(x)); } +inline ex tan(coloridx const & x) { return tan(ex(x)); } + +// fixes for asin(x) +inline ex asin(symbol const & x) { return asin(ex(x)); } +inline ex asin(function const & x) { return asin(ex(x)); } +inline ex asin(constant const & x) { return asin(ex(x)); } +inline ex asin(idx const & x) { return asin(ex(x)); } +inline ex asin(lorentzidx const & x) { return asin(ex(x)); } +inline ex asin(coloridx const & x) { return asin(ex(x)); } + +// fixes for acos(x) +inline ex acos(symbol const & x) { return acos(ex(x)); } +inline ex acos(function const & x) { return acos(ex(x)); } +inline ex acos(constant const & x) { return acos(ex(x)); } +inline ex acos(idx const & x) { return acos(ex(x)); } +inline ex acos(lorentzidx const & x) { return acos(ex(x)); } +inline ex acos(coloridx const & x) { return acos(ex(x)); } + +// fixes for atan(x) +inline ex atan(symbol const & x) { return atan(ex(x)); } +inline ex atan(function const & x) { return atan(ex(x)); } +inline ex atan(constant const & x) { return atan(ex(x)); } +inline ex atan(idx const & x) { return atan(ex(x)); } +inline ex atan(lorentzidx const & x) { return atan(ex(x)); } +inline ex atan(coloridx const & x) { return atan(ex(x)); } + +// fixes for exp(x) +inline ex exp(symbol const & x) { return exp(ex(x)); } +inline ex exp(function const & x) { return exp(ex(x)); } +inline ex exp(constant const & x) { return exp(ex(x)); } +inline ex exp(idx const & x) { return exp(ex(x)); } +inline ex exp(lorentzidx const & x) { return exp(ex(x)); } +inline ex exp(coloridx const & x) { return exp(ex(x)); } + +// fixes for log(x) +inline ex log(symbol const & x) { return log(ex(x)); } +inline ex log(function const & x) { return log(ex(x)); } +inline ex log(constant const & x) { return log(ex(x)); } +inline ex log(idx const & x) { return log(ex(x)); } +inline ex log(lorentzidx const & x) { return log(ex(x)); } +inline ex log(coloridx const & x) { return log(ex(x)); } + +// fixes for sqrt(x) +inline ex sqrt(symbol const & x) { return sqrt(ex(x)); } +inline ex sqrt(function const & x) { return sqrt(ex(x)); } +inline ex sqrt(constant const & x) { return sqrt(ex(x)); } +inline ex sqrt(idx const & x) { return sqrt(ex(x)); } +inline ex sqrt(lorentzidx const & x) { return sqrt(ex(x)); } +inline ex sqrt(coloridx const & x) { return sqrt(ex(x)); } + +// fixes for sinh(x) +inline ex sinh(symbol const & x) { return sinh(ex(x)); } +inline ex sinh(function const & x) { return sinh(ex(x)); } +inline ex sinh(constant const & x) { return sinh(ex(x)); } +inline ex sinh(idx const & x) { return sinh(ex(x)); } +inline ex sinh(lorentzidx const & x) { return sinh(ex(x)); } +inline ex sinh(coloridx const & x) { return sinh(ex(x)); } + +// fixes for cosh(x) +inline ex cosh(symbol const & x) { return cosh(ex(x)); } +inline ex cosh(function const & x) { return cosh(ex(x)); } +inline ex cosh(constant const & x) { return cosh(ex(x)); } +inline ex cosh(idx const & x) { return cosh(ex(x)); } +inline ex cosh(lorentzidx const & x) { return cosh(ex(x)); } +inline ex cosh(coloridx const & x) { return cosh(ex(x)); } + +// fixes for tanh(x) +inline ex tanh(symbol const & x) { return tanh(ex(x)); } +inline ex tanh(function const & x) { return tanh(ex(x)); } +inline ex tanh(constant const & x) { return tanh(ex(x)); } +inline ex tanh(idx const & x) { return tanh(ex(x)); } +inline ex tanh(lorentzidx const & x) { return tanh(ex(x)); } +inline ex tanh(coloridx const & x) { return tanh(ex(x)); } + +// fixes for abs(x) +inline ex abs(symbol const & x) { return abs(ex(x)); } +inline ex abs(function const & x) { return abs(ex(x)); } +inline ex abs(constant const & x) { return abs(ex(x)); } +inline ex abs(idx const & x) { return abs(ex(x)); } +inline ex abs(lorentzidx const & x) { return abs(ex(x)); } +inline ex abs(coloridx const & x) { return abs(ex(x)); } + +// fixes for pow(x,y) +inline ex pow(symbol const & x,symbol const & y) { + return pow(ex(x),ex(y)); +} +inline ex pow(symbol const & x,function const & y) { + return pow(ex(x),ex(y)); +} +inline ex pow(symbol const & x,constant const & y) { + return pow(ex(x),ex(y)); +} +inline ex pow(symbol const & x,idx const & y) { + return pow(ex(x),ex(y)); +} +inline ex pow(symbol const & x,lorentzidx const & y) { + return pow(ex(x),ex(y)); +} +inline ex pow(symbol const & x,coloridx const & y) { + return pow(ex(x),ex(y)); +} +inline ex pow(function const & x,symbol const & y) { + return pow(ex(x),ex(y)); +} +inline ex pow(function const & x,function const & y) { + return pow(ex(x),ex(y)); +} +inline ex pow(function const & x,constant const & y) { + return pow(ex(x),ex(y)); +} +inline ex pow(function const & x,idx const & y) { + return pow(ex(x),ex(y)); +} +inline ex pow(function const & x,lorentzidx const & y) { + return pow(ex(x),ex(y)); +} +inline ex pow(function const & x,coloridx const & y) { + return pow(ex(x),ex(y)); +} +inline ex pow(constant const & x,symbol const & y) { + return pow(ex(x),ex(y)); +} +inline ex pow(constant const & x,function const & y) { + return pow(ex(x),ex(y)); +} +inline ex pow(constant const & x,constant const & y) { + return pow(ex(x),ex(y)); +} +inline ex pow(constant const & x,idx const & y) { + return pow(ex(x),ex(y)); +} +inline ex pow(constant const & x,lorentzidx const & y) { + return pow(ex(x),ex(y)); +} +inline ex pow(constant const & x,coloridx const & y) { + return pow(ex(x),ex(y)); +} +inline ex pow(idx const & x,symbol const & y) { + return pow(ex(x),ex(y)); +} +inline ex pow(idx const & x,function const & y) { + return pow(ex(x),ex(y)); +} +inline ex pow(idx const & x,constant const & y) { + return pow(ex(x),ex(y)); +} +inline ex pow(idx const & x,idx const & y) { + return pow(ex(x),ex(y)); +} +inline ex pow(idx const & x,lorentzidx const & y) { + return pow(ex(x),ex(y)); +} +inline ex pow(idx const & x,coloridx const & y) { + return pow(ex(x),ex(y)); +} +inline ex pow(lorentzidx const & x,symbol const & y) { + return pow(ex(x),ex(y)); +} +inline ex pow(lorentzidx const & x,function const & y) { + return pow(ex(x),ex(y)); +} +inline ex pow(lorentzidx const & x,constant const & y) { + return pow(ex(x),ex(y)); +} +inline ex pow(lorentzidx const & x,idx const & y) { + return pow(ex(x),ex(y)); +} +inline ex pow(lorentzidx const & x,lorentzidx const & y) { + return pow(ex(x),ex(y)); +} +inline ex pow(lorentzidx const & x,coloridx const & y) { + return pow(ex(x),ex(y)); +} +inline ex pow(coloridx const & x,symbol const & y) { + return pow(ex(x),ex(y)); +} +inline ex pow(coloridx const & x,function const & y) { + return pow(ex(x),ex(y)); +} +inline ex pow(coloridx const & x,constant const & y) { + return pow(ex(x),ex(y)); +} +inline ex pow(coloridx const & x,idx const & y) { + return pow(ex(x),ex(y)); +} +inline ex pow(coloridx const & x,lorentzidx const & y) { + return pow(ex(x),ex(y)); +} +inline ex pow(coloridx const & x,coloridx const & y) { + return pow(ex(x),ex(y)); +} +inline ex pow(symbol const & x,numeric const & y) { + return pow(ex(x),ex(y)); +} +inline ex pow(symbol const & x,int const & y) { + return pow(ex(x),ex(y)); +} +inline ex pow(symbol const & x,double const & y) { + return pow(ex(x),ex(y)); +} +inline ex pow(function const & x,numeric const & y) { + return pow(ex(x),ex(y)); +} +inline ex pow(function const & x,int const & y) { + return pow(ex(x),ex(y)); +} +inline ex pow(function const & x,double const & y) { + return pow(ex(x),ex(y)); +} +inline ex pow(constant const & x,numeric const & y) { + return pow(ex(x),ex(y)); +} +inline ex pow(constant const & x,int const & y) { + return pow(ex(x),ex(y)); +} +inline ex pow(constant const & x,double const & y) { + return pow(ex(x),ex(y)); +} +inline ex pow(idx const & x,numeric const & y) { + return pow(ex(x),ex(y)); +} +inline ex pow(idx const & x,int const & y) { + return pow(ex(x),ex(y)); +} +inline ex pow(idx const & x,double const & y) { + return pow(ex(x),ex(y)); +} +inline ex pow(lorentzidx const & x,numeric const & y) { + return pow(ex(x),ex(y)); +} +inline ex pow(lorentzidx const & x,int const & y) { + return pow(ex(x),ex(y)); +} +inline ex pow(lorentzidx const & x,double const & y) { + return pow(ex(x),ex(y)); +} +inline ex pow(coloridx const & x,numeric const & y) { + return pow(ex(x),ex(y)); +} +inline ex pow(coloridx const & x,int const & y) { + return pow(ex(x),ex(y)); +} +inline ex pow(coloridx const & x,double const & y) { + return pow(ex(x),ex(y)); +} +inline ex pow(numeric const & x,symbol const & y) { + return pow(ex(x),ex(y)); +} +inline ex pow(numeric const & x,function const & y) { + return pow(ex(x),ex(y)); +} +inline ex pow(numeric const & x,constant const & y) { + return pow(ex(x),ex(y)); +} +inline ex pow(numeric const & x,idx const & y) { + return pow(ex(x),ex(y)); +} +inline ex pow(numeric const & x,lorentzidx const & y) { + return pow(ex(x),ex(y)); +} +inline ex pow(numeric const & x,coloridx const & y) { + return pow(ex(x),ex(y)); +} +inline ex pow(int const & x,symbol const & y) { + return pow(ex(x),ex(y)); +} +inline ex pow(int const & x,function const & y) { + return pow(ex(x),ex(y)); +} +inline ex pow(int const & x,constant const & y) { + return pow(ex(x),ex(y)); +} +inline ex pow(int const & x,idx const & y) { + return pow(ex(x),ex(y)); +} +inline ex pow(int const & x,lorentzidx const & y) { + return pow(ex(x),ex(y)); +} +inline ex pow(int const & x,coloridx const & y) { + return pow(ex(x),ex(y)); +} +inline ex pow(double const & x,symbol const & y) { + return pow(ex(x),ex(y)); +} +inline ex pow(double const & x,function const & y) { + return pow(ex(x),ex(y)); +} +inline ex pow(double const & x,constant const & y) { + return pow(ex(x),ex(y)); +} +inline ex pow(double const & x,idx const & y) { + return pow(ex(x),ex(y)); +} +inline ex pow(double const & x,lorentzidx const & y) { + return pow(ex(x),ex(y)); +} +inline ex pow(double const & x,coloridx const & y) { + return pow(ex(x),ex(y)); +} +inline ex pow(ex const & x,numeric const & y) { + return pow(ex(x),ex(y)); +} +inline ex pow(ex const & x,int const & y) { + return pow(ex(x),ex(y)); +} +inline ex pow(ex const & x,double const & y) { + return pow(ex(x),ex(y)); +} +inline ex pow(numeric const & x,ex const & y) { + return pow(ex(x),ex(y)); +} +inline ex pow(int const & x,ex const & y) { + return pow(ex(x),ex(y)); +} +inline ex pow(double const & x,ex const & y) { + return pow(ex(x),ex(y)); +} + +// fixes for atan2(x,y) +inline ex atan2(symbol const & x,symbol const & y) { + return atan2(ex(x),ex(y)); +} +inline ex atan2(symbol const & x,function const & y) { + return atan2(ex(x),ex(y)); +} +inline ex atan2(symbol const & x,constant const & y) { + return atan2(ex(x),ex(y)); +} +inline ex atan2(symbol const & x,idx const & y) { + return atan2(ex(x),ex(y)); +} +inline ex atan2(symbol const & x,lorentzidx const & y) { + return atan2(ex(x),ex(y)); +} +inline ex atan2(symbol const & x,coloridx const & y) { + return atan2(ex(x),ex(y)); +} +inline ex atan2(function const & x,symbol const & y) { + return atan2(ex(x),ex(y)); +} +inline ex atan2(function const & x,function const & y) { + return atan2(ex(x),ex(y)); +} +inline ex atan2(function const & x,constant const & y) { + return atan2(ex(x),ex(y)); +} +inline ex atan2(function const & x,idx const & y) { + return atan2(ex(x),ex(y)); +} +inline ex atan2(function const & x,lorentzidx const & y) { + return atan2(ex(x),ex(y)); +} +inline ex atan2(function const & x,coloridx const & y) { + return atan2(ex(x),ex(y)); +} +inline ex atan2(constant const & x,symbol const & y) { + return atan2(ex(x),ex(y)); +} +inline ex atan2(constant const & x,function const & y) { + return atan2(ex(x),ex(y)); +} +inline ex atan2(constant const & x,constant const & y) { + return atan2(ex(x),ex(y)); +} +inline ex atan2(constant const & x,idx const & y) { + return atan2(ex(x),ex(y)); +} +inline ex atan2(constant const & x,lorentzidx const & y) { + return atan2(ex(x),ex(y)); +} +inline ex atan2(constant const & x,coloridx const & y) { + return atan2(ex(x),ex(y)); +} +inline ex atan2(idx const & x,symbol const & y) { + return atan2(ex(x),ex(y)); +} +inline ex atan2(idx const & x,function const & y) { + return atan2(ex(x),ex(y)); +} +inline ex atan2(idx const & x,constant const & y) { + return atan2(ex(x),ex(y)); +} +inline ex atan2(idx const & x,idx const & y) { + return atan2(ex(x),ex(y)); +} +inline ex atan2(idx const & x,lorentzidx const & y) { + return atan2(ex(x),ex(y)); +} +inline ex atan2(idx const & x,coloridx const & y) { + return atan2(ex(x),ex(y)); +} +inline ex atan2(lorentzidx const & x,symbol const & y) { + return atan2(ex(x),ex(y)); +} +inline ex atan2(lorentzidx const & x,function const & y) { + return atan2(ex(x),ex(y)); +} +inline ex atan2(lorentzidx const & x,constant const & y) { + return atan2(ex(x),ex(y)); +} +inline ex atan2(lorentzidx const & x,idx const & y) { + return atan2(ex(x),ex(y)); +} +inline ex atan2(lorentzidx const & x,lorentzidx const & y) { + return atan2(ex(x),ex(y)); +} +inline ex atan2(lorentzidx const & x,coloridx const & y) { + return atan2(ex(x),ex(y)); +} +inline ex atan2(coloridx const & x,symbol const & y) { + return atan2(ex(x),ex(y)); +} +inline ex atan2(coloridx const & x,function const & y) { + return atan2(ex(x),ex(y)); +} +inline ex atan2(coloridx const & x,constant const & y) { + return atan2(ex(x),ex(y)); +} +inline ex atan2(coloridx const & x,idx const & y) { + return atan2(ex(x),ex(y)); +} +inline ex atan2(coloridx const & x,lorentzidx const & y) { + return atan2(ex(x),ex(y)); +} +inline ex atan2(coloridx const & x,coloridx const & y) { + return atan2(ex(x),ex(y)); +} +inline ex atan2(symbol const & x,numeric const & y) { + return atan2(ex(x),ex(y)); +} +inline ex atan2(symbol const & x,int const & y) { + return atan2(ex(x),ex(y)); +} +inline ex atan2(symbol const & x,double const & y) { + return atan2(ex(x),ex(y)); +} +inline ex atan2(function const & x,numeric const & y) { + return atan2(ex(x),ex(y)); +} +inline ex atan2(function const & x,int const & y) { + return atan2(ex(x),ex(y)); +} +inline ex atan2(function const & x,double const & y) { + return atan2(ex(x),ex(y)); +} +inline ex atan2(constant const & x,numeric const & y) { + return atan2(ex(x),ex(y)); +} +inline ex atan2(constant const & x,int const & y) { + return atan2(ex(x),ex(y)); +} +inline ex atan2(constant const & x,double const & y) { + return atan2(ex(x),ex(y)); +} +inline ex atan2(idx const & x,numeric const & y) { + return atan2(ex(x),ex(y)); +} +inline ex atan2(idx const & x,int const & y) { + return atan2(ex(x),ex(y)); +} +inline ex atan2(idx const & x,double const & y) { + return atan2(ex(x),ex(y)); +} +inline ex atan2(lorentzidx const & x,numeric const & y) { + return atan2(ex(x),ex(y)); +} +inline ex atan2(lorentzidx const & x,int const & y) { + return atan2(ex(x),ex(y)); +} +inline ex atan2(lorentzidx const & x,double const & y) { + return atan2(ex(x),ex(y)); +} +inline ex atan2(coloridx const & x,numeric const & y) { + return atan2(ex(x),ex(y)); +} +inline ex atan2(coloridx const & x,int const & y) { + return atan2(ex(x),ex(y)); +} +inline ex atan2(coloridx const & x,double const & y) { + return atan2(ex(x),ex(y)); +} +inline ex atan2(numeric const & x,symbol const & y) { + return atan2(ex(x),ex(y)); +} +inline ex atan2(numeric const & x,function const & y) { + return atan2(ex(x),ex(y)); +} +inline ex atan2(numeric const & x,constant const & y) { + return atan2(ex(x),ex(y)); +} +inline ex atan2(numeric const & x,idx const & y) { + return atan2(ex(x),ex(y)); +} +inline ex atan2(numeric const & x,lorentzidx const & y) { + return atan2(ex(x),ex(y)); +} +inline ex atan2(numeric const & x,coloridx const & y) { + return atan2(ex(x),ex(y)); +} +inline ex atan2(int const & x,symbol const & y) { + return atan2(ex(x),ex(y)); +} +inline ex atan2(int const & x,function const & y) { + return atan2(ex(x),ex(y)); +} +inline ex atan2(int const & x,constant const & y) { + return atan2(ex(x),ex(y)); +} +inline ex atan2(int const & x,idx const & y) { + return atan2(ex(x),ex(y)); +} +inline ex atan2(int const & x,lorentzidx const & y) { + return atan2(ex(x),ex(y)); +} +inline ex atan2(int const & x,coloridx const & y) { + return atan2(ex(x),ex(y)); +} +inline ex atan2(double const & x,symbol const & y) { + return atan2(ex(x),ex(y)); +} +inline ex atan2(double const & x,function const & y) { + return atan2(ex(x),ex(y)); +} +inline ex atan2(double const & x,constant const & y) { + return atan2(ex(x),ex(y)); +} +inline ex atan2(double const & x,idx const & y) { + return atan2(ex(x),ex(y)); +} +inline ex atan2(double const & x,lorentzidx const & y) { + return atan2(ex(x),ex(y)); +} +inline ex atan2(double const & x,coloridx const & y) { + return atan2(ex(x),ex(y)); +} +inline ex atan2(ex const & x,numeric const & y) { + return atan2(ex(x),ex(y)); +} +inline ex atan2(ex const & x,int const & y) { + return atan2(ex(x),ex(y)); +} +inline ex atan2(ex const & x,double const & y) { + return atan2(ex(x),ex(y)); +} +inline ex atan2(numeric const & x,ex const & y) { + return atan2(ex(x),ex(y)); +} +inline ex atan2(int const & x,ex const & y) { + return atan2(ex(x),ex(y)); +} +inline ex atan2(double const & x,ex const & y) { + return atan2(ex(x),ex(y)); +} + diff --git a/cint/genheader.pl b/cint/dummies.pl old mode 100755 new mode 100644 similarity index 55% rename from cint/genheader.pl rename to cint/dummies.pl index 7c4a98fb..86f797a6 --- a/cint/genheader.pl +++ b/cint/dummies.pl @@ -1,15 +1,17 @@ -#!/usr/bin/perl -w +# Create files containing dummies, wrappers and so on to overcome certain +# deficiencies in Cint. In an ideal world it would be unnecessary. + +$header='dummies.h'; +$source='dummies.cpp'; # Generate a header file which is additionally included in cint # to work around the broken overloading resolution of cint for -# C library functions -# e.g. if a function declared as ex sin(ex const & x) and called +# C library functions and other problems. +# E.g: if a function declared as ex sin(ex const & x) and called # with sin(y) where y is a symbol, cint favours a conversion from # symbol to void * to double over symbol to ex and thus calls the # C math library function double sin(double x) (sigh!) -$header='cint_workaround.h'; - # types which need help to be converted to ex @types=('symbol','function','constant','idx','lorentzidx','coloridx'); @moretypes=('numeric','int','double'); @@ -24,6 +26,18 @@ $header='cint_workaround.h'; open OUT,">$header"; +$opening=<$source"; + +$opening=< + +#ifndef NO_NAMESPACE_GINAC +using namespace GiNaC; +#endif // ndef NO_NAMESPACE_GINAC + +END_OF_OPENING + +print OUT $opening; +print OUT "void ginsh_get_ginac_functions(void) { }\n"; + +close OUT; +# Create dummies diff --git a/cint/dummy_ginsh.cpp b/cint/dummy_ginsh.cpp deleted file mode 100644 index 0e384f2e..00000000 --- a/cint/dummy_ginsh.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#include - -#ifndef NO_GINAC_NAMESPACE -using namespace GiNaC; -#endif // ndef NO_GINAC_NAMESPACE - -void ginsh_get_ginac_functions(void) -{ -} - -ex IEvalf(void) -{ - return 0; -} diff --git a/cint/ginaccint.1 b/cint/ginaccint.1 new file mode 100644 index 00000000..c74405ae --- /dev/null +++ b/cint/ginaccint.1 @@ -0,0 +1,129 @@ +.TH ginaccint 1 "January, 2000" "GiNaC" +.SH NAME +GiNaC-cint \- An interactive interface for GiNaC based on the Cint C/C++ interpreter +.SH SYNPOSIS +.B ginaccint +.SH DESCRIPTION +.B ginaccint +is an interactive frontend for the GiNaC symbolic computation +framework. It is a tool that lets you write interactive programs in +C++ that directly make use of GiNaC's classes and thus a more complete +replacement for traditional interactive computer algebra systems than +\fBginsh\fP(1) is. Programs may be composed as scripts and later compiled +with the native compiler and linked into the system. +.SH USAGE +.SS INPUT FORMAT +After startup, ginsh displays a prompt signifying that it is ready to +accept your input. All C++ statements are valid as input, extended by +GiNaC's numeric or symbolic expressions. E.g. +.BR fibonacci(24)/1104; +returns a GiNaC object of class +.BR ex, +, which in this case represents the numeric 42. Symbols are declared by +statements as +.nf +GiNaC> symbol x("x"), y("y"), z; +.fi +which defines two named symbols and an anonymous one for later usage. +All GiNaC methods and functions are available as they would be typed +in C++. It is not necessary to explicitly invoke a print command as +the last expression is automatically printed: +.nf +GiNaC> pow(x+y,4).expand(); +out2 = x^4+4*x^3*y+6*x^2*y^2+4*x*y^3+y^4 +.fi +Statements are generally closed by either when a closing brace +.RB ( } ) +matches the first opening brace +.RB ( { ) +or a semicolon +.RB ( ; ) +is encountered. + + +.SS FUNCTION DEFINITIONS +GiNaC-cint must be put into a special mode in order to define a +function. This is done with the command +.RB .function . +After that any function definition in valid C++ syntax may be typed +in. It becomes immediatly available for usage. + +.SH EXAMPLES +.nf +GiNaC> symbol x("x"), y("y"), z("z"); +GiNaC> ex a = pow(x,2)-x-2; +GiNaC> ex b = pow(x+1,2); +GiNaC> ex s = a/b; +GiNaC> s.diff(x); +out1 -2*(1+x)^(-3)*(-2-x+x^2)+(-1+2*x)*(1+x)^(-2) +GiNaC> s.normal(); +out2 (-2+x)*(1+x)^(-1) +GiNaC> .function +next expression can be a function definition +GiNaC> ex EulerNumber(unsigned n) + > { + > symbol x; + > ex generator = pow(cosh(x),-1); + > return generator.diff(x,n).subs(x==0); + > } +creating file /tmp/ginac26197caa +GiNaC> EulerNumber(42); +out3 -10364622733519612119397957304745185976310201 +GiNaC> quit; +.fi + +.SH BUGS +Cint accepts most of K&R and ANSI C/C++ language construct but not +perfect. In fact, Cint is not aimed to be a 100% ANSI/ISO compliant +C/C++ language processor. It rather is a portable script language +environment which is close enough to the standard C++. See the file +.BR limitati.txt +in your Cint distribution. Please take the time to track down any bug +you encounter as far as possible and contact Masaharu Goto + for Cint-related bugs and + for any bugs in the GiNaC engine. + +.SH AUTHOR +.TP +The GiNaC Group: +.br +Christian Bauer +.br +Alexander Frink +.br +Richard Kreckel +.SH SEE ALSO +GiNaC Tutorial \- An open framework for symbolic computation within the +C++ programming language +.PP +CLN \- A Class Library for Numbers, Bruno Haible +.PP +\fBginsh\fP(1) +.SH COPYRIGHT +.SS CINT COPYRIGHT +Copyright \(co of Cint and associated tools are owned by Agilent +Technologies Japan Company and the author. Acknowledgement to the +author by e-mail is recommended at installation. Source code, binary +executable or library of Cint and associated tools can be used, +modified and distributed free of charge for any purpose provided that +the copyright notice appear in all copies and that both that copyright +notice and this permission notice appear in documentation. +Registration is requested, at this moment, for commercial use. Send +e-mail to the author . The registration is +free. +.SS GINAC COPYRIGHT +Copyright \(co 1999-2000 Johannes Gutenberg Universit\(:at 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., 675 Mass Ave, Cambridge, MA 02139, USA. diff --git a/cint/ginaccint.cpp b/cint/ginaccint.cpp index cca85636..724bffb3 100644 --- a/cint/ginaccint.cpp +++ b/cint/ginaccint.cpp @@ -122,12 +122,12 @@ void process_tempfile(string const & command) static unsigned out_count=0; if (TYPES_EQUAL(retval,ref_ex)) { if (ex::last_created_or_assigned_bp_can_be_converted_to_ex()) { - string varname="Out"+ToString(++out_count); + string varname="out"+ToString(++out_count); exec_tempfile("ex "+varname+"(*ex::last_created_or_assigned_bp);\n" +"LLLAST=LLAST;\n" +"LLAST=LAST;\n" +"LAST="+varname+";\n" - +"cout << \""+varname+" = \" << "+varname+" << endl << endl;"); + +"cout << \""+varname+" \" << "+varname+" << endl << endl;"); } else { cout << "warning: last_created_or_assigned_bp modified 0 or not evaluated or not dynallocated" << endl; } @@ -137,7 +137,13 @@ void process_tempfile(string const & command) void greeting(void) { - cout << "Welcome to GiNaCcint V0.2" << endl << endl; + cout << "Welcome to GiNaC-cint V" << VERSION << endl; + cout << "This software is provided \"as is\" without any warranty. Copyright of Cint is" << endl + << "owned by Agilent Technologies Japan and Masaharu Goto. Registration is" << endl + << " __, _______ requested, at this moment, for commercial use. Send e-mail to" << endl + << " (__) * | . The registration is free." << endl + << " ._) i N a C | The GiNaC framework is Copyright by Johannes Gutenberg Univ." << endl + << "<-------------' Germany and licensed under the terms and conditions of the GPL." << endl << endl; cout << "To quit, type 'quit;', 'exit;', 'bye;', '.q', '.quit', '.exit' or '.bye'" << endl; } @@ -159,7 +165,7 @@ int main(void) bool quit=false; bool next_command_is_function=false; while (!quit) { - strcpy(prompt,"GiNaCcint> "); + strcpy(prompt,"GiNaC> "); int open_braces=0; bool end_of_command=false; string command; @@ -196,7 +202,7 @@ int main(void) end_of_command=true; } } - strcpy(prompt," (more) > "); + strcpy(prompt," > "); } string stripped_command=strip_whitespace(command); if ((stripped_command=="quit;")|| diff --git a/configure b/configure index bd6c576b..fe76b789 100755 --- a/configure +++ b/configure @@ -544,10 +544,10 @@ fi GINACLIB_MAJOR_VERSION=0 -GINACLIB_MINOR_VERSION=4 -GINACLIB_MICRO_VERSION=1 +GINACLIB_MINOR_VERSION=5 +GINACLIB_MICRO_VERSION=0 GINACLIB_INTERFACE_AGE=0 -GINACLIB_BINARY_AGE=1 +GINACLIB_BINARY_AGE=0 GINACLIB_VERSION=$GINACLIB_MAJOR_VERSION.$GINACLIB_MINOR_VERSION.$GINACLIB_MICRO_VERSION @@ -2853,13 +2853,24 @@ fi +LIBGINACCINT= +GINACCINTDIR= if [ "x$with_cint" != "xno" ]; then - echo "with_cint is set to: $with_cint" - CINTSYSDIR=$with_cint + if [ "x$enable_static" != "xyes" ]; then + { echo "configure: error: currently GiNaC-cint needs to build a static libginac" 1>&2; exit 1; } + fi + if [ "x$with_cint" = "xyes" ]; then + if [ "x$CINTSYSDIR" = "x" ]; then + { echo "configure: error: please export \$CINTSYSDIR or specify --with-cint=CINTSYSDIR" 1>&2; exit 1; } + fi + else + CINTSYSDIR=$with_cint + export CINTSYSDIR + fi # Extract the first word of "cint", so it can be a program name with args. set dummy cint; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2863: checking for $ac_word" >&5 +echo "configure:2874: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_CINT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2895,7 +2906,7 @@ fi # Extract the first word of "makecint", so it can be a program name with args. set dummy makecint; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2899: checking for $ac_word" >&5 +echo "configure:2910: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MAKECINT'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2928,13 +2939,24 @@ else echo "$ac_t""no" 1>&6 fi - if [ "$cint" -a "$makecint" ]; then - echo "$ac_t""Configuring GiNaC-cint" 1>&6 + if [ "$CINT" -a "$MAKECINT" ]; then + echo "$ac_t""creating cint/Makefile" 1>&6 + (cd cint && \ + $MAKECINT -mk Makefile.makecint -o ginaccint -m \ + -D OBSCURE_CINT_HACK -D NO_NAMESPACE_GINAC \ + -I .. -I $CINTSYSDIR -m -H ../ginac/ginac.h dummies.h \ + -C++ dummies.cpp -C++ ginaccint.cpp \ + -l ./libginac.a -lcln -cint -M0x10; \ + cd ..) + LIBGINACCINT="libginac.a" + GINACCINTDIR="cint" else { echo "configure: error: Cannot configure GiNaC-cint" 1>&2; exit 1; } fi fi + + trap '' 1 2 15 cat > confcache <<\EOF # This file is a shell script that caches the results of configure @@ -3047,6 +3069,7 @@ tools/Makefile doc/Makefile doc/tutorial/Makefile doc/reference/Makefile +cint/Makefile config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF diff --git a/configure.in b/configure.in index 94f525de..9249f9da 100644 --- a/configure.in +++ b/configure.in @@ -18,10 +18,10 @@ dnl autoconf sees "AC_MAJOR_VERSION" and complains about an undefined macro dnl (don't we all *love* M4?)... GINACLIB_MAJOR_VERSION=0 -GINACLIB_MINOR_VERSION=4 -GINACLIB_MICRO_VERSION=1 +GINACLIB_MINOR_VERSION=5 +GINACLIB_MICRO_VERSION=0 GINACLIB_INTERFACE_AGE=0 -GINACLIB_BINARY_AGE=1 +GINACLIB_BINARY_AGE=0 GINACLIB_VERSION=$GINACLIB_MAJOR_VERSION.$GINACLIB_MINOR_VERSION.$GINACLIB_MICRO_VERSION AC_SUBST(GINACLIB_MAJOR_VERSION) @@ -143,18 +143,40 @@ fi AC_SUBST(TUTORIAL_TARGETS) AC_SUBST(REFERENCE_TARGETS) -dnl Configure GiNaC-cint, if requested +dnl Configure GiNaC-cint +LIBGINACCINT= +GINACCINTDIR= if [[ "x$with_cint" != "xno" ]]; then - echo "with_cint is set to: $with_cint" - CINTSYSDIR=$with_cint + if [[ "x$enable_static" != "xyes" ]]; then + AC_MSG_ERROR([currently GiNaC-cint needs to build a static libginac]) + fi + if [[ "x$with_cint" = "xyes" ]]; then + if [[ "x$CINTSYSDIR" = "x" ]]; then + AC_MSG_ERROR([please export \$CINTSYSDIR or specify --with-cint=CINTSYSDIR]) + fi + else + CINTSYSDIR=$with_cint + export CINTSYSDIR + fi AC_PATH_PROG(CINT, cint, "", $CINTSYSDIR:$PATH) AC_PATH_PROG(MAKECINT, makecint, "", $CINTSYSDIR:$PATH) - if [[ "$cint" -a "$makecint" ]]; then - AC_MSG_RESULT([Configuring GiNaC-cint]) + if [[ "$CINT" -a "$MAKECINT" ]]; then + AC_MSG_RESULT([creating cint/Makefile]) + (cd cint && \ + $MAKECINT -mk Makefile.makecint -o ginaccint -m \ + -D OBSCURE_CINT_HACK -D NO_NAMESPACE_GINAC \ + -I .. -I $CINTSYSDIR -m -H ../ginac/ginac.h dummies.h \ + -C++ dummies.cpp -C++ ginaccint.cpp \ + -l ./libginac.a -lcln -cint -M0x10; \ + cd ..) + LIBGINACCINT="libginac.a" + GINACCINTDIR="cint" else AC_MSG_ERROR([Cannot configure GiNaC-cint]) fi fi +AC_SUBST(LIBGINACCINT) +AC_SUBST(GINACCINTDIR) dnl Output makefiles etc. AC_OUTPUT([ @@ -168,5 +190,6 @@ tools/Makefile doc/Makefile doc/tutorial/Makefile doc/reference/Makefile +cint/Makefile ], [chmod +x ginac-config]) echo "Configuration done. Now type \"make\"." diff --git a/doc/Makefile.in b/doc/Makefile.in index ae3b86c3..40520fae 100644 --- a/doc/Makefile.in +++ b/doc/Makefile.in @@ -70,6 +70,7 @@ DLLTOOL = @DLLTOOL@ DOXYGEN = @DOXYGEN@ DVIPS = @DVIPS@ FIG2DEV = @FIG2DEV@ +GINACCINTDIR = @GINACCINTDIR@ GINACLIB_BINARY_AGE = @GINACLIB_BINARY_AGE@ GINACLIB_CPPFLAGS = @GINACLIB_CPPFLAGS@ GINACLIB_INTERFACE_AGE = @GINACLIB_INTERFACE_AGE@ @@ -82,6 +83,7 @@ GINSH_LIBS = @GINSH_LIBS@ LATEX = @LATEX@ LD = @LD@ LEX = @LEX@ +LIBGINACCINT = @LIBGINACCINT@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LT_AGE = @LT_AGE@ @@ -271,7 +273,7 @@ distdir: $(DISTFILES) @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ - cp -pr $$/$$file $(distdir)/$$file; \ + cp -pr $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ diff --git a/doc/reference/DoxyfileHTML b/doc/reference/DoxyfileHTML index 06b494ee..6be6ac9a 100644 --- a/doc/reference/DoxyfileHTML +++ b/doc/reference/DoxyfileHTML @@ -389,7 +389,7 @@ INCLUDE_PATH = # or name=definition (no spaces). If the definition and the = are # omitted =1 is assumed. -PREDEFINED = NO_GINAC_NAMESPACE +PREDEFINED = NO_NAMESPACE_GINAC # If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES # then the macro expansion is limited to the macros specified with the diff --git a/doc/reference/Makefile.in b/doc/reference/Makefile.in index dedcc950..5f56da04 100644 --- a/doc/reference/Makefile.in +++ b/doc/reference/Makefile.in @@ -73,6 +73,7 @@ DLLTOOL = @DLLTOOL@ DOXYGEN = @DOXYGEN@ DVIPS = @DVIPS@ FIG2DEV = @FIG2DEV@ +GINACCINTDIR = @GINACCINTDIR@ GINACLIB_BINARY_AGE = @GINACLIB_BINARY_AGE@ GINACLIB_CPPFLAGS = @GINACLIB_CPPFLAGS@ GINACLIB_INTERFACE_AGE = @GINACLIB_INTERFACE_AGE@ @@ -85,6 +86,7 @@ GINSH_LIBS = @GINSH_LIBS@ LATEX = @LATEX@ LD = @LD@ LEX = @LEX@ +LIBGINACCINT = @LIBGINACCINT@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LT_AGE = @LT_AGE@ @@ -167,7 +169,7 @@ distdir: $(DISTFILES) @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ - cp -pr $$/$$file $(distdir)/$$file; \ + cp -pr $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ diff --git a/doc/tutorial/Makefile.in b/doc/tutorial/Makefile.in index 19ce30c1..ded8826c 100644 --- a/doc/tutorial/Makefile.in +++ b/doc/tutorial/Makefile.in @@ -72,6 +72,7 @@ DLLTOOL = @DLLTOOL@ DOXYGEN = @DOXYGEN@ DVIPS = @DVIPS@ FIG2DEV = @FIG2DEV@ +GINACCINTDIR = @GINACCINTDIR@ GINACLIB_BINARY_AGE = @GINACLIB_BINARY_AGE@ GINACLIB_CPPFLAGS = @GINACLIB_CPPFLAGS@ GINACLIB_INTERFACE_AGE = @GINACLIB_INTERFACE_AGE@ @@ -84,6 +85,7 @@ GINSH_LIBS = @GINSH_LIBS@ LATEX = @LATEX@ LD = @LD@ LEX = @LEX@ +LIBGINACCINT = @LIBGINACCINT@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LT_AGE = @LT_AGE@ @@ -324,7 +326,7 @@ distdir: $(DISTFILES) @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ - cp -pr $$/$$file $(distdir)/$$file; \ + cp -pr $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ diff --git a/doc/tutorial/version.texi b/doc/tutorial/version.texi index 10c9ec16..f07101f1 100644 --- a/doc/tutorial/version.texi +++ b/doc/tutorial/version.texi @@ -1,3 +1,3 @@ -@set UPDATED 21 January 2000 -@set EDITION 0.4.1 -@set VERSION 0.4.1 +@set UPDATED 29 January 2000 +@set EDITION 0.5.0 +@set VERSION 0.5.0 diff --git a/ginac/Makefile.in b/ginac/Makefile.in index 458d0490..aff25272 100644 --- a/ginac/Makefile.in +++ b/ginac/Makefile.in @@ -70,6 +70,7 @@ DLLTOOL = @DLLTOOL@ DOXYGEN = @DOXYGEN@ DVIPS = @DVIPS@ FIG2DEV = @FIG2DEV@ +GINACCINTDIR = @GINACCINTDIR@ GINACLIB_BINARY_AGE = @GINACLIB_BINARY_AGE@ GINACLIB_CPPFLAGS = @GINACLIB_CPPFLAGS@ GINACLIB_INTERFACE_AGE = @GINACLIB_INTERFACE_AGE@ @@ -82,6 +83,7 @@ GINSH_LIBS = @GINSH_LIBS@ LATEX = @LATEX@ LD = @LD@ LEX = @LEX@ +LIBGINACCINT = @LIBGINACCINT@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LT_AGE = @LT_AGE@ @@ -292,7 +294,7 @@ distdir: $(DISTFILES) @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ - cp -pr $$/$$file $(distdir)/$$file; \ + cp -pr $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ diff --git a/ginac/add.cpp b/ginac/add.cpp index 069e3e02..86703ddc 100644 --- a/ginac/add.cpp +++ b/ginac/add.cpp @@ -29,9 +29,9 @@ #include "debugmsg.h" #include "utils.h" -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC namespace GiNaC { -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC GINAC_IMPLEMENT_REGISTERED_CLASS(add, expairseq) @@ -555,6 +555,6 @@ unsigned add::precedence=40; const add some_add; const type_info & typeid_add=typeid(some_add); -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC } // namespace GiNaC -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC diff --git a/ginac/add.h b/ginac/add.h index d267f25c..176663fb 100644 --- a/ginac/add.h +++ b/ginac/add.h @@ -25,9 +25,9 @@ #include "expairseq.h" -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC namespace GiNaC { -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC /** Sum of expressions. */ class add : public expairseq @@ -116,8 +116,8 @@ inline const add &ex_to_add(const ex &e) return static_cast(*e.bp); } -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC } // namespace GiNaC -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC #endif // ndef __GINAC_ADD_H__ diff --git a/ginac/archive.cpp b/ginac/archive.cpp index 0fdb30ad..2b9ecdb7 100644 --- a/ginac/archive.cpp +++ b/ginac/archive.cpp @@ -3,7 +3,7 @@ * Archiving of GiNaC expressions. */ /* - * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany + * GiNaC Copyright (C) 1999-2000 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 @@ -29,9 +29,9 @@ #include "config.h" #include "utils.h" -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC namespace GiNaC { -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC /** Archive an expression. @@ -206,6 +206,7 @@ ostream &operator<<(ostream &os, const archive_node &n) write_unsigned(os, n.props[i].name); write_unsigned(os, n.props[i].value); } + return os; } /** Write archive to binary data stream. */ @@ -237,6 +238,7 @@ ostream &operator<<(ostream &os, const archive &ar) write_unsigned(os, num_nodes); for (unsigned int i=0; i>(istream &is, archive_node &n) n.props[i].name = read_unsigned(is); n.props[i].value = read_unsigned(is); } + return is; } /** Read archive from binary data stream. */ @@ -284,6 +287,7 @@ istream &operator>>(istream &is, archive &ar) ar.nodes.resize(num_nodes, ar); for (unsigned int i=0; i> ar.nodes[i]; + return is; } @@ -576,7 +580,15 @@ void archive_node::printraw(ostream &os) const } } +/** Create a dummy archive. The intention is to fill archive_node's default ctor, + * which is currently a Cint-requirement. */ +archive* archive_node::dummy_ar_creator(void) +{ + static archive* some_ar = new archive; + return some_ar; +} + -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC } // namespace GiNaC -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC diff --git a/ginac/archive.h b/ginac/archive.h index e24ef7ac..50317b8f 100644 --- a/ginac/archive.h +++ b/ginac/archive.h @@ -3,7 +3,7 @@ * Archiving of GiNaC expressions. */ /* - * GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany + * GiNaC Copyright (C) 1999-2000 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 @@ -31,9 +31,9 @@ class ostream; class istream; -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC namespace GiNaC { -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC class lst; class archive; @@ -55,6 +55,7 @@ class archive_node friend istream &operator>>(istream &is, archive_node &ar); public: + archive_node() : a(*dummy_ar_creator()), has_expression(false) {} archive_node(archive &ar) : a(ar), has_expression(false) {} archive_node(archive &ar, const ex &expr); ~archive_node() {} @@ -80,6 +81,8 @@ public: void printraw(ostream &os) const; private: + static archive* dummy_ar_creator(void); + /** Property data types */ enum property_type { PTYPE_BOOL, @@ -182,8 +185,8 @@ ostream &operator<<(ostream &os, const archive &ar); istream &operator>>(istream &is, archive &ar); -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC } // namespace GiNaC -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC #endif // ndef __GINAC_ARCHIVE_H__ diff --git a/ginac/basic.cpp b/ginac/basic.cpp index 89186ad9..e2a9320e 100644 --- a/ginac/basic.cpp +++ b/ginac/basic.cpp @@ -35,9 +35,9 @@ #include "utils.h" #include "debugmsg.h" -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC namespace GiNaC { -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC GINAC_IMPLEMENT_REGISTERED_CLASS(basic, void) @@ -491,6 +491,6 @@ const type_info & typeid_basic=typeid(some_basic); int max_recursion_level=1024; -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC } // namespace GiNaC -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC diff --git a/ginac/basic.h b/ginac/basic.h index 7305b35a..ebe10e68 100644 --- a/ginac/basic.h +++ b/ginac/basic.h @@ -35,9 +35,9 @@ #include "assertion.h" #include "registrar.h" -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC namespace GiNaC { -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC class basic; class ex; @@ -190,7 +190,7 @@ extern int max_recursion_level; // convenience macros -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC #define is_of_type(OBJ,TYPE) \ (dynamic_cast(const_cast(&OBJ))!=0) @@ -204,7 +204,7 @@ extern int max_recursion_level; #define is_ex_exactly_of_type(OBJ,TYPE) \ ((*(OBJ).bp).tinfo()==GiNaC::TINFO_##TYPE) -#else // ndef NO_GINAC_NAMESPACE +#else // ndef NO_NAMESPACE_GINAC #define is_of_type(OBJ,TYPE) \ (dynamic_cast(const_cast(&OBJ))!=0) @@ -218,10 +218,10 @@ extern int max_recursion_level; #define is_ex_exactly_of_type(OBJ,TYPE) \ ((*(OBJ).bp).tinfo()==TINFO_##TYPE) -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC } // namespace GiNaC -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC #endif // ndef __GINAC_BASIC_H__ diff --git a/ginac/clifford.cpp b/ginac/clifford.cpp index 8d41e92c..65d3584c 100644 --- a/ginac/clifford.cpp +++ b/ginac/clifford.cpp @@ -29,9 +29,9 @@ #include "utils.h" #include "debugmsg.h" -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC namespace GiNaC { -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC ////////// // default constructor, destructor, copy constructor assignment operator and helpers @@ -213,6 +213,6 @@ unsigned clifford::next_serial=0; const clifford some_clifford; const type_info & typeid_clifford=typeid(some_clifford); -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC } // namespace GiNaC -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC diff --git a/ginac/clifford.h b/ginac/clifford.h index 5abd6aee..44757c3e 100644 --- a/ginac/clifford.h +++ b/ginac/clifford.h @@ -27,9 +27,9 @@ #include "indexed.h" #include "ex.h" -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC namespace GiNaC { -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC /** Base class for clifford object */ class clifford : public indexed @@ -92,8 +92,8 @@ inline const clifford &ex_to_clifford(const ex &e) return static_cast(*e.bp); } -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC } // namespace GiNaC -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC #endif // ndef __GINAC_CLIFFORD_H__ diff --git a/ginac/color.cpp b/ginac/color.cpp index 8a793844..c35e03e5 100644 --- a/ginac/color.cpp +++ b/ginac/color.cpp @@ -37,9 +37,9 @@ #include "debugmsg.h" #include "utils.h" -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC namespace GiNaC { -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC GINAC_IMPLEMENT_REGISTERED_CLASS(color, indexed) @@ -1001,7 +1001,7 @@ void append_exvector_to_exvector(exvector & dest, const exvector & source) } } -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC } // namespace GiNaC -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC diff --git a/ginac/color.h b/ginac/color.h index 160aea13..6e852575 100644 --- a/ginac/color.h +++ b/ginac/color.h @@ -28,9 +28,9 @@ #include "indexed.h" #include "ex.h" -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC namespace GiNaC { -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC const unsigned MAX_REPRESENTATION_LABELS = 4; const unsigned COLOR_EIGHT = 8; // N*N-1 @@ -168,8 +168,8 @@ ex brute_force_sum_color_indices(const ex & e); void append_exvector_to_exvector(exvector & dest, const exvector & source); -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC } // namespace GiNaC -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC #endif // ndef __GINAC_COLOR_H__ diff --git a/ginac/coloridx.cpp b/ginac/coloridx.cpp index e7c35c55..3e871fbe 100644 --- a/ginac/coloridx.cpp +++ b/ginac/coloridx.cpp @@ -27,9 +27,9 @@ #include "utils.h" #include "debugmsg.h" -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC namespace GiNaC { -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC GINAC_IMPLEMENT_REGISTERED_CLASS(coloridx, idx) @@ -240,6 +240,6 @@ bool coloridx::info(unsigned inf) const const coloridx some_coloridx; const type_info & typeid_coloridx=typeid(some_coloridx); -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC } // namespace GiNaC -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC diff --git a/ginac/coloridx.h b/ginac/coloridx.h index 5be2970f..a8f368bb 100644 --- a/ginac/coloridx.h +++ b/ginac/coloridx.h @@ -28,9 +28,9 @@ #include "idx.h" #include "ex.h" -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC namespace GiNaC { -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC class coloridx : public idx { @@ -86,8 +86,8 @@ inline const coloridx &ex_to_coloridx(const ex &e) return static_cast(*e.bp); } -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC } // namespace GiNaC -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC #endif // ndef __GINAC_COLORIDX_H__ diff --git a/ginac/constant.cpp b/ginac/constant.cpp index c115d902..cbf90308 100644 --- a/ginac/constant.cpp +++ b/ginac/constant.cpp @@ -29,9 +29,9 @@ #include "archive.h" #include "debugmsg.h" -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC namespace GiNaC { -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC GINAC_IMPLEMENT_REGISTERED_CLASS(constant, basic) @@ -241,6 +241,6 @@ const constant EulerGamma("EulerGamma", EulerGammaEvalf); * Diverts straight into CLN for evalf(). */ const constant Catalan("Catalan", CatalanEvalf); -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC } // namespace GiNaC -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC diff --git a/ginac/constant.h b/ginac/constant.h index e70a2114..c29ecf01 100644 --- a/ginac/constant.h +++ b/ginac/constant.h @@ -26,9 +26,9 @@ #include #include "basic.h" -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC namespace GiNaC { -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC typedef ex (*evalffunctype)(void); @@ -97,8 +97,8 @@ extern const constant Pi; extern const constant Catalan; extern const constant EulerGamma; -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC } // namespace GiNaC -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC #endif // ndef __GINAC_CONSTANT_H__ diff --git a/ginac/container.pl b/ginac/container.pl index 077018c2..a66df7b9 100755 --- a/ginac/container.pl +++ b/ginac/container.pl @@ -130,9 +130,9 @@ $interface=< ${STLT}; typedef ${STLHEADER} ${STLT}; // CINT does not like ${STLHEADER}<...,default_alloc> @@ -231,9 +231,9 @@ inline const ${CONTAINER} &ex_to_${CONTAINER}(const ex &e) return static_cast(*e.bp); } -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC } // namespace GiNaC -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC #endif // ndef __GINAC_${CONTAINER_UC}_H__ @@ -280,9 +280,9 @@ $implementation=<refcount; - break; - case 0: - bp = _ex0().bp; - ++bp->refcount; - break; - case 1: - bp = _ex1().bp; - ++bp->refcount; - break; - default: - construct_from_basic(numeric(i)); - } + construct_from_int(i); } ex::ex(unsigned int i) { debugmsg("ex constructor from unsigned int",LOGLEVEL_CONSTRUCT); - construct_from_basic(numeric(i)); + construct_from_uint(i); } ex::ex(long i) { debugmsg("ex constructor from long",LOGLEVEL_CONSTRUCT); - construct_from_basic(numeric(i)); + construct_from_long(i); } ex::ex(unsigned long i) { debugmsg("ex constructor from unsigned long",LOGLEVEL_CONSTRUCT); - construct_from_basic(numeric(i)); + construct_from_ulong(i); } ex::ex(double const d) { debugmsg("ex constructor from double",LOGLEVEL_CONSTRUCT); - construct_from_basic(numeric(d)); + construct_from_double(d); } - + +#endif // ndef INLINE_EX_CONSTRUCTORS + ////////// // functions overriding virtual functions from bases classes ////////// @@ -507,14 +494,14 @@ void ex::makewriteable() GINAC_ASSERT(bp!=0); GINAC_ASSERT(bp->flags & status_flags::dynallocated); if (bp->refcount > 1) { - basic * bp2=bp->duplicate(); + basic * bp2 = bp->duplicate(); ++bp2->refcount; bp2->setflag(status_flags::dynallocated); --bp->refcount; - bp=bp2; + bp = bp2; } GINAC_ASSERT(bp->refcount == 1); -} +} void ex::construct_from_basic(const basic & other) { @@ -530,9 +517,9 @@ void ex::construct_from_basic(const basic & other) } } else { if (other.flags & status_flags::dynallocated) { - bp=&const_cast(other); + bp = &const_cast(other); } else { - bp=other.duplicate(); + bp = other.duplicate(); bp->setflag(status_flags::dynallocated); } GINAC_ASSERT(bp!=0); @@ -543,6 +530,143 @@ void ex::construct_from_basic(const basic & other) GINAC_ASSERT(bp->flags & status_flags::dynallocated); } +void ex::construct_from_int(int i) +{ + switch (i) { // some tiny efficiency-hack + case -2: + bp = _ex_2().bp; + ++bp->refcount; + break; + case -1: + bp = _ex_1().bp; + ++bp->refcount; + break; + case 0: + bp = _ex0().bp; + ++bp->refcount; + break; + case 1: + bp = _ex1().bp; + ++bp->refcount; + break; + case 2: + bp = _ex2().bp; + ++bp->refcount; + break; + default: + bp = new numeric(i); + bp->setflag(status_flags::dynallocated); + ++bp->refcount; + GINAC_ASSERT((bp->flags) & status_flags::dynallocated); + GINAC_ASSERT(bp->refcount=1); + } +} + +void ex::construct_from_uint(unsigned int i) +{ + switch (i) { // some tiny efficiency-hack + case -2: + bp = _ex_2().bp; + ++bp->refcount; + break; + case -1: + bp = _ex_1().bp; + ++bp->refcount; + break; + case 0: + bp = _ex0().bp; + ++bp->refcount; + break; + case 1: + bp = _ex1().bp; + ++bp->refcount; + break; + case 2: + bp = _ex2().bp; + ++bp->refcount; + break; + default: + bp = new numeric(i); + bp->setflag(status_flags::dynallocated); + ++bp->refcount; + GINAC_ASSERT((bp->flags) & status_flags::dynallocated); + GINAC_ASSERT(bp->refcount=1); + } +} + +void ex::construct_from_long(long i) +{ + switch (i) { // some tiny efficiency-hack + case -2: + bp = _ex_2().bp; + ++bp->refcount; + break; + case -1: + bp = _ex_1().bp; + ++bp->refcount; + break; + case 0: + bp = _ex0().bp; + ++bp->refcount; + break; + case 1: + bp = _ex1().bp; + ++bp->refcount; + break; + case 2: + bp = _ex2().bp; + ++bp->refcount; + break; + default: + bp = new numeric(i); + bp->setflag(status_flags::dynallocated); + ++bp->refcount; + GINAC_ASSERT((bp->flags) & status_flags::dynallocated); + GINAC_ASSERT(bp->refcount=1); + } +} + +void ex::construct_from_ulong(unsigned long i) +{ + switch (i) { // some tiny efficiency-hack + case -2: + bp = _ex_2().bp; + ++bp->refcount; + break; + case -1: + bp = _ex_1().bp; + ++bp->refcount; + break; + case 0: + bp = _ex0().bp; + ++bp->refcount; + break; + case 1: + bp = _ex1().bp; + ++bp->refcount; + break; + case 2: + bp = _ex2().bp; + ++bp->refcount; + break; + default: + bp = new numeric(i); + bp->setflag(status_flags::dynallocated); + ++bp->refcount; + GINAC_ASSERT((bp->flags) & status_flags::dynallocated); + GINAC_ASSERT(bp->refcount=1); + } +} + +void ex::construct_from_double(double d) +{ + bp = new numeric(d); + bp->setflag(status_flags::dynallocated); + ++bp->refcount; + GINAC_ASSERT((bp->flags) & status_flags::dynallocated); + GINAC_ASSERT(bp->refcount=1); +} + ////////// // static member variables ////////// @@ -562,6 +686,6 @@ void ex::construct_from_basic(const basic & other) // none -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC } // namespace GiNaC -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC diff --git a/ginac/ex.h b/ginac/ex.h index b098d582..b63c3726 100644 --- a/ginac/ex.h +++ b/ginac/ex.h @@ -27,9 +27,9 @@ #include "basic.h" #include "operators.h" -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC namespace GiNaC { -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC class ex; class expand_options; @@ -38,7 +38,9 @@ class status_flags; class symbol; class lst; -extern const ex & _ex0(void); /* FIXME: should this pollute headers? */ +// Sorry, this is the only constant to pollute the global scope, the other ones +// are defined in utils.h and not visible from outside. +extern const ex & _ex0(void); // single ex(numeric(0)) // typedef vector exvector; @@ -135,12 +137,67 @@ public: ; #endif // def INLINE_EX_CONSTRUCTORS - ex(int i); - ex(unsigned int i); - ex(long i); - ex(unsigned long i); - ex(double const d); + ex(int i) +#ifdef INLINE_EX_CONSTRUCTORS + { + construct_from_int(i); +#ifdef OBSCURE_CINT_HACK + update_last_created_or_assigned_bp(); +#endif // def OBSCURE_CINT_HACK + } +#else +; +#endif // def INLINE_EX_CONSTRUCTORS + + ex(unsigned int i) +#ifdef INLINE_EX_CONSTRUCTORS + { + construct_from_uint(i); +#ifdef OBSCURE_CINT_HACK + update_last_created_or_assigned_bp(); +#endif // def OBSCURE_CINT_HACK + } +#else +; +#endif // def INLINE_EX_CONSTRUCTORS + + ex(long i) +#ifdef INLINE_EX_CONSTRUCTORS + { + construct_from_long(i); +#ifdef OBSCURE_CINT_HACK + update_last_created_or_assigned_bp(); +#endif // def OBSCURE_CINT_HACK + } +#else +; +#endif // def INLINE_EX_CONSTRUCTORS + ex(unsigned long i) +#ifdef INLINE_EX_CONSTRUCTORS + { + construct_from_ulong(i); +#ifdef OBSCURE_CINT_HACK + update_last_created_or_assigned_bp(); +#endif // def OBSCURE_CINT_HACK + } +#else +; +#endif // def INLINE_EX_CONSTRUCTORS + + ex(double const d) +#ifdef INLINE_EX_CONSTRUCTORS + { + construct_from_double(d); +#ifdef OBSCURE_CINT_HACK + update_last_created_or_assigned_bp(); +#endif // def OBSCURE_CINT_HACK + } +#else +; +#endif // def INLINE_EX_CONSTRUCTORS + + // functions overriding virtual functions from bases classes // none @@ -227,6 +284,11 @@ public: ex exncmul(const ex & rh) const; private: void construct_from_basic(const basic & other); + void construct_from_int(int i); + void construct_from_uint(unsigned int i); + void construct_from_long(long i); + void construct_from_ulong(unsigned long i); + void construct_from_double(double d); void makewriteable(); #ifdef OBSCURE_CINT_HACK @@ -320,9 +382,9 @@ inline ex subs(const ex & thisex, const lst & ls, const lst & lr) inline void swap(ex & e1, ex & e2) { e1.swap(e2); } -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC } // namespace GiNaC -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC #endif // ndef __GINAC_EX_H__ diff --git a/ginac/expair.h b/ginac/expair.h index dd0459b9..68f062be 100644 --- a/ginac/expair.h +++ b/ginac/expair.h @@ -26,9 +26,9 @@ #include "ex.h" #include "numeric.h" -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC namespace GiNaC { -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC /** A pair of expressions. * This similar to, but slightly extended STL's pair<> but we need to account @@ -199,8 +199,8 @@ public: } }; -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC } // namespace GiNaC -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC #endif // ndef __GINAC_EXPAIR_H__ diff --git a/ginac/expairseq.cpp b/ginac/expairseq.cpp index 550b2a88..be065ce6 100644 --- a/ginac/expairseq.cpp +++ b/ginac/expairseq.cpp @@ -31,9 +31,9 @@ #include "debugmsg.h" #include "utils.h" -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC namespace GiNaC { -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC #ifdef EXPAIRSEQ_USE_HASHTAB #error "FIXME: expair_needs_further_processing not yet implemented for hashtabs, sorry. A.F." @@ -1731,6 +1731,6 @@ unsigned expairseq::hashtabfactor=1; const expairseq some_expairseq; const type_info & typeid_expairseq=typeid(some_expairseq); -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC } // namespace GiNaC -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC diff --git a/ginac/expairseq.h b/ginac/expairseq.h index f5039539..54062f64 100644 --- a/ginac/expairseq.h +++ b/ginac/expairseq.h @@ -31,9 +31,9 @@ #include "expair.h" -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC namespace GiNaC { -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC //#define EXPAIRSEQ_USE_HASHTAB @@ -202,8 +202,8 @@ inline const expairseq &ex_to_expairseq(const ex &e) return static_cast(*e.bp); } -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC } // namespace GiNaC -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC #endif // ndef __GINAC_EXPAIRSEQ_H__ diff --git a/ginac/exprseq_suppl.cpp b/ginac/exprseq_suppl.cpp index 62700417..ae2abd20 100644 --- a/ginac/exprseq_suppl.cpp +++ b/ginac/exprseq_suppl.cpp @@ -24,9 +24,9 @@ #include "exprseq.h" #include "ex.h" -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC namespace GiNaC { -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC bool exprseq::info(unsigned inf) const { @@ -42,6 +42,6 @@ ex & exprseq::let_op(int i) return seq[i]; } -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC } // namespace GiNaC -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC diff --git a/ginac/fail.cpp b/ginac/fail.cpp index 92409363..d35c2f43 100644 --- a/ginac/fail.cpp +++ b/ginac/fail.cpp @@ -25,9 +25,9 @@ #include "archive.h" #include "debugmsg.h" -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC namespace GiNaC { -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC GINAC_IMPLEMENT_REGISTERED_CLASS(fail, basic) @@ -162,6 +162,6 @@ int fail::compare_same_type(const basic & other) const const fail some_fail; const type_info & typeid_fail=typeid(some_fail); -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC } // namespace GiNaC -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC diff --git a/ginac/fail.h b/ginac/fail.h index 9a0a3ffe..9d87d1bc 100644 --- a/ginac/fail.h +++ b/ginac/fail.h @@ -26,9 +26,9 @@ #include "basic.h" -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC namespace GiNaC { -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC class fail : public basic { @@ -71,8 +71,8 @@ protected: extern const fail some_fail; extern const type_info & typeid_fail; -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC } // namespace GiNaC -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC #endif // ndef __GINAC_FAIL_H__ diff --git a/ginac/flags.h b/ginac/flags.h index add2cc49..d7e63825 100644 --- a/ginac/flags.h +++ b/ginac/flags.h @@ -23,9 +23,9 @@ #ifndef __GINAC_FLAGS_H__ #define __GINAC_FLAGS_H__ -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC namespace GiNaC { -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC class expand_options { public: @@ -121,8 +121,8 @@ public: }; }; -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC } // namespace GiNaC -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC #endif // ndef __GINAC_FLAGS_H__ diff --git a/ginac/function.pl b/ginac/function.pl index f1b57f13..8ad1abe5 100755 --- a/ginac/function.pl +++ b/ginac/function.pl @@ -171,31 +171,31 @@ $interface=<(OBJ.bp)->getserial() == function_index_##FUNCNAME) -#else // ndef NO_GINAC_NAMESPACE +#else // ndef NO_NAMESPACE_GINAC #define is_ex_the_function(OBJ, FUNCNAME) \\ (is_ex_exactly_of_type(OBJ, function) && static_cast(OBJ.bp)->getserial() == function_index_##FUNCNAME) -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC // global constants extern const function some_function; extern const type_info & typeid_function; -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC } // namespace GiNaC -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC #endif // ndef __GINAC_FUNCTION_H__ @@ -388,9 +388,9 @@ $implementation=< #include "exprseq.h" -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC namespace GiNaC { -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC /** Base class for non-commutative indexed objects */ class indexed : public exprseq @@ -99,8 +99,8 @@ inline const indexed &ex_to_indexed(const ex &e) return static_cast(*e.bp); } -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC } // namespace GiNaC -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC #endif // ndef __GINAC_INDEXED_H__ diff --git a/ginac/inifcns.cpp b/ginac/inifcns.cpp index 9c5019df..70eaf758 100644 --- a/ginac/inifcns.cpp +++ b/ginac/inifcns.cpp @@ -37,9 +37,9 @@ #include "symbol.h" #include "utils.h" -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC namespace GiNaC { -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC ////////// // absolute value @@ -281,6 +281,6 @@ ex ncpower(const ex &basis, unsigned exponent) unsigned force_include_gamma = function_index_gamma; unsigned force_include_zeta1 = function_index_zeta1; -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC } // namespace GiNaC -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC diff --git a/ginac/inifcns.h b/ginac/inifcns.h index 20511e28..603edb3e 100644 --- a/ginac/inifcns.h +++ b/ginac/inifcns.h @@ -26,9 +26,9 @@ #include "function.h" #include "ex.h" -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC namespace GiNaC { -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC /** Absolute value. */ DECLARE_FUNCTION_1P(abs) @@ -132,8 +132,8 @@ inline bool is_order_function(const ex & e) return is_ex_the_function(e, Order); } -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC } // namespace GiNaC -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC #endif // ndef __GINAC_INIFCNS_H__ diff --git a/ginac/inifcns_gamma.cpp b/ginac/inifcns_gamma.cpp index 3a956a92..503c44c8 100644 --- a/ginac/inifcns_gamma.cpp +++ b/ginac/inifcns_gamma.cpp @@ -34,9 +34,9 @@ #include "symbol.h" #include "utils.h" -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC namespace GiNaC { -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC ////////// // Gamma-function @@ -437,6 +437,6 @@ static ex psi2_series(const ex & n, const ex & x, const symbol & s, const ex & p const unsigned function_index_psi2 = function::register_new("psi", psi2_eval, psi2_evalf, psi2_diff, psi2_series); -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC } // namespace GiNaC -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC diff --git a/ginac/inifcns_trans.cpp b/ginac/inifcns_trans.cpp index 4c35bfed..da763b40 100644 --- a/ginac/inifcns_trans.cpp +++ b/ginac/inifcns_trans.cpp @@ -33,9 +33,9 @@ #include "symbol.h" #include "utils.h" -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC namespace GiNaC { -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC ////////// // exponential function @@ -850,6 +850,6 @@ static ex atanh_diff(const ex & x, unsigned diff_param) REGISTER_FUNCTION(atanh, atanh_eval, atanh_evalf, atanh_diff, NULL); -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC } // namespace GiNaC -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC diff --git a/ginac/inifcns_zeta.cpp b/ginac/inifcns_zeta.cpp index 4be6f022..51f9700c 100644 --- a/ginac/inifcns_zeta.cpp +++ b/ginac/inifcns_zeta.cpp @@ -31,9 +31,9 @@ #include "symbol.h" #include "utils.h" -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC namespace GiNaC { -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC ////////// // Riemann's Zeta-function @@ -112,6 +112,6 @@ static ex zeta2_diff(const ex & n, const ex & x, unsigned diff_param) const unsigned function_index_zeta2 = function::register_new("zeta", zeta2_eval, NULL, zeta2_diff, NULL); -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC } // namespace GiNaC -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC diff --git a/ginac/isospin.cpp b/ginac/isospin.cpp index 6fad095d..8ff6b916 100644 --- a/ginac/isospin.cpp +++ b/ginac/isospin.cpp @@ -31,9 +31,9 @@ #include "utils.h" #include "debugmsg.h" -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC namespace GiNaC { -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC GINAC_IMPLEMENT_REGISTERED_CLASS(isospin, indexed) @@ -123,7 +123,7 @@ ex isospin::unarchive(const archive_node &n, const lst &sym_lst) ex s = (new isospin(n, sym_lst))->setflag(status_flags::dynallocated); // If isospin is in sym_lst, return the existing isospin - for (int i=0; i #include "indexed.h" -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC namespace GiNaC { -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC /** Base class for isospin object */ class isospin : public indexed @@ -93,8 +93,8 @@ inline const isospin &ex_to_isospin(const ex &e) return static_cast(*e.bp); } -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC } // namespace GiNaC -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC #endif // ndef __GINAC_ISOSPIN_H__ diff --git a/ginac/lorentzidx.cpp b/ginac/lorentzidx.cpp index 52487dde..5835050e 100644 --- a/ginac/lorentzidx.cpp +++ b/ginac/lorentzidx.cpp @@ -28,9 +28,9 @@ #include "utils.h" #include "debugmsg.h" -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC namespace GiNaC { -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC GINAC_IMPLEMENT_REGISTERED_CLASS(lorentzidx, idx) @@ -146,7 +146,7 @@ ex lorentzidx::unarchive(const archive_node &n, const lst &sym_lst) if (ex_to_lorentzidx(s).symbolic) { // If lorentzidx is in sym_lst, return the existing lorentzidx - for (int i=0; i #include "idx.h" -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC namespace GiNaC { -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC class lorentzidx : public idx { @@ -93,8 +93,8 @@ inline const lorentzidx &ex_to_lorentzidx(const ex &e) return static_cast(*e.bp); } -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC } // namespace GiNaC -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC #endif // ndef __GINAC_LORENTZIDX_H__ diff --git a/ginac/lortensor.cpp b/ginac/lortensor.cpp index 657d10b6..40144814 100644 --- a/ginac/lortensor.cpp +++ b/ginac/lortensor.cpp @@ -41,9 +41,9 @@ #include "symbol.h" #include "utils.h" -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC namespace GiNaC { -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC ////////// // default constructor, destructor, copy constructor assignment operator and helpers @@ -463,7 +463,7 @@ ex simplify_lortensor(const ex & e) // simplification of sum=sum of simplifications if (is_ex_exactly_of_type(e_expanded,add)) { ex sum=_ex0(); - for (int i=0; i(*e.bp); } -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC } // namespace GiNaC -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC #endif // ndef __GINAC_MATRIX_H__ diff --git a/ginac/mul.cpp b/ginac/mul.cpp index 35be3920..1b051abb 100644 --- a/ginac/mul.cpp +++ b/ginac/mul.cpp @@ -30,9 +30,9 @@ #include "debugmsg.h" #include "utils.h" -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC namespace GiNaC { -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC GINAC_IMPLEMENT_REGISTERED_CLASS(mul, expairseq) @@ -788,6 +788,6 @@ unsigned mul::precedence=50; const mul some_mul; const type_info & typeid_mul=typeid(some_mul); -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC } // namespace GiNaC -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC diff --git a/ginac/mul.h b/ginac/mul.h index d81d046b..de047f45 100644 --- a/ginac/mul.h +++ b/ginac/mul.h @@ -25,9 +25,9 @@ #include "expairseq.h" -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC namespace GiNaC { -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC /** Product of expressions. */ class mul : public expairseq @@ -123,8 +123,8 @@ inline const mul &ex_to_mul(const ex &e) return static_cast(*e.bp); } -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC } // namespace GiNaC -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC #endif // ndef __GINAC_MUL_H__ diff --git a/ginac/ncmul.cpp b/ginac/ncmul.cpp index 882265dc..a970a8b2 100644 --- a/ginac/ncmul.cpp +++ b/ginac/ncmul.cpp @@ -32,9 +32,9 @@ #include "debugmsg.h" #include "utils.h" -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC namespace GiNaC { -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC GINAC_IMPLEMENT_REGISTERED_CLASS(ncmul, exprseq) @@ -653,6 +653,6 @@ ex simplified_ncmul(const exvector & v) status_flags::evaluated); } -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC } // namespace GiNaC -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC diff --git a/ginac/ncmul.h b/ginac/ncmul.h index cba21283..b79b0ea6 100644 --- a/ginac/ncmul.h +++ b/ginac/ncmul.h @@ -25,9 +25,9 @@ #include "exprseq.h" -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC namespace GiNaC { -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC /** Non-commutative product of expressions. */ class ncmul : public exprseq @@ -118,8 +118,8 @@ inline const ncmul &ex_to_ncmul(const ex &e) return static_cast (*e.bp); } -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC } // namespace GiNaC -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC #endif // ndef __GINAC_NCMUL_H__ diff --git a/ginac/normal.cpp b/ginac/normal.cpp index f57e4f0d..8a9bc0f4 100644 --- a/ginac/normal.cpp +++ b/ginac/normal.cpp @@ -47,9 +47,9 @@ #include "symbol.h" #include "utils.h" -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC namespace GiNaC { -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_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 @@ -228,12 +228,12 @@ static ex multiply_lcm(const ex &e, const ex &lcm) { if (is_ex_exactly_of_type(e, mul)) { ex c = _ex1(); - for (int i=0; irest,numeric)); -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC numeric coeff = GiNaC::smod(ex_to_numeric(it->coeff), xi); -#else // ndef NO_GINAC_NAMESPACE +#else // ndef NO_NAMESPACE_GINAC numeric coeff = ::smod(ex_to_numeric(it->coeff), xi); -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC if (!coeff.is_zero()) newseq.push_back(expair(it->rest, coeff)); it++; } GINAC_ASSERT(is_ex_exactly_of_type(overall_coeff,numeric)); -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC numeric coeff = GiNaC::smod(ex_to_numeric(overall_coeff), xi); -#else // ndef NO_GINAC_NAMESPACE +#else // ndef NO_NAMESPACE_GINAC numeric coeff = ::smod(ex_to_numeric(overall_coeff), xi); -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC return (new add(newseq,coeff))->setflag(status_flags::dynallocated); } @@ -984,11 +984,11 @@ ex mul::smod(const numeric &xi) const #endif // def DO_GINAC_ASSERT mul * mulcopyp=new mul(*this); GINAC_ASSERT(is_ex_exactly_of_type(overall_coeff,numeric)); -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC mulcopyp->overall_coeff = GiNaC::smod(ex_to_numeric(overall_coeff),xi); -#else // ndef NO_GINAC_NAMESPACE +#else // ndef NO_NAMESPACE_GINAC mulcopyp->overall_coeff = ::smod(ex_to_numeric(overall_coeff),xi); -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC mulcopyp->clearflag(status_flags::evaluated); mulcopyp->clearflag(status_flags::hash_calculated); return mulcopyp->setflag(status_flags::dynallocated); @@ -1104,7 +1104,7 @@ factored_a: ex g = _ex1(); ex acc_ca = _ex1(); ex part_b = b; - for (int i=0; i #endif // def HAVE_CLN_CLN_H -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC namespace GiNaC { -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC // linker has no problems finding text symbols for numerator or denominator //#define SANE_LINKER @@ -524,6 +524,13 @@ bool numeric::info(unsigned inf) const return false; } +ex numeric::eval(int level) const +{ + // Warning: if this is ever gonna do something, the ex ctors from all kinds + // of numbers should be checking for status_flags::evaluated. + return this->hold(); +} + /** Cast numeric into a floating-point object. For example exact numeric(1) is * returned as a 1.0000000000000000000000 and so on according to how Digits is * currently set. @@ -1651,10 +1658,20 @@ ostream& operator<<(ostream& os, const _numeric_digits & e) bool _numeric_digits::too_late = false; + +////////// +// utility functions +////////// + +const numeric &ex_to_numeric(const ex &e) +{ + return static_cast(*e.bp); +} + /** 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; -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC } // namespace GiNaC -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC diff --git a/ginac/numeric.h b/ginac/numeric.h index d99f08dc..6c1f9f2d 100644 --- a/ginac/numeric.h +++ b/ginac/numeric.h @@ -30,9 +30,9 @@ class cl_N; // We want to include cln.h only in numeric.cpp in order to // avoid namespace pollution and keep compile-time low. -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC namespace GiNaC { -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC #define HASHVALUE_NUMERIC 0x80000001U @@ -127,6 +127,7 @@ public: void printtree(ostream & os, unsigned indent) const; void printcsrc(ostream & os, unsigned type, unsigned precedence=0) const; bool info(unsigned inf) const; + ex eval(int level=0) const; ex evalf(int level=0) const; ex diff(const symbol & s) const; ex normal(lst &sym_lst, lst &repl_lst, int level=0) const; @@ -323,13 +324,10 @@ ex EulerGammaEvalf(void); ex CatalanEvalf(void); // utility functions -inline const numeric &ex_to_numeric(const ex &e) -{ - return static_cast(*e.bp); -} +const numeric &ex_to_numeric(const ex &e); -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC } // namespace GiNaC -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC #endif // ndef __GINAC_NUMERIC_H__ diff --git a/ginac/operators.cpp b/ginac/operators.cpp index 10a45165..9a681b5e 100644 --- a/ginac/operators.cpp +++ b/ginac/operators.cpp @@ -32,9 +32,9 @@ #include "debugmsg.h" #include "utils.h" -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC namespace GiNaC { -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC // binary arithmetic operators ex with ex @@ -340,6 +340,6 @@ istream & operator>>(istream & is, ex & e) throw(std::logic_error("input from streams not yet implemented")); } -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC } // namespace GiNaC -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC diff --git a/ginac/operators.h b/ginac/operators.h index 33acabae..a7d84b0a 100644 --- a/ginac/operators.h +++ b/ginac/operators.h @@ -25,9 +25,9 @@ #include -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC namespace GiNaC { -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC class ex; class numeric; @@ -82,8 +82,8 @@ relational operator>=(const ex & lh, const ex & rh); ostream & operator<<(ostream & os, const ex & e); istream & operator>>(istream & is, ex & e); -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC } // namespace GiNaC -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC #endif // ndef __GINAC_OPERATORS_H__ diff --git a/ginac/power.cpp b/ginac/power.cpp index cbe0c65b..89ba78bc 100644 --- a/ginac/power.cpp +++ b/ginac/power.cpp @@ -35,9 +35,9 @@ #include "debugmsg.h" #include "utils.h" -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC namespace GiNaC { -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC GINAC_IMPLEMENT_REGISTERED_CLASS(power, basic) @@ -830,6 +830,6 @@ ex sqrt(const ex & a) return power(a,_ex1_2()); } -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC } // namespace GiNaC -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC diff --git a/ginac/power.h b/ginac/power.h index a0ebc29b..13dfd5ff 100644 --- a/ginac/power.h +++ b/ginac/power.h @@ -26,9 +26,9 @@ #include "basic.h" #include "ex.h" -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC namespace GiNaC { -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC class numeric; class add; @@ -128,8 +128,8 @@ inline ex pow(const ex & b, const ex & e) * expression. */ ex sqrt(const ex & a); -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC } // namespace GiNaC -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC #endif // ndef __GINAC_POWER_H__ diff --git a/ginac/pseries.cpp b/ginac/pseries.cpp index 0f29e5f5..459b4692 100644 --- a/ginac/pseries.cpp +++ b/ginac/pseries.cpp @@ -35,9 +35,9 @@ #include "utils.h" #include "debugmsg.h" -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC namespace GiNaC { -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC GINAC_IMPLEMENT_REGISTERED_CLASS(pseries, basic) @@ -683,6 +683,6 @@ ex ex::series(const symbol &s, const ex &point, int order) const const pseries some_pseries; const type_info & typeid_pseries = typeid(some_pseries); -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC } // namespace GiNaC -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC diff --git a/ginac/pseries.h b/ginac/pseries.h index aed1e99a..1f69ae4b 100644 --- a/ginac/pseries.h +++ b/ginac/pseries.h @@ -26,9 +26,9 @@ #include "basic.h" #include "expairseq.h" -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC namespace GiNaC { -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC /** This class holds a extended truncated power series (positive and negative * integer powers). It consists of expression coefficients (only non-zero @@ -119,8 +119,8 @@ inline ex series_to_poly(const ex &e) return (static_cast(*e.bp).convert_to_poly(true)); } -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC } // namespace GiNaC -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC #endif // ndef __GINAC_SERIES_H__ diff --git a/ginac/registrar.cpp b/ginac/registrar.cpp index fc548302..f95b2013 100644 --- a/ginac/registrar.cpp +++ b/ginac/registrar.cpp @@ -25,9 +25,9 @@ #include "registrar.h" -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC namespace GiNaC { -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC registered_class_info *first_registered_class = NULL; @@ -56,6 +56,6 @@ unarch_func find_unarch_func(const string &class_name) } -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC } // namespace GiNaC -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC diff --git a/ginac/registrar.h b/ginac/registrar.h index 463328dd..1473bbb8 100644 --- a/ginac/registrar.h +++ b/ginac/registrar.h @@ -25,9 +25,9 @@ #include -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC namespace GiNaC { -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC class registered_class_info; class ex; @@ -65,13 +65,8 @@ struct registered_class_info { #define GINAC_DECLARE_REGISTERED_CLASS(classname, supername) \ public: \ typedef supername inherited; \ -\ - /** This structure stores information about the class. */ \ static registered_class_info reg_info; \ -\ - /** Return pointer to class name. */ \ virtual const char *class_name(void) const; \ -\ classname(const archive_node &n, const lst &sym_lst); \ virtual void archive(archive_node &n) const; \ static ex unarchive(const archive_node &n, const lst &sym_lst); \ @@ -90,8 +85,8 @@ extern unsigned int find_tinfo_key(const string &class_name); extern unarch_func find_unarch_func(const string &class_name); -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC } // namespace GiNaC -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC #endif // ndef __GINAC_REGISTRAR_H__ diff --git a/ginac/relational.cpp b/ginac/relational.cpp index 22890646..9511319c 100644 --- a/ginac/relational.cpp +++ b/ginac/relational.cpp @@ -28,9 +28,9 @@ #include "utils.h" #include "debugmsg.h" -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC namespace GiNaC { -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC GINAC_IMPLEMENT_REGISTERED_CLASS(relational, basic) @@ -406,6 +406,6 @@ unsigned relational::precedence=20; const relational some_relational; const type_info & typeid_relational=typeid(some_relational); -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC } // namespace GiNaC -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC diff --git a/ginac/relational.h b/ginac/relational.h index a41831e8..93673111 100644 --- a/ginac/relational.h +++ b/ginac/relational.h @@ -26,9 +26,9 @@ #include "basic.h" #include "ex.h" -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC namespace GiNaC { -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC /** This class holds a relation consisting of two expressions and a logical * relation between them. */ @@ -106,8 +106,8 @@ inline const relational &ex_to_relational(const ex &e) return static_cast(*e.bp); } -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC } // namespace GiNaC -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC #endif // ndef __GINAC_RELATIONAL_H__ diff --git a/ginac/simp_lor.cpp b/ginac/simp_lor.cpp index 36b61408..c5d5f9eb 100644 --- a/ginac/simp_lor.cpp +++ b/ginac/simp_lor.cpp @@ -35,9 +35,9 @@ #include "debugmsg.h" #include "utils.h" -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC namespace GiNaC { -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC ////////// // default constructor, destructor, copy constructor assignment operator and helpers @@ -516,6 +516,6 @@ spmapkey scalar_products::make_key(const simp_lor & v1, const simp_lor & v2) return spmapkey(strstrpair(v1.name,v2.name),anon); } -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC } // namespace GiNaC -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC diff --git a/ginac/simp_lor.h b/ginac/simp_lor.h index 28857993..10186fdf 100644 --- a/ginac/simp_lor.h +++ b/ginac/simp_lor.h @@ -31,9 +31,9 @@ #include "indexed.h" #include "lorentzidx.h" -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC namespace GiNaC { -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC typedef pair strstrpair; typedef pair spmapkey; @@ -172,8 +172,8 @@ ex simplify_simp_lor_mul(const ex & m, const scalar_products & sp); ex simplify_simp_lor(const ex & e, const scalar_products & sp); ex Dim(void); -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC } // namespace GiNaC -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC #endif // ndef _SIMP__GINAC_LOR_H__ diff --git a/ginac/structure.cpp b/ginac/structure.cpp index d829ba24..4e27c49e 100644 --- a/ginac/structure.cpp +++ b/ginac/structure.cpp @@ -25,9 +25,9 @@ #include "structure.h" #include "debugmsg.h" -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC namespace GiNaC { -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC ////////// // default constructor, destructor, copy constructor assignment operator and helpers @@ -177,6 +177,6 @@ unsigned structure::register_new(const char * nm) const structure some_structure; const type_info & typeid_structure=typeid(some_structure); -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC } // namespace GiNaC -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC diff --git a/ginac/structure.h b/ginac/structure.h index 1e1bed02..5bd74685 100644 --- a/ginac/structure.h +++ b/ginac/structure.h @@ -25,9 +25,9 @@ #include "basic.h" -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC namespace GiNaC { -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC struct registered_structure_info { const char * name; @@ -86,8 +86,8 @@ public: extern const structure some_structure; extern const type_info & typeid_structure; -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC } // namespace GiNaC -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC #endif // ndef __GINAC_STRUCTURE_H__ diff --git a/ginac/structure.pl b/ginac/structure.pl index 223b8c70..c7ec0b27 100755 --- a/ginac/structure.pl +++ b/ginac/structure.pl @@ -150,9 +150,9 @@ ${input_structure} #include "structure.h" -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC namespace GiNaC { -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC class ${STRUCTURE} : public structure { @@ -217,9 +217,9 @@ extern const unsigned tinfo_${STRUCTURE}; #define ex_to_${STRUCTURE}(X) (static_cast<${STRUCTURE} const &>(*(X).bp)) -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC } // namespace GiNaC -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC #endif // ndef _${STRUCTURE_UC}_H_ @@ -258,9 +258,9 @@ ${input_structure} #include "${STRUCTURE}.h" -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC namespace GiNaC { -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC ////////// // default constructor, destructor, copy constructor assignment operator and helpers @@ -514,9 +514,9 @@ const ${STRUCTURE} some_${STRUCTURE}; const type_info & typeid_${STRUCTURE}=typeid(some_${STRUCTURE}); const unsigned tinfo_${STRUCTURE}=structure::register_new("${STRUCTURE}"); -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC } // namespace GiNaC -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC END_OF_IMPLEMENTATION diff --git a/ginac/symbol.cpp b/ginac/symbol.cpp index eb8e2546..43927dc3 100644 --- a/ginac/symbol.cpp +++ b/ginac/symbol.cpp @@ -30,9 +30,9 @@ #include "debugmsg.h" #include "utils.h" -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC namespace GiNaC { -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC GINAC_IMPLEMENT_REGISTERED_CLASS(symbol, basic) @@ -122,7 +122,7 @@ ex symbol::unarchive(const archive_node &n, const lst &sym_lst) ex s = (new symbol(n, sym_lst))->setflag(status_flags::dynallocated); // If symbol is in sym_lst, return the existing symbol - for (int i=0; i string ToString(T const & t) @@ -242,8 +242,8 @@ const ex & _ex60(void); const numeric & _num120(void); // 120 const ex & _ex120(void); -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC } // namespace GiNaC -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC #endif // ndef __GINAC_UTILS_H__ diff --git a/ginsh/Makefile.in b/ginsh/Makefile.in index bb1c9d77..d82d2651 100644 --- a/ginsh/Makefile.in +++ b/ginsh/Makefile.in @@ -70,6 +70,7 @@ DLLTOOL = @DLLTOOL@ DOXYGEN = @DOXYGEN@ DVIPS = @DVIPS@ FIG2DEV = @FIG2DEV@ +GINACCINTDIR = @GINACCINTDIR@ GINACLIB_BINARY_AGE = @GINACLIB_BINARY_AGE@ GINACLIB_CPPFLAGS = @GINACLIB_CPPFLAGS@ GINACLIB_INTERFACE_AGE = @GINACLIB_INTERFACE_AGE@ @@ -82,6 +83,7 @@ GINSH_LIBS = @GINSH_LIBS@ LATEX = @LATEX@ LD = @LD@ LEX = @LEX@ +LIBGINACCINT = @LIBGINACCINT@ LIBTOOL = @LIBTOOL@ LN_S = @LN_S@ LT_AGE = @LT_AGE@ @@ -314,7 +316,7 @@ distdir: $(DISTFILES) @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ - cp -pr $$/$$file $(distdir)/$$file; \ + cp -pr $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ diff --git a/ginsh/ginsh.1 b/ginsh/ginsh.1 index 6199676c..9df41f77 100644 --- a/ginsh/ginsh.1 +++ b/ginsh/ginsh.1 @@ -439,7 +439,7 @@ Christian Bauer .br Alexander Frink .br -Richard B. Kreckel +Richard Kreckel .SH SEE ALSO GiNaC Tutorial \- An open framework for symbolic computation within the C++ programming language diff --git a/ginsh/ginsh.h b/ginsh/ginsh.h index 735d4b96..e4bb52dc 100644 --- a/ginsh/ginsh.h +++ b/ginsh/ginsh.h @@ -43,9 +43,9 @@ extern "C" { #include "ginac.h" -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC using namespace GiNaC; -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC // yacc stack type #define YYSTYPE ex diff --git a/ginsh/ginsh_parser.yy b/ginsh/ginsh_parser.yy index 7a94f1f8..265d584e 100644 --- a/ginsh/ginsh_parser.yy +++ b/ginsh/ginsh_parser.yy @@ -552,11 +552,11 @@ static ex f_ginac_function(const exprseq &es, int serial) } // All registered GiNaC functions -#ifndef NO_GINAC_NAMESPACE +#ifndef NO_NAMESPACE_GINAC void GiNaC::ginsh_get_ginac_functions(void) -#else // ndef NO_GINAC_NAMESPACE +#else // ndef NO_NAMESPACE_GINAC void ginsh_get_ginac_functions(void) -#endif // ndef NO_GINAC_NAMESPACE +#endif // ndef NO_NAMESPACE_GINAC { vector::const_iterator i = function::registered_functions().begin(), end = function::registered_functions().end(); unsigned serial = 0;