Richard Kreckel [Sun, 11 Mar 2001 19:10:03 +0000 (19:10 +0000)]
normal.cpp, normal.h: Fix Yun's algorithm (there was a mistake in Geddes et
al.) for square-free factorization. Also change the syntax to allow for
square-free factoring in a recursive way in Q[X]. This is an example how it
works in Z[x,y,z] in ginsh:
> ?sqrfree
sqrfree(expression [, symbol-list]) - square-free factorization of a polynomial
> sqrfree(expand((x+y)*(x+y+z)^2*(y-z)^3));
(x+y)*(-x-y-z)^2*(y^3+3*y*z^2-3*y^2*z-z^3)
> sqrfree(expand((x+y)*(x+y+z)^2*(y-z)^3),[y]);
(x+y)*(y-z)^3*(x+y+z)^2
> sqrfree(expand((x+y)*(x+y+z)^2*(y-z)^3),[z]);
(x+y)*(y-z)^3*(x+y+z)^2
> sqrfree(expand((x+y)*(x+y+z)^2*(y-z)^3),[x]);
(x+y)*(-x-y-z)^2*(y^3+3*y*z^2-3*y^2*z-z^3)
> sqrfree(expand((x+y)*(x+y+z)^2*(y-z)^3),[x,y]);
(x+y)*(-x-y-z)^2*(y^3+3*y*z^2-3*y^2*z-z^3)
> sqrfree(expand((x+y)*(x+y+z)^2*(y-z)^3),[x,y,z]);
(x+y)*(-x-y-z)^2*(y^3+3*y*z^2-3*y^2*z-z^3)
> sqrfree(expand((x+y)*(x+y+z)^2*(y-z)^3),[v]);
3*x*y^5+3*x^2*y^4+x^3*y^3+y^6-y*z^5-2*y^4*z^2+y^2*z^4-y^5*z+2*y^3*z^3-3*x^3*y^2*z+3*x^3*y*z^2-5*x*y^4*z-x*y*z^4+3*x^2*y*z^3+6*x*y^2*z^3+3*x^2*y^2*z^2-2*x*y^3*z^2-7*x^2*y^3*z-x^3*z^3-2*x^2*z^4-x*z^5
Christian Bauer [Fri, 9 Mar 2001 22:21:35 +0000 (22:21 +0000)]
- lcm_of_coefficients_denominators(1/2+x^10) returned 1024 instead of 2 and
multiply_lcm() on that expression barfed
- contract_with() now takes two exvector::iterators and and exvector; this
makes it possible to look for more contractions in the implementation
Richard Kreckel [Wed, 28 Feb 2001 15:54:52 +0000 (15:54 +0000)]
* ginac/registrar.h: dtor is inlined now.
* ginac/basic.h, ginac/ex.h: removed INLINE_FOO_CONSTRUCTORS and hand-inlined
stuff instead, since the macros turned out to get in the way while
fine-tuning the inlining.
* ginac/utils.h: if 'long long' works, use that one for computing the hash
value instead of floating point tricks. 2 Reasons: on Intel the assembler
is terrible and slow otherwise, 'long long' will appear in C++ anyways when
they adapt to the C99 standard.
* Several other small performance tweaks.
* ginac/constant.cpp: (constant::calchash()) implement, caring for serial.
* ginac/function.pl (function::calchash()): implement, caring for serial.
* ginac/expairseq.cpp: honor coeff's hash value.
* ginac/pseries.cpp: (pseries::power_const()) fix problems with zero pseries.
* Added several pounds of in-source documentation in doxygen style.
Richard Kreckel [Wed, 28 Feb 2001 15:53:26 +0000 (15:53 +0000)]
* some longish timings are now disabled by default.
* check/time_lw_M2.cpp: new timing (defaults to disabled)
* check/time_lw_N.cpp: new timing (defaults to disabled)
Christian Bauer [Tue, 27 Feb 2001 19:54:38 +0000 (19:54 +0000)]
when there are multiple variables with the same maximum degree, the one with
the least number of terms in the leading coefficient is chosen as the main
variable in GCD computations
Christian Bauer [Thu, 15 Feb 2001 22:54:52 +0000 (22:54 +0000)]
the destructor, copy constructor, and assignment operator (which were the
same for all subclasses of basic, with very few exceptions) are now included
in the GINAC_IMPLEMENT_REGISTERED_CLASS macro; the GINAC_DECLARE_REGISTERED_CLASS
macro also defines these (and other common) member functions
Christian Bauer [Wed, 14 Feb 2001 00:50:46 +0000 (00:50 +0000)]
- added documentation to the indexed, color, lortensor and clifford classes
- moved Dim() function from lortensor.cpp to lorentzidx.cpp
- moved append_exvector_to_exvector() from color.cpp to utils.cpp
- some cleanups in the lortensor and clifford classes
Christian Bauer [Mon, 12 Feb 2001 20:54:53 +0000 (20:54 +0000)]
- added documentation for the idx, coloridx and lorentzidx classes
- idx_intersect() works correctly when indices appear multiple times
- g~mu_mu = D-2 (instead of D-dim(P))
Christian Bauer [Thu, 25 Jan 2001 20:53:54 +0000 (20:53 +0000)]
- gcd() and lcm() always checked the second argument, even when check_args
was false
- add::normal() handles large expressions (that collapse to much smaller ones)
better
Richard Kreckel [Mon, 22 Jan 2001 18:11:54 +0000 (18:11 +0000)]
- See if __GNUC__ < 2.97 before using std::vector<..,malloc_alloc>. Sorry,
there is no way having this depend on whether we are setting up Cint or
not because the malloc_alloc goes into the mangled signature and the
result won't link if one tries to be more clever. It really sucks.
Let's all just pray Masaharu throws away that old STL implementation
really soon now. (Jeez, he still calls this old junk 'reference'!)
- Bumped up a few dates. :-)
Christian Bauer [Sat, 6 Jan 2001 19:18:29 +0000 (19:18 +0000)]
when normal() doesn't recur any further because the specified recursion level
was reached, the remaining subexpression is replaced by a symbol to avoid
continuing with non-polynomial expressions
Richard Kreckel [Fri, 15 Dec 2000 20:47:51 +0000 (20:47 +0000)]
- utils.cpp, version.h.in: add version information to the library itself.
- numeric.*: It was not a good idea to have a cast from numeric to cl_N,
make a method to_cl_N, instead, in order not to confuse compilers.