ginac.git
7 months agoFinalize 1.7.5 release. release_1-7-5
Richard Kreckel [Sun, 17 Feb 2019 11:13:10 +0000 (12:13 +0100)]
Finalize 1.7.5 release.

7 months agoFix elusive bug in expairseq ctor.
Richard Kreckel [Sat, 16 Feb 2019 11:58:38 +0000 (12:58 +0100)]
Fix elusive bug in expairseq ctor.

When an expair turns out to represent a number, that should go into
the expairseq's overall_coeff. This was accomplished by class mul,
thanks to the override of expair_needs_further_processing(), but not
always for class add.

This patch fixes the base class' expair_needs_further_processing()
with similar logic as that already in place for class mul.

Thanks to Mario Prausa for reporting this.

7 months agoHappy New Year!
Richard Kreckel [Tue, 1 Jan 2019 16:42:15 +0000 (17:42 +0100)]
Happy New Year!

9 months agoG_do_hoelder: fix case with real x values which are not of type cl_R.
Stefan Weinzierl [Wed, 12 Dec 2018 21:53:12 +0000 (22:53 +0100)]
G_do_hoelder: fix case with real x values which are not of type cl_R.

In CLN, a complex number of type cl_N with vanishing imaginary part is not
necessarily a real number of type cl_R.

This bug has been reported by T. Huber.

11 months agoHandle un-normal zeros properly in the division-free elimination.
Vitaly Magerya [Fri, 12 Oct 2018 18:45:27 +0000 (20:45 +0200)]
Handle un-normal zeros properly in the division-free elimination.

Call .normal() instead of just .expand(), such that matrix::pivot() finds
the pivot.

Note that this problem also affects matrix::solve() with 'algo'
set to solve_algo::automatic.

Of course, using .normal() makes division_free_elimination only
truly "division-free" if the input matrix didn't have fractions.
In other cases, GCDs will be computed.

11 months agoUpdate m4/ax_cxx_compile_stdcxx.m4 to current upstream version.
Richard Kreckel [Thu, 4 Oct 2018 19:32:21 +0000 (21:32 +0200)]
Update m4/ax_cxx_compile_stdcxx.m4 to current upstream version.

11 months ago[DOC] Explaining in tutorial sign ambiguity for numer() and denom().
Richard Kreckel [Thu, 4 Oct 2018 19:28:42 +0000 (21:28 +0200)]
[DOC] Explaining in tutorial sign ambiguity for numer() and denom().

Based on a patch provided by Vladimir V. Kisil <kisilv@maths.leeds.ac.uk>.

15 months agoConsider solve_algo::markowitz in automatic elimination algorithm selection.
Vitaly Magerya [Tue, 19 Jun 2018 23:13:07 +0000 (01:13 +0200)]
Consider solve_algo::markowitz in automatic elimination algorithm selection.

Cf. <https://www.ginac.de/pipermail/ginac-list/2018-June/002211.html>.

15 months agoAdd optional matrix::rank() algorighm selection.
Vitaly Magerya [Wed, 13 Jun 2018 21:07:45 +0000 (23:07 +0200)]
Add optional matrix::rank() algorighm selection.

Before, matrix::rank() was hardcoded to use Bareiss elimination,
which for some matrices is way too slow (and I had to work around
this limitation in my own code). I propose adding an argument that
will allow users to select which elimination scheme to use. The
argument is the same as matrix::solve() takes (so, solve_algo::*).

I've tried to mimic how a similar argument was added to
matrix::inverse() by keeping the current set of rank() functions
and defining separate ones with the 'algo' argument, with the
old ones calling the new ones with solve_algo::automatic. This
is instead of using default argument values.

I've also put the code that makes the automatic selection of
the elimination method into a separate function so that both
matrix::solve() and matrix::rank() could share it. There's a bit
of similar code in matrix::determinant(), but since the self
of determinant algorithms is different from the elimination
algorithms, it's not clear if these two could be unified.

15 months agoCorrect wording in tutorial regarding degree(), ldegree().
Richard Kreckel [Sun, 10 Jun 2018 11:46:39 +0000 (13:46 +0200)]
Correct wording in tutorial regarding degree(), ldegree().

15 months agoAllow expreseq in the arguments of lsolve(eqns, vars).
Vitaly Magerya [Thu, 31 May 2018 16:39:08 +0000 (18:39 +0200)]
Allow expreseq in the arguments of lsolve(eqns, vars).

See <http://www.cebix.net/pipermail/ginac-list/2018-May/002201.html>.

15 months agoAdd Markowitz-ordered Gaussian elimination algorithm.
Vitaly Magerya [Thu, 31 May 2018 15:43:56 +0000 (17:43 +0200)]
Add Markowitz-ordered Gaussian elimination algorithm.

This algorithm avoids the 'fill-in' problem of Gaussian elimination
and significantly improves the times for solving large sparse systems.
See: <https://www.ginac.de/pipermail/ginac-list/2018-May/002202.html>.

16 months agoRemove MSVC-specific definition of __func__ and __alignof__.
Jan Rheinländer [Tue, 1 May 2018 18:43:04 +0000 (20:43 +0200)]
Remove MSVC-specific definition of __func__ and __alignof__.

They are not required any more in C++11.

18 months agoAvoid multiple filling of partitions in ::get() member functions.
Richard Kreckel [Mon, 5 Mar 2018 08:15:18 +0000 (09:15 +0100)]
Avoid multiple filling of partitions in ::get() member functions.

19 months agoFinalize 1.7.4 release. release_1-7-4
Richard Kreckel [Mon, 19 Feb 2018 22:32:51 +0000 (23:32 +0100)]
Finalize 1.7.4 release.

19 months agoFix ABI compatibility with so-version 6.
Richard Kreckel [Mon, 19 Feb 2018 22:10:32 +0000 (23:10 +0100)]
Fix ABI compatibility with so-version 6.

Commit 1be7026a unintentionally broke the ABI since g++ doesn't appear
to generate symbols for inline methods. Ugh.

Cf. https://bugzilla.redhat.com/show_bug.cgi?id=1541187

19 months agoFinalize 1.7.3 release. release_1-7-3
Richard Kreckel [Thu, 1 Feb 2018 21:59:46 +0000 (22:59 +0100)]
Finalize 1.7.3 release.

19 months agoPrepare for release 1.7.3 (yeah, again).
Richard Kreckel [Wed, 31 Jan 2018 22:07:35 +0000 (23:07 +0100)]
Prepare for release 1.7.3 (yeah, again).

19 months agoFix two comments in ginac/normal.cpp.
Richard Kreckel [Wed, 31 Jan 2018 22:00:08 +0000 (23:00 +0100)]
Fix two comments in ginac/normal.cpp.

And, while at it, make some disabled debugging output code compile when
it is enabled.

19 months agoFix out-of-bounds error in multivar_diophant().
Richard Kreckel [Wed, 31 Jan 2018 21:55:02 +0000 (22:55 +0100)]
Fix out-of-bounds error in multivar_diophant().

This could trigger an assertion in the factorization exams introduced
in afb0ccaa49 if the library was compiled with -DDO_GINAC_ASSERT.

19 months agoShortcut conversion ex->numeric->ex in expairseq::make_flat().
Richard Kreckel [Wed, 31 Jan 2018 11:18:37 +0000 (12:18 +0100)]
Shortcut conversion ex->numeric->ex in expairseq::make_flat().

Of course, passing an ex by reference is always faster than converting
it to a numeric first (even if it is a numeric).

19 months agoImprove gcd(a, b) where one argument is a power of a symbol.
Richard Kreckel [Wed, 31 Jan 2018 09:04:25 +0000 (10:04 +0100)]
Improve gcd(a, b) where one argument is a power of a symbol.

The already implemented recursion
  gcd(x^n, x*p(x)) -> x*gcd(x^(n-1), p(x))
is not ambitious enough: If p(x) has a factor of x, it just goes through
the same step again, and if p(x) has a factor which is a power of x, this
is reapeted many times.

Example:
  gcd(x^n, expand(x^n*(1+x)))
used to go recurse through the gcd routine n times, which could
easily lead to a stack overflow for n about 10^5.

To improve the situation, introduce a special case for gcd where one
argument is a power of a symbol and just cancel the common factor.

This turned out to be the root cause of segfaults in matrix elimination
algorithms, as reported by Patrick Schulz and Vitaly Magerya:
Cf. <https://www.ginac.de/pipermail/ginac-list/2018-January/thread.html>

19 months agoMake matrix::solve() work with non-normal zeros.
Richard Kreckel [Sun, 28 Jan 2018 23:07:17 +0000 (00:07 +0100)]
Make matrix::solve() work with non-normal zeros.

Normalize elements of augmented matrix before checking if they are zero.
This ensures that we don't divide by a non-normal zero. Also added a test.

This bug was reported by Vitaly Magerya <vmagerya@gmail.com>.

19 months ago[CHECK] Add some more factorization exams.
Richard Kreckel [Sun, 28 Jan 2018 18:59:54 +0000 (19:59 +0100)]
[CHECK] Add some more factorization exams.

Add the 15 multivariate polynomials from P. S. Wang's paper "An
Improved Multivariate Polynomial Factoring Algorithm" as exams.

Don't add them as benchmarks since timings vary considerably
depending on internal choice of variables. In any case, this should
never take hours. (But before 630db9a0b0 it did, occasionally.)

19 months agoAdd optional algorithm selection to matrix::inverse().
Richard Kreckel [Sun, 28 Jan 2018 18:23:50 +0000 (19:23 +0100)]
Add optional algorithm selection to matrix::inverse().

Following a proposal by Vitaly Magerya, a signature with a solve_algo
is added to class matrix. (Not using a default argument in order to
not break the ABI.)

19 months agoFix previous commit 'Speed up special cases of square-free...'.
Richard Kreckel [Thu, 25 Jan 2018 18:59:00 +0000 (19:59 +0100)]
Fix previous commit 'Speed up special cases of square-free...'.

Huh, I swear 4ffb3cbb3 worked for me! Sorry for that.

19 months agoSpeed up special cases of square-free factorization.
Richard Kreckel [Wed, 24 Jan 2018 21:37:24 +0000 (22:37 +0100)]
Speed up special cases of square-free factorization.

Square-free factorization of polynomials containing a factor which is
a high power P of a symbol x did scale like O(P) in space and time.
This patch introduces a shortcut in Yun's algorithm, such that the
computation is only O(1) in space and time.

This makes it possible to compute, say sqrfree(x^P + x^(P+1)) =>
(1+x)*x^P with P=123456789.

Found this to be a bottleneck while debugging one of Vitaly Magerya's
examples.

20 months agoPrepare for release 1.7.3.
Richard Kreckel [Mon, 1 Jan 2018 20:21:41 +0000 (21:21 +0100)]
Prepare for release 1.7.3.

20 months agoHappy New Year!
Richard Kreckel [Mon, 1 Jan 2018 19:47:26 +0000 (20:47 +0100)]
Happy New Year!

20 months ago[BUGFIX] Speed up some cases of polynomial factorization.
Richard Kreckel [Fri, 29 Dec 2017 21:16:54 +0000 (22:16 +0100)]
[BUGFIX] Speed up some cases of polynomial factorization.

Speed up a naive O(N) modulus operation in multivar_diophant().
This loop caused some polynomials to seemingly hang forever.

21 months agoDo not expand pre-factored polynomials.
Vitaly Magerya [Mon, 18 Dec 2017 18:28:01 +0000 (19:28 +0100)]
Do not expand pre-factored polynomials.

See <https://www.ginac.de/pipermail/ginac-list/2017-December/002155.html>.

21 months agoMinor sreamlining of some internal code using class lst...
Richard Kreckel [Mon, 18 Dec 2017 18:19:34 +0000 (19:19 +0100)]
Minor sreamlining of some internal code using class lst...

...without any external effect at all.

2 years agoAdd LaTeX pretty-print for function derivatives.
Vladimir V. Kisil [Tue, 12 Sep 2017 21:07:59 +0000 (23:07 +0200)]
Add LaTeX pretty-print for function derivatives.

2 years agoUpdate m4/ax_cxx_compile_stdcxx.m4 to current upstream version.
Richard Kreckel [Tue, 12 Sep 2017 20:32:20 +0000 (22:32 +0200)]
Update m4/ax_cxx_compile_stdcxx.m4 to current upstream version.

2 years ago[PATCH] Fix bug in evaluation of real and imaginary parts of powers.
Vladimir V. Kisil [Mon, 11 Sep 2017 21:12:36 +0000 (23:12 +0200)]
[PATCH] Fix bug in evaluation of real and imaginary parts of powers.

Be more careful when simplifying Re(a^c) -> a^c and Im(a^c) -> 0.

Thanks to Jan Rheinländer for reporting this.

2 years agoIntroducing method symbol::get_TeX_name() to match existing symbol::get_name().
Vladimir V. Kisil [Mon, 17 Jul 2017 07:37:21 +0000 (09:37 +0200)]
Introducing method symbol::get_TeX_name() to match existing symbol::get_name().

Signed-off-by: Vladimir V. Kisil <kisilv@maths.leeds.ac.uk>
2 years agoFix excessive backslashes in the LaTeX function names.
Vladimir V. Kisil [Mon, 17 Jul 2017 07:35:40 +0000 (09:35 +0200)]
Fix excessive backslashes in the LaTeX function names.

Signed-off-by: Vladimir V. Kisil <kisilv@maths.leeds.ac.uk>
2 years agochecks: prefer initializer lists over push_back on vectors.
Richard Kreckel [Fri, 17 Feb 2017 22:32:19 +0000 (23:32 +0100)]
checks: prefer initializer lists over push_back on vectors.

2 years agoClean up combinatorial helpers.
Richard Kreckel [Wed, 15 Feb 2017 11:58:48 +0000 (12:58 +0100)]
Clean up combinatorial helpers.

* Convert all signatures from int to unsiged.
* Renamed partition_generator to partition_with_zero_parts_generator...
* ...and add class partition_generator which does not include zero parts.
*  Rename ::current() to ::get() and make them compute vectors on first use.

2 years agoMove combinatorial helpers from power.cpp to utils.h.
Richard Kreckel [Wed, 15 Feb 2017 11:42:00 +0000 (12:42 +0100)]
Move combinatorial helpers from power.cpp to utils.h.

This way, these can be used by other modules.

2 years agoFinalize 1.7.2 release. release_1-7-2
Richard Kreckel [Tue, 10 Jan 2017 07:16:08 +0000 (08:16 +0100)]
Finalize 1.7.2 release.

2 years agoHappy New Year!
Richard Kreckel [Mon, 9 Jan 2017 22:38:38 +0000 (23:38 +0100)]
Happy New Year!

Update copyright statements.

2 years agoFix memory leaks in operators returning relationals.
Richard Kreckel [Mon, 9 Jan 2017 21:49:11 +0000 (22:49 +0100)]
Fix memory leaks in operators returning relationals.

These memory leaks were introduced in 82df71852.

Thanks to Thomas Luthe for reporting this.

2 years agoGINAC_DECLARE_REGISTERED_CLASS(): add namespace of status_flags.
Stefan Weinzierl [Tue, 3 Jan 2017 20:43:42 +0000 (21:43 +0100)]
GINAC_DECLARE_REGISTERED_CLASS(): add namespace of status_flags.

2 years agoFix MSC compiler warning.
Richard Kreckel [Sun, 6 Nov 2016 18:41:47 +0000 (19:41 +0100)]
Fix MSC compiler warning.

Thanks to Jan Rheinländer for reporting this.

2 years agoClean up some header files and fix compilation with MSC.
Richard Kreckel [Sun, 6 Nov 2016 18:35:46 +0000 (19:35 +0100)]
Clean up some header files and fix compilation with MSC.

On MSC there is no <unistd.h>. It turns out that we need to #include <io.h>
in order to use close(3). This fixes the build failure introduced in 8305ec38.

Thanks to Jan Rheinländer for reporting this.

2 years agoRemove configure check for type 'long long'.
Richard Kreckel [Sun, 6 Nov 2016 17:39:08 +0000 (18:39 +0100)]
Remove configure check for type 'long long'.

This type with at least 64 bits is mandatory since C++11.

2 years agoReplace mktemp with mkstemp.
Till Hofmann [Sat, 8 Oct 2016 18:34:40 +0000 (20:34 +0200)]
Replace mktemp with mkstemp.

As the manpage says, mktemp is deprecated ("Never use mktemp") and gcc
warns about the usage of mktemp. Replace mktemp with its safe variant
mkstemp.

2 years agoFinalize 1.7.1 release. release_1-7-1
Richard Kreckel [Sat, 1 Oct 2016 22:46:08 +0000 (00:46 +0200)]
Finalize 1.7.1 release.

2 years agoSuppress compiler warnings about inconsistent override.
Richard Kreckel [Sat, 1 Oct 2016 22:45:11 +0000 (00:45 +0200)]
Suppress compiler warnings about inconsistent override.

The introduction of the 'override' keyword in GiNaC in d5b86dd10 was
deliberately incomplete: Duplication of code in macros was avoided.
It turns out that some compilers (e.g. g++ -Wsuggest-override or clang++
-Wall) complain if the 'override' keyword is used inconsistently. Let's
make this consistent now, even if it leads to the introduction of two
more macros.

3 years agoFix compilation of programs using __attribute__((deprecated)).
Richard Kreckel [Wed, 14 Sep 2016 20:00:29 +0000 (22:00 +0200)]
Fix compilation of programs using __attribute__((deprecated)).

Ouu, we mustn't redefine 'deprecated' in order for this to work...

Thanks to Alexander Proskurin for reporting this.

3 years agoUpdate ax_cxx_compile_stdcxx.m4.
Richard Kreckel [Wed, 17 Aug 2016 20:08:57 +0000 (22:08 +0200)]
Update ax_cxx_compile_stdcxx.m4.

Serial 3 fixes make CXXFLAGS=..., c.f. the macro's upstream revision history.

3 years agoImprove performance of clifford_to_lst().
Vladimir Kisil [Wed, 17 Aug 2016 20:05:13 +0000 (22:05 +0200)]
Improve performance of clifford_to_lst().

Rewrite get_clifford_comp() so it is less obscure and more efficient.

3 years agoFix convergence of Li_projection at ±I.
Stefan Weinzierl [Thu, 11 Aug 2016 21:55:59 +0000 (23:55 +0200)]
Fix convergence of Li_projection at ±I.

For arguments near ±I, direct summation does not practically converge.
Use the Bernoulli transformation instead.

Thanks to Peter Banks for reporting this:
<http://www.cebix.net/pipermail/ginac-list/2016-August/002085.html>

3 years agoAdd proper functions to make clifford_bar() and clifford_star().
Vladimir Kisil [Thu, 11 Aug 2016 18:47:08 +0000 (20:47 +0200)]
Add proper functions to make clifford_bar() and clifford_star().

Previously operations clifford_bar() and clifford_star() called
conjugate() method. This results in reversion of all non-commutative
entries (not only Clifford units) and produced complex conjugation
of all non-real items. The new routine operates on Clifford units only.

3 years ago[bugfix] Fix crash in basic::subs().
Richard Kreckel [Thu, 21 Jul 2016 06:55:44 +0000 (08:55 +0200)]
[bugfix] Fix crash in basic::subs().

A regression in 1.7.0 was introduced with 1b8bcb06 in function
basic::subs_one_level(): implicitly casting *this to an ex first for
finding *this in m and later in the function's return statement caused
a crash in the second cast because *this was deleted in the first one.
After all, *this was dynamically allocated in basic::subs().

This bug was reported and hunted down by Mario Prausa.

3 years agoFinalize 1.7.0 release. release_1-7-0
Richard Kreckel [Sat, 30 Apr 2016 20:39:42 +0000 (22:39 +0200)]
Finalize 1.7.0 release.

3 years agoMore shortcuts for trivial cases in mul::combine_*_to_pair().
Richard Kreckel [Fri, 29 Apr 2016 05:31:20 +0000 (07:31 +0200)]
More shortcuts for trivial cases in mul::combine_*_to_pair().

3 years agoUpdate reference to Robert C. Martin's "Acyclic Visitor" paper.
Richard Kreckel [Mon, 18 Apr 2016 20:18:20 +0000 (22:18 +0200)]
Update reference to Robert C. Martin's "Acyclic Visitor" paper.

The source at objectmentor.com has been unavailble for a long while.

3 years agoAdd fderivative::derivatives() method.
Richard Kreckel [Thu, 14 Apr 2016 19:29:37 +0000 (21:29 +0200)]
Add fderivative::derivatives() method.

3 years agoFix typos in comments.
Richard Kreckel [Wed, 13 Apr 2016 06:50:41 +0000 (08:50 +0200)]
Fix typos in comments.

3 years agoUpdate compiler list and compile times.
Richard Kreckel [Wed, 13 Apr 2016 06:15:44 +0000 (08:15 +0200)]
Update compiler list and compile times.

3 years agoPrefer C library wrappers over C headers, where possible.
Richard Kreckel [Wed, 13 Apr 2016 06:10:22 +0000 (08:10 +0200)]
Prefer C library wrappers over C headers, where possible.

3 years agoMerge branch 'c++11' in preparation for version 1.7.0.
Richard Kreckel [Tue, 5 Apr 2016 20:51:12 +0000 (22:51 +0200)]
Merge branch 'c++11' in preparation for version 1.7.0.

3 years ago[build] Install compiler.h header file. c++11
Richard Kreckel [Mon, 4 Apr 2016 18:42:12 +0000 (20:42 +0200)]
[build] Install compiler.h header file.

Some header files need the deprecated macro. (Looking forward to C++14.)

3 years agoInstall ginac-excompiler in $LIBEXECDIR, not in $BINDIR.
Richard Kreckel [Mon, 4 Apr 2016 07:05:50 +0000 (09:05 +0200)]
Install ginac-excompiler in $LIBEXECDIR, not in $BINDIR.

...and make the GiNaC library aware of where it is installed.

The ginac-excompiler script is only invoked by GiNaC::compile_ex(...)
and serves no purpose on its own. In compliance with the FHS, it should
be installed in $LIBEXECDIR, not in $BINDIR. This also disburdens
distribution packagers from having to provide a manpage (which may be
required for all programs in $BINDIR).

The location for $LIBEXECDIR defaults to ${prefix}/libexec/. It may be
overwritten at configuration time. (Many distributions want to set it to
${prefix}/lib/ginac/.)

3 years ago[build] Ship FindLibDL.cmake, it's needed by CMakeLists.txt.
Richard Kreckel [Sun, 3 Apr 2016 15:46:47 +0000 (17:46 +0200)]
[build] Ship FindLibDL.cmake, it's needed by CMakeLists.txt.

3 years agoRemove ex::to_rational(lst) and ex::to_polynomial(lst).
Richard Kreckel [Sat, 12 Mar 2016 23:02:57 +0000 (00:02 +0100)]
Remove ex::to_rational(lst) and ex::to_polynomial(lst).

Those were GiNaC 1.1 compatibility functions. Use the corresponding
functions with exmap arguments instead.

3 years agoFinalize 1.6.7 release. release_1-6-7
Richard Kreckel [Sat, 6 Feb 2016 11:51:39 +0000 (12:51 +0100)]
Finalize 1.6.7 release.

3 years agoUse C++11 'auto' and range-based for loops where possible.
Richard Kreckel [Thu, 25 Feb 2016 21:12:28 +0000 (22:12 +0100)]
Use C++11 'auto' and range-based for loops where possible.

3 years agoUse C++11 'nullptr' where applicable.
Richard Kreckel [Mon, 22 Feb 2016 21:51:40 +0000 (22:51 +0100)]
Use C++11 'nullptr' where applicable.

3 years ago[build] Force C++11 compilation when using CMake.
Richard Kreckel [Thu, 11 Feb 2016 22:10:55 +0000 (23:10 +0100)]
[build] Force C++11 compilation when using CMake.

3 years ago[build] Fix CMake build.
Richard Kreckel [Thu, 11 Feb 2016 22:08:12 +0000 (23:08 +0100)]
[build] Fix CMake build.

3 years agominor optimization in power::expand_add
Richard Kreckel [Sat, 6 Feb 2016 22:19:35 +0000 (23:19 +0100)]
minor optimization in power::expand_add

3 years agoFix a comment.
Richard Kreckel [Sat, 6 Feb 2016 11:53:14 +0000 (12:53 +0100)]
Fix a comment.

3 years agospeed up multiply_lcm(e, lcm) a bit
Richard Kreckel [Sat, 6 Feb 2016 00:35:07 +0000 (01:35 +0100)]
speed up multiply_lcm(e, lcm) a bit

and comment it a little

3 years ago[bugfix] fix elusive bug in quo, rem,...
Richard Kreckel [Fri, 5 Feb 2016 23:47:08 +0000 (00:47 +0100)]
[bugfix] fix elusive bug in quo, rem,...

The power of two rational numeric objects needs not be rational. As a
result, some care is required when transforming (b^e)*l -> (b*l^(1/e))^e
for some rational e and l. This is a common transformation in order to
convert a polynomial over Q into a polynomial over Z when computing
their quotient, remainder, etc. Failure to be careful can potentially
introduce spurious non-rational numbers into rational polynomials and
make those operations fail. This patch avoids this transformation when
l^(1/e) is not a rational number.

3 years ago[bugfix] fix elusive bug in quo, rem,...
Richard Kreckel [Fri, 5 Feb 2016 23:47:08 +0000 (00:47 +0100)]
[bugfix] fix elusive bug in quo, rem,...

The power of two rational numeric objects needs not be rational. As a
result, some care is required when transforming (b^e)*l -> (b*l^(1/e))^e
for some rational e and l. This is a common transformation in order to
convert a polynomial over Q into a polynomial over Z when computing
their quotient, remainder, etc. Failure to be careful can potentially
introduce spurious non-rational numbers into rational polynomials and
make those operations fail. This patch avoids this transformation when
l^(1/e) is not a rational number.

3 years ago[bugfix] fix sqrfree(poly) for zero polynomials in disguise.
Richard Kreckel [Wed, 3 Feb 2016 07:13:58 +0000 (08:13 +0100)]
[bugfix] fix sqrfree(poly) for zero polynomials in disguise.

Yun's algorithm now handles polynomials which would become zero after
expanding.

3 years ago[bugfix] fix sqrfree(poly) for zero polynomials in disguise.
Richard Kreckel [Wed, 3 Feb 2016 07:13:58 +0000 (08:13 +0100)]
[bugfix] fix sqrfree(poly) for zero polynomials in disguise.

Yun's algorithm now handles polynomials which would become zero after
expanding.

3 years agoRemove extra cases for missing <stdint.h>.
Richard Kreckel [Sun, 31 Jan 2016 09:15:50 +0000 (10:15 +0100)]
Remove extra cases for missing <stdint.h>.

Use <cstdint> unconditionally -- it's been standardized in C++11.

3 years ago[C++17] Remove inheritance from std::binary_function, std::unary_function.
Richard Kreckel [Fri, 29 Jan 2016 22:45:21 +0000 (23:45 +0100)]
[C++17] Remove inheritance from std::binary_function, std::unary_function.

This inheritance is unneeded since C++11 and the two classes may be
removed in C++-17.

3 years ago[C++17] Replace std::bind2nd with a lambda.
Richard Kreckel [Fri, 29 Jan 2016 21:57:52 +0000 (22:57 +0100)]
[C++17] Replace std::bind2nd with a lambda.

3 years agoRemove global variable max_recursion_level.
Richard Kreckel [Thu, 28 Jan 2016 23:11:14 +0000 (00:11 +0100)]
Remove global variable max_recursion_level.

With the removal of the last 'level' parameter, this variable has
become obsolete.

3 years agoRemove 'level' argument of normal().
Richard Kreckel [Thu, 28 Jan 2016 21:45:56 +0000 (22:45 +0100)]
Remove 'level' argument of normal().

The 'level' argument was modeled after that of the eval() methods
(removed in 6c946d4c). It has never been very useful except for
confusing developers and it hasn't been documented in the tutorial.
Moreover, I have no indication that it has ever been used.

3 years agoRemove 'level' argument of evalf().
Richard Kreckel [Thu, 28 Jan 2016 21:11:46 +0000 (22:11 +0100)]
Remove 'level' argument of evalf().

The 'level' argument was modeled after that of the eval() methods
(removed in 6c946d4c). It has never been very useful except for
confusing developers. Moreover, I have no indication that it has
ever been used.

3 years agoAvoid x^0 and Order(x^0) terms together in series expansion.
Richard Kreckel [Wed, 6 Jan 2016 21:34:23 +0000 (22:34 +0100)]
Avoid x^0 and Order(x^0) terms together in series expansion.

At the branch cut, the series expansions of log(), atan(), and atanh()
assembled pseries objects which contained both x^0 and Order(x^0) terms.
This patch removes the extra x^0 term if the order is 0. It also adds
a GINAC_ASSERT for these kinds of invariants to the pseries ctor and
simplifies the loops in pseries' degree(), ldegree(), eval() and evalf()
member functions.

3 years agoHappy New Year!
Richard Kreckel [Fri, 1 Jan 2016 10:49:48 +0000 (11:49 +0100)]
Happy New Year!

3 years agoHappy New Year!
Richard Kreckel [Fri, 1 Jan 2016 01:05:06 +0000 (02:05 +0100)]
Happy New Year!

3 years agoDe-document eval() in ginsh help and manpage.
Richard Kreckel [Fri, 1 Jan 2016 01:02:49 +0000 (02:02 +0100)]
De-document eval() in ginsh help and manpage.

This was forgotten in 6c946d4c.

3 years agoMake relational::rhs() and lhs() nonvirtual.
Richard Kreckel [Thu, 31 Dec 2015 18:34:54 +0000 (19:34 +0100)]
Make relational::rhs() and lhs() nonvirtual.

I am unable to see a point in ever overriding these two member functions.

3 years agoClarification on symmetries of metric of clifford object.
Vladimir V. Kisil [Thu, 31 Dec 2015 15:44:16 +0000 (16:44 +0100)]
Clarification on symmetries of metric of clifford object.

The metric of a clifford object may be non-symmetric. Even if
a metric is defined by a symmetric tensor, clifford object may
not be aware of the symmetry and it needs to be explicitly declared.

Signed-off-by: Vladimir V. Kisil <kisilv@maths.leeds.ac.uk>
3 years agoAdd specific dbgprinttree() method to clifford.
Vladimir V. Kisil [Thu, 31 Dec 2015 15:41:48 +0000 (16:41 +0100)]
Add specific dbgprinttree() method to clifford.

Metric is an important element of a clifford object, thus it is useful
to have the metric to be printed in the detailed debug printing.

Signed-off-by: Vladimir V. Kisil <kisilv@maths.leeds.ac.uk>
3 years agocache pseries coeff accesses in pseries::mul_series.
Ralf Stephan [Thu, 31 Dec 2015 15:36:46 +0000 (16:36 +0100)]
cache pseries coeff accesses in pseries::mul_series.

Coeff is too general as long as we have only ints as exponents.
This patch fixes a potentially cubic slowdown.

3 years agoFinalize 1.6.6 release. ginac_1-6-6
Richard Kreckel [Sun, 20 Dec 2015 20:29:55 +0000 (21:29 +0100)]
Finalize 1.6.6 release.

3 years agoRemove reference to ftpthep.physik.uni-mainz.de.
Richard Kreckel [Sun, 20 Dec 2015 16:56:09 +0000 (17:56 +0100)]
Remove reference to ftpthep.physik.uni-mainz.de.

Higgs is down, alas...

3 years agoRemove reference to ftpthep.physik.uni-mainz.de.
Richard Kreckel [Sun, 20 Dec 2015 16:56:09 +0000 (17:56 +0100)]
Remove reference to ftpthep.physik.uni-mainz.de.

Higgs is down, alas...

3 years agoHoist typeid(*this) from loops.
Richard Kreckel [Sun, 20 Dec 2015 16:50:07 +0000 (17:50 +0100)]
Hoist typeid(*this) from loops.

The compilers don't seem to reliably recognize the invariance of this.

3 years agoRemove iter_swap specializations.
Richard Kreckel [Sun, 20 Dec 2015 16:30:34 +0000 (17:30 +0100)]
Remove iter_swap specializations.

It's a myth that iter_swap helps the compiler produce better code.
Let's just use specialized swap instead.

3 years agoAdd support for power::info(info_flags::real).
Richard Kreckel [Sun, 20 Dec 2015 03:44:01 +0000 (04:44 +0100)]
Add support for power::info(info_flags::real).

(And, while at it, clean up the surrounding code a bit.)