From 0025975e46fffba62c7b2b72f869b0bb1fe47e09 Mon Sep 17 00:00:00 2001 From: Christian Bauer Date: Fri, 12 Jul 2002 18:07:52 +0000 Subject: [PATCH] documentation update --- NEWS | 2 ++ doc/tutorial/ginac.texi | 15 +++++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/NEWS b/NEWS index 0e3d5bf3..54bc58db 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,8 @@ This file records noteworthy changes. 1.0.10 () * Powers of indexed objects are now parenthesized correctly in LaTeX output. +* Input parser handles indices (they have to be specified in the same list + as the symbols). 1.0.9 (11 June 2002) * simplify_indexed() now raises/lowers dummy indices to canonicalize the index diff --git a/doc/tutorial/ginac.texi b/doc/tutorial/ginac.texi index 241de676..14154336 100644 --- a/doc/tutorial/ginac.texi +++ b/doc/tutorial/ginac.texi @@ -4298,19 +4298,22 @@ and have the @samp{x} and @samp{y} correspond to the symbols @code{x} and desired symbols to the @code{>>} stream input operator. Instead, GiNaC lets you construct an expression from a string, specifying the -list of symbols to be used: +list of symbols and indices to be used: @example @{ - symbol x("x"), y("y"); - ex e("2*x+sin(y)", lst(x, y)); + symbol x("x"), y("y"), p("p"); + idx i(symbol("i"), 3); + ex e("2*x+sin(y)+p.i", lst(x, y, p, i)); @} @end example The input syntax is the same as that used by @command{ginsh} and the stream -output operator @code{<<}. The symbols in the string are matched by name to -the symbols in the list and if GiNaC encounters a symbol not specified in -the list it will throw an exception. +output operator @code{<<}. The symbols and indices in the string are matched +by name to the symbols and indices in the list and if GiNaC encounters a +symbol or index not specified in the list it will throw an exception. Only +indices whose values are single symbols can be used (i.e. numeric indices +or compound indices as in "A.(2*n+1)" are not allowed). With this constructor, it's also easy to implement interactive GiNaC programs: -- 2.44.0