]> www.ginac.de Git - ginac.git/log
ginac.git
2 weeks ago[BUGFIX] Fix crash in parser. master
Richard Kreckel [Fri, 5 Apr 2024 16:34:48 +0000 (18:34 +0200)]
[BUGFIX] Fix crash in parser.

Relying on aligned functions is non-portable.

Reported by Diego Conti <diego.conti@unipi.it>.

2 weeks ago[DOC] Fix some TeXinfo warnings.
Richard Kreckel [Fri, 5 Apr 2024 14:17:04 +0000 (16:17 +0200)]
[DOC] Fix some TeXinfo warnings.

3 months agoHappy New Year!
Richard Kreckel [Thu, 4 Jan 2024 00:31:12 +0000 (01:31 +0100)]
Happy New Year!

5 months agoAvoid internal use of designated initializer...
Richard Kreckel [Sat, 28 Oct 2023 15:57:43 +0000 (17:57 +0200)]
Avoid internal use of designated initializer...

...which is a C++20 feature. This fixes MSVC build.

Reported by Igor Machado <igor.machado@gmail.com>.

8 months agoFinalize 1.8.7 release. release_1-8-7
Richard Kreckel [Sat, 12 Aug 2023 16:17:41 +0000 (18:17 +0200)]
Finalize 1.8.7 release.

8 months agoUpdate NEWS.
Richard Kreckel [Sun, 6 Aug 2023 17:57:35 +0000 (19:57 +0200)]
Update NEWS.

8 months agoAdd evaluation of Order(x)^e -> Order(x^e) for positive integer e.
Richard Kreckel [Sun, 6 Aug 2023 17:47:19 +0000 (19:47 +0200)]
Add evaluation of Order(x)^e -> Order(x^e) for positive integer e.

8 months agoFix series of positive powers of polynomials.
Richard Kreckel [Sun, 6 Aug 2023 17:27:51 +0000 (19:27 +0200)]
Fix series of positive powers of polynomials.

Before calling pseries::power_const(), make sure the basis series has
sufficient terms. In particular, do not shrink the order of expansion
- only grow it.

Fix various hairy problems in pseries::power_const() when a polynomial
is raised to a positive integer power.

(The special cases here can actually also be computed by Taylor
expansion but the fixes should be more general.)

Also add test cases.

Thanks to Vitaly Magerya <vmagerya@gmail.com> for reporting this.

9 months ago[PATCH] Make ginsh evaluate line-by-line in non-interactive mode.
Vitaly Magerya [Wed, 21 Jun 2023 18:48:36 +0000 (20:48 +0200)]
[PATCH] Make ginsh evaluate line-by-line in non-interactive mode.

When used interactively ginsh consumes the input line-by-line, so
if a complete expression is entered it is enough to end the line
to get an evaluated result. In the non-interative mode (i.e. if
the input is not a tty) the input is consumed in blocks, making
it impossible to use ginsh as a subprocess.

This patch makes the non-interactive mode reuse the same line
parsing logic as the interactive mode (without readline), but skips
printing the "> " prompt, preserving the backward compatibility.

9 months agoFix GiNaC's internal parsing of expressions.
Vitaly Magerya [Tue, 20 Jun 2023 20:35:48 +0000 (22:35 +0200)]
Fix GiNaC's internal parsing of expressions.

...with explicit signs in multiplications and in exponents. Also fix
nested exponentiation. Add exams compatible with ginsh's parsing.

14 months ago[PATCH] Resolve ambiguous overload.
Vladimir V. Kisil [Sun, 12 Feb 2023 10:20:47 +0000 (11:20 +0100)]
[PATCH] Resolve ambiguous overload.

It confuses MinGW compiler on Windows from Qt suit.

Signed-off-by: Vladimir V. Kisil <V.Kisilv@leeds.ac.uk>
14 months ago[DOC] Fix a typo.
Richard Kreckel [Sat, 11 Feb 2023 23:41:47 +0000 (00:41 +0100)]
[DOC] Fix a typo.

14 months ago[DOC] Fix build of reference.pdf.
Richard Kreckel [Sat, 11 Feb 2023 23:09:48 +0000 (00:09 +0100)]
[DOC] Fix build of reference.pdf.

This is obnoxious: It is 2023, the ≥ character is in Unicode since
1993, and UTF-8 is ubiquitous. Yet, pdfLaTeX balks at this.

Maybe the right fix would be to switch to LuaLaTeX. Alas, that doesn't
seem to have reached the necessary maturity yet:
<https://tug.org/pipermail/luatex/2023-February/007799.html>

14 months ago[DOC] Fix some Doxygen references.
Richard Kreckel [Sat, 11 Feb 2023 22:27:21 +0000 (23:27 +0100)]
[DOC] Fix some Doxygen references.

14 months agoRevert "Work around Tex Live 2012 versus doxygen problem."
Richard Kreckel [Sat, 11 Feb 2023 17:51:08 +0000 (18:51 +0100)]
Revert "Work around Tex Live 2012 versus doxygen problem."

The bug seems to have disappeared many years ago, at least since
Debian 9 Stretch (ca. 2017).

This reverts commit af3801eb5e40bb3717bf207470252172a0af2559.

14 months ago[build] Fix a typo in configure.ac.
Richard Kreckel [Sat, 11 Feb 2023 10:57:33 +0000 (11:57 +0100)]
[build] Fix a typo in configure.ac.

14 months agoFinalize 1.8.6 release. release_1-8-6
Richard Kreckel [Wed, 8 Feb 2023 21:42:03 +0000 (22:42 +0100)]
Finalize 1.8.6 release.

14 months agoFix numeric binomial(n, k) for integer n<0 and k≤n...
Richard Kreckel [Tue, 7 Feb 2023 23:03:06 +0000 (00:03 +0100)]
Fix numeric binomial(n, k) for integer n<0 and k≤n...

...by instead returning binomial(n, n-k).

Suggested by Marko Riedel <riedelmo@mathematik.uni-stuttgart.de>.

14 months ago[PATCH] Fix wrong numeric info on transcendental functions.
Vladimir V. Kisil [Tue, 7 Feb 2023 21:42:09 +0000 (22:42 +0100)]
[PATCH] Fix wrong numeric info on transcendental functions.

Although expression like cos(numeric(1, 2)) is not a symbolic, it
neither is numeric in the sense of CLN library. Without this patch
GiNaC crashes on expressions like cos(cos(ex(1)/ex(2))).

Thanks to Weng Zhanyang <cosine@pcbcos.xyz> for reporting this.

15 months agoFinalize 1.8.5 release. release_1-8-5
Richard Kreckel [Sun, 1 Jan 2023 13:31:35 +0000 (14:31 +0100)]
Finalize 1.8.5 release.

15 months agoHappy New Year!
Richard Kreckel [Sun, 1 Jan 2023 01:21:55 +0000 (02:21 +0100)]
Happy New Year!

15 months agoMinor refactoring in factor.cpp.
Richard Kreckel [Thu, 29 Dec 2022 20:00:36 +0000 (21:00 +0100)]
Minor refactoring in factor.cpp.

- Substitute the misnamed expt_pos(a,q) with the more specialized
  expt_pos_Q(w,a,q,r) function, for use by distinct_degree_factor().
- Rework canonicalize function and change semantics of its hint
  argument to be more natural.
- Use the hint argument of canonicalize() in rem().
- Add some documenting comments.

15 months agoSome more minor optimizations in factor.cpp.
Richard Kreckel [Thu, 22 Dec 2022 23:44:23 +0000 (00:44 +0100)]
Some more minor optimizations in factor.cpp.

This isn't changing much, but once I've seen a missed opportunity, it
keeps catching the eye and then it's hard to resist.  :-)

15 months agoFix internal next_prime(n) function.
Richard Kreckel [Thu, 22 Dec 2022 17:19:59 +0000 (18:19 +0100)]
Fix internal next_prime(n) function.

This helper function was doing wild things when called the wrong way.
E.g. it would allocate obscene amounts of memory and run for ages when
called with an argument that has never been returned by it before.

In the context where it's being used so far this is not a problem. But
it's better to make it foolproof and spare a new user some possible
despair and distress.

16 months agoPrefer CLN left shift operations over multiplications in factor().
Richard Kreckel [Mon, 19 Dec 2022 19:17:55 +0000 (20:17 +0100)]
Prefer CLN left shift operations over multiplications in factor().

16 months agoChange some internal lst to exvector in factor.cpp...
Richard Kreckel [Mon, 19 Dec 2022 19:13:11 +0000 (20:13 +0100)]
Change some internal lst to exvector in factor.cpp...

...in places where c[i] is more readable than c.op(i) or the insidious
c.let_op(i) notation.

16 months ago[BUGFIX] Fix corner cases of factor_multivariate().
Richard Kreckel [Mon, 19 Dec 2022 17:14:32 +0000 (18:14 +0100)]
[BUGFIX] Fix corner cases of factor_multivariate().

In some rare cases, factor() failed with what looks like an endless
loop trying evaluation homomorphisms with ever increasing moduli (or
maybe it just took eons to complete).

Whether this happened depended on which symbol was left unevaluated
for univariate factorization. As a workaround for this problem, we now
apply the evaluation homomorphism for each symbol in a round-robin
mode until one of them succeeds.

This somewhat speeds up factorization of multivariate polynomials
even in those cases where the old implementation terminated in time.

Thanks to Vitaly Magerya <vmagerya@gmail.com> for reporting this.

17 months agoRefactor internal calc_bound() routines.
Richard Kreckel [Mon, 14 Nov 2022 23:08:28 +0000 (00:08 +0100)]
Refactor internal calc_bound() routines.

Reduce them to computation of absolute values of the polynomial's roots
and document that this is known as Landau's inequality. The multiplication
with a power of two is done by the caller.

Also remove the internal fallback computation using the maxcoeff since
this cannot happen. (In the worst case, there is only one non-zero
coefficient 'a'. Then we compute sqrt(a^2) which is not smaller than a.
Otherwise, we compute sqrt(a^2 + x) > a.)

17 months agoRemove own definition of enable_if<B, T> in favor of...
Richard Kreckel [Mon, 14 Nov 2022 22:13:21 +0000 (23:13 +0100)]
Remove own definition of enable_if<B, T> in favor of...

...the definition provided by <type_traits> since C++11.

17 months ago[DEBUG] Make some debug output operators compile in factor.cpp...
Richard Kreckel [Mon, 14 Nov 2022 22:05:47 +0000 (23:05 +0100)]
[DEBUG] Make some debug output operators compile in factor.cpp...

...for the case when somebody actually #defines DEBUGFACTOR. The operators
must be in the same anonymous namespace in which umodpoly, upoly and upvec
are typedef'ed. (I'm not really sure I understand why but that's what GCC
and CLang are convinced of.)

18 months agoOptimize some use of CLN's expt_pos() function in factor().
Richard Kreckel [Wed, 12 Oct 2022 22:12:07 +0000 (00:12 +0200)]
Optimize some use of CLN's expt_pos() function in factor().

(Not that it's slow or mattered much, but why waste cycles?)

19 months agoReally finalize 1.8.4 release. release_1-8-4
Richard Kreckel [Mon, 19 Sep 2022 09:09:36 +0000 (11:09 +0200)]
Really finalize 1.8.4 release.

Fix SONAME screw-up in last commit.

19 months agoFinalize 1.8.4 release.
Richard Kreckel [Mon, 19 Sep 2022 08:28:48 +0000 (10:28 +0200)]
Finalize 1.8.4 release.

Also update helper scripts from savannah.gnu.org.

19 months agoFix -Wsign-compare warnings in new code.
Richard Kreckel [Sun, 18 Sep 2022 21:54:02 +0000 (23:54 +0200)]
Fix -Wsign-compare warnings in new code.

19 months agoFix checks for sqrfree_parfrac().
Richard Kreckel [Sun, 18 Sep 2022 21:04:26 +0000 (23:04 +0200)]
Fix checks for sqrfree_parfrac().

19 months agoMake sqrfree_parfrac() work in the general case and make it supported.
Richard Kreckel [Sun, 18 Sep 2022 19:36:31 +0000 (21:36 +0200)]
Make sqrfree_parfrac() work in the general case and make it supported.

19 months ago[PATCH] Implement info methods for transcendent functions.
Vladimir V. Kisil [Fri, 9 Sep 2022 22:59:59 +0000 (00:59 +0200)]
[PATCH] Implement info methods for transcendent functions.

Here only easy answers are sought, which can be decided on
info tests of the functions arguments. From such coarse viepoint
functions are grouped into several classes and the respective
routines can be shared.

20 months ago[C++17] Convert std::mem_fun_ref_t to std::mem_fn...
Richard Kreckel [Wed, 10 Aug 2022 07:55:01 +0000 (09:55 +0200)]
[C++17] Convert std::mem_fun_ref_t to std::mem_fn...

...because it has been deprecated in C++11.

20 months ago[C++17] Don't inherit from std::iterator...
Richard Kreckel [Tue, 9 Aug 2022 22:35:22 +0000 (00:35 +0200)]
[C++17] Don't inherit from std::iterator...

...because this has been deprecated. See LWG2438.

22 months ago[TESTS] Fix node::operator< in time_antipode.cpp.
Richard Kreckel [Mon, 6 Jun 2022 16:52:02 +0000 (18:52 +0200)]
[TESTS] Fix node::operator< in time_antipode.cpp.

Reported by Yuri Gribov <tetra2005@gmail.com>.

2 years agoFinalize 1.8.3 release. release_1-8-3
Richard Kreckel [Wed, 23 Mar 2022 20:33:55 +0000 (21:33 +0100)]
Finalize 1.8.3 release.

2 years agoFix power::subs() in some special cases.
Richard Kreckel [Wed, 23 Mar 2022 20:21:48 +0000 (21:21 +0100)]
Fix power::subs() in some special cases.

In some cases, after subs'ing in basis and exponent, an extra
substitution was performed. This could lead to messed-up final results
because, e.g. substituting x==1/x in 1/x evaluated to x, but then
another substitution x==1/x was performed.

Reported by Feng Feng <f.feng@outlook.com>.

2 years agoWork around a compiler bug on MSVC.
Jan Rheinländer [Wed, 16 Feb 2022 22:57:36 +0000 (23:57 +0100)]
Work around a compiler bug on MSVC.

The two 'reg_info' declarations introduced in f271f67d2f turned out
to confuse MSVC: It thinks that these declarations are definitions
and then complains about a missing default ctor (error C2512) and
about duplicate definitions later in the .cpp files (error C2766).

But the standard says in [temp.expl.spec] §13:
An explicit specialization of a static data member of a template or
an explicit specialization of a static  data member template is a
definition if the declaration includes an initializer; otherwise, it
is a declaration. [Note: The definition of a static data member of a
template that requires default-initialization must use a braced-init-
list:
    template<> X Q<int>::x;     // declaration
    template<> X Q<int>::x ();  // error: declares a function
    template<> X Q<int>::x { }; // definition
--end note]
There is no initializer at lst.h:35 and at exprseq.h:35. Hence, this
is merely a declaration and the compiler's error message is wrong.
Let's work around by #ifndef'ing the two lines for silly MSVC.

2 years agoFix some compiler warnings.
Richard Kreckel [Tue, 15 Feb 2022 21:07:25 +0000 (22:07 +0100)]
Fix some compiler warnings.

2 years ago[DOC] Add "series_to_poly" to ginsh man page.
Vitaly Magerya [Mon, 7 Feb 2022 19:28:08 +0000 (20:28 +0100)]
[DOC] Add "series_to_poly" to ginsh man page.

2 years ago[DOC] Fix g++ argument order in tutorial example.
Richard Kreckel [Mon, 7 Feb 2022 19:26:21 +0000 (20:26 +0100)]
[DOC] Fix g++ argument order in tutorial example.

2 years ago[DOC] Replace obsolete @inforef with @xref command.
Richard Kreckel [Sun, 6 Feb 2022 20:54:56 +0000 (21:54 +0100)]
[DOC] Replace obsolete @inforef with @xref command.

2 years ago[DOC] Fix typo in series_to_poly() documentation.
Vladimir V. Kisil [Sun, 6 Feb 2022 18:21:55 +0000 (19:21 +0100)]
[DOC] Fix typo in series_to_poly() documentation.

2 years agoAdd "series_to_poly" to ginsh.
Vitaly Magerya [Sun, 6 Feb 2022 18:20:15 +0000 (19:20 +0100)]
Add "series_to_poly" to ginsh.

2 years agoexam_inifcns_nstdsums.cpp: prec set to 10*pow(10,-Digits) in inifcns_test_HLi to...
Stefan Weinzierl [Sat, 15 Jan 2022 09:08:07 +0000 (10:08 +0100)]
exam_inifcns_nstdsums.cpp: prec set to 10*pow(10,-Digits) in inifcns_test_HLi to avoid sporadic make check failure.

2 years agoFix power::to_polynomial() for posint exponents.
Vladimir V. Kisil [Thu, 13 Jan 2022 19:59:21 +0000 (20:59 +0100)]
Fix power::to_polynomial() for posint exponents.

This makes things like pow(x+1/x,2).to_polynomial(repl) actually
produce (x+sym)^2 with sym==1/x in repl, as it should.

Reported by Feng Feng <f.feng@outlook.com>.

2 years agoFinalize 1.8.2 release. release_1-8-2
Richard Kreckel [Sat, 1 Jan 2022 16:08:13 +0000 (17:08 +0100)]
Finalize 1.8.2 release.

Oh, and Happy New Year!

2 years agoFix relational::compare_same_type.
Oleg Finkelshteyn [Tue, 21 Dec 2021 09:02:29 +0000 (10:02 +0100)]
Fix relational::compare_same_type.

A hash collision was needed to elicit this bug because basic::compare
returns early without calling compare_same_type if hashes differ.

Reported by Feng Feng <f.feng@outlook.com>.

2 years agoUpdate and clean up autoconf template files.
Richard Kreckel [Fri, 5 Nov 2021 13:47:53 +0000 (14:47 +0100)]
Update and clean up autoconf template files.

This is needed for compatibility with newer autoconf:
* Removed macro GINAC_STD_CXX_HEADERS (we use AX_CXX_COMPILE_STDCXX).
* Updated m4/* files from upstream.
* Ran autoupdate on acinclude.m4 and configure.ac.

Tested successfully with autoconf 1.69 and 1.71.

2 years agoMinor bug fix for the class modular_form_kernel: Ensure that the series-method includ...
Stefan Weinzierl [Thu, 9 Sep 2021 14:21:45 +0000 (16:21 +0200)]
Minor bug fix for the class modular_form_kernel: Ensure that the series-method includes an order term.

2 years agoFinalize 1.8.1 release. release_1-8-1
Richard Kreckel [Mon, 9 Aug 2021 09:39:31 +0000 (11:39 +0200)]
Finalize 1.8.1 release.

2 years agoAdd method relational::canonical().
Vladimir V. Kisil [Sun, 8 Aug 2021 14:18:31 +0000 (16:18 +0200)]
Add method relational::canonical().

It returns an equivalent relation with the zero right-hand side.

2 years ago[BUGFIX] Fix a bug in normal() method.
Vladimir V. Kisil [Sun, 8 Aug 2021 14:01:46 +0000 (16:01 +0200)]
[BUGFIX] Fix a bug in normal() method.

Any function was confused with an exponent of the same argument
during a normalisation of an expression.

Example: normal(cos(x)/exp(x)) often returned 1 for realsymbol x.

2 years agoBug fix in modular_form_kernel::is_numeric and modular_form_kernel::Laurent_series...
Stefan Weinzierl [Tue, 27 Jul 2021 18:55:54 +0000 (20:55 +0200)]
Bug fix in modular_form_kernel::is_numeric and modular_form_kernel::Laurent_series: Call the correct method to compute the series expansion.

This bug has been reported by Christoph Dlapa.

2 years agoBug fix in the routine H_evalf (a minus sign should not be forgotten).
Stefan Weinzierl [Wed, 9 Jun 2021 12:10:23 +0000 (14:10 +0200)]
Bug fix in the routine H_evalf (a minus sign should not be forgotten).

This bug was reported by Bin Zhou.

2 years agoAdd simple exam test for releational objects.
Richard Kreckel [Sun, 6 Jun 2021 12:48:00 +0000 (14:48 +0200)]
Add simple exam test for releational objects.

2 years agoSmarter relational to Boolean conversion.
Vladimir V. Kisil [Sun, 6 Jun 2021 12:00:50 +0000 (14:00 +0200)]
Smarter relational to Boolean conversion.

If a relational contains symbolic entries we look to ex::info
to decide whether it can be converted to true value.

3 years ago[PATCH] Improve normalisation of negative exponents.
Vladimir V. Kisil [Mon, 5 Apr 2021 19:01:30 +0000 (21:01 +0200)]
[PATCH] Improve normalisation of negative exponents.

If an expression contains exponents with opposite signs,
then the respective symbolic substitutions need to be properly
attributed to numerator/denominator slots.

3 years agoAdd exam for ex::collect().
Richard Kreckel [Mon, 5 Apr 2021 18:57:34 +0000 (20:57 +0200)]
Add exam for ex::collect().

3 years ago[PATCH] Make ex::operator[] const dispatch to basic::operator[] const.
Richard Kreckel [Mon, 5 Apr 2021 18:46:55 +0000 (20:46 +0200)]
[PATCH] Make ex::operator[] const dispatch to basic::operator[] const.

It turned out that ex::operator[] const dispatched to non-const
basic::operator[] because
* member variable ex::bp is non-const and
* ptr<T>::operator*() returns a non-const T &.

As a result, indexing failed for multiply referenced objects.

Thanks to Vitaly Magerya <vmagerya@gmail.com> for reporting this.

3 years agoG_do_hoelder: fix bug related to comparing a float with a rational number in CLN.
Stefan Weinzierl [Wed, 24 Mar 2021 08:43:26 +0000 (09:43 +0100)]
G_do_hoelder: fix bug related to comparing a float with a rational number in CLN.

This bug has been reported by Simone Zoia.

3 years agoFix misleading comment in last commit.
Richard Kreckel [Fri, 26 Feb 2021 22:15:12 +0000 (23:15 +0100)]
Fix misleading comment in last commit.

3 years agoAvoid "instantiation of variable 'reg_info' required..." warning.
Richard Kreckel [Wed, 3 Feb 2021 13:40:49 +0000 (14:40 +0100)]
Avoid "instantiation of variable 'reg_info' required..." warning.

With -Wundefined-var-template (on by default), CLang++ warns that
no definition for the static 'reg_info' member variable is available.

3 years agobugfix: function: always pass evalf'ed arguments to evalf_funcp
Alexey Sheplyakov [Fri, 1 Jan 2021 16:09:47 +0000 (20:09 +0400)]
bugfix: function: always pass evalf'ed arguments to evalf_funcp

GiNaC passes unevaluted arguments to a function with evalf_funcp
taking an exvector. Fixed that, and added a test case

3 years agoAvoid multiple definitions of `lst::info` (MinGW compile fix)
Alexey Sheplyakov [Wed, 6 Jan 2021 07:20:46 +0000 (11:20 +0400)]
Avoid multiple definitions of `lst::info` (MinGW compile fix)

[55/59] Linking CXX shared library bin/libginac.dll
FAILED: bin/libginac.dll ginac/libginac.dll.a
[skipped long list of object files]
/usr/bin/x86_64-w64-mingw32-ld: ginac/CMakeFiles/ginac.dir/lst.cpp.obj: in function `GiNaC::ptr<GiNaC::basic>::~ptr()':
/home/asheplyakov/work/sw/ginac/_build_w64/../ginac/container.h:150: multiple definition of `GiNaC::container<std::__cxx11::list>::info(unsigned int) const'; ginac/CMakeFiles/ginac.dir/integration_kernel.cpp.obj:/home/asheplyakov/work/sw/ginac/_build_w64/../ginac/container.h:116: first defined here

integration_kernel.cpp makes use of GiNaC::lst without including the `lst.h`
header. That's possible since there's a typedef in `registrar.h` (included
by virtually all GiNaC sources) and a defintion in `container.h` (included
via `add.h` -> `expairseq.h` -> `indexed.h` -> `exprseq.h`), so the compiler
can instantiate container<std::list>. However the explicit specialization
of `lst::info` is not available (in integration_kernel.cpp). This violates
17.8.3.6 [templ.expl.spec] which demands

If a template, a member template or a member of a class template is
explicitly specialized then that specialization shall be declared before
the first use of that specialization that would cause an implicit
instantiation to take place, in every translation unit in which such
a use occurs; no diagnostic is required. If the program does not provide
a definition for an explicit specialization and either the specialization
is used ina way that would cause an implicit instantiation to take place
or the member is a virtual member function, the program is ill-formed,
no diagnostic required.

On ELF platforms libginac appears to link just fine despite having two
instantiations of `lst::info` since the of them (in `integration_kernel.o`)
is a weak symbol:

$ find ginac -type f -name '*.o' | xargs -n 1 nm --print-file-name --defined | c++filt | grep -e 'list>::info('
ginac/CMakeFiles/ginac.dir/integration_kernel.cpp.o:0000000000000000 W GiNaC::container<std::__cxx11::list>::info(unsigned int) const
ginac/CMakeFiles/ginac.dir/lst.cpp.o:0000000000000000 T GiNaC::container<std::__cxx11::list>::info(unsigned int) const

so the linker discards the wrong instantiation of `lst::info` method.
However on MinGW there are no weak symbols (in ELF sense):

$ find ginac -type f -name '*.obj' | xargs -n 1 x86_64-w64-mingw32-nm --print-file-name --defined | c++filt | grep -e 'list>::info('
ginac/CMakeFiles/ginac.dir/lst.cpp.obj:0000000000000010 T GiNaC::container<std::__cxx11::list>::info(unsigned int) const
ginac/CMakeFiles/ginac.dir/integration_kernel.cpp.obj:0000000000000000 T GiNaC::container<std::__cxx11::list>::info(unsigned int) const

Hence the above multiple definition error.

To avoid the problem #include "lst.h" (so explicit specialization is available).
While at it explicitly instantiate lst::info method in lst.cpp

A better solution would be to remove declaration of lst from registrar.h,
but that's too disruptive since GiNaC uses lst a lot: subs, unarchive, etc.

3 years agoFix minimum CLN version for pkg-config.
Richard Kreckel [Fri, 1 Jan 2021 19:33:09 +0000 (20:33 +0100)]
Fix minimum CLN version for pkg-config.

3 years agoHappy New Year!
Richard Kreckel [Fri, 1 Jan 2021 18:14:38 +0000 (19:14 +0100)]
Happy New Year!

3 years agoUpdate some references.
Richard Kreckel [Sun, 22 Nov 2020 22:05:36 +0000 (23:05 +0100)]
Update some references.

3 years agoAvoid 'variable uninitialized when used within its own initialization' warning.
Richard Kreckel [Sun, 22 Nov 2020 20:40:58 +0000 (21:40 +0100)]
Avoid 'variable uninitialized when used within its own initialization' warning.

Initialize the static flyweight ex objects with the pointeed numeric
objects instead of using self-assignment. This is 100% equivalent to
before: The objects have already been initialized by the library_init
ctor so all the static object's ctor does is increment the pointeed
object's refcount.

According to the resolution of C++ core language defect 363 the warning is
incorrect because it is allowed to pass a reference to the object, see
<https://wg21.link/cwg363>. Incrementing the bp's refcount is okay too,
because the pointee numeric object has been fully initialized by the
library_init ctor. However, the compiler can hardly know this, so CLang++
issues a warning.

3 years agobuild: Fix CMake install for info file. release_1-8-0
Richard Kreckel [Wed, 14 Oct 2020 21:16:08 +0000 (23:16 +0200)]
build: Fix CMake install for info file.

It seams like CMake does not know any variable named ${SHARE_INSTALL_PREFIX}.

3 years agoFinalize 1.8.0 release.
Richard Kreckel [Wed, 14 Oct 2020 21:15:05 +0000 (23:15 +0200)]
Finalize 1.8.0 release.

3 years agoClarify types of test suite files.
Richard Kreckel [Wed, 14 Oct 2020 18:12:37 +0000 (20:12 +0200)]
Clarify types of test suite files.

3 years agoReplaced dummy reference by correct reference.
Stefan Weinzierl [Tue, 13 Oct 2020 12:51:24 +0000 (14:51 +0200)]
Replaced dummy reference by correct reference.

3 years agoRename test suite files...
Richard Kreckel [Mon, 12 Oct 2020 18:42:49 +0000 (20:42 +0200)]
Rename test suite files...

...to match any of the three types:
exam*   test result for specific input (like a pupil's exam)
check*  test coherence of results among each other, for random input
time*   measure run-time

All tests are still there, but maybe elsewhere:
* rename match_bug.cpp => exam_match.cpp
* rename heur_gcd_bug.cpp => exam_heur_gcd.cpp
* rename bugme_chinrem_gcd.cpp => exam_chinrem_gcd.cpp
* rename parser_bugs.cpp => exam_parser.cpp
* rename exam_cra.cpp => check_cra.cpp
* include numeric_archive.cpp => exam_archive.cpp
* include pgcd_infinite_loop.cpp => exam_pgcd.cpp
* include pgcd_relatively_prime_bug.cpp => exam_pgcd.cpp

These two have been deleted, since memory leaks are best looked for
using tools on real programs on a regular basis (they were also not
automatically executed):
* delete parser_memleak.cpp
* delete mul_eval_memleak.cpp

3 years agoReset GINAC_LT_AGE to bump SONAME.
Richard Kreckel [Sun, 11 Oct 2020 17:08:19 +0000 (19:08 +0200)]
Reset GINAC_LT_AGE to bump SONAME.

Vladimir's last changes affected virtual functions and vtbl changes usually
require a new library version.

3 years ago[PATCH 3/3] Stronger normalisation method for powers.
Vladimir V. Kisil [Sun, 11 Oct 2020 17:03:30 +0000 (19:03 +0200)]
[PATCH 3/3] Stronger normalisation method for powers.

Now normalisation method try to express powers with the same base
as monomials of some dummy variables. This allows to make cancellations
of the sort:
(x-1)/(sqrt(x)-1)  ->  sqrt(x)+1

Signed-off-by: Vladimir V. Kisil <V.Kisilv@leeds.ac.uk>
3 years ago[PATCH 2/3] Make a stronger normalisation for expressions with exponents.
Vladimir V. Kisil [Sun, 11 Oct 2020 16:44:48 +0000 (18:44 +0200)]
[PATCH 2/3] Make a stronger normalisation for expressions with exponents.

If several exponents have arguments different by a rational number
factors they are replaced by monomials of the same variable.

Signed-off-by: Vladimir V. Kisil <V.Kisilv@leeds.ac.uk>
3 years ago[PATCH 1/3] Automatic evaluation of (e^t)^s = e^(ts).
Vladimir V. Kisil [Sun, 11 Oct 2020 16:33:32 +0000 (18:33 +0200)]
[PATCH 1/3] Automatic evaluation of (e^t)^s = e^(ts).

If it safe to evaluate (e^t)^s = e^(ts) at least in two cases:

a) t and s are reals, the respective formula can be found in
any analysis textbook.

b) if s is an integer, then the ambiguity of t up to the term 2*Pi*k
does not cause a different value.

Signed-off-by: Vladimir V. Kisil <kisilv@maths.leeds.ac.uk>
3 years agoUpdate AUTHORS file more.
Richard Kreckel [Sat, 10 Oct 2020 19:37:35 +0000 (21:37 +0200)]
Update AUTHORS file more.

3 years agoSet version, soname ahead of release.
Richard Kreckel [Sat, 10 Oct 2020 19:35:05 +0000 (21:35 +0200)]
Set version, soname ahead of release.

3 years agoUpdate AUTHORS file...
Richard Kreckel [Sat, 10 Oct 2020 19:01:44 +0000 (21:01 +0200)]
Update AUTHORS file...

...to be more complete and remove authors' names from manpages in favor
of a reference to the web site.

3 years agoRemove deprecated initialization via overloaded comma operator.
Richard Kreckel [Sat, 10 Oct 2020 18:20:59 +0000 (20:20 +0200)]
Remove deprecated initialization via overloaded comma operator.

This feature has been marked as deprecated since 1.7.0. There's been more
than four years to switch to initializer lists. Let's hope people have
modified their code since.

3 years agoAdded new routines for the numerical evaluation of iterated integrals like
Stefan Weinzierl [Sat, 10 Oct 2020 15:11:09 +0000 (17:11 +0200)]
Added new routines for the numerical evaluation of iterated integrals like
elliptic multiple polylogarithms or iterated integrals of modular forms.

Changes to be committed:
modified:   check/CMakeLists.txt
modified:   check/Makefile.am
new file:   check/exam_inifcns_elliptic.cpp
modified:   doc/tutorial/ginac.texi
modified:   ginac/CMakeLists.txt
modified:   ginac/Makefile.am
modified:   ginac/ginac.h
modified:   ginac/inifcns.h
new file:   ginac/inifcns_elliptic.cpp
new file:   ginac/integration_kernel.cpp
new file:   ginac/integration_kernel.h
new file:   ginac/utils_multi_iterator.h
modified:   ginsh/ginsh_parser.ypp

3 years agoRemove executable file attribute from last Python script.
Richard Kreckel [Sat, 29 Aug 2020 18:22:49 +0000 (20:22 +0200)]
Remove executable file attribute from last Python script.

They are all invoked by ${PYTHON} and lack a shebang line since 8a4e28dc81.

3 years agobuild: use bundled CLN if available
Alexey Sheplyakov [Thu, 19 Dec 2019 14:17:41 +0000 (18:17 +0400)]
build: use bundled CLN if available

So one can unpack CLN tarball (or clone CLN git repository) and compile
both CLN and GiNaC in one pass:

git clone git://ginac.de/ginac.git
cd ginac
git clone git://www.ginac.de/cln.git
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo .. && make

3 years agoUse "modern" CMake facilities to manage includes and libs
Alexey Sheplyakov [Wed, 18 Dec 2019 10:52:17 +0000 (14:52 +0400)]
Use "modern" CMake facilities to manage includes and libs

* Use target_link_libraries to specify dependencies (include paths,
  compiler options, etc)

* Export targets and provide `ginac-config.cmake` so the following
  `CMakeLists.txt` is enough to build a program using GiNaC:

    cmake_minimum_required(VERSION 3.1)
    project(foo)
    find_package(ginac REQUIRED)
    add_executable(foo foo.cpp)
    target_link_libraries(foo PRIVATE ginac::ginac)

* GiNaC can be included as a (CMake) subproject. One can put GiNaC
  sources (either from git or a tarball) into a subdirectory (say,
  `ginac`) and use the following CMakeLists.txt to build everything:

    cmake_minimum_required(VERSION 3.1)
    project(foo)
    add_subdirectory(ginac)
    add_executable(foo foo.cpp)
    target_link_libraries(foo PRIVATE ginac::ginac)

3 years agobuild: windows: enable automatic imports by default
Alexey Sheplyakov [Thu, 26 Dec 2019 17:45:11 +0000 (21:45 +0400)]
build: windows: enable automatic imports by default

For now there are no dllexport/dllimport markings in GiNaC and CLN, so
export all symbols when building GiNaC DLL, and enable automatic imports
when linking with it. Note: this works with GNU linker only.

3 years agobuild: CMake: made it easier to run tests in parallel
Alexey Sheplyakov [Fri, 27 Dec 2019 13:34:05 +0000 (17:34 +0400)]
build: CMake: made it easier to run tests in parallel

As of now `make -jN check` executes test suite sequentially
(although it builds test executables in parallel). This takes
a bit too long, so it would be nice to run tests in parallel.
`ctest -jN` or `make test ARGS=-jN` runs tests concurrently,
however it does not build test executables, instead it fails
if any test binary is missing.

Also `test` target is a bit special and it's impossible to add
dependencies to it, see
https://gitlab.kitware.com/cmake/cmake/issues/8438

To work around the problem define `test_suite` target which
builds the tests suite without running it, so one can both
compile and run tests in parallel

make -j8 test_suite
make test ARGS=-j8

3 years agoMade it easier to run tests on windows
Alexey Sheplyakov [Wed, 25 Dec 2019 16:41:17 +0000 (20:41 +0400)]
Made it easier to run tests on windows

Put executables and DLLs into the `bin` subdirectory so the system
can locate GiNaC (and CLN) DLLs without extra configuration.

3 years agonumeric.cpp, archive.cpp: don't include config.h
Alexey Sheplyakov [Wed, 18 Dec 2019 12:39:12 +0000 (16:39 +0400)]
numeric.cpp, archive.cpp: don't include config.h

config.h is necessary for excompiler only, the rest of the library
is pretty portable. Not including dynamically generated headers
saves compilation time due to more (c)cache hits.

3 years agoBuild example programs to avoid breaking them on API changes
Alexey Sheplyakov [Mon, 6 Jan 2020 18:34:09 +0000 (22:34 +0400)]
Build example programs to avoid breaking them on API changes

3 years agobuild: fixed `ginac-excompiler` installation with CMake
Alexey Sheplyakov [Thu, 19 Dec 2019 14:16:53 +0000 (18:16 +0400)]
build: fixed `ginac-excompiler` installation with CMake

3 years agobuild: accept both python 3 and python 2
Alexey Sheplyakov [Sun, 23 Aug 2020 07:28:07 +0000 (11:28 +0400)]
build: accept both python 3 and python 2

This makes building GiNaC a bit easier for users of "old" distributions
where python 3 is not installed by default (Ubuntu 16.04), or even not
available (CentOS 7).

Scripts themselves work just fine with python 2.7 and python 3.x, so
only minor changes to CMakeLists.txt are required (autotools scripts
already handle python2/3)

3 years ago[build] Fix Python detection in Autotools build.
Richard Kreckel [Sun, 23 Aug 2020 14:09:34 +0000 (16:09 +0200)]
[build] Fix Python detection in Autotools build.

This was a latent bug: the PYTHON variable was not set in Makefiles,
only PYTHON3 was, but scripts were still invoked with $(PYTHON).

While at it, let's also accept python2 >= 2.7.

3 years agoAvoid "catching polymorphic type by value" warnings.
Richard Kreckel [Fri, 21 Aug 2020 17:10:12 +0000 (19:10 +0200)]
Avoid "catching polymorphic type by value" warnings.