]> www.ginac.de Git - ginac.git/log
ginac.git
13 years agoParser: handle abbreviations as advertized in the manual.
Alexei Sheplyakov [Mon, 5 Jul 2010 07:15:20 +0000 (09:15 +0200)]
Parser: handle abbreviations as advertized in the manual.

The following example from the tutorial

GiNaC::symbol x, y;
GiNaC::symtab table;
table["x"] = x+log(y)+1;
GiNaC::parser reader(table);
GiNaC::ex e = reader("5*x3 - x2");

fails with the following exception:

terminate called after throwing an instance of 'std::invalid_argument'
what(): find_or_insert_symbol: name "x" does not correspond to a symbol

Remove silly checks from find_or_insert_symbol, and fix its return value
(should be ex, not symbol).

13 years agoBe more careful with conjugate(f(x)) -> f(conjugate(x)).
Richard Kreckel [Sat, 22 May 2010 20:34:42 +0000 (22:34 +0200)]
Be more careful with conjugate(f(x)) -> f(conjugate(x)).

That identity is correct for holomorphic functions, but we have to be
careful with some functions not being holomorphic everywhere. On branch
cuts, it is wrong. For a discussion, see:
<http://www.ginac.de/pipermail/ginac-list/2010-April/001601.html>.

This patch changes the default behavior of user-defined functions. From
now on, a user-defined conjugate_func must be registered, in order to
evaluate conjugate(f(x)) -> f(conjugate(x)). This patch also adds such
functions for most initially known functions.

13 years agoBe more careful with conjugate(f(x)) -> f(conjugate(x)).
Richard Kreckel [Sat, 22 May 2010 20:34:42 +0000 (22:34 +0200)]
Be more careful with conjugate(f(x)) -> f(conjugate(x)).

That identity is correct for holomorphic functions, but we have to be
careful with some functions not being holomorphic everywhere. On branch
cuts, it is wrong. For a discussion, see:
<http://www.ginac.de/pipermail/ginac-list/2010-April/001601.html>.

This patch changes the default behavior of user-defined functions. From
now on, a user-defined conjugate_func must be registered, in order to
evaluate conjugate(f(x)) -> f(conjugate(x)). This patch also adds such
functions for most initially known functions.

13 years agoFix dangerous iterator use.
Richard Kreckel [Tue, 18 May 2010 22:18:35 +0000 (00:18 +0200)]
Fix dangerous iterator use.

This was detected by cppcheck and reported by Martin Ettl <ettl.martin@gmx.de>.

13 years agoFix dangerous iterator use.
Richard Kreckel [Tue, 18 May 2010 22:18:35 +0000 (00:18 +0200)]
Fix dangerous iterator use.

This was detected by cppcheck and reported by Martin Ettl <ettl.martin@gmx.de>.

13 years agopgcd(), chinrem_gcd(): use appropriate definition of the degree.
Alexei Sheplyakov [Mon, 17 May 2010 22:23:03 +0000 (00:23 +0200)]
pgcd(), chinrem_gcd(): use appropriate definition of the degree.

Effect: fixes (rare) GCD miscalculation.

pgcd() treats polynomials Z_p[x_0, ..., x_n] as R[x_0, ..., x_{n - 1}], where
R = Z_p[x_n]. Therefore one should use correct definition of the degree
(i.e. compute it w.r.t. x_0, ..., x_{n-1}, but NOT w.r.t. x_n!).

One should use appropriate definition of degree (that is, w.r.t.  x_0, ..., x_n)
in chinrem_gcd() too.

Thanks to Aless Lasaruk for a bug report.

13 years agoAdded `degree_vector' utility function.
Alexei Sheplyakov [Mon, 17 May 2010 22:21:53 +0000 (00:21 +0200)]
Added `degree_vector' utility function.

It's a generalization of degree(expr, var) for multivariate polynomials.

13 years agoprimpart_content: correctly handle monomials.
Alexei Sheplyakov [Mon, 17 May 2010 22:20:08 +0000 (00:20 +0200)]
primpart_content: correctly handle monomials.

Impact: fixes (rare) incorrect gcd calculation and (potential) segfault.

Thanks to Aless Lasaruk for a bug report.

13 years agopgcd(): avoid infinite loop if the first GCD candidate coincides with GCD
Alexei Sheplyakov [Mon, 17 May 2010 22:17:26 +0000 (00:17 +0200)]
pgcd(): avoid infinite loop if the first GCD candidate coincides with GCD

136 if (H_lcoeff.is_equal(lc_gcd)) {
137 if ((Hprev-H).expand().smod(pn).is_zero()) // (*)
138 continue;

The check (*) can result in infinite loop if the (very) first GCD candidate
gives the correct GCD: any subsequent iterations give the same result, so
Hprev and H will be equal (hence the infinite loop). That check is not very
useful (AFAIR I was trying to avoid extra division checks), so let's remove it.

13 years agopgcd(), chinrem_gcd(): use appropriate definition of the degree.
Alexei Sheplyakov [Mon, 17 May 2010 22:23:03 +0000 (00:23 +0200)]
pgcd(), chinrem_gcd(): use appropriate definition of the degree.

Effect: fixes (rare) GCD miscalculation.

pgcd() treats polynomials Z_p[x_0, ..., x_n] as R[x_0, ..., x_{n - 1}], where
R = Z_p[x_n]. Therefore one should use correct definition of the degree
(i.e. compute it w.r.t. x_0, ..., x_{n-1}, but NOT w.r.t. x_n!).

One should use appropriate definition of degree (that is, w.r.t.  x_0, ..., x_n)
in chinrem_gcd() too.

Thanks to Aless Lasaruk for a bug report.

13 years agoAdded `degree_vector' utility function.
Alexei Sheplyakov [Mon, 17 May 2010 22:21:53 +0000 (00:21 +0200)]
Added `degree_vector' utility function.

It's a generalization of degree(expr, var) for multivariate polynomials.

13 years agoprimpart_content: correctly handle monomials.
Alexei Sheplyakov [Mon, 17 May 2010 22:20:08 +0000 (00:20 +0200)]
primpart_content: correctly handle monomials.

Impact: fixes (rare) incorrect gcd calculation and (potential) segfault.

Thanks to Aless Lasaruk for a bug report.

13 years agopgcd(): avoid infinite loop if the first GCD candidate coincides with GCD
Alexei Sheplyakov [Mon, 17 May 2010 22:17:26 +0000 (00:17 +0200)]
pgcd(): avoid infinite loop if the first GCD candidate coincides with GCD

136 if (H_lcoeff.is_equal(lc_gcd)) {
137 if ((Hprev-H).expand().smod(pn).is_zero()) // (*)
138 continue;

The check (*) can result in infinite loop if the (very) first GCD candidate
gives the correct GCD: any subsequent iterations give the same result, so
Hprev and H will be equal (hence the infinite loop). That check is not very
useful (AFAIR I was trying to avoid extra division checks), so let's remove it.

13 years agoFix URL of CODA.
Richard Kreckel [Mon, 17 May 2010 06:37:08 +0000 (08:37 +0200)]
Fix URL of CODA.

13 years agoFix URL of CODA.
Richard Kreckel [Mon, 17 May 2010 06:37:08 +0000 (08:37 +0200)]
Fix URL of CODA.

13 years agoFix memory leak in excompiler due to use of wrong operator delete.
Richard Kreckel [Thu, 13 May 2010 20:54:52 +0000 (22:54 +0200)]
Fix memory leak in excompiler due to use of wrong operator delete.

This was reported by Martin Ettl <ettl.martin@gmx.de>.

13 years agoFix memory leak in excompiler due to use of wrong operator delete.
Richard Kreckel [Thu, 13 May 2010 20:54:52 +0000 (22:54 +0200)]
Fix memory leak in excompiler due to use of wrong operator delete.

This was reported by Martin Ettl <ettl.martin@gmx.de>.

13 years agoExplicit function disambiguation.
Richard Kreckel [Thu, 13 May 2010 16:30:40 +0000 (18:30 +0200)]
Explicit function disambiguation.

This is necessary for compilers where the hyperbolic and the tgamma function
templates are pulled in from <cmath> and compete with GiNaC's function
templates. GCC 4.4 and 4.5 need this, when compiling with -std=cxx0x.

13 years agoExplicit function disambiguation.
Richard Kreckel [Thu, 13 May 2010 16:30:40 +0000 (18:30 +0200)]
Explicit function disambiguation.

This is necessary for compilers where the hyperbolic and the tgamma function
templates are pulled in from <cmath> and compete with GiNaC's function
templates. GCC 4.4 and 4.5 need this, when compiling with -std=cxx0x.

13 years agoFix weird ctor invocation syntax.
Richard Kreckel [Tue, 27 Apr 2010 20:44:35 +0000 (22:44 +0200)]
Fix weird ctor invocation syntax.

This patch is required for GCC-4.5.

13 years agoFix weird ctor invocation syntax.
Richard Kreckel [Tue, 27 Apr 2010 20:44:35 +0000 (22:44 +0200)]
Fix weird ctor invocation syntax.

This patch is required for GCC-4.5.

14 years agoPreparing for release 1.5.7. release_1-5-7
Jens Vollinga [Mon, 29 Mar 2010 00:34:52 +0000 (02:34 +0200)]
Preparing for release 1.5.7.

14 years agoProducts (class mul) now answer correctly to info_flags::negative and
Jens Vollinga [Sun, 28 Mar 2010 22:21:18 +0000 (00:21 +0200)]
Products (class mul) now answer correctly to info_flags::negative and
info_flags::negint.
(cherry picked from commit 8a30acc990818792ec4e8f8f4d48f5dd8286dbed)

14 years agoProducts (class mul) now answer correctly to info_flags::negative and
Jens Vollinga [Sun, 28 Mar 2010 22:21:18 +0000 (00:21 +0200)]
Products (class mul) now answer correctly to info_flags::negative and
info_flags::negint.

14 years agoReally fixed the atan2(-Pi, 0) bug.
Richard Kreckel [Thu, 25 Mar 2010 22:08:54 +0000 (23:08 +0100)]
Really fixed the atan2(-Pi, 0) bug.

The problem was that atan2_eval assumed that if y is real and not
positive, it must be negative. But this neglects the fact that in
symbolic compution it may just not be possible to determine the
sign. Now, the expression is returned as it is. Ugly, but correct.

14 years agoReally fixed the atan2(-Pi, 0) bug.
Richard Kreckel [Thu, 25 Mar 2010 22:08:54 +0000 (23:08 +0100)]
Really fixed the atan2(-Pi, 0) bug.

The problem was that atan2_eval assumed that if y is real and not
positive, it must be negative. But this neglects the fact that in
symbolic compution it may just not be possible to determine the
sign. Now, the expression is returned as it is. Ugly, but correct.

14 years agoMerge branch 'master' of ssh://www.ginac.de/srv/git/ginac
Richard Kreckel [Thu, 25 Mar 2010 21:23:13 +0000 (22:23 +0100)]
Merge branch 'master' of ssh://www.ginac.de/srv/git/ginac

14 years agoFixed a bug in atan2. It gave a division by zero error for calls like
Jens Vollinga [Thu, 25 Mar 2010 09:36:41 +0000 (10:36 +0100)]
Fixed a bug in atan2. It gave a division by zero error for calls like
atan2(-Pi,0), because arguments like -Pi were not recognized (via
info_flags) as negative but as real nevertheless.
(cherry picked from commit 9e13d46552bb7852399867b9eb355732b9ded59e)

14 years agoFixed a bug in atan2. It gave a division by zero error for calls like
Jens Vollinga [Thu, 25 Mar 2010 09:36:41 +0000 (10:36 +0100)]
Fixed a bug in atan2. It gave a division by zero error for calls like
atan2(-Pi,0), because arguments like -Pi were not recognized (via
info_flags) as negative but as real nevertheless.

14 years agoCopyright goes 2010.
Jens Vollinga [Fri, 5 Mar 2010 20:37:19 +0000 (21:37 +0100)]
Copyright goes 2010.
(cherry picked from commit 95ede03f00106be5fb087d76c86ca5c27edb9122)

14 years agoCopyright goes 2010.
Jens Vollinga [Fri, 5 Mar 2010 20:37:19 +0000 (21:37 +0100)]
Copyright goes 2010.

14 years agoUpdate copyright notice.
Richard Kreckel [Sat, 27 Feb 2010 14:00:22 +0000 (15:00 +0100)]
Update copyright notice.

14 years agopgcd(): detect relatively prime polynomials properly...
Alexei Sheplyakov [Tue, 23 Feb 2010 10:01:23 +0000 (12:01 +0200)]
pgcd(): detect relatively prime polynomials properly...

... so pgcd() doesn't loop forever any more. Division test does not handle
relatively prime polynomials (because C = 1 divides any polynomial). So we
should stop interpolation (and return gcd of contents) if we got relatively
prime images (we should do that for efficiency reasons too).

Thanks to Jörg Arndt for a bug report.
(cherry picked from commit 6afbb9793e359cf388462c471ea256a6662b0cd4)

14 years agopgcd(): detect relatively prime polynomials properly...
Alexei Sheplyakov [Tue, 23 Feb 2010 10:01:23 +0000 (12:01 +0200)]
pgcd(): detect relatively prime polynomials properly...

... so pgcd() doesn't loop forever any more. Division test does not handle
relatively prime polynomials (because C = 1 divides any polynomial). So we
should stop interpolation (and return gcd of contents) if we got relatively
prime images (we should do that for efficiency reasons too).

Thanks to Jörg Arndt for a bug report.

14 years agoPreparing for release 1.5.6. release_1-5-6
Jens Vollinga [Thu, 28 Jan 2010 14:25:01 +0000 (15:25 +0100)]
Preparing for release 1.5.6.

14 years agoUse C style cast when converting void* into function pointer.
Alexei Sheplyakov [Wed, 6 Jan 2010 17:55:43 +0000 (19:55 +0200)]
Use C style cast when converting void* into function pointer.

Building GiNaC 1.5.5 with GCC 3.4 fails with the following error:

libtool: compile:  ccache g++-3.4 -DHAVE_CONFIG_H -I. -I../../ginac -I../config -I/home/pc7135/varg/target/x86_64-linux-gnu/include -O2 -g -Wall -pipe -MT builtin_fcns.lo -MD -MP -MF .deps/builtin_fcns.Tpo -c ../../ginac/parser/builtin_fcns.cpp  -fPIC -DPIC -o .libs/builtin_fcns.o
../../ginac/parser/builtin_fcns.cpp: In function `GiNaC::ex (* GiNaC::encode_serial_as_reader_func(unsigned int))(const GiNaC::exvector&)':
/home/pc7135/varg/tmp/build/GiNaC/build-linux-gcc-3.4/ginac/../../ginac/parser/builtin_fcns.cpp|67| error: ISO C++ forbids casting between pointer-to-function and pointer-to-object
make[2]: *** [builtin_fcns.lo] Error 1

The C++98 standard [expr.reinterpret.cast] does not allow

reinterpret_cast<function_pointer>(void*)
reinterpret_cast<void*>(function_pointer)

But the ability to do so is important for a lot of practical uses. So soon
after the C++98 standard was approved, a language defect report was filed
on this topic, see
http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#195
The result is that compilers will be allowed to support reinterpret_cast
conversions of function pointers to other (pointers) types, and vice a versa.
Such conversions work with *current* compilers (GCC 4.x), but don't work
with older ones, hence this patch.

14 years agoInstall the ginac-excompiler script iff excompiler is supported and enabled.
Alexei Sheplyakov [Wed, 6 Jan 2010 17:56:04 +0000 (19:56 +0200)]
Install the ginac-excompiler script iff excompiler is supported and enabled.
(cherry picked from commit 25c7a8c09f7db73b48675777aa805e788f2308be)

14 years agoInstall the ginac-excompiler script iff excompiler is supported and enabled.
Alexei Sheplyakov [Wed, 6 Jan 2010 17:56:04 +0000 (19:56 +0200)]
Install the ginac-excompiler script iff excompiler is supported and enabled.

14 years agoPreparing for release.
Jens Vollinga [Wed, 4 Nov 2009 22:12:57 +0000 (23:12 +0100)]
Preparing for release.

14 years agoFix libtool versioning fiasco.
Richard Kreckel [Wed, 4 Nov 2009 20:58:26 +0000 (21:58 +0100)]
Fix libtool versioning fiasco.

Fix f2f67dde5c9caca, which caused the soname to be bumped too frequently.

14 years agoFix libtool versioning fiasco.
Richard Kreckel [Wed, 4 Nov 2009 20:58:26 +0000 (21:58 +0100)]
Fix libtool versioning fiasco.

Fix f2f67dde5c9caca, which caused the soname to be bumped too frequently.

14 years agoPreparing for release. release_1-5-4
Jens Vollinga [Mon, 2 Nov 2009 22:29:21 +0000 (23:29 +0100)]
Preparing for release.

14 years agoAdd mul::info() and add::info() support for numeric info_flags.
Richard Kreckel [Sun, 11 Oct 2009 21:19:21 +0000 (23:19 +0200)]
Add mul::info() and add::info() support for numeric info_flags.

This way, GiNaC knows that the sum or product of a number of positive
expressions is again a positive expression. [by Vladimir Kisil]

14 years agoAdd mul::info() and add::info() support for numeric info_flags.
Richard Kreckel [Sun, 11 Oct 2009 21:19:21 +0000 (23:19 +0200)]
Add mul::info() and add::info() support for numeric info_flags.

This way, GiNaC knows that the sum or product of a number of positive
expressions is again a positive expression. [by Vladimir Kisil]

14 years agoMerge branch 'ginac_1-5' of ssh://www.ginac.de/srv/git/ginac into ginac_1-5
Richard Kreckel [Sun, 4 Oct 2009 20:34:33 +0000 (22:34 +0200)]
Merge branch 'ginac_1-5' of ssh://www.ginac.de/srv/git/ginac into ginac_1-5

14 years agoOutput LaTeX-symbols using \mathrm, instead of \mbox.
Richard Kreckel [Sun, 4 Oct 2009 20:30:45 +0000 (22:30 +0200)]
Output LaTeX-symbols using \mathrm, instead of \mbox.

Using \mathrm improves printing in complex formulae.
One reason is that it scales in fractions. [by Vladimir Kisil]

14 years agoOutput LaTeX-symbols using \mathrm, instead of \mbox.
Richard Kreckel [Sun, 4 Oct 2009 20:30:45 +0000 (22:30 +0200)]
Output LaTeX-symbols using \mathrm, instead of \mbox.

Using \mathrm improves printing in complex formulae.
One reason is that it scales in fractions. [by Vladimir Kisil]

14 years agoMoved header includes to source files to avoid polluting the namespace
Jens Vollinga [Sun, 4 Oct 2009 20:15:13 +0000 (22:15 +0200)]
Moved header includes to source files to avoid polluting the namespace
for library users.

14 years agoRemove debian/ directory.
Richard Kreckel [Tue, 29 Sep 2009 20:28:47 +0000 (22:28 +0200)]
Remove debian/ directory.

The lifecycle of the Debian packaging files is better maintained in
the Debian pool's diff file. Removing these files makes the life of
the GiNaC releaser easier.

14 years agoRemove debian/ directory.
Richard Kreckel [Tue, 29 Sep 2009 20:25:16 +0000 (22:25 +0200)]
Remove debian/ directory.

The lifecycle of the Debian packaging files is better maintained in
the Debian pool's diff file. Removing these files makes the life of
the GiNaC releaser easier.

14 years agoProperly document how to deal with libtool versioning.
Richard Kreckel [Tue, 29 Sep 2009 20:08:11 +0000 (22:08 +0200)]
Properly document how to deal with libtool versioning.

The old description was referring to ginac_lt_age which should always
stay 0, because we promised to mark incompatible binary interfaces by
bumping ginac_minor_version (or even ginac_major_version). Let's get
rid of ginac_lt_age.

14 years agoProperly document how to deal with libtool versioning.
Richard Kreckel [Tue, 29 Sep 2009 20:08:11 +0000 (22:08 +0200)]
Properly document how to deal with libtool versioning.

The old description was referring to ginac_lt_age which should always
stay 0, because we promised to mark incompatible binary interfaces by
bumping ginac_minor_version (or even ginac_major_version). Let's get
rid of ginac_lt_age.

14 years agoncmul::eval(): don't write beyond the end of the vector.
Alexei Sheplyakov [Sat, 8 Aug 2009 10:03:38 +0000 (13:03 +0300)]
ncmul::eval(): don't write beyond the end of the vector.

14 years agomodular_matrix: don't use STL iterators in {mul, sub}_col and friends.
Alexei Sheplyakov [Sat, 8 Aug 2009 10:03:15 +0000 (13:03 +0300)]
modular_matrix: don't use STL iterators in {mul, sub}_col and friends.

Not using STL iterators makes the code simpler and cleaner. Also we don't
have to argue whether the standard ([lib.random.access.iterators]) imposes
any pre/post-condictions on operator+=.
(cherry picked from commit 59ec13895c97ffd74979a0b811a7571f6de56386)

14 years agomodular_matrix: don't use STL iterators in {mul, sub}_col and friends.
Alexei Sheplyakov [Sat, 8 Aug 2009 10:03:15 +0000 (13:03 +0300)]
modular_matrix: don't use STL iterators in {mul, sub}_col and friends.

Not using STL iterators makes the code simpler and cleaner. Also we don't
have to argue whether the standard ([lib.random.access.iterators]) imposes
any pre/post-condictions on operator+=.

14 years agoAdded get_builtin_reader() that parses only the builtin GiNaC functions
Jens Vollinga [Sun, 9 Aug 2009 21:38:48 +0000 (23:38 +0200)]
Added get_builtin_reader() that parses only the builtin GiNaC functions
and pow, sqrt, and power.

14 years agoFixed include of stdint.h (parser.cpp needs the header as well).
Jens Vollinga [Sun, 9 Aug 2009 21:27:10 +0000 (23:27 +0200)]
Fixed include of stdint.h (parser.cpp needs the header as well).

14 years agoshaker_sort, permutation_sign: fix invalid use of STL iterators.
Alexei Sheplyakov [Sat, 8 Aug 2009 10:03:48 +0000 (13:03 +0300)]
shaker_sort, permutation_sign: fix invalid use of STL iterators.

According to the standard incrementing end(), and decrementing begin()
are ill-defined operations (see [lib.forward.iterators],
[lib.bidirectional.iterators]).
(cherry picked from commit 694f839947982f5b12b6c629d5bab522c801630d)

14 years agosymmetry::calchash(): be careful to not dereference past-the-end iterator.
Alexei Sheplyakov [Sat, 8 Aug 2009 10:07:14 +0000 (13:07 +0300)]
symmetry::calchash(): be careful to not dereference past-the-end iterator.
(cherry picked from commit 526825bcee294cb20e37d8db6d5040ba0f8c428f)

14 years agocheck_parameter_G: fix pontential increment of end().
Alexei Sheplyakov [Sat, 8 Aug 2009 10:06:36 +0000 (13:06 +0300)]
check_parameter_G: fix pontential increment of end().

Incrementing past-the-end iterator is not permitted by the standard, see
[lib.input.iterators].
(cherry picked from commit 49a44f7d55ec0d6686d3c32c7081a07d10c93274)

14 years agoG_eval: fix incorrect use of STL iterator.
Alexei Sheplyakov [Sat, 8 Aug 2009 10:02:47 +0000 (13:02 +0300)]
G_eval: fix incorrect use of STL iterator.

According to [lib.bidirectional.iterators] it's not OK to decrement
an iterator pointing to the beginning of the sequence. Fortunately random
access iterators provided by (current versions of) gcc/libstdc++ don't have
this silly limitation, so the code which works with pointers works with
iterators without any changes at all. However,
 - there's no guarantee that the current behavior won't change in the future
 - some non-GNU compilers are not that smart (i.e. the program segfaults
   upon when decrementing beginning-of-the-sequence iterator).
(cherry picked from commit dda45abd8a2c408f8b3eb7959a10dfb2468ecc3a)

14 years agoFix the compliation error *for real* ... and restore performance
Alexei Sheplyakov [Sat, 8 Aug 2009 08:43:12 +0000 (11:43 +0300)]
Fix the compliation error *for real* ... and restore performance

Commit 8bf0597dde55e4c94a2ff39f1d8130902e3d7a9b (titled as 'Fixed the parser
such that it can read in user defined classes again.') made the parser a bit
slower, especially if the input contains many terms of user-defined type.
The reason for that is quite simple: we throw and catch an exception every
time we construct an object of user-defined type:

       // dirty hack to distinguish between serial numbers of functions and real
       // pointers.
       GiNaC::function* f = NULL;
       try {
               unsigned serial = (unsigned)(unsigned long)(void *)(reader->second);
               f = new GiNaC::function(serial, args);
       }
       catch ( std::runtime_error ) {
               if ( f ) delete f;
               ex ret = reader->second(args);
               return ret;
       }

Fortunately functions are aligned and we can use much more efficient
technique to distinguish between serial and pointers to functions.

14 years agoFix the compliation error *for real*
Alexei Sheplyakov [Fri, 7 Aug 2009 20:22:18 +0000 (23:22 +0300)]
Fix the compliation error *for real*

14 years agoshaker_sort, permutation_sign: fix invalid use of STL iterators.
Alexei Sheplyakov [Sat, 8 Aug 2009 10:03:48 +0000 (13:03 +0300)]
shaker_sort, permutation_sign: fix invalid use of STL iterators.

According to the standard incrementing end(), and decrementing begin()
are ill-defined operations (see [lib.forward.iterators],
[lib.bidirectional.iterators]).

14 years agosymmetry::calchash(): be careful to not dereference past-the-end iterator.
Alexei Sheplyakov [Sat, 8 Aug 2009 10:07:14 +0000 (13:07 +0300)]
symmetry::calchash(): be careful to not dereference past-the-end iterator.

14 years agocheck_parameter_G: fix pontential increment of end().
Alexei Sheplyakov [Sat, 8 Aug 2009 10:06:36 +0000 (13:06 +0300)]
check_parameter_G: fix pontential increment of end().

Incrementing past-the-end iterator is not permitted by the standard, see
[lib.input.iterators].

14 years agoG_eval: fix incorrect use of STL iterator.
Alexei Sheplyakov [Sat, 8 Aug 2009 10:02:47 +0000 (13:02 +0300)]
G_eval: fix incorrect use of STL iterator.

According to [lib.bidirectional.iterators] it's not OK to decrement
an iterator pointing to the beginning of the sequence. Fortunately random
access iterators provided by (current versions of) gcc/libstdc++ don't have
this silly limitation, so the code which works with pointers works with
iterators without any changes at all. However,
 - there's no guarantee that the current behavior won't change in the future
 - some non-GNU compilers are not that smart (i.e. the program segfaults
   upon when decrementing beginning-of-the-sequence iterator).

14 years agoFixed memory leak.
Jens Vollinga [Fri, 31 Jul 2009 15:54:16 +0000 (17:54 +0200)]
Fixed memory leak.

14 years agoFixed the fix in commit f059ebe117d15292e0d262e6e8e232e835c7e33c.
Jens Vollinga [Fri, 31 Jul 2009 13:29:17 +0000 (15:29 +0200)]
Fixed the fix in commit f059ebe117d15292e0d262e6e8e232e835c7e33c.

14 years agoFixed dirty hack in parser to distinguish between serial numbers and pointers.
Jens Vollinga [Fri, 31 Jul 2009 12:41:08 +0000 (14:41 +0200)]
Fixed dirty hack in parser to distinguish between serial numbers and pointers.

14 years agoFixed the parser such that it can read in user defined classes again.
Jens Vollinga [Fri, 31 Jul 2009 10:48:58 +0000 (12:48 +0200)]
Fixed the parser such that it can read in user defined classes again.
Fixed default reader to parse also pow, sqrt and power.

14 years agoFixed cast that caused compile error on 64bit machines.
Jens Vollinga [Fri, 31 Jul 2009 09:14:01 +0000 (11:14 +0200)]
Fixed cast that caused compile error on 64bit machines.

14 years agoPreparing for release 1.5.3. release_1-5-3
Jens Vollinga [Thu, 30 Jul 2009 17:04:32 +0000 (19:04 +0200)]
Preparing for release 1.5.3.

14 years agoAllow underscores in identifiers.
Jens Vollinga [Wed, 15 Jul 2009 03:19:07 +0000 (05:19 +0200)]
Allow underscores in identifiers.
(cherry picked from commit 619879b5bd86a99334affe1f05d17616cc2c1898)

14 years agoAllow user defined functions to be parsed.
Jens Vollinga [Wed, 15 Jul 2009 06:26:33 +0000 (08:26 +0200)]
Allow user defined functions to be parsed.

This patch is an ugly hack that does the same as the commit
f38cbcd651246fb5c1294705d29399f3cbfddaf5
but without changing the ABI (so it can be used in ginac_1-5).

14 years agoAllow underscores in identifiers.
Jens Vollinga [Wed, 15 Jul 2009 03:19:07 +0000 (05:19 +0200)]
Allow underscores in identifiers.

14 years agoPreparing for release 1.5.2. release_1-5-2
Jens Vollinga [Fri, 10 Jul 2009 13:21:09 +0000 (15:21 +0200)]
Preparing for release 1.5.2.

14 years agoChanged the parser such that it understands all defined functions
Jens Vollinga [Fri, 10 Jul 2009 13:01:04 +0000 (15:01 +0200)]
Changed the parser such that it understands all defined functions
including the user defined ones.

To this end a method has been added to class function to allow the
modified get_default_reader() function to build up a complete prototype
table. The autogen tool is no longer required.

14 years agoFixed manual to correctly explain return_type_tinfo().
Jens Vollinga [Fri, 10 Jul 2009 07:54:09 +0000 (09:54 +0200)]
Fixed manual to correctly explain return_type_tinfo().
(cherry picked from commit feed241b95f7dbd6294795b4afc2bcae41880c31)

14 years agoFixed manual to correctly explain return_type_tinfo().
Jens Vollinga [Fri, 10 Jul 2009 07:54:09 +0000 (09:54 +0200)]
Fixed manual to correctly explain return_type_tinfo().

14 years agoRaised required version of CLN to 1.2.2.
Jens Vollinga [Wed, 10 Jun 2009 09:28:34 +0000 (11:28 +0200)]
Raised required version of CLN to 1.2.2.

14 years agoRaised required version of CLN to 1.2.2.
Jens Vollinga [Wed, 10 Jun 2009 09:28:34 +0000 (11:28 +0200)]
Raised required version of CLN to 1.2.2.

14 years agoAdded include for cstdio header.
Jens Vollinga [Fri, 24 Apr 2009 21:37:44 +0000 (23:37 +0200)]
Added include for cstdio header.
gcc 4.0 does not include cstdio as part of other headers like string
anymore. As a result, gcc 4.0 complained about EOF being undefined.

14 years agoAdded include for cstdio header.
Jens Vollinga [Fri, 24 Apr 2009 21:37:44 +0000 (23:37 +0200)]
Added include for cstdio header.
gcc 4.0 does not include cstdio as part of other headers like string
anymore. As a result, gcc 4.0 complained about EOF being undefined.

15 years agoRepairing the preparing of the release. release_1-5-1
Jens Vollinga [Wed, 25 Feb 2009 14:03:38 +0000 (15:03 +0100)]
Repairing the preparing of the release.

15 years agoPreparing for release.
Jens Vollinga [Wed, 25 Feb 2009 12:07:18 +0000 (13:07 +0100)]
Preparing for release.

15 years agocalchash(): work around broken RTTI.
Alexei Sheplyakov [Mon, 23 Feb 2009 12:08:42 +0000 (14:08 +0200)]
calchash(): work around broken RTTI.

Due to the strange (although permitted by the standard) behaviour of C++
RTTI on woe32 calchash() returns different hash values for equal objects.
As a result automatic evaluation gets spectacularly broken:

examining clifford objects.....({1+t,2+x,3+y,4+z}) - ({1+t,2+x,3+y,4+z}) erroneously returned -{1+t,2+x,3+y,4+z}+{1+t,2+x,3+y,4+z} instead of 0
({1+t,2+x,3+y,4+z}) - ({1+t,2+x,3+y,4+z}) erroneously returned -{1+t,2+x,3+y,4+z}+{1+t,2+x,3+y,4+z} instead of 0
.({1+t,2+x,3+y,4+z}) - ({1+t,2+x,3+y,4+z}) erroneously returned -{1+t,2+x,3+y,4+z}+{1+t,2+x,3+y,4+z} instead of 0
({1+t,2+x,3+y,4+z}) - ({1+t,2+x,3+y,4+z}) erroneously returned {1+t,2+x,3+y,4+z}-{1+t,2+x,3+y,4+z} instead of 0
[skipped]
.......FAIL: exam_clifford.exe

This patch works around `features' of woe32 RTTI, so calchash() works
properly.

15 years agoFix compilation failure due to (template) operator- defined in factor.cpp
Alexei Sheplyakov [Mon, 23 Feb 2009 12:03:16 +0000 (14:03 +0200)]
Fix compilation failure due to (template) operator- defined in factor.cpp

GiNaC 1.5.0 fails to compile with g++ 3.4.
The fix is simple: declare (and define) operator- (and operator+) only
for (univariate) polynomials.

15 years agocalchash(): work around broken RTTI.
Alexei Sheplyakov [Mon, 23 Feb 2009 12:08:42 +0000 (14:08 +0200)]
calchash(): work around broken RTTI.

Due to the strange (although permitted by the standard) behaviour of C++
RTTI on woe32 calchash() returns different hash values for equal objects.
As a result automatic evaluation gets spectacularly broken:

examining clifford objects.....({1+t,2+x,3+y,4+z}) - ({1+t,2+x,3+y,4+z}) erroneously returned -{1+t,2+x,3+y,4+z}+{1+t,2+x,3+y,4+z} instead of 0
({1+t,2+x,3+y,4+z}) - ({1+t,2+x,3+y,4+z}) erroneously returned -{1+t,2+x,3+y,4+z}+{1+t,2+x,3+y,4+z} instead of 0
.({1+t,2+x,3+y,4+z}) - ({1+t,2+x,3+y,4+z}) erroneously returned -{1+t,2+x,3+y,4+z}+{1+t,2+x,3+y,4+z} instead of 0
({1+t,2+x,3+y,4+z}) - ({1+t,2+x,3+y,4+z}) erroneously returned {1+t,2+x,3+y,4+z}-{1+t,2+x,3+y,4+z} instead of 0
[skipped]
.......FAIL: exam_clifford.exe

This patch works around `features' of woe32 RTTI, so calchash() works
properly.

15 years agoFix compilation failure due to (template) operator- defined in factor.cpp
Alexei Sheplyakov [Mon, 23 Feb 2009 12:03:16 +0000 (14:03 +0200)]
Fix compilation failure due to (template) operator- defined in factor.cpp

GiNaC 1.5.0 fails to compile with g++ 3.4.
The fix is simple: declare (and define) operator- (and operator+) only
for (univariate) polynomials.

15 years agoUnivariate GCD timing: use sr_gcd when appropriate. release_1-5-0
Alexei Sheplyakov [Mon, 16 Feb 2009 14:23:16 +0000 (16:23 +0200)]
Univariate GCD timing: use sr_gcd when appropriate.

The benchmark consists of two parts:
1) timing of different GCD calculation methods (i.e. subresultant PRS,
   heuristic, chinese remaindering).
2) timing of different implementations of the same method. The purpose
   is to find out how (in)efficient GiNaC::ex is as a representation
   of (univariate) polynomials (as a side note, the result is a bit
   depressing -- using coefficient vector instead of GiNaC:ex makes
   GCD calculation 50x -- 1000x faster).

Now GiNaC uses modular (chinese remaindering) GCD by default, so part 2)
got broken, i.e. instead of (intended) timings

a) (heuristic, GiNaC::ex) versus (heuristic, coefficient vector)
b) (PRS, GiNaC::ex) versus (PRS, coefficient vector)

one gets

a') (heuristic, GiNaC::ex) versus (heuristic, coefficient vector)
b') (chinese remaindering, GiNaC::ex) versus (PRS, coefficient vector)

Set the gcd_options::use_sr_gcd to restore the meaning of the benchmark.

Note: this patch does not affect the library proper.

15 years agoPolished NEWS a little bit.
Alexei Sheplyakov [Mon, 16 Feb 2009 14:24:15 +0000 (16:24 +0200)]
Polished NEWS a little bit.

15 years agoAdded release date.
Jens Vollinga [Tue, 17 Feb 2009 13:38:17 +0000 (14:38 +0100)]
Added release date.

15 years agoAdjusted NEWS and INSTALL documentation.
Jens Vollinga [Fri, 6 Feb 2009 15:49:47 +0000 (16:49 +0100)]
Adjusted NEWS and INSTALL documentation.

15 years agoMissed to change one date in function.pl.
Jens Vollinga [Fri, 6 Feb 2009 15:35:22 +0000 (16:35 +0100)]
Missed to change one date in function.pl.

15 years agoChanged name of debugging macro (to avoid warning cause by multiple definition).
Jens Vollinga [Fri, 6 Feb 2009 15:24:58 +0000 (16:24 +0100)]
Changed name of debugging macro (to avoid warning cause by multiple definition).

15 years agoFixed returning of test result (++result was +result).
Jens Vollinga [Fri, 6 Feb 2009 15:22:58 +0000 (16:22 +0100)]
Fixed returning of test result (++result was +result).

15 years agoPrettified source code.
Jens Vollinga [Fri, 6 Feb 2009 15:07:10 +0000 (16:07 +0100)]
Prettified source code.

- Added copyright and GPL licencing to new files.
- Increased year to 2009.
- Changed guarding macros in header to uniform pattern without leading or
  trailing __ (double underscores).
- Put includes of system wide header consistently below own includes (help
  a tiny bit to clarify dependencies).

15 years agoFix chinese_remainder() so modular GCD actually works.
Alexei Sheplyakov [Fri, 6 Feb 2009 06:57:32 +0000 (08:57 +0200)]
Fix chinese_remainder() so modular GCD actually works.

15 years agoAutomake now needs to be version >=1.8. Older versions like 1.7.9 do not create
Jens Vollinga [Fri, 6 Feb 2009 12:13:06 +0000 (13:13 +0100)]
Automake now needs to be version >=1.8. Older versions like 1.7.9 do not create
the directory m4 in a VPATH build.