]> www.ginac.de Git - ginac.git/log
4 weeks agoFinalize 1.8.5 release. master release_1-8-5
Richard Kreckel [Sun, 1 Jan 2023 13:31:35 +0000 (14:31 +0100)]
Finalize 1.8.5 release.

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

5 weeks 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.

6 weeks 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.  :-)

6 weeks 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.

6 weeks 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().

6 weeks 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.

6 weeks 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.

2 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.)

2 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.

2 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.)

3 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?)

4 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.

4 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.

4 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.

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

4 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.

4 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.

5 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.

5 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.

7 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>.

10 months 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.

10 months 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>.

11 months 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-
    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.

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

11 months 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.

11 months 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.

11 months 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.

11 months 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.

11 months 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.

12 months 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.

12 months 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>.

13 months 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!

13 months 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>.

14 months 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:
* Updated m4/* files from upstream.
* Ran autoupdate on acinclude.m4 and configure.ac.

Tested successfully with autoconf 1.69 and 1.71.

16 months 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.

17 months 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.

17 months 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.

17 months 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.

18 months 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.

19 months 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.

19 months 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.

19 months 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.

22 months 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.

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

22 months 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.

22 months 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.

23 months 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.

2 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.

2 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

2 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 [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.

2 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.

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

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

2 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.

2 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}.

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

2 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.

2 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.

2 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

2 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.

2 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>
2 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>
2 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>
2 years agoUpdate AUTHORS file more.
Richard Kreckel [Sat, 10 Oct 2020 19:37:35 +0000 (21:37 +0200)]
Update AUTHORS file more.

2 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.

2 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.

2 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.

2 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

2 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.

2 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

2 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)
    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)
    add_executable(foo foo.cpp)
    target_link_libraries(foo PRIVATE ginac::ginac)

2 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.

2 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

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

2 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.

2 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.

2 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

2 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

2 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)

2 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.

2 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.

2 years agoAvoid unnecessary expansion in sqrfree_yun().
Richard Kreckel [Fri, 21 Aug 2020 15:47:19 +0000 (17:47 +0200)]
Avoid unnecessary expansion in sqrfree_yun().

Don't make the polynomial primitive inside Yun's algorithm. Computing the
primitive part will incur an extra expansion of the polynomial and this
may distroy a pre-factored structure in the other variables. In the multi-
variate case, working with primitive polynomials isn't sufficient anyways
to avoid a final division to discover lost factors.

2 years agoSegregate sqfree() tests into file of its own.
Richard Kreckel [Fri, 21 Aug 2020 15:45:08 +0000 (17:45 +0200)]
Segregate sqfree() tests into file of its own.

2 years ago[build] Use python3 command in CMake build, not python.
Richard Kreckel [Fri, 21 Aug 2020 15:09:36 +0000 (17:09 +0200)]
[build] Use python3 command in CMake build, not python.

2 years agoFinalize 1.7.11 release. release_1-7-11
Richard Kreckel [Mon, 3 Aug 2020 18:45:53 +0000 (20:45 +0200)]
Finalize 1.7.11 release.

2 years agoAdd m4/host-cpu-c-abi.m4.
Richard Kreckel [Mon, 3 Aug 2020 18:44:09 +0000 (20:44 +0200)]
Add m4/host-cpu-c-abi.m4.

This avoids warnings about gl_HOST_CPU_C_ABI_32BIT being m4_require'd
but not m4_defun'd.

2 years agoClean up check suite a little bit.
Richard Kreckel [Mon, 3 Aug 2020 18:01:13 +0000 (20:01 +0200)]
Clean up check suite a little bit.

Some tests in tiny test files are better moved elsewhere to reduce compile
and link time.

2 years agoRemove obsolete debug #include file from factor.cpp.
Richard Kreckel [Mon, 3 Aug 2020 17:20:56 +0000 (19:20 +0200)]
Remove obsolete debug #include file from factor.cpp.

2 years agoMake workarounds for sqrfree_yun() obsolete.
Richard Kreckel [Mon, 3 Aug 2020 16:20:27 +0000 (18:20 +0200)]
Make workarounds for sqrfree_yun() obsolete.

Since Yun's algorithm is based on polynomial GCD, it only finds factors
up to a unit. Callers shouldn't have to work around this, so sqrfree_yun()
now does a final polynomial long division to compute the lost factor and
fixes the result before returning.

2 years ago[BUGFIX] Fix factor_univariate(poly, x) for constant poly.
Richard Kreckel [Mon, 3 Aug 2020 16:09:30 +0000 (18:09 +0200)]
[BUGFIX] Fix factor_univariate(poly, x) for constant poly.

The modular factorization fails to find a prime in this case, leading to
an infinite loop. At least one caller (factor_sqrfree) happens to produce
such constant polys in some cases.

2 years ago[BUGFIX] factor_multivariate(): respect unit...
Richard Kreckel [Wed, 29 Jul 2020 22:20:22 +0000 (00:20 +0200)]
[BUGFIX] factor_multivariate(): respect unit...

...if the content of polynomial isn't a number and needs to be factored.
And while at it, reduce the scope of a local variable.

2 years agoFix bug in power::expand() with the overall coefficient.
Vladimir V. Kisil [Mon, 27 Jul 2020 19:03:42 +0000 (21:03 +0200)]
Fix bug in power::expand() with the overall coefficient.

The negative sign of overall coefficient had been lost if a
power base contained some sign-definite factors.

2 years agoFix of a bug in sqrfree_parfrac() related to Yun factorisation.
Vladimir V. Kisil [Mon, 27 Jul 2020 18:58:27 +0000 (20:58 +0200)]
Fix of a bug in sqrfree_parfrac() related to Yun factorisation.

Yun's algorithm does not account for constant factors, thus
sqrfree_parfrac() dropped such factors in partial fractions.

2 years agoFinalize 1.7.10 release. release_1-7-10
Richard Kreckel [Sun, 28 Jun 2020 17:33:38 +0000 (19:33 +0200)]
Finalize 1.7.10 release.

2 years agoAdd exam for exam_common_factors.
Richard Kreckel [Sun, 28 Jun 2020 15:21:33 +0000 (17:21 +0200)]
Add exam for exam_common_factors.

Including a case involving a hidden zero to catch errors like the one fixed
in 5f7f81ad35a, as suggested by Alexey Sheplyakov <asheplyakov@yandex.ru>.

2 years ago[build] Check for python3 command, not python.
Richard Kreckel [Sun, 28 Jun 2020 14:07:30 +0000 (16:07 +0200)]
[build] Check for python3 command, not python.

PEP 394 does not require the python command to be installed.

2 years ago[BUGFIX] Prevent crashes in find_common_factor()
Vladimir V. Kisil [Mon, 22 Jun 2020 07:49:00 +0000 (09:49 +0200)]
[BUGFIX] Prevent crashes in find_common_factor()

These happened if a non-normalised common factor was equal to zero.

Thanks to Feng Feng for reporting this bug.

2 years agoRevert "Improve diff(abs(x)) for real x."
Richard Kreckel [Fri, 19 Jun 2020 11:34:07 +0000 (13:34 +0200)]
Revert "Improve diff(abs(x)) for real x."

This reverts commit fa1ffcfdc9da97a6fb7cc2c9c36fe1fc45c808a9.

2 years agoImprove diff(abs(x)) for real x.
Pierangelo Masarati [Wed, 17 Jun 2020 17:52:49 +0000 (19:52 +0200)]
Improve diff(abs(x)) for real x.

2 years ago[C++20] Disambiguate std::integral concept and GiNaC::integral class.
Richard Kreckel [Mon, 18 May 2020 06:26:09 +0000 (08:26 +0200)]
[C++20] Disambiguate std::integral concept and GiNaC::integral class.