GiNaC 1.2.0 now available
Christian.Bauer at Uni-Mainz.DE
Fri Mar 19 16:53:05 CET 2004
In an unforeseen turn of events, the GiNaC Group (who, by the way, don't
endorse the use of recreational drugs, except for C++ templates and Pokemon
movies) proudly presents GiNaC 1.2.0 "We don't have the funds for champagne
but we're going to release anyway". (And we also finally leave CLN in the
dust in terms of version numbers. Hah, in your face, Richy! :-)
Compared to the last few 1.1.x releases, this one has a rather impressive
list of changes, with the focus on improving GiNaC's extensibility:
- Added a structure<T> template class for the easy creation of user-defined
- Added support for (acyclic) visitors, to allow cleaner implementations of
- Added a const_iterator class that can be used instead of op()/nops().
- Completely revamped the implementation of expression output. It is now
possible to add new output formats, to change the behavior of predefined
formats at run-time, and to have different output styles for algebraic
- Symbols can be made non-commutative.
- Added a method ex::conjugate() and a function conjugate() for complex
conjugation. Symbols can be declared as real or complex-valued.
- Improved the speed of subs(), normal(), to_rational() and to_polynomial()
by the use of maps instead of lists. The old forms
subs(const lst & ls, const lst & lr, unsigned options)
to_rational/to_polynomial(lst & repl)
are still available for compatibility, but using the new forms
subs(const exmap & m, unsigned options)
to_rational/to_polynomial(exmap & repl)
is more efficient, especially when the number of replacements is large.
- quo(), rem(), prem(), sprem(), decomp_rational(), unit(), content(),
primpart() and matrix::charpoly() now take a "const ex &" instead of a
"const symbol &".
- Redundant expressions (two ex pointing to different objects are found to be
equal in compare()) are now actively deleted/fused to conserve memory and
speed up subsequent comparisons. This behavior can be suppressed on a
per-object level with status_flags::not_shareable. Lists and matrices are
not shareable by default.
- Lots of internal streamlining and optimizations.
- Caveats for class implementors:
- basic::copy() and basic::destroy() are gone; classes derived from
basic can use the defaults for the assignment operator and copy
constructor. [Roberto: this also means that annoying compiler warning
is finally gone... :-]
- basic::subs(), basic::normal(), basic::to_rational() and
basic::to_polynomial() take 'exmap' objects instead of lists.
- basic::subs() now descends into subexpressions (if accessible via
nops()/op()/let_op()). If you have a custom implementation of subs()
that calls basic::subs() after substituting subexpressions, this needs
to be changed to a call to subs_one_level().
- lst::thislst() and exprseq::thisexprseq() renamed to thiscontainer().
- thiscontainer() and associated constructors now take a std::auto_ptr.
- Overloading basic::print() is now deprecated. You should use
print_func<>() class options instead.
Most of the new features are explained in more detail in the tutorial.
GiNaC 1.2.0 is not binary compatible to 1.1.x, so you have to recompile
your stuff. It shouldn't be necessary to make any modifications to your
sources when switching to 1.2, except when you implemented your own GiNaC
classes (see above).
As before, all 1.2.x releases will be (upwards) binary compatible to each
other. There is a new CVS branch "ginac_1-2" for the 1.2.x series, and the
CVS head branch will eventually become GiNaC 1.3 (or GiNaC 2.0, or GiNaC
Advanced Datacenter Edition, or whatever).
What's left to say? Ah, yes, download GiNaC 1.2.0 from
/ Physics is an algorithm
More information about the GiNaC-list