]> www.ginac.de Git - ginac.git/blobdiff - doc/tutorial/ginac.texi
don't mention CVS any more, describe how to install from git.
[ginac.git] / doc / tutorial / ginac.texi
index 51341f4dd2f2f16075b676378d9f091ebec35cfd..2f160c7bfb16459bd1d18fd7c46fb9c43273ad27 100644 (file)
@@ -15,6 +15,7 @@
 
 @include version.texi
 
+@dircategory Mathematics
 @direntry
 * ginac: (ginac).                   C++ library for symbolic computation.
 @end direntry
@@ -23,7 +24,7 @@
 This is a tutorial that documents GiNaC @value{VERSION}, an open
 framework for symbolic computation within the C++ programming language.
 
-Copyright (C) 1999-2007 Johannes Gutenberg University Mainz, Germany
+Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
 
 Permission is granted to make and distribute verbatim copies of
 this manual provided the copyright notice and this permission notice
@@ -51,7 +52,7 @@ notice identical to this one.
 
 @page
 @vskip 0pt plus 1filll
-Copyright @copyright{} 1999-2007 Johannes Gutenberg University Mainz, Germany
+Copyright @copyright{} 1999-2008 Johannes Gutenberg University Mainz, Germany
 @sp 2
 Permission is granted to make and distribute verbatim copies of
 this manual provided the copyright notice and this permission notice
@@ -134,7 +135,7 @@ the near future.
 
 @section License
 The GiNaC framework for symbolic computation within the C++ programming
-language is Copyright @copyright{} 1999-2007 Johannes Gutenberg
+language is Copyright @copyright{} 1999-2008 Johannes Gutenberg
 University Mainz, Germany.
 
 This program is free software; you can redistribute it and/or
@@ -552,7 +553,7 @@ environment variable, like optimization, debugging information and
 warning levels.  If omitted, it defaults to @option{-g
 -O2}.@footnote{The @command{configure} script is itself generated from
 the file @file{configure.ac}.  It is only distributed in packaged
-releases of GiNaC.  If you got the naked sources, e.g. from CVS, you
+releases of GiNaC.  If you got the naked sources, e.g. from git, you
 must generate @command{configure} along with the various
 @file{Makefile.in} by using the @command{autoreconf} utility.  This will
 require a fair amount of support from your local toolchain, though.}
@@ -920,7 +921,12 @@ To get an idea about what kinds of symbolic composites may be built we
 have a look at the most important classes in the class hierarchy and
 some of the relations among the classes:
 
+@ifnotinfo
 @image{classhierarchy}
+@end ifnotinfo
+@ifinfo
+<PICTURE MISSING>
+@end ifinfo
 
 The abstract classes shown here (the ones without drop-shadow) are of no
 interest for the user.  They are used internally in order to avoid code
@@ -2321,12 +2327,12 @@ get an error message from this but you will probably not be able to do
 anything useful with it.
 
 @cindex @code{get_value()}
-@cindex @code{get_dimension()}
+@cindex @code{get_dim()}
 The methods
 
 @example
 ex idx::get_value();
-ex idx::get_dimension();
+ex idx::get_dim();
 @end example
 
 return the value and dimension of an @code{idx} object. If you have an index
@@ -3401,8 +3407,20 @@ $v^0 e_0 + v^1 e_1 + ... + v^n e_n$
 with @samp{e.k}
 directly supplied in the second form of the procedure. In the first form
 the Clifford unit @samp{e.k} is generated by the call of
-@code{clifford_unit(mu, metr, rl)}. The previous code may be rewritten
-with the help of @code{lst_to_clifford()} as follows
+@code{clifford_unit(mu, metr, rl)}. 
+@cindex pseudo-vector
+If the number of components supplied
+by @code{v} exceeds the dimensionality of the Clifford unit @code{e} by
+1 then function @code{lst_to_clifford()} uses the following
+pseudo-vector representation: 
+@tex
+$v^0 {\bf 1} + v^1 e_0 + v^2 e_1 + ... + v^{n+1} e_n$
+@end tex
+@ifnottex
+@samp{v~0 ONE + v~1 e.0 + v~2 e.1 + ... + v~[n+1] e.n}
+@end ifnottex
+
+The previous code may be rewritten with the help of @code{lst_to_clifford()} as follows
 
 @example
 @{
@@ -3432,17 +3450,25 @@ $v = (v^0, v^1, ..., v^n)$
 @ifnottex
 @samp{v = (v~0, v~1, ..., v~n)} 
 @end ifnottex
-such that 
+such that the expression is either vector 
 @tex
 $e = v^0 c_0 + v^1 c_1 + ... + v^n c_n$
 @end tex
 @ifnottex
 @samp{e = v~0 c.0 + v~1 c.1 + ... + v~n c.n}
 @end ifnottex
-with respect to the given Clifford units @code{c} and with none of the
-@samp{v~k} containing Clifford units @code{c} (of course, this
+or pseudo-vector 
+@tex
+$v^0 {\bf 1} + v^1 e_0 + v^2 e_1 + ... + v^{n+1} e_n$
+@end tex
+@ifnottex
+@samp{v~0 ONE + v~1 e.0 + v~2 e.1 + ... + v~[n+1] e.n}
+@end ifnottex
+with respect to the given Clifford units @code{c}. Here none of the
+@samp{v~k} should contain Clifford units @code{c} (of course, this
 may be impossible). This function can use an @code{algebraic} method
-(default) or a symbolic one. With the @code{algebraic} method the @samp{v~k} are calculated as
+(default) or a symbolic one. With the @code{algebraic} method the
+@samp{v~k} are calculated as 
 @tex
 $(e c_k + c_k e)/c_k^2$. If $c_k^2$
 @end tex
@@ -4394,10 +4420,7 @@ This function returns @code{true} when the expression matches the pattern
 and @code{false} if it doesn't. If used in the second form, the actual
 subexpressions matched by the wildcards get returned in the @code{repls}
 object as a list of relations of the form @samp{wildcard == expression}.
-If @code{match()} returns false, the state of @code{repls} is undefined.
-For reproducible results, the list should be empty when passed to
-@code{match()}, but it is also possible to find similarities in multiple
-expressions by passing in the result of a previous match.
+If @code{match()} returns false,  @code{repls} remains unmodified.
 
 The matching algorithm works as follows:
 
@@ -7802,7 +7825,8 @@ Now we will start implementing a new class @code{mystring} that allows
 placing character strings in algebraic expressions (this is not very useful,
 but it's just an example). This class will be a direct subclass of
 @code{basic}. You can use this sample implementation as a starting point
-for your own classes.
+for your own classes @footnote{The self-contained source for this example is
+included in GiNaC, see the @file{doc/examples/mystring.cpp} file.}.
 
 The code snippets given here assume that you have included some header files
 as follows:
@@ -8529,7 +8553,12 @@ addition and multiplication, one container for exponentiation with base
 and exponent and some atomic leaves of symbols and numbers in this
 fashion:
 
+@ifnotinfo
 @image{repnaive}
+@end ifnotinfo
+@ifinfo
+<PICTURE MISSING>
+@end ifinfo
 
 @cindex pair-wise representation
 However, doing so results in a rather deeply nested tree which will
@@ -8540,7 +8569,12 @@ spirit we can store the multiplication as a sequence of terms, each
 having a numeric exponent and a possibly complicated base, the tree
 becomes much more flat:
 
+@ifnotinfo
 @image{reppair}
+@end ifnotinfo
+@ifinfo
+<PICTURE MISSING>
+@end ifinfo
 
 The number @code{3} above the symbol @code{d} shows that @code{mul}
 objects are treated similarly where the coefficients are interpreted as
@@ -8562,7 +8596,12 @@ $2d^3 \left( 4a + 5b - 3 \right)$:
 @math{2*d^3*(4*a+5*b-3)}:
 @end ifnottex
 
+@ifnotinfo
 @image{repreal}
+@end ifnotinfo
+@ifinfo
+<PICTURE MISSING>
+@end ifinfo
 
 @cindex radical
 This also allows for a better handling of numeric radicals, since