]> www.ginac.de Git - ginac.git/blobdiff - cint/ginaccint.1
* basic::collec() never worked correctly on non-polynomials till now.
[ginac.git] / cint / ginaccint.1
index 7940a5c47b2d05174eeba9cbd3bc6521a3e141f8..e9ebd08afdb2aec180f8e40c8e637d8daa683cd8 100644 (file)
@@ -3,46 +3,78 @@
 GiNaC-cint \- An interactive interface for GiNaC based on the Cint C/C++ interpreter
 .SH SYNPOSIS
 .B ginaccint
+[file ...]
 .SH DESCRIPTION
 .B ginaccint
 is an interactive frontend for the GiNaC symbolic computation
-framework.  It is a tool that lets you write interactive programs in
-C++ that directly make use of GiNaC's classes and thus a more complete
-replacement for traditional interactive computer algebra systems than
-\fBginsh\fP(1) is.  Programs may be composed as scripts and later compiled
-with the native compiler and linked into the system.
+framework.  It is a tool that lets you write interactive programs
+(scripts) in C++ that directly make use of GiNaC's classes.  Thus it
+is a more complete replacement for traditional interactive computer
+algebra systems than \fBginsh\fP(1) is.  Programs may be composed as
+scripts and later compiled with the native compiler and linked into
+the system.
 .SH USAGE
 .SS INPUT FORMAT
-After startup, ginsh displays a prompt signifying that it is ready to
+After startup, GiNaC-cint reads and executes the files given as 
+command line arguments. If any of these files contains a
+.BR .quit
+command, GiNaC-cint exits at this point.
+Otherwise it displays a prompt signifying that it is ready to
 accept your input. All C++ statements are valid as input, extended by
 GiNaC's numeric or symbolic expressions.  E.g.
-.BR fibonacci(24)/1104;
+.BR fibonacci(numeric(24))/1104;
 returns a GiNaC object of class
-.BR ex,
-which in this case represents the numeric 42.  Symbols are declared by 
+.BR "ex" ,
+which in this case represents the numeric 42.  Symbols are declared by 
 statements as
 .nf 
 GiNaC> symbol x("x"), y("y"), z;
 .fi
 which defines two named symbols and an anonymous one for later usage.
-All GiNaC methods and functions are available as they would be typed
+All GiNaC methods and functions are available as they would be coded
 in C++.  It is not necessary to explicitly invoke a print command as
 the last expression is automatically printed:
 .nf
 GiNaC> pow(x+y,4).expand();
-out2 = x^4+4*x^3*y+6*x^2*y^2+4*x*y^3+y^4
+Out2 = x^4+4*x^3*y+6*x^2*y^2+4*x*y^3+y^4
 .fi
-Statements are generally closed by either when a closing brace 
+Statements are generally closed either when a closing brace 
 .RB ( } )
 matches the first opening brace
 .RB ( { ) 
 or a semicolon
 .RB ( ; )
-is encountered.
+is encountered while there are no open braces. This implies that
+an input like 
+.nf
+GiNaC> class A {
+     > }
+     > ;
+.fi
+is misinterpreted to be complete after the closing brace.
+Instead you have to write
+.nf
+GiNaC> class A {
+     > };
+.fi
 
 .SS SPECIAL COMMANDS
+
+Lines starting with a dot mark special GiNaC-cint commands. Instead of
+.BR "\fB.cmd\fB"
+you can also write
+.BR "\fB//GiNaC-cint.cmd\fB"
+to be compatible with programs that will be compiled later.
+This is mostly useful for the
+.BR "\fB.function\fB" 
+declaration.
+
+Lines starting with #! (for #!/path/ginaccint) are ignored.
+
+
 .IP "\fB.cint\fR"
-Switch to cint interactive mode.
+Switch to cint's interactive mode.
+
 .IP "\fB.function\fR"
 
 Allow a function definition in interactive mode.  GiNaC-cint must be
@@ -50,14 +82,50 @@ put into a special mode in order to define a function. After that any
 function definition in valid C++ syntax may be typed in.  It becomes
 immediatly available for usage.
 
-.IP "\fBquit;\fR"
-Exit from GiNaC-Cint.  Same as 
-.BR "exit;" ,
-.BR "bye;" ,
+.IP "\fB.help\fB"
+
+List a short summary of available commands.
+
+.IP "\fB.quit\fR"
+Exit from GiNaC-cint.  Same as 
+.BR ".bye" ,
+.BR ".exit" ,
 .BR ".q" ,
-.BR ".quit" ,
-.BR ".exit " or
-.BR ".bye" .
+.BR "bye;" ,
+.BR "exit; " or
+.BR "quit;" .
+
+.IP "\fB.read filename\fB"
+
+Read a file from disk and execute it in GiNaC-cint
+(recursive call is possible).
+
+.IP "\fB.redirect [filename]\fB"
+
+Redirect
+.BR "\fBOut\fP\fInum\fP" 
+output to a file (
+.BR .redirect
+alone redirects output to console).
+
+.IP "\fB.restart\fB"
+
+Restart GiNaC-cint (does not re-read command line files).      
+
+.IP "\fB.save filename\fB"
+
+Save the commands you have entered so far in a file.
+
+.IP "\fB.silent\fB"
+
+suppress
+.BR "\fBOut\fP\fInum\fP" 
+output (variables are still accessible).
+
+.IP "\fB.> [filename]\fB"
+
+same as
+.BR "\fB.redirect [filename]\fB" .
 
 .IP "\fBOut\fP\fInum\fP"
 Returns the expression whose output was marked
@@ -79,7 +147,7 @@ Out1 = -2*(1+x)^(-3)*(-2-x+x^2)+(-1+2*x)*(1+x)^(-2)
 GiNaC> s.normal();
 Out2 = (-2+x)*(1+x)^(-1)
 GiNaC> for (int i=2; i<20; i+=2) {
-     >     cout << "B(" << i << ")==" << bernoulli(i) << endl;
+     >     cout << "B(" << i << ")==" << bernoulli(numeric(i)) << endl;
      > }
 B(2)==1/6
 B(4)==-1/30
@@ -111,7 +179,7 @@ The GCD of -3+2*x*z*y+x^2*z^2*y^2 and 3-4*x*z*y+x^2*z^2*y^2
  is -1+x*z*y
  so (-3+2*x*z*y+x^2*z^2*y^2)*(3-4*x*z*y+x^2*z^2*y^2)^(-1)
  is (-3+x*z*y)^(-1)*(3+x*z*y)
-GiNaC> quit;
+GiNaC> .quit
 .fi
 
 .SH BUGS
@@ -125,6 +193,20 @@ you encounter as far as possible and contact Masaharu Goto
 <MXJ02154@niftyserve.or.jp> for Cint-related bugs and
 <ginac-bugs@ginac.de> for any bugs in the GiNaC engine.
 
+Only expressions (class
+.BR ex )
+are typed out and available through 
+.BR "\fBOut\fP\fInum\fP" 
+and 
+.BR LAST
+after declaring them.  This accounts for some funny behaviour, like
+.BR fibonacci(numeric(7))
+doesn't print, but
+.BR fibonacci(numeric(7))*1
+does, since this is not a naked number but an expression holding
+that number. A warning message is printed in this case only for
+the first occurence.
+
 .SH AUTHOR
 .TP
 The GiNaC Group
@@ -147,7 +229,7 @@ CLN \- A Class Library for Numbers, Bruno Haible
 \fBginsh\fP(1)
 .SH COPYRIGHT
 .SS GINAC COPYRIGHT
-Copyright \(co 1999-2000 Johannes Gutenberg Universit\(:at Mainz, Germany
+Copyright \(co 1999-2001 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
@@ -164,12 +246,16 @@ along with this program; if not, write to the Free Software
 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 .SS CINT COPYRIGHT
 Copyright \(co of Cint and associated tools are owned by Agilent
-Technologies Japan Company and the author.  Acknowledgement to the
-author by e-mail is recommended at installation.  Source code, binary
-executable or library of Cint and associated tools can be used,
-modified and distributed free of charge for any purpose provided that
-the copyright notice appear in all copies and that both that copyright
-notice and this permission notice appear in documentation.
-Registration is requested, at this moment, for commercial use.  Send
-e-mail to the author <MXJ02154@niftyserve.or.jp>.  The registration is
-free.
+Technologies Japan Company and the author (Masaharu Goto).  Source
+code, binary executable or library of Cint and associated tools can be
+used, modified and distributed with no royalty for any purpose
+provided that the copyright notice appear in all copies and that both
+that copyright notice and this permission notice appear in supporting
+documentation.  Registration is recommended for commercial use
+(=Selling a software that uses cint as a component).  Send e-mail to
+the author (MXJ02154@niftyserve.or.jp) with your name, e-mail address,
+institute, purpose of using cint and computer platform.  If a
+modification is made on any of the source or documentation, it has to
+be clearly documented and expressed.  Agilent Technologies Japan and
+the author make no representations about the suitability of this
+software for any purpose.