]> www.ginac.de Git - ginac.git/blobdiff - ginsh/ginsh.1
- numeric::archive(): fixed a typo.
[ginac.git] / ginsh / ginsh.1
index 69c378307ab3c024347e7920c2e63f1cd91eca05..b84aca96700fe43c909330dc19a83aad187193ce 100644 (file)
@@ -1,8 +1,9 @@
-.TH ginsh 1 "October, 1999" "GiNaC"
+.TH ginsh 1 "January, 2000" "GiNaC"
 .SH NAME
 ginsh \- GiNaC Interactive Shell
 .SH SYNPOSIS
 .B ginsh
 .SH NAME
 ginsh \- GiNaC Interactive Shell
 .SH SYNPOSIS
 .B ginsh
+.RI [ file\&... ]
 .SH DESCRIPTION
 .B ginsh
 is an interactive frontend for the GiNaC symbolic computation framework.
 .SH DESCRIPTION
 .B ginsh
 is an interactive frontend for the GiNaC symbolic computation framework.
@@ -24,17 +25,23 @@ mathematical operators like
 .BR + " and  " * ,
 and functions (e.g.
 .BR sin " or " normal ).
 .BR + " and  " * ,
 and functions (e.g.
 .BR sin " or " normal ).
-ginsh will evaluate the expression and print the result to stdout. Every
-input expression must be terminated by a semicolon
-.RB ( ; ),
-and it is possible to enter multiple expressions on one line. Whitespace
-(spaces, tabs, newlines) can be applied freely between tokens. To quit ginsh,
-enter
+Every input expression must be terminated with either a semicolon
+.RB ( ; )
+or a colon
+.RB ( : ).
+If terminated with a semicolon, ginsh will evaluate the expression and print
+the result to stdout. If terminated with a colon, ginsh will only evaluate the
+expression but not print the result. It is possible to enter multiple
+expressions on one line. Whitespace (spaces, tabs, newlines) can be applied
+freely between tokens. To quit ginsh, enter
 .BR quit " or " exit ,
 or type an EOF (Ctrl-D) at the prompt.
 .BR quit " or " exit ,
 or type an EOF (Ctrl-D) at the prompt.
+.SS COMMENTS
+Anything following a double slash
+.RB ( // )
+up to the end of the line is treated as a comment and ignored.
 .SS NUMBERS
 .SS NUMBERS
-ginsh accepts numbers in all formats accepted by CLN (the Class Library for
-Numbers, that is the foundation of GiNaC's numerics). This includes arbitrary
+ginsh accepts numbers in the usual decimal notations. This includes arbitrary
 precision integers and rationals as well as floating point numbers in standard
 or scientific notation (e.g.
 .BR 1.2E6 ).
 precision integers and rationals as well as floating point numbers in standard
 or scientific notation (e.g.
 .BR 1.2E6 ).
@@ -42,6 +49,11 @@ The general rule is that if a number contains a decimal point
 .RB ( . ),
 it is an (inexact) floating point number; otherwise it is an (exact) integer or
 rational.
 .RB ( . ),
 it is an (inexact) floating point number; otherwise it is an (exact) integer or
 rational.
+Integers can be specified in binary, octal, hexadecimal or arbitrary (2-36) base
+by prefixing them with
+.BR #b ", " #o ", " #x ", or "
+.BI # n R
+, respectively.
 .SS SYMBOLS
 Symbols are made up of a string of alphanumeric characters and the underscore
 .RB ( _ ),
 .SS SYMBOLS
 Symbols are made up of a string of alphanumeric characters and the underscore
 .RB ( _ ),
@@ -78,11 +90,11 @@ Archimedes' Constant
 .B Catalan
 Catalan's Constant
 .TP
 .B Catalan
 Catalan's Constant
 .TP
-.B EulerGamma
+.B Euler
 Euler-Mascheroni Constant
 .TP
 .B I
 Euler-Mascheroni Constant
 .TP
 .B I
-(-1)^1/2
+sqrt(-1)
 .TP
 .B FAIL
 an object of the GiNaC "fail" class
 .TP
 .B FAIL
 an object of the GiNaC "fail" class
@@ -107,6 +119,7 @@ expression.
 ginsh provides the following operators, listed in falling order of precedence:
 .RS
 .TP 8m
 ginsh provides the following operators, listed in falling order of precedence:
 .RS
 .TP 8m
+\" GINSH_OP_HELP_START
 .B !
 postfix factorial
 .TP
 .B !
 postfix factorial
 .TP
@@ -154,6 +167,7 @@ not equal
 .TP
 .B =
 symbol assignment
 .TP
 .B =
 symbol assignment
+\" GINSH_OP_HELP_END
 .RE
 .PP
 All binary operators are left-associative, with the exception of
 .RE
 .PP
 All binary operators are left-associative, with the exception of
@@ -209,94 +223,130 @@ respective GiNaC methods of the same name, so I will not describe them in
 detail here. Please refer to the GiNaC documentation.
 .PP
 .RS
 detail here. Please refer to the GiNaC documentation.
 .PP
 .RS
-.BI beta( expression ", " expression )
-.br
+\" GINSH_FCN_HELP_START
 .BI charpoly( matrix ", " symbol )
 .BI charpoly( matrix ", " symbol )
+\- characteristic polynomial of a matrix
 .br
 .BI coeff( expression ", " symbol ", " number )
 .br
 .BI coeff( expression ", " symbol ", " number )
+\- extracts coefficient of symbol^number from a polynomial
 .br
 .BI collect( expression ", " symbol )
 .br
 .BI collect( expression ", " symbol )
+\- collects coefficients of like powers
 .br
 .BI content( expression ", " symbol )
 .br
 .BI content( expression ", " symbol )
+\- content part of a polynomial
 .br
 .BI degree( expression ", " symbol )
 .br
 .BI degree( expression ", " symbol )
+\- degree of a polynomial
 .br
 .BI denom( expression )
 .br
 .BI denom( expression )
+\- denominator of a rational function
 .br
 .BI determinant( matrix )
 .br
 .BI determinant( matrix )
+\- determinant of a matrix
 .br
 .BI diag( expression... )
 .br
 .BI diag( expression... )
+\- constructs diagonal matrix
 .br
 .BI diff( expression ", " "symbol [" ", " number] )
 .br
 .BI diff( expression ", " "symbol [" ", " number] )
+\- partial differentiation
 .br
 .BI divide( expression ", " expression )
 .br
 .BI divide( expression ", " expression )
+\- exact polynomial division
 .br
 .br
-.BI eval( "expression [" ", " number] )
+.BI eval( "expression [" ", " level] )
+\- evaluates an expression, replacing symbols by their assigned value
 .br
 .br
-.BI evalf( "expression [" ", " number] )
+.BI evalf( "expression [" ", " level] )
+\- evaluates an expression to a floating point number
 .br
 .BI expand( expression )
 .br
 .BI expand( expression )
+\- expands an expression
 .br
 .BI gcd( expression ", " expression )
 .br
 .BI gcd( expression ", " expression )
+\- greatest common divisor
 .br
 .BI has( expression ", " expression )
 .br
 .BI has( expression ", " expression )
+\- returns "1" if the first expression contains the second as a subexpression, "0" otherwise
 .br
 .BI inverse( matrix )
 .br
 .BI inverse( matrix )
+\- inverse of a matrix
 .br
 .BI is( relation )
 .br
 .BI is( relation )
-\- returns "1" if the
-.I relation
-is true, "0" otherwise (false or undecided)
+\- returns "1" if the relation is true, "0" otherwise (false or undecided)
 .br
 .BI lcm( expression ", " expression )
 .br
 .BI lcm( expression ", " expression )
+\- least common multiple
 .br
 .BI lcoeff( expression ", " symbol )
 .br
 .BI lcoeff( expression ", " symbol )
+\- leading coefficient of a polynomial
 .br
 .BI ldegree( expression ", " symbol )
 .br
 .BI ldegree( expression ", " symbol )
+\- low degree of a polynomial
 .br
 .br
-.BI lsolve( list ", " list )
+.BI lsolve( equation-list ", " symbol-list )
+\- solve system of linear equations
 .br
 .BI nops( expression )
 .br
 .BI nops( expression )
+\- number of operands in expression
 .br
 .br
-.BI normal( "expression [" ", " number] )
+.BI normal( "expression [" ", " level] )
+\- rational function normalization
 .br
 .BI numer( expression )
 .br
 .BI numer( expression )
+\- numerator of a rational function
 .br
 .BI op( expression ", " number )
 .br
 .BI op( expression ", " number )
+\- extract operand from expression
 .br
 .br
-.BI power( expression ", " expression )
+.BI power( expr1 ", " expr2 )
+\- exponentiation (equivalent to writing expr1^expr2)
 .br
 .BI prem( expression ", " expression ", " symbol )
 .br
 .BI prem( expression ", " expression ", " symbol )
+\- pseudo-remainder of polynomials
 .br
 .BI primpart( expression ", " symbol )
 .br
 .BI primpart( expression ", " symbol )
+\- primitive part of a polynomial
 .br
 .BI quo( expression ", " expression ", " symbol )
 .br
 .BI quo( expression ", " expression ", " symbol )
+\- quotient of polynomials
 .br
 .BI rem( expression ", " expression ", " symbol )
 .br
 .BI rem( expression ", " expression ", " symbol )
+\- remainder of polynomials
 .br
 .br
-.BI series( expression ", " "symbol [" ", " "number [" ", " number]] )
+.BI series( expression ", " relation-or-symbol ", " order )
+\- series expansion
 .br
 .BI sqrfree( expression ", " symbol )
 .br
 .BI sqrfree( expression ", " symbol )
+\- square-free factorization of a polynomial
 .br
 .BI sqrt( expression )
 .br
 .BI sqrt( expression )
+\- square root
 .br
 .BI subs( expression ", " relation-or-list )
 .br
 .br
 .BI subs( expression ", " relation-or-list )
 .br
-.BI subs( expression ", " list ", " list )
+.BI subs( expression ", " look-for-list ", " replace-by-list )
+\- substitute subexpressions
 .br
 .BI tcoeff( expression ", " symbol )
 .br
 .BI tcoeff( expression ", " symbol )
+\- trailing coefficient of a polynomial
 .br
 .BI time( expression )
 .br
 .BI time( expression )
-\- returns the time in seconds needed to evaluate the given
-.I expression
+\- returns the time in seconds needed to evaluate the given expression
 .br
 .BI trace( matrix )
 .br
 .BI trace( matrix )
+\- trace of a matrix
 .br
 .BI transpose( matrix )
 .br
 .BI transpose( matrix )
+\- transpose of a matrix
 .br
 .BI unassign( symbol )
 .br
 .BI unassign( symbol )
+\- unassign an assigned symbol
 .br
 .BI unit( expression ", " symbol )
 .br
 .BI unit( expression ", " symbol )
+\- unit part of a polynomial
+.br
+\" GINSH_FCN_HELP_END
 .RE
 .SS SPECIAL COMMANDS
 To exit ginsh, enter
 .RE
 .SS SPECIAL COMMANDS
 To exit ginsh, enter
@@ -308,6 +358,17 @@ or
 .B exit
 .RE
 .PP
 .B exit
 .RE
 .PP
+ginsh can display a (short) help for a given topic (mostly about functions
+and operators) by entering
+.RS
+.BI ? topic
+.RE
+Typing
+.RS
+.B ??
+.RE
+will display a list of available help topics.
+.PP
 The command
 .RS
 .BI print( expression );
 The command
 .RS
 .BI print( expression );
@@ -316,6 +377,14 @@ will print a dump of GiNaC's internal representation for the given
 .IR expression .
 This is useful for debugging and for learning about GiNaC internals.
 .PP
 .IR expression .
 This is useful for debugging and for learning about GiNaC internals.
 .PP
+The command
+.RS
+.BI iprint( expression );
+.RE
+prints the given
+.I expression
+(which must evaluate to an integer) in decimal, octal, and hexadecimal representations.
+.PP
 Finally, the shell escape
 .RS
 .B !
 Finally, the shell escape
 .RS
 .B !
@@ -361,6 +430,8 @@ x
 \-2*d\-2*x*c\-x^2*c\-x*d+x^2*d\-c
 > collect(", x);
 (\-d\-2*c)*x+(d\-c)*x^2\-2*d\-c
 \-2*d\-2*x*c\-x^2*c\-x*d+x^2*d\-c
 > collect(", x);
 (\-d\-2*c)*x+(d\-c)*x^2\-2*d\-c
+> solve quantum field theory;
+parse error at quantum
 > quit
 .fi
 .SH DIAGNOSTICS
 > quit
 .fi
 .SH DIAGNOSTICS
@@ -384,14 +455,14 @@ Christian Bauer <Christian.Bauer@uni-mainz.de>
 .br
 Alexander Frink <Alexander.Frink@uni-mainz.de>
 .br
 .br
 Alexander Frink <Alexander.Frink@uni-mainz.de>
 .br
-Richard B. Kreckel <Richard.Kreckel@uni-mainz.de>
+Richard Kreckel <Richard.Kreckel@uni-mainz.de>
 .SH SEE ALSO
 GiNaC Tutorial \- An open framework for symbolic computation within the
 C++ programming language
 .PP
 CLN \- A Class Library for Numbers, Bruno Haible
 .SH COPYRIGHT
 .SH SEE ALSO
 GiNaC Tutorial \- An open framework for symbolic computation within the
 C++ programming language
 .PP
 CLN \- A Class Library for Numbers, Bruno Haible
 .SH COPYRIGHT
-Copyright \(co 1999 Johannes Gutenberg Universit\(:at Mainz, Germany
+Copyright \(co 1999-2000 Johannes Gutenberg Universit\(:at Mainz, Germany
 
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by