Christian Bauer [Fri, 25 May 2001 20:51:35 +0000 (20:51 +0000)]
- removed debugging code in match()
- added ex::match(const ex & pattern) which doesn't take a list as second
argument
- expairseq::subs() substitutes in recombined pairs when the pattern is a
product or a power; this is necessary for things like subs(2*x^2,x^2==3)
because the first expression is mul(<x,2>,2) and only substituting in the
"rest" part of the expair is not enough
Christian Bauer [Mon, 21 May 2001 22:49:16 +0000 (22:49 +0000)]
- Clifford traces of many gammas are a lot faster now (especially with gamma5)
- new simplifications for color classes:
d.abc T.b T.c = 5/6 T.a
f.abc T.b T.c = 3/2 I T.a
- added indexed::has_dummy_index_for() member function
Christian Bauer [Sat, 19 May 2001 00:42:07 +0000 (00:42 +0000)]
- dummy index renamer didn't account for internal dummy indices of objects
in products; a~mu.mu-a~nu.nu gets simplified to 0 now
- made a little more use of STL facilities for exvectors, especially in the
indexed stuff; append_exvector_to_exvector() and index_set_difference() are
gone and utils.h defines the functors ex_is_less and ex_is_equal
Christian Bauer [Fri, 18 May 2001 00:53:07 +0000 (00:53 +0000)]
- simplify_indexed() renames dummy indices so, e.g., "a.i*a.i+a.j*a.j" gets
simplified to "2*a.i*a.i" (or 2*a.j*a.j, you can't know which one)
- fixed possible crash when calling subs() on expressions with non-commutative
products
- added canonicalize_clifford()
Richard Kreckel [Fri, 11 May 2001 19:43:31 +0000 (19:43 +0000)]
- Renamed our detected libreadline version in order to avoid conflicts
with Chat Rameys (still broken) macros and future CPP definitions in
libreadline's headers. Oh what a pain in the ass!
Christian Bauer [Thu, 10 May 2001 20:41:24 +0000 (20:41 +0000)]
- color and clifford classes are quite functional now
- new "spinidx" class for dotted/undotted indices
- predefined spinor metric tensor (created by spinor_metric())
Richard Kreckel [Tue, 8 May 2001 20:42:51 +0000 (20:42 +0000)]
* All operators are now strictly following the semantics we all know from
C/C++. I.e. e1+e2=42; is now impossible and other such stuff. For all
remaining errors (i.e. ++e1 = e1+1;) the compiler alone is to blame...
Richard Kreckel [Sat, 5 May 2001 23:09:07 +0000 (23:09 +0000)]
Changes needed for compilation with -DDO_GINAC_ASSERT:
* basic.cpp: if needed, #include <typeinfo>,
* mul.h: mul::print() needed a default for 2nd arg.
Hey, Cebix, could you please have a look at the assertions of type
basis.return_type()==return_types::commutative in power.cpp ctors?
Watch out, though: they are not just bogus because of the rule
(x*y)^2 -> x^2*y^2 in power::eval().
Christian Bauer [Fri, 4 May 2001 23:55:36 +0000 (23:55 +0000)]
- symbols can have a LaTeX name, e.g. symbol s("s", "\\sigma");
- LaTeX output of indexed objects and tensors is much nicer
- simplify_indexed() can do arbitrary contractions in Dirac gamma strings
- constructing expressions like
(x * dirac_ONE() + dirac_ONE()) * dirac_gamma(mu)
resulted in an exception because mul::simplify_ncmul() wasn't implemented
(maybe afrink didn't anticipate that an implementation would really be
needed...)
Richard Kreckel [Thu, 3 May 2001 23:50:48 +0000 (23:50 +0000)]
* Fix incompatibilities with recent versions of libreadline by having
configure find out the version and then doing ugly things with #ifdef.
* config.*: updates from upstream.
Christian Bauer [Thu, 26 Apr 2001 19:36:07 +0000 (19:36 +0000)]
- dirac_trace() handles arbitrary expressions (even unexpanded), including
gamma5
- implemented color_trace()
- eps0123() creates a 4-dimensional epsilon tensor without checking the
indices (so they may be D-dimensional); this may become a different class
soon, but for now all the implemented properties of the standard epsilon
tensor also apply to eps0123
Christian Bauer [Fri, 20 Apr 2001 23:09:09 +0000 (23:09 +0000)]
- degree(), ldegree(), coeff(), lcoeff(), tcoeff() and collect() work with
non-symbols as the second argument
- collect_distributed() produces result in distributed form (second argument
should be a list of symbols)
Christian Bauer [Fri, 20 Apr 2001 23:06:55 +0000 (23:06 +0000)]
- color/clifford objects have representation label to distinguish elements
of different algebras; objects with different labels commute with each
other
- dirac_one() -> dirac_ONE()
- added gamma5 clifford objects which is constructed by dirac_gamma5()
- clifford::simplify_ncmul() anticommutes gamma5's to the front and removes
squares of gamma5
- the argument to collect() can be a list of objects in which case the
result is either a recursively collected polynomial, or a polynomial in
a distributed form with terms like coeff*x1^e1*...*xn^en, as specified by
the second argument to collect(). For example (ginsh):
> f=a*x-x+a*x*y+x*y+a*x*y^2-2*x*y^2+y^2;
a*x+y*a*x+y^2*a*x+y^2-x+y*x-2*y^2*x
> collect(f,x);
(-1+y+y^2*a+y*a+a-2*y^2)*x+y^2
> collect(f,y);
a*x-x+y^2*(1+a*x-2*x)+y*(a*x+x)
> collect(f,[x,y]);
(-1+y*(1+a)+y^2*(-2+a)+a)*x+y^2
> collect(f,[y,x]);
(-1+a)*x+y*(1+a)*x+(1+(-2+a)*x)*y^2
> collect_distributed(f,[x,y]);
(-1+a)*x+y^2*(-2+a)*x+y*(1+a)*x+y^2
Richard Kreckel [Wed, 18 Apr 2001 19:30:21 +0000 (19:30 +0000)]
* color.cpp: remove duplicated default args.
* numeric.cpp: insert some missing cln:: namespace decls.
Why did this ever work?
* structure.cpp, structure.h: adjust to the new print scheme.
Richard Kreckel [Sun, 15 Apr 2001 00:28:18 +0000 (00:28 +0000)]
* basic::collec() never worked correctly on non-polynomials till now.
We simply correct for the missing terms, which makes it at least
algebraically correct (suggested by Pearu Peterson).
* Added support to print out LaTeX-style, based on some work by Stefan
Weinzierl:
- print.h: added a class print_latex().
- function.pl: added function_options::latex_name() because there was
no good way of setting that name before.
- inifncs*.cpp: use it.
- *.cpp: switch to see if print_context is actually print_latex and
then change the style.
* Fixed some stupid bugs in sections that were #define'd away for gcc-2.95.