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

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

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

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

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

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

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

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

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

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

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

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

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

6 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:
* 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.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

20 months 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

20 months 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)

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

20 months 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

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

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

20 months 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

20 months 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

20 months 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)

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

2 years ago[C++20] Clean up using-declarations.
Richard Kreckel [Mon, 18 May 2020 06:22:21 +0000 (08:22 +0200)]
[C++20] Clean up using-declarations.

Never write a using-declaration before #including another header file!

2 years ago[PATCH] Add default print function as the Python printing method.
Vladimir V. Kisil [Sat, 25 Apr 2020 21:26:07 +0000 (23:26 +0200)]
[PATCH] Add default print function as the Python printing method.

2 years agoFinalize 1.7.9 release. release_1-7-9
Richard Kreckel [Fri, 10 Apr 2020 23:20:22 +0000 (01:20 +0200)]
Finalize 1.7.9 release.

2 years agoMinor enhancements to tutorial.
Richard Kreckel [Fri, 10 Apr 2020 23:10:47 +0000 (01:10 +0200)]
Minor enhancements to tutorial.

2 years agoAdd .gitignore files.
Richard Kreckel [Fri, 10 Apr 2020 23:01:47 +0000 (01:01 +0200)]
Add .gitignore files.

2 years ago[PATCH] Fix zeta(x, s).evalf() when x and s aren't lists.
Stefan Weinzierl [Fri, 10 Apr 2020 16:01:28 +0000 (18:01 +0200)]
[PATCH] Fix zeta(x, s).evalf() when x and s aren't lists.

2 years agoMake C++ files in doc/examples/ compile again.
Richard Kreckel [Thu, 9 Apr 2020 19:23:25 +0000 (21:23 +0200)]
Make C++ files in doc/examples/ compile again.

2 years agoRemove obsolete CVSROOT directory.
Richard Kreckel [Thu, 9 Apr 2020 18:44:41 +0000 (20:44 +0200)]
Remove obsolete CVSROOT directory.

2 years ago[PATCH] Check number of parameters when reading function from archive.
Richard Kreckel [Tue, 7 Apr 2020 21:56:25 +0000 (23:56 +0200)]
[PATCH] Check number of parameters when reading function from archive.

Functions where looked up by their function name in archives. However,
some functions have overloads for different numbers of parameters
('zeta', 'G', 'psi'). Reading archives could pick the wrong overload.

Fixed by requiring that the actual number of function parameters in the
archive node must equal the function's declared number of parameters.

Thanks to Feng Feng for reporting this problem.

2 years agoUpdate some compiler versions.
Richard Kreckel [Tue, 7 Jan 2020 23:03:50 +0000 (00:03 +0100)]
Update some compiler versions.

2 years agoChange www.ginac.de urls to https.
Richard Kreckel [Tue, 7 Jan 2020 22:41:40 +0000 (23:41 +0100)]
Change www.ginac.de urls to https.

2 years agoHappy New Year!
Richard Kreckel [Wed, 1 Jan 2020 11:57:25 +0000 (12:57 +0100)]
Happy New Year!

2 years ago[PATCH] numeric, ex: added constructors taking `long long`. Fixes MinGW64 build.
Alexey Sheplyakov [Thu, 12 Dec 2019 07:38:18 +0000 (08:38 +0100)]
[PATCH] numeric, ex: added constructors taking `long long`. Fixes MinGW64 build.

On 64-bit windows std::size_t is `unsigned long long` (64 bit).
However there is no ex constructor taking (unsigned) long long.

This patch adds ex and numeric constructors taking `long long`
and `unsigned long long`.

2 years agoFinalize 1.7.8 release. release_1-7-8
Richard Kreckel [Mon, 7 Oct 2019 20:23:54 +0000 (22:23 +0200)]
Finalize 1.7.8 release.

2 years agoFix bug in H_evalf: Flag has_minus_one is now computed where it is needed.
Stefan Weinzierl [Mon, 7 Oct 2019 18:32:01 +0000 (20:32 +0200)]
Fix bug in H_evalf: Flag has_minus_one is now computed where it is needed.

This bug has been reported and fixed by Yannick Ulrich <yannick.ulrich@psi.ch>.

2 years agoTrivialize pseries::eval().
Richard Kreckel [Thu, 3 Oct 2019 21:08:24 +0000 (23:08 +0200)]
Trivialize pseries::eval().

Since 1.7.0, the elements are eval()'ed, so there's nothing to do any
more for pseries::eval().

2 years agoFix pseries::evalf() regression.
Vladimir V. Kisil [Tue, 1 Oct 2019 22:00:09 +0000 (00:00 +0200)]
Fix pseries::evalf() regression.

Since f8c2455fbb, rest was not evalf()'ed any more.

2 years agoReally finalize 1.7.7 release. release_1-7-7
Richard Kreckel [Sun, 22 Sep 2019 21:50:45 +0000 (23:50 +0200)]
Really finalize 1.7.7 release.

2 years agoFinalize 1.7.7 release.
Richard Kreckel [Sun, 22 Sep 2019 21:39:06 +0000 (23:39 +0200)]
Finalize 1.7.7 release.

2 years agoReplace some .push_back() with .emplace_back() where it's safe.
Richard Kreckel [Sun, 22 Sep 2019 21:32:14 +0000 (23:32 +0200)]
Replace some .push_back() with .emplace_back() where it's safe.

2 years agoFix unarchiving empty containers.
Richard Kreckel [Sun, 22 Sep 2019 17:18:19 +0000 (19:18 +0200)]
Fix unarchiving empty containers.

The bug was reported by Vladimir V. Kisil <kisilv@maths.leeds.ac.uk>, see
<https://www.ginac.de/pipermail/ginac-devel/2019-September/002399.html>.