<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
<!ENTITY app "<application>Genius Mathematics Tool</application>">
<!ENTITY appname "Genius">
<!ENTITY appversion "1.0.17">
<!ENTITY date "June 2013">
<!ENTITY legal SYSTEM "legal.xml">
<!ENTITY manrevision "0.2">
<!ENTITY gt "&#62;">
<!ENTITY le "&#8804;">
<!ENTITY ge "&#8805;">
<!ENTITY lsquo "&#8216;">
<!ENTITY rsquo "&#8217;">
<!--<!ENTITY gel-function-list SYSTEM "gel-function-list.xml">-->]>
<!-- 
      (Do not remove this comment block.)
  Maintained by the GNOME Documentation Project
  http://developer.gnome.org/projects/gdp
  Template version: 2.0 beta
  Template last modified Apr 11, 2002
-->
<!-- =============Document Header ============================= -->
<book id="index" lang="fr">
<!-- please do not change the id; for translations, change lang to -->
<!-- appropriate code -->
  <bookinfo>
	  <abstract role="description"><para>Manuel de l'Outil de maths Genius.</para></abstract>
    <title>Manuel de Genius</title>       

    <copyright>
      <year>1997-2013</year>
      <holder>Jiří (George) Lebl</holder>
    </copyright>
    <copyright>
      <year>2004</year>
      <holder>Kai Willadsen</holder>
    </copyright><copyright><year>2010-11</year><holder>Bruno Brouard (annoa.b@gmail.com)</holder></copyright><copyright><year>2011</year><holder>Luc Pionchon (pionchon.luc@gmail.com)</holder></copyright>
<!-- translators: uncomment this:
  <copyright>
   <year>2002</year>
   <holder>ME-THE-TRANSLATOR (Latin translation)</holder>
  </copyright>
-->

    <publisher> 
      <publishername/> 
    </publisher> 

   
   <!-- This file  contains link to license for the documentation (GNU FDL), and 
        other legal stuff such as "NO WARRANTY" statement. Please do not change 
	any of this. -->

    <authorgroup> 
      <author role="maintainer"> 
		<firstname>Jiří</firstname> 
		<surname>Lebl</surname> 
		<affiliation> 
	  		<orgname>University of Wisconsin-Madison</orgname> 
	  		<address> <email>jirka@5z.com</email> </address> 
		</affiliation> 
      </author> 
      <author> 
		<firstname>Kai</firstname> 
		<surname>Willadsen</surname> 
		<affiliation> 
	  		<orgname>University of Queensland, Australia</orgname> 
	  		<address> <email>kaiw@itee.uq.edu.au</email> </address> 
		</affiliation> 
      </author> 
      
<!-- This is appropriate place for other contributors: translators,
     maintainers,  etc. Commented out by default.
     
      <othercredit role="translator">
		<firstname>Latin</firstname> 
		<surname>Translator 1</surname> 
		<affiliation> 
	  		<orgname>Latin Translation Team</orgname> 
	  		<address> <email>translator@gnome.org</email> </address> 
		</affiliation>
		<contrib>Latin translation</contrib>
      </othercredit>
-->
    </authorgroup>


<!-- According to GNU FDL, revision history is mandatory if you are -->
<!-- modifying/reusing someone else's document.  If not, you can omit it. -->
<!-- Remember to remove the &manrevision; entity from the revision entries other
-->
<!-- than the current revision. -->
<!-- The revision numbering system for GNOME manuals is as follows: -->
<!-- * the revision number consists of two components -->
<!-- * the first component of the revision number reflects the release version of the GNOME desktop. -->
<!-- * the second component of the revision number is a decimal unit that is incremented with each revision of the manual. -->
<!-- For example, if the GNOME desktop release is V2.x, the first version of the manual that -->
<!-- is written in that desktop timeframe is V2.0, the second version of the manual is V2.1, etc. -->
<!-- When the desktop release version changes to V3.x, the revision number of the manual changes -->
<!-- to V3.0, and so on. -->  
<!--  This is unmaintained quite a bit so screw this it just makes things
      ugly and we don't update the manrevision stuff anyway
    <revhistory>
      <revision> 
		<revnumber>&manrevision;</revnumber> 
		<date>&date;</date> 
		<revdescription> 
	  		<para role="author">Jiri (George) Lebl
	    	<email>jirka@5z.com</email>
	  		</para>
		</revdescription> 
      </revision> 
      <revision> 
		<revnumber>0.1</revnumber> 
		<date>September 2004</date> 
		<revdescription> 
	  		<para role="author">Kai Willadsen
	    	<email>kaiw@itee.uq.edu.au</email>
	  		</para>
		</revdescription> 
      </revision> 
      <revision> 
		<revnumber>Genius Calculator Manual</revnumber> 
		<date>August 2004</date> 
		<revdescription> 
	  		<para role="author">Jiri (George) Lebl
	    	<email>jirka@5z.com</email>
	  		</para>
		</revdescription> 
      </revision> 
    </revhistory> 
-->

    <revhistory>
      <revision> 
		<revnumber>0.2</revnumber> 
		<date>June 2013</date> 
		<revdescription> 
	  		<para role="author">Jiri (George) Lebl
	    	<email>jirka@5z.com</email>
	  		</para>
		</revdescription> 
      </revision> 
    </revhistory>
    <releaseinfo>This manual describes version 1.0.17 of Genius.
    </releaseinfo> 
    <legalnotice> 
      <title>Feedback</title> 
      <para>To report a bug or make a suggestion regarding the <application>Genius Mathematics Tool</application> application or
      this manual, follow the directions in the <ulink url="ghelp:gnome-feedback" type="help">GNOME Feedback Page</ulink>. 
      </para>
<!-- Translators may also add here feedback address for translations -->
    </legalnotice> 
  </bookinfo> 

<!-- ============= Introduction =============================== -->
  <chapter id="genius-introduction"> 
    <title>Introduction</title> 
    <para>
	The <application>Genius Mathematics Tool</application> application is a general calculator for use as a desktop
	calculator, an educational tool in mathematics, and is useful even for
	research.  The language used in <application>Genius Mathematics Tool</application> is designed to be
	‘mathematical’ in the sense that it should be ‘what
	you mean is what you get’.  Of course that is not an
	entirely attainable goal.  <application>Genius Mathematics Tool</application> features rationals, arbitrary
	precision integers and multiple precision floats using the GMP library.
	It handles complex numbers using cartesian notation.  It has good
	vector and matrix manipulation and can handle basic linear algebra.
	The programming language allows user defined functions, variables and
	modification of parameters.
    </para> 

    <para>
	<application>Genius Mathematics Tool</application> comes in two versions.  One version is the graphical GNOME
	version, which features an IDE style interface and the ability 
	to plot functions of one or two variables.
	The command line version does not require GNOME, but of course
	does not implement any feature that requires the graphical interface.
    </para> 

    <para>
	This manual describes mostly the graphical version of the calculator,
	but the language is of course the same.  The command line only version
	lacks the graphing capabilities and all other capabilities that require
	the graphical user interface.
    </para>

  </chapter>

<!-- =========== Getting Started ============================== -->
  <chapter id="genius-getting-started"> 
    <title>Premiers pas</title> 

    <sect1 id="genius-to-start">
      <title>To Start <application>Genius Mathematics Tool</application></title>
      <para>You can start <application><application>Genius Mathematics Tool</application></application> in the following ways:
      </para> 
      <variablelist>
        <varlistentry>
          <term><guimenu>Applications</guimenu> menu</term>
          <listitem>
	    <para>
	      Depending on your operating system and version, the
	      menu item for <application>Genius Mathematics Tool</application> could appear in a number of different
	      places.  It can be in the 
              <guisubmenu>Education</guisubmenu>, 
              <guisubmenu>Accessories</guisubmenu>, 
              <guisubmenu>Office</guisubmenu>, 
              <guisubmenu>Science</guisubmenu>, or
	      similar submenu, depending on your particular setup.
	      The menu item name you are looking for is
	      <guimenuitem>Genius Math Tool</guimenuitem>.  Once you locate
	      this menu item click on it to start <application>Genius Mathematics Tool</application>.
            </para>
	      </listitem>
        </varlistentry>
        <varlistentry>
          <term><guilabel>Run</guilabel> dialog</term>
          <listitem>
	    <para>
	      Depending on your system installation the menu item 
	      may not be available.  If it is not, you can open the Run dialog
              and execute <command>gnome-genius</command>.
            </para>
	      </listitem>
        </varlistentry>
        <varlistentry>
    	  <term>Command line</term>
    	  <listitem>
    	    <para>
	      To start the GNOME version of <application>Genius Mathematics Tool</application> execute
	      <command>gnome-genius</command> from the command line.
	    </para>
	    <para>
	      To start the command line only version,
              execute the following command: <command>genius</command>.
	      This version does not include the graphical environment
	      and some functionality such as plotting will not be available.
            </para> 
          </listitem>
        </varlistentry>
      </variablelist>
    </sect1>

    <sect1 id="genius-when-start">
    <title>When You Start Genius</title>
      <para>When you start the GNOME edition of
	    <application>Genius Mathematics Tool</application>, the window pictured in <xref linkend="mainwindow-fig"/> is displayed.</para>

      <figure id="mainwindow-fig"> 
        <title><application>Genius Mathematics Tool</application> Window</title> 
        <screenshot> 
          <mediaobject> 
            <imageobject>
              <imagedata fileref="figures/genius_window.png" format="PNG" scalefit="1"/> 
            </imageobject>
            <textobject> 
	      <phrase>Shows <application>Genius Mathematics Tool</application> main window. Contains titlebar, menubar,
toolbar and working area. Menubar contains <guilabel>File</guilabel>,
<guilabel>Edit</guilabel>, <guilabel>Calculator</guilabel>,
<guilabel>Settings</guilabel>, and <guilabel>Help</guilabel> menus.</phrase> 
            </textobject> 
          </mediaobject>
        </screenshot> 
      </figure>

      <para>The <application>Genius Mathematics Tool</application> window contains the following elements:
      </para>
      <variablelist>
        <varlistentry>
          <term>Menubar.</term>
          <listitem>
            <para>The menus on the menubar contain all of the commands that you need to work with files in <application>Genius Mathematics Tool</application>.
	     The <guilabel>File</guilabel> menu contains items for loading and saving items and creating
	     new programs.  The <guilabel>Load and Run...</guilabel> command does not open a new window for
	     the program, but just executes the program directly.  It is equivalent to the <command>load</command>
	     command.</para>
	    <para>
		The <guilabel>Calculator</guilabel> menu controls the
calculator engine.  It allows you to run the currently selected program or to
interrupt the current calculation.  You can also look at the full expression of
the last answer (useful if the last answer was too large to fit onto the
console), or you can view a listing of the values of all user defined
variables.  Finally it allows plotting functions using a user friendly dialog box.
	   </para>
	   <para>
	    The other menus have same familiar functions as in other applications.
	   </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>Toolbar.</term>
          <listitem>
            <para>The toolbar contains a subset of the commands that you can access from the menubar.</para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term>Working area</term>
          <listitem>
            <para>
		The working area is the primary method of interacting with
		the application.
	    </para>
	    <para>
	    	The working area initially has just the <guilabel>Console</guilabel> tab which is
		the main way of interacting with the calculator.  Here you
		type expressions and the results are immediately returned
		after you hit the Enter key.
	    </para>
	    <para>
	    	Alternatively you can write longer programs and those can
		appear in separate tabs and can be stored in files for later
		retrieval.
	    </para>
          </listitem>
        </varlistentry>
      </variablelist>
    </sect1>

  </chapter>

<!-- ================ Usage =================================== -->
  <chapter id="genius-usage"> 
    <title>Utilisation de base</title> 

    <sect1 id="genius-usage-workarea"> 
      <title>Using the Work Area</title> 

      <para>
        Normally you interact with the calculator in the <guilabel>Console</guilabel> tab of the
	work area.  If you are running the text only version then the console
	will be the only thing that is available to you.  If you want to use
	<application>Genius Mathematics Tool</application> as a calculator only, just type in your expression here and it
	will be evaluated.
      </para>

      <para>
	Type your expression into the <guilabel>Console</guilabel> work area and press enter and
	the expression will be evaluated.  Expressions are written in a
language called GEL.  The most simple GEL expression just looks like
mathematics.  For example
<screen><prompt>genius&gt; </prompt><userinput>30*70 + 67^3.0 + ln(7) * (88.8/100)</userinput>
</screen>
or
<screen><prompt>genius&gt; </prompt><userinput>62734 + 812634 + 77^4 mod 5</userinput>
</screen>
or
<screen><prompt>genius&gt; </prompt><userinput>| sin(37) - e^7 |</userinput>
</screen>
or
<screen><prompt>genius&gt; </prompt><userinput>sum n=1 to 70 do 1/n</userinput>
</screen>
(Last is the harmonic sum from 1 to 70)
</para>
<para>
To get a list of functions and commands, type:
<screen><prompt>genius&gt; </prompt><userinput>help</userinput>
</screen>
If you wish to get more help on a specific function, type:
<screen><prompt>genius&gt; </prompt><userinput>help FunctionName</userinput>
</screen>
To view this manual, type:
<screen><prompt>genius&gt; </prompt><userinput>manual</userinput>
</screen>
</para>
<para>
Suppose you have previously saved some GEL commands as a program to a file and
you now want to execute them.
To load this program from the file <filename>path/to/program.gel</filename>,
type
<screen><prompt>genius&gt; </prompt><userinput>load path/to/program.gel</userinput>
</screen>
<application>Genius Mathematics Tool</application> keeps track of the current directory.
To list files in the current directory type <command>ls</command>, to change directory
do <userinput>cd directory</userinput> as in the unix command shell.
</para>
    </sect1>

    <sect1 id="genius-usage-create-program"> 
      <title>To Create a New Program </title> 
      <para>
To start writing a new program, choose
<menuchoice><guimenu>File</guimenu><guimenuitem>New
Program</guimenuitem></menuchoice>. A new tab will appear in the work area. You
can write a <link linkend="genius-gel">GEL</link> program in this work area.
Once you have written your program you can run it by 
<menuchoice><guimenu>Calculator</guimenu><guimenuitem>Run</guimenuitem></menuchoice>.
This will execute your program and will display any output on the <guilabel>Console</guilabel> tab.
Executing a program is equivalent of taking the text of the program and
typing it into the console.  The only difference is that this input is done
independent of the console and just the output goes onto the console.
<menuchoice><guimenu>Calculator</guimenu><guimenuitem>Run</guimenuitem></menuchoice>
will always run the currently selected program even if you are on the <guilabel>Console</guilabel>
tab.  The currently selected program has its tab in bold type.  To select a
program, just click on its tab.
      </para>
      <para>
To save the program you've just written, choose <menuchoice><guimenu>File</guimenu><guimenuitem>Save As...</guimenuitem></menuchoice>
      </para>
    </sect1>

    <sect1 id="genius-usage-open-program"> 
      <title>To Open and Run a Program </title> 
      <para>
To open a file, choose
<menuchoice><guimenu>File</guimenu><guimenuitem>Open</guimenuitem></menuchoice>.
A new tab containing the file will appear in the work area. You can use this to
edit the file.
      </para>
      <para>
To run a program from a file, choose
<menuchoice><guimenu>File</guimenu><guimenuitem>Load and
Run...</guimenuitem></menuchoice>.  This will run the program without opening it
in a separate tab.  This is equivalent to the <command>load</command> command.
      </para>
    </sect1>

  </chapter>

  <!-- ============= Plotting ============================== -->
  <chapter id="genius-gel-plotting">
    <title>Tracé de graphiques</title>

    <para>
      Plotting support is only available in the graphical GNOME version.
      All plotting accessible from the graphical interface is available from
      the <guilabel>Create Plot</guilabel> window.  You can access this window by either clicking
      on the <guilabel>Plot</guilabel> button on the toolbar or selecting <guilabel>Plot</guilabel> from the <guilabel>Calculator</guilabel>
      menu.  You can also access the plotting functionality by using the
      <link linkend="genius-gel-function-list-plotting">plotting
      functions</link> of the GEL language.  See 
      <xref linkend="genius-gel"/> to find out how to
      enter expressions that Genius understands.
    </para>

    <sect1 id="genius-line-plots">
      <title>Line Plots</title>
      <para>
	To graph real valued functions of one variable open the <guilabel>Create Plot</guilabel>
	window.  You can also use the
        <link linkend="gel-function-LinePlot"><function>LinePlot</function></link> function
	on the command line (see its documentation).
      </para>
      <para>
	Once you click the <guilabel>Plot</guilabel> button, a window opens up with some notebooks in it.
	You want to be in the <guilabel>Function line plot</guilabel> notebook
tab, and inside you want to be on the <guilabel>Functions / Expressions</guilabel> notebook tab.
See <xref linkend="lineplot-fig"/>.
      </para>

      <figure id="lineplot-fig"> 
        <title>Create Plot Window</title> 
        <screenshot> 
          <mediaobject> 
            <imageobject>
              <imagedata fileref="figures/line_plot.png" format="PNG" scalefit="1"/> 
            </imageobject>
            <textobject> 
              <phrase>Shows the line plotting window.</phrase> 
            </textobject> 
          </mediaobject> 
        </screenshot> 
      </figure>

      <para>
	Type expressions with <userinput>x</userinput> as
	the independent variable into the textboxes.  Alternatively you can give names of functions such as
	<userinput>cos</userinput> rather then having to type <userinput>cos(x)</userinput>.
	You can graph up to ten functions.  If you make a mistake and Genius cannot
	parse the input it will signify this with a warning icon on the right of the text
	input box where the error occurred, as well as giving you an error dialog.
	You can change the ranges of the dependent and independent variables in the bottom
	part of the dialog.
	The <varname>y</varname> (dependent) range can be set automatically by turning on the <guilabel>Fit dependent axis</guilabel>
	checkbox.
	The names of the variables can also be changed.
	Pressing the <guilabel>Plot</guilabel> button produces the graph shown in <xref linkend="lineplot2-fig"/>.
      </para>

      <figure id="lineplot2-fig"> 
        <title>Plot Window</title> 
        <screenshot> 
          <mediaobject> 
            <imageobject>
              <imagedata fileref="figures/line_plot_graph.png" format="PNG" scalefit="1"/> 
            </imageobject>
            <textobject> 
              <phrase>The graph produced.</phrase> 
            </textobject> 
          </mediaobject> 
        </screenshot> 
      </figure>

      <para>
	From here you can print out the plot, create encapsulated postscript
	or a PNG version of the plot or change the zoom.  If the dependent axis was
	not set correctly you can have Genius fit it by finding out the extrema of
	the graphed functions.
      </para>

      <para>
	For plotting using the command line see the documentation of the
        <link linkend="gel-function-LinePlot"><function>LinePlot</function></link> function.
      </para>
    </sect1>

    <sect1 id="genius-parametric-plots">
      <title>Parametric Plots</title>
      <para>
	In the create plot window, you can also choose the <guilabel>Parametric</guilabel> notebook
        tab to create two dimensional parametric plots.  This way you can
	plot a single parametric function.  You can either specify the
	points as <varname>x</varname> and <varname>y</varname>, or giving a single complex number
	as a function of the variable <varname>t</varname>.
	The range of the variable <varname>t</varname> is given explicitly, and the function is sampled
	according to the given increment.
	The <varname>x</varname> and <varname>y</varname> range can be set
	automatically by turning on the <guilabel>Fit dependent axis</guilabel>
	checkbox, or it can be specified explicitly.
	See <xref linkend="paramplot-fig"/>.
      </para>

      <figure id="paramplot-fig"> 
        <title>Parametric Plot Tab</title> 
        <screenshot> 
          <mediaobject> 
            <imageobject>
              <imagedata fileref="figures/parametric.png" format="PNG" scalefit="1"/> 
            </imageobject>
            <textobject> 
              <phrase>Parametric plotting tab in the <guilabel>Create Plot</guilabel> window.</phrase> 
            </textobject> 
          </mediaobject> 
        </screenshot> 
      </figure>

      <para>
	An example of a parametric plot is given in
	<xref linkend="paramplot2-fig"/>.
	Similar operations can be
	done on such graphs as can be done on the other line plots.
	For plotting using the command line see the documentation of the
        <link linkend="gel-function-LinePlotParametric"><function>LinePlotParametric</function></link> or
        <link linkend="gel-function-LinePlotCParametric"><function>LinePlotCParametric</function></link> function.
      </para>

      <figure id="paramplot2-fig"> 
        <title>Parametric Plot</title> 
        <screenshot> 
          <mediaobject> 
            <imageobject>
              <imagedata fileref="figures/parametric_graph.png" format="PNG" scalefit="1"/> 
            </imageobject>
            <textobject> 
              <phrase>Parametric plot produced</phrase> 
            </textobject> 
          </mediaobject> 
        </screenshot> 
      </figure>

    </sect1>

    <sect1 id="genius-slopefield-plots">
      <title>Slopefield Plots</title>
      <para>
	In the create plot window, you can also choose the <guilabel>Slope field</guilabel> notebook
        tab to create a two dimensional slope field plot.
	Similar operations can be
	done on such graphs as can be done on the other line plots.
	For plotting using the command line see the documentation of the
        <link linkend="gel-function-SlopefieldPlot"><function>SlopefieldPlot</function></link> function.
      </para>

      <para>
	When a slope field is active, there is an extra <guilabel>Solver</guilabel> menu available,
	through which you can bring up the solver dialog.  Here you can have Genius plot specific
	solutions for the given initial conditions.  You can either specify initial conditions in the dialog,
	or you can click on the plot directly to specify the initial point.  While the solver dialog
	is active, the zooming by clicking and dragging does not work.  You have to close the dialog first
	if you want to zoom using the mouse.
      </para>

      <para>
	The solver uses the standard Runge-Kutta method.
	The plots will stay on the screen until cleared.  The solver will stop whenever it reaches the boundary
	of the plot window.  Zooming does not change the limits or parameters of the solutions,
	you will have to clear and redraw them with appropriate parameters.
	You can also use the
        <link linkend="gel-function-SlopefieldDrawSolution"><function>SlopefieldDrawSolution</function></link>
	function to draw solutions from the command line or programs.  
      </para>

    </sect1>

    <sect1 id="genius-vectorfield-plots">
      <title>Vectorfield Plots</title>
      <para>
	In the create plot window, you can also choose the <guilabel>Vector field</guilabel> notebook
        tab to create a two dimensional vector field plot.
	Similar operations can be
	done on such graphs as can be done on the other line plots.
	For plotting using the command line see the documentation of the
        <link linkend="gel-function-VectorfieldPlot"><function>VectorfieldPlot</function></link> function.
      </para>

      <para>
	By default the direction and magnitude of the vector field is shown.
	To only show direction and not the magnitude, check the appropriate
	checkbox to normalize the arrow lengths.
      </para>

      <para>
	When a vector field is active, there is an extra <guilabel>Solver</guilabel> menu available,
	through which you can bring up the solver dialog.  Here you can have Genius plot specific
	solutions for the given initial conditions.  You can either specify initial conditions in the dialog,
	or you can click on the plot directly to specify the initial point.  While the solver dialog
	is active, the zooming by clicking and dragging does not work.  You have to close the dialog first
	if you want to zoom using the mouse.
      </para>

      <para>
	The solver uses the standard Runge-Kutta method.
	The plots will stay on the screen until cleared.
	Zooming does not change the limits or parameters of the solutions,
	you will have to clear and redraw them with appropriate parameters.
	You can also use the
        <link linkend="gel-function-VectorfieldDrawSolution"><function>VectorfieldDrawSolution</function></link>
	function to draw solutions from the command line or programs.  
      </para>

    </sect1>

    <sect1 id="genius-surface-plots">
      <title>Surface Plots</title>
      <para>
	Genius can also plot surfaces.  Select the <guilabel>Surface plot</guilabel> tab in the
	main notebook of the <guilabel>Create Plot</guilabel> window.  Here you can specify a single
	expression which should use either <varname>x</varname> and <varname>y</varname> as real independent variables
	or <varname>z</varname> as a complex variable (where <varname>x</varname> is the real part of <varname>z</varname> and <varname>y</varname> is the
	imaginary part).  For example to plot the modulus of the cosine
	function for complex parameters,
	you could enter <userinput>|cos(z)|</userinput>.  This would be
	equivalent to <userinput>|cos(x+1i*y)|</userinput>.
	See <xref linkend="surfaceplot-fig"/>.
	For plotting using the command line see the documentation of the
        <link linkend="gel-function-SurfacePlot"><function>SurfacePlot</function></link> function.
      </para>
      <para>
	      The <varname>z</varname> range can be set automatically by turning on the <guilabel>Fit dependent axis</guilabel>
	      checkbox.
      </para>

      <figure id="surfaceplot-fig"> 
        <title>Surface Plot</title> 
        <screenshot> 
          <mediaobject> 
            <imageobject>
              <imagedata fileref="figures/surface_graph.png" format="PNG" scalefit="1"/> 
            </imageobject>
            <textobject> 
              <phrase>Modulus of the complex cosine function.</phrase> 
            </textobject> 
          </mediaobject> 
        </screenshot> 
      </figure>

    </sect1>

  </chapter>

  <!-- ============= GEL ====================================== -->
  <chapter id="genius-gel"> 
    <title>Fondamentaux GEL</title> 

	<para>
	  GEL stands for Genius Extension Language.  <!-- Alternatively it also
	  stands for George's Ego Leverage. -->  It is the language you use
	  to write programs in Genius. A program in GEL is simply an
	  expression that evaluates to a number.
	  <application>Genius Mathematics Tool</application> can be used as a simple calculator, or as a
	  powerful theoretical research tool.  The syntax is meant to
	  have as shallow of a learning curve as possible, especially for use
	  as a calculator.
	</para>

    <sect1 id="genius-gel-values">
      <title>Values</title>

      <para>
Values in GEL can be <link linkend="genius-gel-values-numbers">numbers</link>, <link linkend="genius-gel-values-booleans">Booleans</link> or <link linkend="genius-gel-values-strings">strings</link>. Values can be used in calculations, assigned to variables and returned from functions, among other uses.
      </para>

      <sect2 id="genius-gel-values-numbers">
        <title>Numbers</title>
        <para>
Integers are the first type of number in GEL. Integers are written in the normal way.
<programlisting>1234
</programlisting>
Hexadecimal and octal numbers can be written using C notation. For example:
<programlisting>0x123ABC
01234
</programlisting>
Or you can type numbers in an arbitrary base using <literal>&lt;base&gt;\&lt;number&gt;</literal>. Digits higher than 10 use letters in a similar way to hexadecimal. For example, a number in base 23 could be written:
<programlisting>23\1234ABCD
</programlisting>
        </para>

        <para>
The second type of GEL number is rationals. Rationals are simply achieved by dividing two integers. So one could write:
<programlisting>3/4
</programlisting>
to get three quarters. Rationals also accept mixed fraction notation. So in order to get one and three tenths you could write:
<programlisting>1 3/10
</programlisting>
        </para>

        <para>
The next type if number is floating point. These are entered in a similar fashion to C notation. You can use <literal>E</literal>, <literal>e</literal> or <literal>@</literal> as the exponent delimiter. Note that using the exponent delimiter gives a float even if there is no decimal point in the number. Examples:
<programlisting>1.315
7.887e77
7.887e-77
.3
0.3
77e5
</programlisting>
	When Genius prints a floating point number it will always append a
	<computeroutput>.0</computeroutput> even if the number is whole.  This is to indicate that
	floating point numbers are taken as imprecise quantities.  When a number is written in the
	scientific notation, it is always a floating point number and thus Genius does not
	print the <computeroutput>.0</computeroutput>.
        </para>

        <para>
The final type of number in gel is the complex numbers. You can enter a complex number as a sum of real and imaginary parts. To add an imaginary part, append an <literal>i</literal>.  Here are examples of entering complex numbers:
<programlisting>1+2i
8.01i
77*e^(1.3i)
</programlisting>
        </para>

        <important>
          <para>
When entering imaginary numbers, a number must be in front of the <literal>i</literal>. If you use <literal>i</literal> by itself, Genius will interpret this as referring to the variable <varname>i</varname>. If you need to refer to <literal>i</literal> by itself, use <literal>1i</literal> instead.
          </para>

          <para>
In order to use mixed fraction notation with imaginary numbers you must have the mixed fraction in parentheses. (i.e., <userinput>(1 2/5)i</userinput>)
          </para>
        </important>

      </sect2>


      <sect2 id="genius-gel-values-booleans">
        <title>Booleans</title>
        <para>
Genius also supports native Boolean values. The two Boolean constants are
defined as <constant>true</constant> and <constant>false</constant>; these
identifiers can be used like any other variable. You can also use the
identifiers <constant>True</constant>, <constant>TRUE</constant>,
<constant>False</constant> and <constant>FALSE</constant> as aliases for the
above.
        </para>
        <para>
At any place where a Boolean expression is expected, you can use a Boolean
value or any expression that produces either a number or a Boolean. If
Genius needs to evaluate a number as a Boolean it will interpret
0 as <constant>false</constant> and any other number as
<constant>true</constant>.
         </para>
        <para>
In addition, you can do arithmetic with Boolean values. For example:
<programlisting>( (1 + true) - false ) * true
</programlisting>
is the same as:
<programlisting>( (true or true) or not false ) and true
</programlisting>
Only addition, subtraction and multiplication are supported. If you mix numbers with Booleans in an expression then the numbers are converted to Booleans as described above. This means that, for example:
<programlisting>1 == true
</programlisting>
always evaluates to <constant>true</constant> since 1 will be converted to <constant>true</constant> before being compared to <constant>true</constant>.
        </para>
      </sect2>


      <sect2 id="genius-gel-values-strings">
        <title>Strings</title>
        <para>
Like numbers and Booleans, strings in GEL can be stored as values inside variables and passed to functions. You can also concatenate a string with another value using the plus operator. For example:
<programlisting>a=2+3;"The result is: "+a
</programlisting>
will create the string:
<programlisting>The result is: 5
</programlisting>
You can also use C-like escape sequences such as <literal>\n</literal>,<literal>\t</literal>,<literal>\b</literal>,<literal>\a</literal> and <literal>\r</literal>. To get a <literal>\</literal> or <literal>"</literal> into the string you can quote it with a <literal>\</literal>. For example:
<programlisting>"Slash: \\ Quotes: \" Tabs: \t1\t2\t3"
</programlisting>
will make a string:
<programlisting>Slash: \ Quotes: " Tabs: 	1	2	3
</programlisting>
        </para>
        <para>
In addition, you can use the library function <function>string</function> to convert anything to a string. For example:
<programlisting>string(22)
</programlisting>
will return
<programlisting>"22"
</programlisting>
Strings can also be compared with <literal>==</literal> (equal), <literal>!=</literal> (not equal) and <literal>&lt;=&gt;</literal> (comparison) operators
        </para>
      </sect2>


      <sect2 id="genius-gel-values-null">
        <title>Null</title>
        <para>
There is a special value called
<constant>null</constant>. No operations can be performed on
it, and nothing is printed when it is returned. Therefore,
<constant>null</constant> is useful when you do not want output from an
expression.  The value <constant>null</constant> can be obtained as an expression when you
type <literal>.</literal>, the contant <constant>null</constant> or nothing.
By nothing we mean that if you end an expression with
a separator <literal>;</literal>, it is equivalent to ending it with a
separator followed by a <constant>null</constant>.
        </para>
        <para>
Example:
<programlisting>x=5;.
x=5;
</programlisting>
        </para>
<para>
Some functions return <constant>null</constant> when no value can be returned
or an error happened.  Also <constant>null</constant> is used as an empty vector
or matrix, or an empty reference.
</para>
      </sect2>

    </sect1>

    <sect1 id="genius-gel-variables">
      <title>Using Variables</title>

      <para>
Syntax:
<programlisting>VariableName
</programlisting>
Example:
<screen><prompt>genius&gt; </prompt><userinput>e</userinput>
= 2.71828182846
</screen>
      </para>

      <para>
To evaluate a variable by itself, just enter the name of the variable. This will return the value of the variable. You can use a variable anywhere you would normally use a number or string. In addition, variables are necessary when defining functions that take arguments (see <xref linkend="genius-gel-functions-defining"/>).
      </para>

      <tip>
        <title>Using Tab completion</title>
        <para>
You can use Tab completion to get Genius to complete variable names for you. Try typing the first few letters of the name and pressing <userinput>Tab</userinput>.
        </para>
      </tip>

      <important>
        <title>Variable names are case sensitive</title>
        <para>
The names of variables are case sensitive. That means that variables named <varname>hello</varname>, <varname>HELLO</varname> and <varname>Hello</varname> are all different variables.
        </para>
      </important>


      <sect2 id="genius-gel-variables-setting">
        <title>Setting Variables</title>
        <para>
Syntax:
<programlisting><![CDATA[<identifier> = <value>
<identifier> := <value>]]>
</programlisting>
Example:
<programlisting>x = 3
x := 3
</programlisting>
        </para>

        <para>
To assign to a variable, use the <literal>=</literal> or <literal>:=</literal> operators. These operators set the value of the variable and return the number you set, so you can do things like
<programlisting>a = b = 5
</programlisting>
        </para>

        <para>
The <literal>=</literal> and <literal>:=</literal> operators can both be used to set variables. The difference between them is that the <literal>:=</literal> operator always acts as an assignment operator, whereas the <literal>=</literal> operator may be interpreted as testing for equality when used in a context where a Boolean expression is expected.
       </para>

	<para>
	  For issues regarding the scope of variables, see <xref linkend="genius-gel-variables-global"/>.
	</para>
      </sect2>

      <sect2 id="genius-gel-variables-built-in">
        <title>Built-in Variables</title>
        <para>
GEL has a number of built-in ‘variables’, such as
<varname>e</varname>, <varname>pi</varname> or <varname>GoldenRatio</varname>.  These are widely used constants with a preset value, and
they cannot be assigned new values.
There are a number of other built-in variables.
See <xref linkend="genius-gel-function-list-constants"/> for a full list.
        </para>
      </sect2>


      <sect2 id="genius-gel-previous-result">
        <title>Previous Result Variable</title>
        <para>
The <varname>Ans</varname> and <varname>ans</varname> variables can be used to get the result of the last expression. For example, if you had performed some calculation, to add 389 to the result you could do:
<programlisting>Ans+389
</programlisting>
        </para>
      </sect2>
    </sect1>

    <sect1 id="genius-gel-functions">
      <title>Using Functions</title>

      <para>
Syntax:
<programlisting>FunctionName(argument1, argument2, ...)
</programlisting>
Example:
<programlisting>Factorial(5)
cos(2*pi)
gcd(921,317)
</programlisting>

To evaluate a function, enter the name of the function, followed by the arguments (if any) to the function in parentheses. This will return the result of applying the function to its arguments. The number of arguments to the function is, of course, different for each function.
      </para>

      <para>
There are many built-in functions, such as <function>sin</function>, <function>cos</function> and <function>tan</function>. You can use the <function>help</function> built-in function to get a list of available functions, or see <xref linkend="genius-gel-function-list"/> for a full listing.
      </para>

      <tip>
        <title>Using Tab completion</title>
        <para>
You can use Tab completion to get Genius to complete function names for you. Try typing the first few letters of the name and pressing <userinput>Tab</userinput>.
        </para>
      </tip>

      <important>
        <title>Function names are case sensitive</title>
        <para>
The names of functions are case sensitive. That means that functions named <function>dosomething</function>, <function>DOSOMETHING</function> and <function>DoSomething</function> are all different functions.
        </para>
      </important>


      <sect2 id="genius-gel-functions-defining">
        <title>Defining Functions</title>
        <para>
Syntax:
<programlisting><![CDATA[function <identifier>(<comma separated arguments>) = <function body>
<identifier> = (`() = <function body>)
]]></programlisting>
The <literal>`</literal> is the backquote character, and signifies an anonymous function. By setting it to a variable name you effectively define a function.
        </para>

        <para>
A function takes zero or more comma separated arguments, and returns the result of the function body. Defining your own functions is primarily a matter of convenience; one possible use is to have sets of functions defined in GEL files which Genius can load in order to make available.
Example:
<programlisting>function addup(a,b,c) = a+b+c
</programlisting>
then <userinput>addup(1,4,9)</userinput> yields 14
        </para>
      </sect2>

      <sect2 id="genius-gel-functions-variable-argument-lists">
        <title>Variable Argument Lists</title>
        <para>
If you include <literal>...</literal> after the last argument name in the function declaration, then Genius will allow any number of arguments to be passed in place of that argument. If no arguments were passed then that argument will be set to <constant>null</constant>. Otherwise, it will be a horizontal vector containing all the arguments. For example:
<programlisting>function f(a,b...) = b
</programlisting>
Then <userinput>f(1,2,3)</userinput> yields <computeroutput>[2,3]</computeroutput>, while <userinput>f(1)</userinput> yields a <constant>null</constant>.
        </para>
      </sect2>


      <sect2 id="genius-gel-functions-passing-functions">
        <title>Passing Functions to Functions</title>

        <para>
In Genius, it is possible to pass a function as an argument to another function. This can be done using either ‘function nodes’ or anonymous functions.
        </para>

        <para>
If you do not enter the parentheses after a function name, instead of being evaluated, the function will instead be returned as a ‘function node’. The function node can then be passed to another function.
Example:
<programlisting>function f(a,b) = a(b)+1;
function b(x) = x*x;
f(b,2)
</programlisting>
        </para>
        <para>
To pass functions which are not defined,
you can use an anonymous function (see <xref linkend="genius-gel-functions-defining"/>).  That is, you want to pass a function without giving it a name.
Syntax:
<programlisting><![CDATA[function(<comma separated arguments>) = <function body>
`(<comma separated arguments>) = <function body>
]]></programlisting>
Example:
<programlisting>function f(a,b) = a(b)+1;
f(`(x) = x*x,2)
</programlisting>
This will return 5.
        </para>
      </sect2>


    <sect2 id="genius-gel-functions-operations">
      <title>Operations on Functions</title>
      <para>
Some functions allow arithmetic operations, and some single argument functions such as <function>exp</function> or <function>ln</function>, to operate on the function. For example,
<programlisting>exp(sin*cos+4)
</programlisting>
will return a function that takes <varname>x</varname> and returns <userinput>exp(sin(x)*cos(x)+4)</userinput>.  It is functionally equivalent
to typing
<programlisting>`(x) = exp(sin(x)*cos(x)+4)
</programlisting>

This operation can be useful when quickly defining functions. For example to create a function called <varname>f</varname>
to perform the above operation, you can just type:
<programlisting>f = exp(sin*cos+4)
</programlisting>
It can also be used in plotting. For example, to plot sin squared you can enter:
<programlisting>LinePlot(sin^2)
</programlisting>
      </para>

      <warning>
        <para>
Not all functions can be used in this way.  For example, when you use a binary operation the functions must take the same number of arguments. 
        </para>
      </warning>
    </sect2>


    </sect1>

    <sect1 id="genius-gel-absolute-value-modulus">
      <title>Absolute Value / Modulus</title>
      <para>
You can make an absolute value of something by putting the
<literal>|</literal>'s around it.  For example:
<programlisting>|a-b|</programlisting>
</para>
<para>
In case the expression is a complex number the result will be the modulus
(distance from the origin).  For example:
<userinput>|3 * e^(1i*pi)|</userinput>
returns 3.
      </para>
    </sect1>

    <sect1 id="genius-gel-separator">
      <title>Separator</title>
      <para>
In GEL if you want to type more than one command you have to use
the <literal>;</literal> operator, which is a way to separate expressions,
such a combined expression will return whatever is the result of the last
one, so suppose you type the following:
<programlisting>3 ; 5
</programlisting>
This expression will yield 5.
      </para>
      <para>
This will require some parenthesizing to make it unambiguous sometimes,
especially if the <literal>;</literal> is not the top most primitive. This slightly differs from
other programming languages where the <literal>;</literal> is a terminator of statements, whereas
in GEL it’s actually a binary operator. If you are familiar with pascal
this should be second nature. However genius can let you pretend it is a
terminator somewhat, if a <literal>;</literal> is found at the end of a parenthesis or a block,
genius will itself append a null node to it as if you would have written
<userinput>;null</userinput>.
This is useful in case you do not want to return a value from say a loop,
or if you handle the return differently. Note that it will slightly slow down
the code if it is executed too often as there is one more operator involved.
      </para>
    </sect1>

    <sect1 id="genius-gel-comments">
      <title>Comments</title>
      <para>
	      GEL is similar to other scripting languages in that <literal>#</literal> denotes
	      a comments, that is text that is not meant to be evaluated.  Everything beyond the
	      pound sign till the end of line will just be ignored.  So
<programlisting># This is just a comment
# every line in a comment must have its own pond sign
# in the next line we set x to the value 123
x=123;
</programlisting>
      </para>
    </sect1>

    <sect1 id="genius-gel-modular-evaluation">
      <title>Modular Evaluation</title>
      <para>
	      Genius implements modular arithmetic.
To use it you just add "mod &lt;integer&gt;" after
the expression.  Example:
<programlisting>2^(5!) * 3^(6!) mod 5</programlisting>
It could be possible to do modular arithmetic by computing with integers and then modding in the end with
the <literal>%</literal> operator, which simply gives the remainder, but
that may be time consuming if not impossible when working with larger numbers.
For example, <userinput>10^(10^10) % 6</userinput> will simply not work (the exponent
will be too large), while
<userinput>10^(10^10) mod 6</userinput> is instanteneous.  The first expression first tries to compute the integer
<userinput>10^(10^10)</userinput> and then find remainder after division by 6, while the second expression evaluates
everything modulo 6 to begin with.
      </para>
      <para>
You can calculate the inverses of numbers mod some integer by just using
rational numbers (of course the inverse has to exist).
Examples:
<programlisting>10^-1 mod 101
1/10 mod 101</programlisting>
You can also do modular evaluation with matrices including taking inverses,
powers and dividing.
Example:
<programlisting>A = [1,2;3,4]
B = A^-1 mod 5
A*B mod 5</programlisting>
This should yield the identity matrix as B will be the inverse of A mod 5.
      </para>
      <para>
Some functions such as
<link linkend="gel-function-sqrt"><function>sqrt</function></link> or
<link linkend="gel-function-log"><function>log</function></link>
work in a different way when in modulo mode.  These will then work like their
discrete versions working within the ring of integers you selected.  For
example:
<programlisting>genius&gt; sqrt(4) mod 7
=
[2, 5]
genius&gt; 2*2 mod 7
= 4</programlisting>
	<function>sqrt</function> will actually return all the possible square
	roots.
      </para>
      <para>
	      Do not chain mod operators, simply place it at the end of the computation, all computations in the expression on the left
	      will be carried out in mod arithmetic.  If you place a mod inside
	      a mod, you will get unexpected results.  If you simply want to
	      mod a single number and control exactly when remainders are
	      taken, best to use the <literal>%</literal> operator.  When you
	      need to chain several expressions in modular arithmetic with
	      different divisors, it may be best to just split up the expression into several and use
	      temporary variables to avoid a mod inside a mod.
      </para>
    </sect1>

    <sect1 id="genius-gel-operator-list">
      <title>List of GEL Operators</title>

      <para>
	      Everything in gel is really just an expression.  Expressions are stringed together with
	      different operators.  As we have seen, even the separator is simply a binary operator
	      in GEL.  Here is a list of the operators in GEL. 
      </para>

      <variablelist>
        <varlistentry>
         <term><synopsis>a;b</synopsis></term>
         <listitem>
           <para>
             The separator, just evaluates both
	     <varname>a</varname> and
	     <varname>b</varname>,
	     but returns only the result of
	     <varname>b</varname>.
           </para>
         </listitem>
        </varlistentry>


        <varlistentry>
         <term><synopsis>a=b</synopsis></term>
         <listitem>
           <para>
	     The assignment operator.  This assigns <varname>b</varname> to
<varname>a</varname> (<varname>a</varname> must be a valid <link linkend="genius-gel-lvalues">lvalue</link>) (note however that this operator
may be translated to <literal>==</literal> if used in a place where boolean
expression is expected)
           </para>
         </listitem>
        </varlistentry>


        <varlistentry>
         <term><synopsis>a:=b</synopsis></term>
         <listitem>
           <para>
	     The assignment operator.  Assigns <varname>b</varname> to
<varname>a</varname> (<varname>a</varname> must be a valid <link linkend="genius-gel-lvalues">lvalue</link>).  This is
different from <literal>=</literal> because it never gets translated to a
<literal>==</literal>.
           </para>
         </listitem>
        </varlistentry>


        <varlistentry>
         <term><synopsis>|a|</synopsis></term>
         <listitem>
           <para>
             Absolute value or modulus (if <varname>a</varname>
	     is a complex number).
           </para>
          <para>
	    See
	    <ulink url="http://mathworld.wolfram.com/AbsoluteValue.html">Mathworld</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>


        <varlistentry>
         <term><synopsis>a^b</synopsis></term>
         <listitem>
           <para>
             Exponentiation, raises <varname>a</varname> to the <varname>b</varname>th power.
           </para>
         </listitem>
        </varlistentry>


        <varlistentry>
         <term><synopsis>a.^b</synopsis></term>
         <listitem>
           <para>
	     Element by element exponentiation.  Raise each element of a matrix
	     <varname>a</varname> to the <varname>b</varname>th power.  Or if
	     <varname>b</varname> is a matrix of the same size as
	     <varname>a</varname>, then do the operation element by element.
	     If <varname>a</varname> is a number and <varname>b</varname> is a
	     matrix then it creates matrix of the same size as
	     <varname>b</varname> with <varname>a</varname> raised to all the
	     different powers in <varname>b</varname>.
           </para>
         </listitem>
        </varlistentry>


        <varlistentry>
         <term><synopsis>a+b</synopsis></term>
         <listitem>
           <para>
             Addition.  Adds two numbers, matrices, functions or strings.  If
	     you add a string to anything the result will just be a string.  If one is
	     a square matrix and the other a number, then the number is multiplied by
	     the identity matrix.
           </para>
         </listitem>
        </varlistentry>


        <varlistentry>
         <term><synopsis>a-b</synopsis></term>
         <listitem>
           <para>
             Subtraction.  Subtract two numbers, matrices or functions.
           </para>
         </listitem>
        </varlistentry>


        <varlistentry>
         <term><synopsis>a*b</synopsis></term>
         <listitem>
           <para>
             Multiplication.  This is the normal matrix multiplication.
           </para>
         </listitem>
        </varlistentry>


        <varlistentry>
         <term><synopsis>a.*b</synopsis></term>
         <listitem>
           <para>
	     Element by element multiplication if <varname>a</varname> and
	     <varname>b</varname> are matrices.
           </para>
         </listitem>
        </varlistentry>


        <varlistentry>
         <term><synopsis>a/b</synopsis></term>
         <listitem>
           <para>
		   Division.  When <varname>a</varname> and <varname>b</varname> are just numbers
		   this is the normal division.  When they are matrices, then this is
		   equivalent to <userinput>a*b^-1</userinput>.
           </para>
         </listitem>
        </varlistentry>


        <varlistentry>
         <term><synopsis>a./b</synopsis></term>
         <listitem>
           <para>
		   Element by element division.  Same as <userinput>a/b</userinput> for
		   numbers, but operarates element by element on matrices.
           </para>
         </listitem>
        </varlistentry>


        <varlistentry>
         <term><synopsis>a\b</synopsis></term>
         <listitem>
           <para>
             Back division.  That is this is the same as <userinput>b/a</userinput>.
           </para>
         </listitem>
        </varlistentry>


        <varlistentry>
         <term><synopsis>a.\b</synopsis></term>
         <listitem>
           <para>
             Element by element back division.
           </para>
         </listitem>
        </varlistentry>


        <varlistentry>
         <term><synopsis>a%b</synopsis></term>
         <listitem>
           <para>
	     The mod operator.  This does not turn on the <link linkend="genius-gel-modular-evaluation">modular mode</link>, but
	     just returns the remainder of <userinput>a/b</userinput>.
           </para>
         </listitem>
        </varlistentry>


        <varlistentry>
         <term><synopsis>a.%b</synopsis></term>
         <listitem>
           <para>
             Element by element the mod operator.  Returns the remainder
	     after element by element integer <userinput>a./b</userinput>.
           </para>
         </listitem>
        </varlistentry>


        <varlistentry>
         <term><synopsis>a mod b</synopsis></term>
         <listitem>
           <para>
             Modular evaluation operator.  The expression <varname>a</varname>
	     is evaluated modulo <varname>b</varname>.  See <xref linkend="genius-gel-modular-evaluation"/>.
	     Some functions and operators behave differently modulo an integer.
           </para>
         </listitem>
        </varlistentry>


        <varlistentry>
         <term><synopsis>a!</synopsis></term>
         <listitem>
           <para>
             Factorial operator.  This is like
	     <userinput>1*...*(n-2)*(n-1)*n</userinput>.
           </para>
         </listitem>
        </varlistentry>


        <varlistentry>
         <term><synopsis>a!!</synopsis></term>
         <listitem>
           <para>
             Double factorial operator.  This is like
	     <userinput>1*...*(n-4)*(n-2)*n</userinput>.
           </para>
         </listitem>
        </varlistentry>


        <varlistentry>
         <term><synopsis>a==b</synopsis></term>
         <listitem>
           <para>
	     Equality operator.
	     Returns <constant>true</constant> or <constant>false</constant>
	     depending on <varname>a</varname> and <varname>b</varname> being equal or not.
           </para>
         </listitem>
        </varlistentry>


        <varlistentry>
         <term><synopsis>a!=b</synopsis></term>
         <listitem>
           <para>
             Inequality operator,
	     returns <constant>true</constant> if <varname>a</varname> does not
	     equal <varname>b</varname> else returns <constant>false</constant>.
           </para>
         </listitem>
        </varlistentry>


        <varlistentry>
         <term><synopsis>a&lt;&gt;b</synopsis></term>
         <listitem>
           <para>
             Alternative inequality operator,
	     returns <constant>true</constant> if <varname>a</varname> does not
	     equal <varname>b</varname> else returns <constant>false</constant>.
           </para>
         </listitem>
        </varlistentry>


        <varlistentry>
         <term><synopsis>a&lt;=b</synopsis></term>
         <listitem>
           <para>
             Less than or equal operator,
	     returns <constant>true</constant> if <varname>a</varname> is
	     less than or equal to 
	     <varname>b</varname> else returns <constant>false</constant>.
	     These can be chained as in <userinput>a &lt;= b &lt;= c</userinput> (can
	     also be combined with the less than operator).
           </para>
         </listitem>
        </varlistentry>


        <varlistentry>
         <term><synopsis>a&gt;=b</synopsis></term>
         <listitem>
           <para>
             Greater than or equal operator,
	     returns <constant>true</constant> if <varname>a</varname> is
	     greater than or equal to 
	     <varname>b</varname> else returns <constant>false</constant>.
	     These can be chained as in <userinput>a &gt;= b &gt;= c</userinput>
	     (can also be combine with the greater than operator).
           </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><synopsis>a&lt;b</synopsis></term>
         <listitem>
           <para>
             Less than operator,
	     returns <constant>true</constant> if <varname>a</varname> is
	     less than 
	     <varname>b</varname> else returns <constant>false</constant>.
	     These can be chained as in <userinput>a &lt; b &lt; c</userinput>
	     (can also be combine with the less than or equal to operator).
           </para>
         </listitem>
        </varlistentry>


        <varlistentry>
         <term><synopsis>a&gt;b</synopsis></term>
         <listitem>
           <para>
             Greater than operator,
	     returns <constant>true</constant> if <varname>a</varname> is
	     greater than 
	     <varname>b</varname> else returns <constant>false</constant>.
	     These can be chained as in <userinput>a &gt; b &gt; c</userinput>
	     (can also be combine with the greater than or equal to operator).
           </para>
         </listitem>
        </varlistentry>


        <varlistentry>
         <term><synopsis>a&lt;=&gt;b</synopsis></term>
         <listitem>
           <para>
	     Comparison operator.  If <varname>a</varname> is equal to
	     <varname>b</varname> it returns 0, if <varname>a</varname> is less
	     than <varname>b</varname> it returns -1 and if
	     <varname>a</varname> is greater than <varname>b</varname> it
	     returns 1.
           </para>
         </listitem>
        </varlistentry>


        <varlistentry>
         <term><synopsis>a and b</synopsis></term>
         <listitem>
           <para>
		   Logical and.  Returns true if both
		   <varname>a</varname> and <varname>b</varname> are true,
		   else returns false.  If given numbers, nonzero numbers
		   are treated as true.
           </para>
         </listitem>
        </varlistentry>


        <varlistentry>
         <term><synopsis>a or b</synopsis></term>
         <listitem>
           <para>
             Logical or.
	     Returns true if both
	     <varname>a</varname> or <varname>b</varname> are true,
	     else returns false.  If given numbers, nonzero numbers
	     are treated as true.
           </para>
         </listitem>
        </varlistentry>


        <varlistentry>
         <term><synopsis>a xor b</synopsis></term>
         <listitem>
           <para>
             Logical xor.
	     Returns true exactly one of
	     <varname>a</varname> or <varname>b</varname> is true,
	     else returns false.  If given numbers, nonzero numbers
	     are treated as true.
           </para>
         </listitem>
        </varlistentry>


        <varlistentry>
         <term><synopsis>not a</synopsis></term>
         <listitem>
           <para>
		   Logical not.  Returns the logical negation of <varname>a</varname>
           </para>
         </listitem>
        </varlistentry>


        <varlistentry>
         <term><synopsis>-a</synopsis></term>
         <listitem>
           <para>
             Negation operator.  Returns the negative of a number or a matrix (works elementwise on a matrix).
           </para>
         </listitem>
        </varlistentry>


        <varlistentry>
         <term><synopsis>&amp;a</synopsis></term>
         <listitem>
           <para>
             Variable referencing (to pass a reference to a variable).
	     See <xref linkend="genius-gel-references"/>.
           </para>
         </listitem>
        </varlistentry>


        <varlistentry>
         <term><synopsis>*a</synopsis></term>
         <listitem>
           <para>
             Variable dereferencing (to access a referenced variable).
	     See <xref linkend="genius-gel-references"/>.
           </para>
         </listitem>
        </varlistentry>


        <varlistentry>
         <term><synopsis>a'</synopsis></term>
         <listitem>
           <para>
		   Matrix conjugate transpose.  That is, rows and columns get swapped and we take complex conjugate of all entries.  That is
		   if the i,j element of <varname>a</varname> is x+iy, then the j,i element of <userinput>a'</userinput> is x-iy.
           </para>
         </listitem>
        </varlistentry>


        <varlistentry>
         <term><synopsis>a.'</synopsis></term>
         <listitem>
           <para>
             Matrix transpose, does not conjugate the entries.  That is, 
	     the i,j element of <varname>a</varname>  becomes the j,i element of <userinput>a.'</userinput>.
           </para>
         </listitem>
        </varlistentry>


        <varlistentry>
         <term><synopsis>a@(b,c)</synopsis></term>
         <listitem>
           <para>
	     Get element of a matrix in row <varname>b</varname> and column
	     <varname>c</varname>.   If <varname>b</varname>,
	     <varname>c</varname> are vectors, then this gets the corresponding
	     rows columns or submatrices.
           </para>
         </listitem>
        </varlistentry>


        <varlistentry>
         <term><synopsis>a@(b,)</synopsis></term>
         <listitem>
           <para>
             Get row of a matrix (or multiple rows if <varname>b</varname> is a vector).
           </para>
         </listitem>
        </varlistentry>


        <varlistentry>
         <term><synopsis>a@(b,:)</synopsis></term>
         <listitem>
           <para>
             Same as above.
           </para>
         </listitem>
        </varlistentry>


        <varlistentry>
         <term><synopsis>a@(,c)</synopsis></term>
         <listitem>
           <para>
	     Get column of a matrix (or columns if <varname>c</varname> is a
	     vector).
           </para>
         </listitem>
        </varlistentry>


        <varlistentry>
         <term><synopsis>a@(:,c)</synopsis></term>
         <listitem>
           <para>
             Same as above.
           </para>
         </listitem>
        </varlistentry>


        <varlistentry>
         <term><synopsis>a@(b)</synopsis></term>
         <listitem>
           <para>
             Get an element from a matrix treating it as a vector.  This will
	     traverse the matrix row-wise.
           </para>
         </listitem>
        </varlistentry>


        <varlistentry>
         <term><synopsis>a:b</synopsis></term>
         <listitem>
           <para>
             Build a vector from <varname>a</varname> to <varname>b</varname> (or specify a row, column region for the <literal>@</literal> operator).  For example to get rows 2 to 4 of matrix <varname>A</varname> we could do
	     <programlisting>A@(2:4,)
	     </programlisting>
	     as <userinput>2:4</userinput> will return a vector
	     <userinput>[2,3,4]</userinput>.
           </para>
         </listitem>
        </varlistentry>


        <varlistentry>
         <term><synopsis>a:b:c</synopsis></term>
         <listitem>
           <para>
	     Build a vector from <varname>a</varname> to <varname>c</varname>
	     with <varname>b</varname> as a step.  That is for example
	     <programlisting>genius&gt; 1:2:9
=
`[1, 3, 5, 7, 9]
</programlisting>
           </para>
         </listitem>
        </varlistentry>


        <varlistentry>
         <term><synopsis>(a)i</synopsis></term>
         <listitem>
           <para>
	     Make a imaginary number (multiply <varname>a</varname> by the
	     imaginary).  Note that normally the number <varname>i</varname> is
	     written as <userinput>1i</userinput>.  So the above is equal to
	     <programlisting>(a)*1i
	     </programlisting>
           </para>
         </listitem>
        </varlistentry>


        <varlistentry>
         <term><synopsis>`a</synopsis></term>
         <listitem>
           <para>
             Quote an identifier so that it doesn't get evaluated.  Or
	     quote a matrix so that it doesn't get expanded.
           </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><synopsis>a swapwith b</synopsis></term>
         <listitem>
           <para>
		   Swap value of <varname>a</varname> with the value
		   of <varname>b</varname>.  Currently does not operate
		   on ranges of matrix elements.
		   It returns <constant>null</constant>.
		   Available from version 1.0.13.
           </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><synopsis>increment a</synopsis></term>
         <listitem>
           <para>
		   Increment the variable <varname>a</varname> by 1.  If
		   <varname>a</varname> is a matrix, then increment each element.
		   This is equivalent to <userinput>a=a+1</userinput>, but 
		   it is somewhat faster.  It returns <constant>null</constant>.
		   Available from version 1.0.13.
           </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><synopsis>increment a by b</synopsis></term>
         <listitem>
           <para>
		   Increment the variable <varname>a</varname> by <varname>b</varname>.  If
		   <varname>a</varname> is a matrix, then increment each element.
		   This is equivalent to <userinput>a=a+b</userinput>, but 
		   it is somewhat faster.  It returns <constant>null</constant>.
		   Available from version 1.0.13.
           </para>
         </listitem>
        </varlistentry>


      </variablelist>

<note>
<para>
The @() operator makes the : operator most useful.  With this you can specify regions of a matrix.  So that a@(2:4,6) is the rows 2,3,4 of the column 6. Or a@(,1:2) will get you the first two columns of a matrix. You can also assign to the @() operator, as long as the right value is a matrix that matches the region in size, or if it is any other type of value.
</para>
</note>

<note>
<para>
The comparison operators (except for the &lt;=&gt; operator which behaves normally), are not strictly binary operators, they can in fact be grouped in the normal mathematical way, e.g.: (1&lt;x&lt;=y&lt;5) is a legal boolean expression and means just what it should, that is (1&lt;x and x≤y and y&lt;5)
</para>
</note>

<note>
<para>
The unitary minus operates in a different fashion depending on where it
appears.  If it appears before a number it binds very closely, if it appears in
front of an expression it binds less than the power and factorial operators.
So for example <userinput>-1^k</userinput> is really <userinput>(-1)^k</userinput>,
but <userinput>-foo(1)^k</userinput> is really <userinput>-(foo(1)^k)</userinput>.  So
be careful how you use it and if in doubt, add parentheses.
</para>
</note>
    </sect1>

  </chapter>

  <!-- ============= GEL Programming ========================== -->
  <chapter id="genius-gel-programming">
    <title>Programmation avec GEL</title>

    <sect1 id="genius-gel-conditionals">
      <title>Conditionals</title>
      <para>
Syntax:
<programlisting><![CDATA[if <expression1> then <expression2> [else <expression3>]
]]></programlisting>
If <literal>else</literal> is omitted, then if the <literal>expression1</literal> yields <constant>false</constant> or 0, <literal>NULL</literal> is returned.
      </para>
      <para>
Examples:
<programlisting><![CDATA[if(a==5)then(a=a-1)
if b<a then b=a
if c>0 then c=c-1 else c=0
a = ( if b>0 then b else 1 )
]]></programlisting>
Note that <literal>=</literal> will be translated to <literal>==</literal> if used inside the expression for <literal>if</literal>, so
<programlisting>if a=5 then a=a-1
</programlisting>
will be interpreted as:
<programlisting>if a==5 then a:=a-1
</programlisting>
      </para>
    </sect1>

    <sect1 id="genius-gel-loops">
      <title>Loops</title>

      <sect2 id="genius-gel-loops-while">
        <title>While Loops</title>
        <para>
Syntax:
<programlisting><![CDATA[while <expression1> do <expression2>
until <expression1> do <expression2>
do <expression2> while <expression1>
do <expression2> until <expression1>]]></programlisting>

	These are similar to other languages.  However, as in gel it is simply an expression that must have some return value, these
	constructs will simply return the result of the last iteration or <literal>NULL</literal> if no iteration was done.  In the boolean expression, <literal>=</literal> is translated into <literal>==</literal> just as for the <literal>if</literal> statement.
        </para>
      </sect2>

      <sect2 id="genius-gel-loops-for">
        <title>For Loops</title>
        <para>
Syntax:
<programlisting><![CDATA[for <identifier> = <from> to <to> do <body>
for <identifier> = <from> to <to> by <increment> do <body>]]></programlisting>

Loop with identifier being set to all values from <literal>&lt;from&gt;</literal> to <literal>&lt;to&gt;</literal>, optionally using an increment other than 1. These are faster, nicer and more compact than the normal loops such as above, but less flexible. The identifier must be an identifier and can't be a dereference. The value of identifier is the last value of identifier, or <literal>&lt;from&gt;</literal> if body was never evaluated. The variable is guaranteed to be initialized after a loop, so you can safely use it.  Also the <literal>&lt;from&gt;</literal>, <literal>&lt;to&gt;</literal> and <literal>&lt;increment&gt;</literal> must be non complex values. The <literal>&lt;to&gt;</literal> is not guaranteed to be hit, but will never be overshot, for example the following prints out odd numbers from 1 to 19:
<programlisting>for i = 1 to 20 by 2 do print(i)
</programlisting>
        </para>
        <para>
		When one of the values is a floating point number, then the
		final check is done to within 2^-20 of the step size.  That is,
		even if we overshoot by 2^-20 times the "by" above, we still execute the last
		iteration.  This way 
<programlisting>for x = 0 to 1 by 0.1 do print(x)
</programlisting>
does the expected even though adding 0.1 ten times becomes just slightly more 1.0 due to the way that floating point numbers
are stored in base 2 (there is no 0.1, the actual number stored is just ever so slightly bigger).  This is not perfect but it handles
the majority of the cases.  If you want to avoid dealing with this issue, use actual rational numbers for example:
<programlisting>for x = 0 to 1 by 1/10 do print(x)
</programlisting>
		This check is done only from version 1.0.16 onwards, so execution of your code may differ on older versions.
	</para>
      </sect2>

      <sect2 id="genius-gel-loops-foreach">
        <title>Foreach Loops</title>
        <para>
Syntax:
<programlisting><![CDATA[for <identifier> in <matrix> do <body>]]></programlisting>

			For each element in the matrix, going row by row from left to right we execute the body
		       with the identifier set to the current element. To
print numbers 1,2,3 and 4 in this order you could do:
<programlisting>for n in [1,2:3,4] do print(n)
</programlisting>
If you wish to run through the rows and columns of a matrix, you can use
the RowsOf and ColumnsOf functions which return a vector of the rows or
columns of the matrix.  So,
<programlisting>for n in RowsOf ([1,2:3,4]) do print(n)
</programlisting>
will print out [1,2] and then [3,4].
        </para>
      </sect2>

      <sect2 id="genius-gel-loops-break-continue">
        <title>Break and Continue</title>
        <para>
You can also use the <literal>break</literal> and <literal>continue</literal> commands in loops. The continue <literal>continue</literal> command will restart the current loop at its next iteration, while the <literal>break</literal> command exits the current loop.
<programlisting><![CDATA[while(<expression1>) do (
  if(<expression2>) break
  else if(<expression3>) continue;
  <expression4>
)
]]></programlisting>
        </para>
      </sect2>
    </sect1>

    <sect1 id="genius-gel-sums-products">
      <title>Sums and Products</title>
      <para>
Syntax:
<programlisting><![CDATA[sum <identifier> = <from> to <to> do <body>
sum <identifier> = <from> to <to> by <increment> do <body>
sum <identifier> in <matrix> do <body>
prod <identifier> = <from> to <to> do <body>
prod <identifier> = <from> to <to> by <increment> do <body>
prod <identifier> in <matrix> do <body>]]></programlisting>

If you substitute <literal>for</literal> with <literal>sum</literal> or <literal>prod</literal>, then you will get a sum or a product instead of a <literal>for</literal> loop. Instead of returning the last value, these will return the sum or the product of the values respectively.
      </para>
      <para>
If no body is executed (for example <userinput>sum i=1 to 0 do ...</userinput>) then <literal>sum</literal> returns 0 and <literal>prod</literal> returns 1 as is the standard convention.
      </para>
      <para>
	      For floating point numbers the same roundoff error protection is done as in the for loop.
	     See <xref linkend="genius-gel-loops-for"/>.
      </para>
    </sect1>

    <sect1 id="genius-gel-comparison-operators">
      <title>Comparison Operators</title>
      <para>
	The following standard comparison operators are supported in GEL and have the obvious meaning:
	<literal>==</literal>, <literal>&gt;=</literal>,
	<literal>&lt;=</literal>, <literal>!=</literal>,
	<literal>&lt;&gt;</literal>, <literal>&lt;</literal>,
	<literal>&gt;</literal>.  They return <constant>true</constant> or
	<constant>false</constant>.
	The operators
	<literal>!=</literal> and <literal>&lt;&gt;</literal> are the same
	thing and mean "is not equal to".
	GEL also supports the operator
	<literal>&lt;=&gt;</literal>, which returns -1 if left side is
	smaller, 0 if both sides are equal, 1 if left side is larger.
      </para>

      <para>
	Normally <literal>=</literal> is translated to <literal>==</literal> if
	it happens to be somewhere where GEL is expecting a condition such as
	in the if condition.  For example
	<programlisting>if a=b then c
if a==b then c
</programlisting>
	are the same thing in GEL.  However you should really use
	<literal>==</literal> or <literal>:=</literal> when you want to compare
	or assign respectively if you want your code to be easy to read and
	to avoid mistakes.
      </para>

      <para>
	All the comparison operators (except for the
	<literal>&lt;=&gt;</literal> operator which
	behaves normally), are not strictly binary operators, they can in fact
	be grouped in the normal mathematical way, e.g.:
	(<literal>1&lt;x&lt;=y&lt;5</literal>) is
	a legal boolean expression and means just what it should, that is
	(1&lt;x and x≤y and y&lt;5)
      </para>
      <para>
	To build up logical expressions use the words <literal>not</literal>,
	<literal>and</literal>, <literal>or</literal>, <literal>xor</literal>.
	The operators <literal>or</literal> and <literal>and</literal> are
special beasts as they evaluate their arguments one by one, so the usual trick
for conditional evaluation works here as well. For example, <literal>1 or a=1</literal> will not set
<literal>a=1</literal> since the first argument was true.
      </para>
    </sect1>

      <sect1 id="genius-gel-variables-global">
        <title>Global Variables and Scope of Variables</title>
	<para>
	  GEL is a
	  <ulink url="http://en.wikipedia.org/wiki/Scope_%28programming%29">
	  dynamically scoped language</ulink>.  We will explain what this
	  means below.  That is, normal variables and functions are dynamically
	  scoped.  The exception are 
	  <link linkend="genius-gel-parameters">parameter variables</link>,
	  which are always global.
	</para>
	<para>
	  Like most programming languages, GEL has different types
	  of variables.  Normally when a variable is defined in a function,
	  it is visible from that function and from all functions that are
	  called (all higher contexts).  For example, suppose a function
	  <function>f</function> defines a variable <varname>a</varname>
	  and then calls function <function>g</function>.  Then
	  function <function>g</function> can reference
	  <varname>a</varname>.  But once <function>f</function> returns,
	  the variable <varname>a</varname> goes out of scope.
	  For example, the following code will print out 5.
	  The function <function>g</function> cannot be called on the
	  top level (outside <function>f</function> as <varname>a</varname>
	  will not be defined).
<programlisting>function f() = (a:=5; g());
function g() = print(a);
f();
</programlisting>
        </para>
        <para>
	  If you define a variable inside a function it will override
	  any variables defined in calling functions.  For example,
	  we modify the above code and write:
<programlisting>function f() = (a:=5; g());
function g() = print(a);
a:=10;
f();
</programlisting>
	  This code will still print out 5.  But if you call
	  <function>g</function> outside of <function>f</function> then
	  you will get a printout of 10.  Note that
	  setting <varname>a</varname>
	  to 5 inside <function>f</function> does not change
	  the value of <varname>a</varname> at the top (global) level,
	  so if you now check the value of <varname>a</varname> it will
	  still be 10.
        </para>
	<para>
	  Function arguments are exactly like variables defined inside
	  the function, except that they are initialized with the value
	  that was passed to the function.  Other than this point, they are
	  treated just like all other variables defined inside the
	  function.
	</para>
	<para>
	  Functions are treated exactly like variables.  Hence you can
	  locally redefine functions.  Normally (on the top level) you
	  cannot redefine protected variables and functions.  But locally
	  you can do this.  Consider the following session:
<screen><prompt>genius&gt; </prompt><userinput>function f(x) = sin(x)^2</userinput>
= (`(x)=(sin(x)^2))
<prompt>genius&gt; </prompt><userinput>function f(x) = sin(x)^2</userinput>
= (`(x)=(sin(x)^2))
<prompt>genius&gt; </prompt><userinput>function g(x) = ((function sin(x)=x^10);f(x))</userinput>
= (`(x)=((sin:=(`(x)=(x^10)));f(x)))
<prompt>genius&gt; </prompt><userinput>g(10)</userinput>
= 1e20
</screen>
	</para>
	<para>
	  Functions and variables defined at the top level are
	  considered global.  They are visible from anywhere.  As we
	  said the following function <function>f</function>
	  will not change the value of <varname>a</varname> to 5.
<programlisting>a=6;
function f() = (a:=5);
f();
</programlisting>
	  Sometimes, however, it is necessary to set
a global variable from inside a function.  When this behaviour is needed,
use the
<function>set</function> function. Passing a string or a quoted identifier to
this function sets the variable globally (on the top level).
For example, to set
<varname>a</varname> to the value 3 you could call:
<programlisting>set(`a,3)
</programlisting>
or:
<programlisting>set("a",3)
</programlisting>
        </para>
        <para>
	  The <function>set</function> function always sets the toplevel
	  global.  There is no way to set a local variable in some function
	  from a subroutine.  If this is required, must use passing by
	  reference.
        </para>
	<para>
	  So to recap in a more technical language:  Genius operates with
	  different numbered contexts.  The top level is the context 0
	  (zero).  Whenever a function is entered, the context is raised,
	  and when the function returns the context is lowered.  A function
	  or a variable is always visible from all higher numbered contexts.
	  When a variable was defined in a lower numbered context, then
	  setting this variable has the effect of creating a new local
	  variable in the current context number and this variable
	  will now be visible from all higher numbered contexts.
	</para>
	<para>
	  There are also true local variables, which are not seen from
	  anywhere but the current context.  Also when returning functions
	  by value it may reference variables not visible from higher context
	  and this may be a problem.  See the sections
	  <link linkend="genius-gel-true-local-variables">True
	  Local Variables</link> and
	  <link linkend="genius-gel-returning-functions">Returning
	  Functions</link>.
	</para>
      </sect1>

      <sect1 id="genius-gel-parameters">
        <title>Parameter variables</title>
	<para>
	  As we said before, there exist special variables called parameters
	  that exist in all scopes.  To declare a parameter called
	  <varname>foo</varname> with the initial value 1, we write
<programlisting><![CDATA[parameter foo = 1
]]></programlisting>
	  From then on, <varname>foo</varname> is a strictly global variable.
	  Setting <varname>foo</varname> inside any function will modify the
	  variable in all contexts, that is, functions do not have a private
	  copy of parameters.
        </para>
        <para>
	  When you undefine a parameter using the
	  <link linkend="gel-function-undefine">
	  <function>undefine</function></link> function, it stops being
	  a parameter.
        </para>
        <para>
	  Some parameters are built-in and modify the behaviour of genius.
        </para>
      </sect1>

    <sect1 id="genius-gel-returning">
      <title>Returning</title>
	<para>
	  Normally a function is one or several expressions separated by a
semicolon, and the value of the last expression is returned.  This is fine for
simple functions, but
sometimes you do not want a function to return the last thing calculated. You may, for example, want to return from a middle of a function. In this case, you can use the <literal>return</literal> keyword. <literal>return</literal> takes one argument, which is the value to be returned.
      </para>
      <para>
Example:
<programlisting><![CDATA[function f(x) = (
  y=1;
  while true do (
    if x>50 then return y;
    y=y+1;
    x=x+1
  )
)
]]></programlisting>
      </para>
    </sect1>


    <sect1 id="genius-gel-references">
      <title>References</title>
      <para>
	It may be necessary for some functions to return more than one value.
	This may be accomplished by returning a vector of values, but many
	times it is convenient to use passing a reference to a variable.
	You pass a reference to a variable to a function, and the function
	will set the variable for you using a dereference.  You do not have
	to use references only for this purpose, but this is their main use.
      </para>
      <para>
	When using functions that return values through references
	in the argument list, just pass the variable name with an ampersand.
	For example the following code will compute an eigenvalue of a matrix
	<varname>A</varname> with initial eigenvector guess
	<varname>x</varname>, and store the computed eigenvector
	into the variable named <varname>v</varname>:
<programlisting><![CDATA[RayleighQuotientIteration (A,x,0.001,100,&v)
]]></programlisting>
      </para>
      <para>
The details of how references work and the syntax is similar to the C language.
The operator
<literal>&amp;</literal> references a variable
and <literal>*</literal> dereferences a variable. Both can only be applied to an identifier,
so <literal>**a</literal> is not a legal expression in GEL.
      </para>
      <para>
References are best explained by an example:
<programlisting><![CDATA[a=1;
b=&a;
*b=2;
]]></programlisting>
now <varname>a</varname> contains 2.  You can also reference functions:
<programlisting><![CDATA[function f(x) = x+1;
t=&f;
*t(3)
]]></programlisting>
gives us 4.
      </para>
    </sect1>

    <sect1 id="genius-gel-lvalues">
      <title>Lvalues</title>
      <para>
	An lvalue is the left hand side of an assignment. In other words, an
	lvalue is what you assign something to.  Valid lvalues are:
<variablelist>
  <varlistentry>
    <term><userinput>a</userinput></term>
    <listitem>
      <para>
	Identifier.  Here we would be setting the variable of name
	<varname>a</varname>.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term><userinput>*a</userinput></term>
    <listitem>
      <para>
	Dereference of an identifier.  This will set whatever variable
	<varname>a</varname> points to.
      </para>
    </listitem>
  </varlistentry>
  <varlistentry>
    <term><userinput>a@(&lt;region&gt;)</userinput></term>
    <listitem>
      <para>
	A region of a matrix.  Here the region is specified normally as with
	the regular @() operator, and can be a single entry, or an entire
	region of the matrix.
      </para>
    </listitem>
  </varlistentry>
</variablelist>
      </para>
      <para>
Examples:
<programlisting>a:=4
*tmp := 89
a@(1,1) := 5
a@(4:8,3) := [1,2,3,4,5]'
</programlisting>
Note that both <literal>:=</literal> and <literal>=</literal> can be used
interchangably.  Except if the assignment appears in a condition.
It is thus always safer to just use
<literal>:=</literal> when you mean assignment, and <literal>==</literal>
when you mean comparison.
      </para>
    </sect1>

  </chapter>

  <chapter id="genius-gel-programming-advanced">
    <title>Programmation avancée avec GEL</title>

    <sect1 id="genius-gel-error-handling">
      <title>Error Handling</title>
      <para>
If you detect an error in your function, you can bail out of it. For normal
errors, such as wrong types of arguments, you can fail to compute the function
by adding the statement <literal>bailout</literal>. If something went
really wrong and you want to completely kill the current computation, you can
use <literal>exception</literal>.
      </para>
      <para>
	For example if you want to check for arguments in your function.  You
could use the following code.
<programlisting>function f(M) = (
  if not IsMatrix (M) then (
    error ("M not a matrix!");
    bailout
  );
  ...
)
</programlisting>
      </para>
    </sect1>

    <sect1 id="genius-gel-toplevel-syntax">
      <title>Toplevel Syntax</title>
      <para>
	The synatax is slightly different if you enter statements on
	the top level versus when they are inside parentheses or
	inside functions.  On the top level, enter acts the same as if
	you press return on the command line.  Therefore think of programs
	as just sequence of lines as if were entered on the command line.
	In particular, you do not need to enter the separator at the end of the
	line (unless it is of course part of several statements inside
	parentheses).
      </para>
      <para>
	The following code will produce an error when entered on the top
	level of a program, while it will work just fine in a function.
<programlisting>if Something() then
  DoSomething()
else
  DoSomethingElse()
</programlisting>
      </para>
      <para>
	The problem is that after <application>Genius Mathematics Tool</application> sees the end of line after the
	second line, it will decide that we have whole statement and
	it will execute it.  After the execution is done, <application>Genius Mathematics Tool</application> will
	go on to the next
	line, it will see <literal>else</literal>, and it will produce
	a parsing error.  To fix this, use parentheses.  <application>Genius Mathematics Tool</application> will not
	be satisfied until it has found that all parentheses are closed.
<programlisting>if Something() then (
  DoSomething()
) else (
  DoSomethingElse()
)
</programlisting>
      </para>
    </sect1>

     <sect1 id="genius-gel-returning-functions">
       <title>Returning Functions</title>
	<para>
	  It is possible to return functions as value.  This way you can
	  build functions that construct special purpose functions according
	  to some parameters.  The tricky bit is what variables does the
	  function see.  The way this works in GEL is that when a function
	  returns another function, all identifiers referenced in the
	  function body that went out of scope
	  are prepended a private dictionary of the returned
	  function.  So the function will see all variables that were in
	  scope
	  when it was defined.  For example, we define a function that
	  returns a function that adds 5 to its argument.
<programlisting>function f() = (
  k = 5;
  `(x) = (x+k)
)
</programlisting>
	  Notice that the function adds <varname>k</varname> to
	  <varname>x</varname>.  You could use this as follows.
<programlisting>g = f();
g(5)
</programlisting>
	  And <userinput>g(5)</userinput> should return 10.
        </para>
	<para>
	  One thing to note is that the value of <varname>k</varname>
	  that is used is the one that's in effect when the
	  <function>f</function> returns.  For example:
<programlisting>function f() = (
  k := 5;
  function r(x) = (x+k);
  k := 10;
  r
)
</programlisting>
	  will return a function that adds 10 to its argument rather than
	  5.  This is because the extra dictionary is created only when
	  the context
	  in which the function was defined ends, which is when the function
	  <function>f</function> returns.  This is consistent with how you
	  would expect the function <function>r</function> to work inside
	  the function <function>f</function> according to the rules of
	  scope of variables in GEL.  Only those variables are added to the
	  extra dictionary that are in the context that just ended and
	  no longer exists.  Variables
	  used in the function that are in still valid contexts will work
	  as usual, using the current value of the variable.
	  The only difference is with global variables and functions.
	  All identifiers that referenced global variables at time of
	  the function definition are not added to the private dictionary.
	  This is to avoid much unnecessary work when returning functions
	  and would rarely be a problem.  For example, suppose that you
	  delete the "k=5" from the function <function>f</function>,
	  and at the top level you define <varname>k</varname> to be
	  say 5.  Then when you run <function>f</function>, the function
	  <function>r</function> will not put <varname>k</varname> into
	  the private dictionary because it was global (toplevel)
	  at the time of definition of <function>r</function>.
	</para>
	<para>
	  Sometimes it is better to have more control over how variables
	  are copied into the private dictionary.  Since version 1.0.7,
	  you can specify which
	  variables are copied into the private dictionary by putting
	  extra square brackets after the arguments with the list of
	  variables to be copied separated by commas.
	  If you do this, then variables are
	  copied into the private dictionary at time of the function
	  definition, and the private dictionary is not touched afterwards.
	  For example
<programlisting>function f() = (
  k := 5;
  function r(x) [k] = (x+k);
  k := 10;
  r
)
</programlisting>
	  will return a function that when called will add 5 to its
	  argument.  The local copy of <varname>k</varname> was created
	  when the function was defined.
	</para>
	<para>
	  When you want the function to not have any private dictionary
	  then put empty square brackets after the argument list.  Then
	  no private dictionary will be created at all.  Doing this is
	  good to increase efficiency when a private dictionary is not
	  needed or when you want the function to lookup all variables
	  as it sees them when called.  For example suppose you want
	  the function returned from <function>f</function> to see
	  the value of <varname>k</varname> from the toplevel despite
	  there being a local variable of the same name during definition.
	  So the code
<programlisting>function f() = (
  k := 5;
  function r(x) [] = (x+k);
  r
);
k := 10;
g = f();
g(10)
</programlisting>
	  will return 20 and not 15, which would happen if
	  <varname>k</varname> with a value of 5 was added to the private
	  dictionary.
	</para>
    </sect1>

    <sect1 id="genius-gel-true-local-variables">
      <title>True Local Variables</title>
      <para>
	When passing functions into other functions, the normal scoping of
	variables might be undesired.  For example:
<programlisting>k := 10;
function r(x) = (x+k);
function f(g,x) = (
  k := 5;
  g(x)
);
f(r,1)
</programlisting>
	you probably want the function <function>r</function>
	when passed as <function>g</function> into <function>f</function>
	to see <varname>k</varname> as 10 rather than 5, so that
	the code returns 11 and not 6.  However, as written, the function
	when executed will see the <varname>k</varname> that is
	equal to 5.  There are two ways to solve this.  One would be
	to have <function>r</function> get <varname>k</varname> in a
	private dictionary using the square bracket notation section
	<link linkend="genius-gel-returning-functions">Returning
	Functions</link>.
      </para>
      <para>
	But there is another solution.  Since version 1.0.7 there are
	true local variables.  These are variables that are visible only
	from the current context and not from any called functions.
	We could define <varname>k</varname> as a local variable in the
	function <function>f</function>.  To do this add a
	<command>local</command> statement as the first statement in the
	function (it must always be the first statement in the function).
	You can also make any arguments be local variables as well.
	That is,
<programlisting>function f(g,x) = (
  local g,x,k;
  k := 5;
  g(x)
);
</programlisting>
	Then the code will work as expected and prints out 11.
	Note that the <command>local</command> statement initializes
	all the refereced variables (except for function arguments) to
	a <constant>null</constant>.
      </para>
      <para>
	If all variables are to be created as locals you can just pass an
	asterix instead of a list of variables.  In this case the variables
	will not be initialized until they are actually set of course.
	So the following definition of <function>f</function>
	will also work:
<programlisting>function f(g,x) = (
  local *;
  k := 5;
  g(x)
);
</programlisting>
      </para>
      <para>
	It is good practice that all functions that take other functions
	as arguments use local variables.  This way the passed function 
	does not see implementation details and get confused.
      </para>
    </sect1>

    <sect1 id="genius-gel-startup-procedure">
      <title>GEL Startup Procedure</title>
      <para>
First the program looks for the installed library file (the compiled version <filename>lib.cgel</filename>) in the installed directory, then it looks into the current directory, and then it tries to load an uncompiled file called
<filename>~/.geniusinit</filename>.
      </para>
      <para>
If you ever change the library in its installed place, you’ll have to
first compile it with <command>genius --compile loader.gel &gt; lib.cgel</command>
      </para>
    </sect1>

    <sect1 id="genius-gel-loading-programs">
      <title>Loading Programs</title>
      <para>
Sometimes you have a larger program that you wrote into a file and want to read in that file. In these situations, you have two options. You can keep the functions you use most inside the <filename>~/.geniusinit</filename> file. Or if you want to load up a file in a middle of a session (or from within another file), you can type <command>load &lt;list of filenames&gt;</command> at the prompt. This has to be done on the top level and not inside any function or whatnot, and it cannot be part of any expression. It also has a slightly different syntax than the rest of genius, more similiar to a shell. You can enter the file in quotes. If you use the '' quotes, you will get exactly the string that you typed, if you use the "" quotes, special characters will be unescaped as they are for strings. Example:
<programlisting>load program1.gel program2.gel
load "Weird File Name With SPACES.gel"
</programlisting>
There are also <command>cd</command>, <command>pwd</command> and <command>ls</command> commands built in. <command>cd</command> will take one argument, <command>ls</command> will take an argument that is like the glob in the unix shell (i.e., you can use wildcards). <command>pwd</command> takes no arguments. For example:
<programlisting>cd directory_with_gel_programs
ls *.gel
</programlisting>
      </para>
    </sect1>

  </chapter>

  <!-- ============= Matrices ================================= -->
  <chapter id="genius-gel-matrices">
    <title>Matrices en GEL</title>

    <para>
      Genius has support for vectors and matrices and a sizable library of
      matrix manipulation and linear algebra functions.
    </para>

    <sect1 id="genius-gel-matrix-support">
      <title>Entering Matrices</title>
      <para>
To enter matrixes, you can use one of the following two syntaxes. You can either enter
the matrix on one line, separating values by commas and rows by semicolons.  Or you
can enter each row on one line, separating
values by commas.
You can also just combine the two methods.
So to enter a 3x3 matrix
of numbers 1-9 you could do
<programlisting>[1,2,3;4,5,6;7,8,9]
</programlisting>
or
<programlisting>[1, 2, 3
 4, 5, 6
 7, 8, 9]
</programlisting>
Do not use both ';' and return at once on the same line though.
      </para>

      <para>
You can also use the matrix expansion functionality to enter matricies.
For example you can do:
<programlisting>a = [ 1, 2, 3
      4, 5, 6
      7, 8, 9]
b = [ a,  10
      11, 12]
</programlisting>
and you should get
<programlisting>[1,   2,  3, 10
 4,   5,  6, 10
 7,   8,  9, 10
 11, 11, 11, 12]
</programlisting>
similiarly you can build matricies out of vectors and other stuff like that.
      </para>

      <para>
Another thing is that non-specified spots are initialized to 0, so
<programlisting>[1, 2, 3
 4, 5
 6]
</programlisting>
will end up being
<programlisting>
[1, 2, 3
 4, 5, 0
 6, 0, 0]
</programlisting>
      </para>

      <para>
	When matrices are evaluated, they are evaluated and traversed row-wise.  This is just
	like the <literal>M@(j)</literal> operator which traverses the matrix row-wise.
      </para>

      <note>
        <para>
Be careful about using returns for expressions inside the
<literal>[ ]</literal> brackets, as they have a slightly different meaning
there.  You will start a new row.
        </para>
      </note>

    </sect1>

    <sect1 id="genius-gel-matrix-transpose">
      <title>Conjugate Transpose and Transpose Operator</title>
      <para>
You can conjugate transpose a matrix by using the <literal>'</literal> operator.  That is
the entry in the
<varname>i</varname>th column and the <varname>j</varname>th row will be
the complex conjugate of the entry in the
<varname>j</varname>th column and the <varname>i</varname>th row of the original matrix.
 For example:
<programlisting>[1,2,3]*[4,5,6]'
</programlisting>
We transpose the second vector to make matrix multiplication possible.
If you just want to transpose a matrix without conjugating it, you would
use the <literal>.'</literal> operator.  For example:
<programlisting>[1,2,3]*[4,5,6i].'
</programlisting>
      </para>
	<para>
	  Note that normal transpose, that is the <literal>.'</literal> operator, is much faster
	  and will not create a new copy of the matrix in memory.  The conjugate transpose does
	  create a new copy unfortunately.
	  It is recommended to always use the <literal>.'</literal> operator when working with real
	  matrices and vectors.
	</para>
    </sect1>

    <sect1 id="genius-gel-matrix-linalg">
      <title>Linear Algebra</title>
      <para>
	Genius implements many useful linear algebra and matrix manipulation
routines.  See the <link linkend="genius-gel-function-list-linear-algebra">Linear Algebra</link> and
<link linkend="genius-gel-function-list-matrix">Matrix Manipulation</link>
sections of the GEL function listing.
      </para>
      <para>
	The linear algebra routines implemented in GEL do not currently come
from a well tested numerical package, and thus should not be used for critical
numerical computation.  On the other hand, Genius implements very well many
linear algebra operations with rational and integer coefficients.  These are
inherently exact and in fact will give you much better results than common
double precision routines for linear algebra.
      </para>
      <para>
	For example, it is pointless to compute the rank and nullspace of a
floating point matrix since for all practical purposes, we need to consider the
matrix as having some slight errors.  You are likely to get a different result
than you expect.  The problem is that under a small perturbation every matrix
is of full rank and invertible.  If the matrix however is of rational numbers,
then the rank and nullspace are always exact.
      </para>
      <para>
	In general when Genius computes the basis of a certain vectorspace
(for example with the <function>NullSpace</function>) it will give the basis as
a matrix, in which the columns are the vectors of the basis.  That is, when
Genius talks of a linear subspace it means a matrix whose column space is
the given linear subspace.
      </para>
      <para>
	It should be noted that Genius can remember certain properties of a
matrix.  For example, it will remember that a matrix is in row reduced form.
If many calls are made to functions that internally use row reduced form of
the matrix, we can just row reduce the matrix beforehand once.  Successive
calls to <function>rref</function> will be very fast.
      </para>
    </sect1>

  </chapter>

  <!-- ============= Polynomials ============================== -->
  <chapter id="genius-gel-polynomials">
    <title>Polynômes en GEL</title>

    <para>
      Currently Genius can handle polynomials of one variable written out
      as vectors, and do some basic operations with these.  It is planned to
      expand this support further.
    </para>

    <sect1 id="genius-gel-polynomials-using">
      <title>Using Polynomials</title>
      <para>
Currently
polynomials in one variable are just horizontal vectors with value only nodes.
The power of the term is the position in the vector, with the first position
being 0. So,
<programlisting>[1,2,3]
</programlisting>
translates to a polynomial of
<programlisting>1 + 2*x + 3*x^2
</programlisting>
      </para>
      <para>
You can add, subtract and multiply polynomials using the
<link linkend="gel-function-AddPoly"><function>AddPoly</function></link>,
<link linkend="gel-function-SubtractPoly"><function>SubtractPoly</function></link>, and
<link linkend="gel-function-MultiplyPoly"><function>MultiplyPoly</function></link> functions respectively.
You can print a polynomial using the
<link linkend="gel-function-PolyToString"><function>PolyToString</function></link>
function.
For example,
<programlisting>PolyToString([1,2,3],"y")
</programlisting>
gives
<programlisting>3*y^2 + 2*y + 1
</programlisting>
You can also get a function representation of the polynomial so that you can
evaluate it. This is done by using
<link linkend="gel-function-PolyToFunction"><function>PolyToFunction</function></link>,
which
returns an anonymous function.
<programlisting>f = PolyToFunction([0,1,1])
f(2)
</programlisting>
      </para>
      <para>
	It is also possible to find roots of polynomials of degrees 1 through 4 by using the
function
<link linkend="gel-function-PolynomialRoots"><function>PolynomialRoots</function></link>,
which calls the appropriate formula function.  Higher degree polynomials must be converted to
functions and solved
numerically using a function such as
<link linkend="gel-function-FindRootBisection"><function>FindRootBisection</function></link>,
<link linkend="gel-function-FindRootFalsePosition"><function>FindRootFalsePosition</function></link>,
<link linkend="gel-function-FindRootMullersMethod"><function>FindRootMullersMethod</function></link>, or
<link linkend="gel-function-FindRootSecant"><function>FindRootSecant</function></link>.
      </para>
      <para>
See <xref linkend="genius-gel-function-list-polynomials"/> in the function list
for the rest of functions acting on polynomials.
      </para>
    </sect1>

  </chapter>

  <!-- ============= Set Theory ============================== -->
  <chapter id="genius-gel-settheory">
    <title>Théorie des ensembles en GEL</title>

    <para>
      Genius has some basic set theoretic functionality built in.  Currently a set is
      just a vector (or a matrix).  Every distinct object is treated as a different element.
    </para>

    <sect1 id="genius-gel-sets-using">
      <title>Using Sets</title>
      <para>
	Just like vectors, objects
      in sets can include numbers, strings, <constant>null</constant>, matrices and vectors.  It is
      planned in the future to have a dedicated type for sets, rather than using vectors.
      Note that floating point numbers are distinct from integers, even if they appear the same.
      That is, Genius will treat <constant>0</constant> and <constant>0.0</constant>
      as two distinct elements.  The <constant>null</constant> is treated as an empty set.
    </para>
      <para>
	To build a set out of a vector, use the 
	<link linkend="gel-function-MakeSet"><function>MakeSet</function></link> function.
	Currently, it will just return a new vector where every element is unique.
<screen><prompt>genius&gt; </prompt><userinput>MakeSet([1,2,2,3])</userinput>
= [1, 2, 3]
</screen>
</para>

	<para>
	Similarly there are functions 
	<link linkend="gel-function-Union"><function>Union</function></link>,
	<link linkend="gel-function-Intersection"><function>Intersection</function></link>,
	<link linkend="gel-function-SetMinus"><function>SetMinus</function></link>, which
	are rather self explanatory.  For example:
<screen><prompt>genius&gt; </prompt><userinput>Union([1,2,3], [1,2,4])</userinput>
= [1, 2, 4, 3]
</screen>
	Note that no order is guaranteed for the return values.  If you wish to sort the vector you
should use the
	<link linkend="gel-function-SortVector"><function>SortVector</function></link> function.
	</para>

	<para>
	  For testing membership, there are functions
	<link linkend="gel-function-IsIn"><function>IsIn</function></link> and
	<link linkend="gel-function-IsSubset"><function>IsSubset</function></link>,
	which return a boolean value.  For example:
<screen><prompt>genius&gt; </prompt><userinput>IsIn (1, [0,1,2])</userinput>
= true
</screen>
	The input <userinput>IsIn(x,X)</userinput> is of course equivalent to
	<userinput>IsSubset([x],X)</userinput>.  Note that since the empty set is a subset
	of every set, <userinput>IsSubset(null,X)</userinput> is always true.
	</para>

    </sect1>

  </chapter>

  <!-- ============= GEL function list ======================== -->
  <chapter id="genius-gel-function-list">
    <title>Liste des fonctions GEL</title>

    <!--&gel-function-list;-->

    <para>
To get help on a specific function from the console type:
<programlisting>help FunctionName
</programlisting>
    </para>

    <sect1 id="genius-gel-function-list-commands">
      <title>Commands</title>
      <variablelist>
        <varlistentry>
         <term><anchor id="gel-command-help"/>help</term>
         <listitem>
          <synopsis>help</synopsis>
          <synopsis>help FunctionName</synopsis>
          <para>Print help (or help on a function/command).</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-command-load"/>load</term>
         <listitem>
          <synopsis>load "file.gel"</synopsis>
          <para>Load a file into the interpretor.  The file will execute
as if it were typed onto the command line.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-command-cd"/>cd</term>
         <listitem>
          <synopsis>cd /directory/name</synopsis>
          <para>Change working directory to <filename>/directory/name</filename>.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-command-pwd"/>pwd</term>
         <listitem>
          <synopsis>pwd</synopsis>
          <para>Print the current working directory.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-command-ls"/>ls</term>
         <listitem>
          <synopsis>ls</synopsis>
          <para>List files in the current directory.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-command-plugin"/>plugin</term>
         <listitem>
          <synopsis>plugin plugin_name</synopsis>
          <para>Load a plugin.  Plugin of that name must be installed on the system
in the proper directory.</para>
         </listitem>
        </varlistentry>
      </variablelist>
    </sect1>

    <sect1 id="genius-gel-function-list-basic">
      <title>Basic</title>
      <variablelist>
        <varlistentry>
         <term><anchor id="gel-function-AskButtons"/>AskButtons</term>
         <listitem>
          <synopsis>AskButtons (query)</synopsis>
          <synopsis>AskButtons (query, button1, ...)</synopsis>
	  <para>Asks a question and presents a list of buttons to the user (or
a menu of options in text mode).  Returns the 1-based index of the button
pressed.  That is, returns 1 if the first button was pressed, 2 if the second
button was pressed, and so on.  If the user closes the window (or simply hits
enter in text mode), then <constant>null</constant> is returned.  The execution
of the program is blocked until the user responds.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-AskString"/>AskString</term>
         <listitem>
          <synopsis>AskString (query)</synopsis>
          <synopsis>AskString (query, default)</synopsis>
          <para>Asks a question and lets the user enter a string which
it then returns.  If the user cancels or closes the window, then
<constant>null</constant> is returned.  The execution of the program
is blocked until the user responds.  If <varname>default</varname> is given, then it is pre-typed in for the user to just press enter on.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-Compose"/>Compose</term>
         <listitem>
          <synopsis>Compose (f,g)</synopsis>
          <para>Compose two functions and return a function that is the composition of <function>f</function> and <function>g</function>.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-ComposePower"/>ComposePower</term>
         <listitem>
          <synopsis>ComposePower (f,n,x)</synopsis>
          <para>Compose and execute a function with itself <varname>n</varname> times, passing <varname>x</varname> as argument.  Returning <varname>x</varname> if
<varname>n</varname> equals 0.
		Example:
          <screen><prompt>genius&gt;</prompt> <userinput>function f(x) = x^2 ;</userinput>
<prompt>genius&gt;</prompt> <userinput>ComposePower (f,3,7)</userinput>
= 5764801
<prompt>genius&gt;</prompt> <userinput>f(f(f(7)))</userinput>
= 5764801
</screen>
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-Evaluate"/>Evaluate</term>
         <listitem>
          <synopsis>Evaluate (str)</synopsis>
          <para>Parses and evaluates a string.</para>
         </listitem>
        </varlistentry>


        <varlistentry>
         <term><anchor id="gel-function-GetCurrentModulo"/>GetCurrentModulo</term>
         <listitem>
          <synopsis>GetCurrentModulo</synopsis>
          <para>Get current modulo from the context outside the function.  That is, if outside of
the function was executed in modulo (using <literal>mod</literal>) then this returns what
this modulo was.  Normally the body of the function called is not executed in modular arithmetic,
and this builtin function makes it possible to make GEL functions aware of modular arithmetic.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-Identity"/>Identity</term>
         <listitem>
          <synopsis>Identity (x)</synopsis>
          <para>Identity function, returns its argument.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-IntegerFromBoolean"/>IntegerFromBoolean</term>
         <listitem>
          <synopsis>IntegerFromBoolean (bval)</synopsis>
	  <para>
	    Make integer (0 for <constant>false</constant> or 1 for
	    <constant>true</constant>) from a boolean value.
	    <varname>bval</varname> can also be a number in which case a
	    non-zero value will be interpreted as <constant>true</constant> and
	    zero will be interpreted as <constant>false</constant>.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-IsBoolean"/>IsBoolean</term>
         <listitem>
          <synopsis>IsBoolean (arg)</synopsis>
          <para>Check if argument is a boolean (and not a number).</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-IsDefined"/>IsDefined</term>
         <listitem>
          <synopsis>IsDefined (id)</synopsis>
          <para>Check if an id is defined.  You should pass a string or
	   and identifier.  If you pass a matrix, each entry will be
	   evaluated separately and the matrix should contain strings
	   or identifiers.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-IsFunction"/>IsFunction</term>
         <listitem>
          <synopsis>IsFunction (arg)</synopsis>
          <para>Check if argument is a function.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-IsFunctionOrIdentifier"/>IsFunctionOrIdentifier</term>
         <listitem>
          <synopsis>IsFunctionOrIdentifier (arg)</synopsis>
          <para>Check if argument is a function or an identifier.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-IsFunctionRef"/>IsFunctionRef</term>
         <listitem>
          <synopsis>IsFunctionRef (arg)</synopsis>
          <para>Check if argument is a function reference.  This includes variable
references.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-IsMatrix"/>IsMatrix</term>
         <listitem>
          <synopsis>IsMatrix (arg)</synopsis>
          <para>Check if argument is a matrix.  Even though <constant>null</constant> is
sometimes considered an empty matrix, the function <function>IsMatrix</function> does
not consider <constant>null</constant> a matrix.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-IsNull"/>IsNull</term>
         <listitem>
          <synopsis>IsNull (arg)</synopsis>
	  <para>Check if argument is a <constant>null</constant>.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-IsString"/>IsString</term>
         <listitem>
          <synopsis>IsString (arg)</synopsis>
          <para>Check if argument is a text string.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-IsValue"/>IsValue</term>
         <listitem>
          <synopsis>IsValue (arg)</synopsis>
          <para>Check if argument is a number.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-Parse"/>Parse</term>
         <listitem>
          <synopsis>Parse (str)</synopsis>
          <para>Parses but does not evaluate a string.  Note that certain
	    pre-computation is done during the parsing stage.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-SetFunctionFlags"/>SetFunctionFlags</term>
         <listitem>
          <synopsis>SetFunctionFlags (id,flags...)</synopsis>
          <para>Set flags for a function, currently <literal>"PropagateMod"</literal> and <literal>"NoModuloArguments"</literal>.
If <literal>"PropagateMod"</literal> is set, then the body of the function is evaluated in modular arithmetic when the function
is called inside a block that was evaluated using modular arithmetic (using <literal>mod</literal>).  If
<literal>"NoModuloArguments"</literal>, then the arguments of the function are never evaluated using modular arithmetic.
 </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-SetHelp"/>SetHelp</term>
         <listitem>
          <synopsis>SetHelp (id,category,desc)</synopsis>
          <para>Set the category and help description line for a function.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-SetHelpAlias"/>SetHelpAlias</term>
         <listitem>
          <synopsis>SetHelpAlias (id,alias)</synopsis>
          <para>Sets up a help alias.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-chdir"/>chdir</term>
         <listitem>
          <synopsis>chdir (dir)</synopsis>
          <para>Changes current directory, same as the <command>cd</command>.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-CurrentTime"/>CurrentTime</term>
         <listitem>
          <synopsis>CurrentTime</synopsis>
          <para>Returns the current UNIX time with microsecond precision as a floating point number.  That is, returns the number of seconds since January 1st 1970.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-display"/>display</term>
         <listitem>
          <synopsis>display (str,expr)</synopsis>
          <para>Display a string and an expression with a colon to separate them.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-error"/>error</term>
         <listitem>
          <synopsis>error (str)</synopsis>
          <para>Prints a string to the error stream (onto the console).</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-exit"/>exit</term>
         <listitem>
          <synopsis>exit</synopsis>
          <para>Aliases: <function>quit</function></para>
          <para>Exits the program.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-false"/>false</term>
         <listitem>
          <synopsis>false</synopsis>
          <para>Aliases: <function>False</function> <function>FALSE</function></para>
	  <para>The <constant>false</constant> boolean value.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-manual"/>manual</term>
         <listitem>
          <synopsis>manual</synopsis>
          <para>Displays the user manual.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-print"/>print</term>
         <listitem>
          <synopsis>print (str)</synopsis>
          <para>Prints an expression and then print a newline.  The argument <varname>str</varname> can be any expression.  It is
made into a string before being printed.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-printn"/>printn</term>
         <listitem>
          <synopsis>printn (str)</synopsis>
          <para>Prints an expression without a trailing newline.  The argument <varname>str</varname> can be any expression.  It is
made into a string before being printed.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-protect"/>protect</term>
         <listitem>
          <synopsis>protect (id)</synopsis>
          <para>Protect a variable from being modified.  This is used on the internal GEL functions to
avoid them being accidentally overridden.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-ProtectAll"/>ProtectAll</term>
         <listitem>
          <synopsis>ProtectAll ()</synopsis>
          <para>Protect all currently defined variables, parameters and
functions from being modified.  This is used on the internal GEL functions to
avoid them being accidentally overridden.  Normally <application>Genius Mathematics Tool</application> considers
unprotected variables as user defined.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-set"/>set</term>
         <listitem>
          <synopsis>set (id,val)</synopsis>
          <para>Set a global variable.  The <varname>id</varname>
            can be either a string or a quoted identifier as follows.
	    For example:
	    <programlisting>set(`x,1)
	    </programlisting>
	    will set the global variable <varname>x</varname> to the value 1.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-string"/>string</term>
         <listitem>
          <synopsis>string (s)</synopsis>
          <para>Make a string.  This will make a string out of any argument.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-true"/>true</term>
         <listitem>
          <synopsis>true</synopsis>
          <para>Aliases: <function>True</function> <function>TRUE</function></para>
	  <para>The <constant>true</constant> boolean value.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-undefine"/>undefine</term>
         <listitem>
          <synopsis>undefine (id)</synopsis>
          <para>Alias: <function>Undefine</function></para>
          <para>Undefine a variable.  This includes locals and globals,
	    every value on all context levels is wiped.  This function
	    should really not be used on local variables.  A vector of
	    identifiers can also be passed to undefine several variables.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-UndefineAll"/>UndefineAll</term>
         <listitem>
          <synopsis>UndefineAll ()</synopsis>
	  <para>Undefine all unprotected global variables
	    (including functions and parameters).  Normally <application>Genius Mathematics Tool</application>
	    considers protected variables as system defined functions
	    and variables.  Note that <function>UndefineAll</function>
	    only removes the global definition of symbols not local ones,
	    so that it may be run from inside other functions safely.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-unprotect"/>unprotect</term>
         <listitem>
          <synopsis>unprotect (id)</synopsis>
          <para>Unprotect a variable from being modified.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-UserVariables"/>UserVariables</term>
         <listitem>
          <synopsis>UserVariables ()</synopsis>
          <para>Return a vector of identifiers of
	    user defined (unprotected) global variables.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-wait"/>wait</term>
         <listitem>
          <synopsis>wait (secs)</synopsis>
          <para>Waits a specified number of seconds.  <varname>secs</varname>
must be non-negative.  Zero is accepted and nothing happens in this case,
except possibly user interface events are processed.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-version"/>version</term>
         <listitem>
          <synopsis>version</synopsis>
          <para>Returns the version of Genius as a horizontal 3-vector with
	  major version first, then minor version and finally the patch level.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-warranty"/>warranty</term>
         <listitem>
          <synopsis>warranty</synopsis>
          <para>Gives the warranty information.</para>
         </listitem>
        </varlistentry>
      </variablelist>

    </sect1>

    <sect1 id="genius-gel-function-parameters">
      <title>Parameters</title>
      <variablelist>
        <varlistentry>
         <term><anchor id="gel-function-ChopTolerance"/>ChopTolerance</term>
         <listitem>
          <synopsis>ChopTolerance = number</synopsis>
          <para>Tolerance of the <function>Chop</function> function.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-ContinuousNumberOfTries"/>ContinuousNumberOfTries</term>
         <listitem>
          <synopsis>ContinuousNumberOfTries = number</synopsis>
          <para>How many iterations to try to find the limit for continuity and limits.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-ContinuousSFS"/>ContinuousSFS</term>
         <listitem>
          <synopsis>ContinuousSFS = number</synopsis>
          <para>How many successive steps to be within tolerance for calculation of continuity.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-ContinuousTolerance"/>ContinuousTolerance</term>
         <listitem>
          <synopsis>ContinuousTolerance = number</synopsis>
          <para>Tolerance for continuity of functions and for calculating the limit.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-DerivativeNumberOfTries"/>DerivativeNumberOfTries</term>
         <listitem>
          <synopsis>DerivativeNumberOfTries = number</synopsis>
          <para>How many iterations to try to find the limit for derivative.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-DerivativeSFS"/>DerivativeSFS</term>
         <listitem>
          <synopsis>DerivativeSFS = number</synopsis>
          <para>How many successive steps to be within tolerance for calculation of derivative.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-DerivativeTolerance"/>DerivativeTolerance</term>
         <listitem>
          <synopsis>DerivativeTolerance = number</synopsis>
          <para>Tolerance for calculating the derivatives of functions.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-ErrorFunctionTolerance"/>ErrorFunctionTolerance</term>
         <listitem>
          <synopsis>ErrorFunctionTolerance = number</synopsis>
          <para>Tolerance of the <function>ErrorFunction</function>.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-FloatPrecision"/>FloatPrecision</term>
         <listitem>
          <synopsis>FloatPrecision = number</synopsis>
          <para>Floating point precision.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-FullExpressions"/>FullExpressions</term>
         <listitem>
          <synopsis>FullExpressions = boolean</synopsis>
          <para>Print full expressions, even if more than a line.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-GaussDistributionTolerance"/>GaussDistributionTolerance</term>
         <listitem>
          <synopsis>GaussDistributionTolerance = number</synopsis>
          <para>Tolerance of the <function>GaussDistribution</function> function.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-IntegerOutputBase"/>IntegerOutputBase</term>
         <listitem>
          <synopsis>IntegerOutputBase = number</synopsis>
          <para>Integer output base.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-IsPrimeMillerRabinReps"/>IsPrimeMillerRabinReps</term>
         <listitem>
          <synopsis>IsPrimeMillerRabinReps = number</synopsis>
          <para>Number of extra Miller-Rabin tests to run on a number before declaring it a prime in <function>IsPrime</function>.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-LinePlotDrawLegends"/>LinePlotDrawLegends</term>
         <listitem>
          <synopsis>LinePlotDrawLegends = true</synopsis>
          <para>Tells genius to draw the legends for <link linkend="genius-gel-function-list-plotting">line plotting
	  functions</link> such as <link linkend="gel-function-LinePlot"><function>LinePlot</function></link>.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-LinePlotDrawAxisLabels"/>LinePlotDrawAxisLabels</term>
         <listitem>
          <synopsis>LinePlotDrawAxisLabels = true</synopsis>
          <para>Tells genius to draw the axis labels for <link linkend="genius-gel-function-list-plotting">line plotting
	  functions</link> such as <link linkend="gel-function-LinePlot"><function>LinePlot</function></link>.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-LinePlotVariableNames"/>LinePlotVariableNames</term>
         <listitem>
          <synopsis>LinePlotVariableNames = ["x","y","z","t"]</synopsis>
          <para>Tells genius which variable names are used as default names  for <link linkend="genius-gel-function-list-plotting">line plotting
	  functions</link> such as <link linkend="gel-function-LinePlot"><function>LinePlot</function></link> and friends.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-LinePlotWindow"/>LinePlotWindow</term>
         <listitem>
          <synopsis>LinePlotWindow = [x1,x2,y1,y2]</synopsis>
          <para>Sets the limits for <link linkend="genius-gel-function-list-plotting">line plotting
	  functions</link> such as <link linkend="gel-function-LinePlot"><function>LinePlot</function></link>.
          </para>
         </listitem>
        </varlistentry>


        <varlistentry>
         <term><anchor id="gel-function-MaxDigits"/>MaxDigits</term>
         <listitem>
          <synopsis>MaxDigits = number</synopsis>
          <para>Maximum digits to display.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-MaxErrors"/>MaxErrors</term>
         <listitem>
          <synopsis>MaxErrors = number</synopsis>
          <para>Maximum errors to display.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-MixedFractions"/>MixedFractions</term>
         <listitem>
          <synopsis>MixedFractions = boolean</synopsis>
          <para>If true, mixed fractions are printed.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-NumericalIntegralFunction"/>NumericalIntegralFunction</term>
         <listitem>
          <synopsis>NumericalIntegralFunction = function</synopsis>
          <para>The function used for numerical integration in <function>NumericalIntegral</function>.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-NumericalIntegralSteps"/>NumericalIntegralSteps</term>
         <listitem>
          <synopsis>NumericalIntegralSteps = number</synopsis>
          <para>Steps to perform in <function>NumericalIntegral</function>.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-OutputChopExponent"/>OutputChopExponent</term>
         <listitem>
          <synopsis>OutputChopExponent = number</synopsis>
	  <para>When another number in the object being printed (a matrix or a
value) is greater than
10<superscript>-OutputChopWhenExponent</superscript>, and
the number being printed is less than 
10<superscript>-OutputChopExponent</superscript>, then
display <computeroutput>0.0</computeroutput> instead of the number.
</para>
<para>
Output is never chopped if <function>OutputChopExponent</function> is zero.
It must be a non-negative integer.
</para>
<para>
If you want output always chopped according to
<function>OutputChopExponent</function>, then set
<function>OutputChopWhenExponent</function>, to something
greater than or equal to
<function>OutputChopExponent</function>.
</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-OutputChopWhenExponent"/>OutputChopWhenExponent</term>
         <listitem>
          <synopsis>OutputChopWhenExponent = number</synopsis>
	  <para>When to chop output.  See
          <link linkend="gel-function-OutputChopExponent"><function>OutputChopExponent</function></link>.
</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-OutputStyle"/>OutputStyle</term>
         <listitem>
          <synopsis>OutputStyle = string</synopsis>
          <para>
	    Output style, this can be <literal>normal</literal>, <literal>latex</literal>, <literal>mathml</literal> or <literal>troff</literal>.
	  </para>
	  <para>
	    This affects mostly how matrices and fractions are printed out and
	    is useful for pasting into documents.  For example you can set this
	    to the latex by:
	    <programlisting>OutputStyle = "latex"
</programlisting>
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-ResultsAsFloats"/>ResultsAsFloats</term>
         <listitem>
          <synopsis>ResultsAsFloats = boolean</synopsis>
          <para>Convert all results to floats before printing.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-ScientificNotation"/>ScientificNotation</term>
         <listitem>
          <synopsis>ScientificNotation = boolean</synopsis>
          <para>Use scientific notation.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-SlopefieldTicks"/>SlopefieldTicks</term>
         <listitem>
          <synopsis>SlopefieldTicks = [vertical,horizontal]</synopsis>
          <para>Sets the number of vertical and horizontal ticks in a
slopefield plot.  (See <link linkend="gel-function-SlopefieldPlot"><function>SlopefieldPlot</function></link>).
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-SumProductNumberOfTries"/>SumProductNumberOfTries</term>
         <listitem>
          <synopsis>SumProductNumberOfTries = number</synopsis>
          <para>How many iterations to try for <function>InfiniteSum</function> and <function>InfiniteProduct</function>.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-SumProductSFS"/>SumProductSFS</term>
         <listitem>
          <synopsis>SumProductSFS = number</synopsis>
          <para>How many successive steps to be within tolerance for <function>InfiniteSum</function> and <function>InfiniteProduct</function>.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-SumProductTolerance"/>SumProductTolerance</term>
         <listitem>
          <synopsis>SumProductTolerance = number</synopsis>
          <para>Tolerance for <function>InfiniteSum</function> and <function>InfiniteProduct</function>.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-SurfacePlotDrawLegends"/>SurfacePlotDrawLegends</term>
         <listitem>
          <synopsis>SurfacePlotDrawLegends = true</synopsis>
          <para>Tells genius to draw the legends for <link linkend="genius-gel-function-list-plotting">surface plotting
	  functions</link> such as <link linkend="gel-function-SurfacePlot"><function>SurfacePlot</function></link>.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-SurfacePlotVariableNames"/>SurfacePlotVariableNames</term>
         <listitem>
          <synopsis>SurfacePlotVariableNames = ["x","y","z"]</synopsis>
          <para>Tells genius which variable names are used as default names for <link linkend="genius-gel-function-list-plotting">surface plotting
	  functions</link> using <link linkend="gel-function-SurfacePlot"><function>SurfacePlot</function></link>.
          Note that the <varname>z</varname> does not refer to the dependent (vertical) axis, but to the indepent complex variable
          <userinput>z=x+iy</userinput>.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-SurfacePlotWindow"/>SurfacePlotWindow</term>
         <listitem>
          <synopsis>SurfacePlotWindow = [x1,x2,y1,y2,z1,z2]</synopsis>
          <para>Sets the limits for surface plotting (See <link linkend="gel-function-SurfacePlot"><function>SurfacePlot</function></link>).</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-VectorfieldNormalized"/>VectorfieldNormalized</term>
         <listitem>
          <synopsis>VectorfieldNormalized = true</synopsis>
          <para>Should the vectorfield plotting have normalized arrow length.  If true, vector fields will only show direction
	   and not magnitude.  (See <link linkend="gel-function-VectorfieldPlot"><function>VectorfieldPlot</function></link>).
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-VectorfieldTicks"/>VectorfieldTicks</term>
         <listitem>
          <synopsis>VectorfieldTicks = [vertical,horizontal]</synopsis>
          <para>Sets the number of vertical and horizontal ticks in a
vectorfield plot.  (See <link linkend="gel-function-VectorfieldPlot"><function>VectorfieldPlot</function></link>).
          </para>
         </listitem>
        </varlistentry>

      </variablelist>
    </sect1>

    <sect1 id="genius-gel-function-list-constants">
      <title>Constants</title>
      <variablelist>
        <varlistentry>
         <term><anchor id="gel-function-CatalanConstant"/>CatalanConstant</term>
         <listitem>
          <synopsis>CatalanConstant</synopsis>
          <para>
	    Catalan's Constant, approximately 0.915...  It is defined to be the series where terms are <userinput>(-1^k)/((2*k+1)^2)</userinput>, where <varname>k</varname> ranges from 0 to infinity.
	  </para>
          <para>
	    See
	    <ulink url="http://mathworld.wolfram.com/CatalansConstant.html">Mathworld</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-EulerConstant"/>EulerConstant</term>
         <listitem>
          <synopsis>EulerConstant</synopsis>
          <para>Aliases: <function>gamma</function></para>
          <para>
	    Euler's Constant gamma.  Sometimes called the
	    Euler-Mascheroni constant.
	  </para>
          <para>
	    See
	    <ulink url="http://en.wikipedia.org/wiki/Euler-Mascheroni_constant">Wikipedia</ulink> or
	    <ulink url="http://planetmath.org/encyclopedia/MascheroniConstant.html">Planetmath</ulink> or
	    <ulink url="http://mathworld.wolfram.com/Euler-MascheroniConstant.html">Mathworld</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-GoldenRatio"/>GoldenRatio</term>
         <listitem>
          <synopsis>GoldenRatio</synopsis>
          <para>The Golden Ratio.</para>
          <para>
	    See
	    <ulink url="http://en.wikipedia.org/wiki/Golden_ratio">Wikipedia</ulink> or
	    <ulink url="http://planetmath.org/encyclopedia/GoldenRatio.html">Planetmath</ulink> or
	    <ulink url="http://mathworld.wolfram.com/GoldenRatio.html">Mathworld</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-Gravity"/>Gravity</term>
         <listitem>
          <synopsis>Gravity</synopsis>
          <para>Free fall acceleration at sea level.</para>
          <para>
	    See
	    <ulink url="http://en.wikipedia.org/wiki/Standard_gravity">Wikipedia</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-e"/>e</term>
         <listitem>
          <synopsis>e</synopsis>
          <para>
	    The base of the natural logarithm.  <userinput>e^x</userinput>
	    is the exponential function
	    <link linkend="gel-function-exp"><function>exp</function></link>.  This is the
	    number approximately 2.71828182846...
	  </para>
          <para>
	    See
	    <ulink url="http://en.wikipedia.org/wiki/E_(mathematical_constant)">Wikipedia</ulink> or
	    <ulink url="http://planetmath.org/encyclopedia/E.html">Planetmath</ulink> or
	    <ulink url="http://mathworld.wolfram.com/e.html">Mathworld</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-pi"/>pi</term>
         <listitem>
          <synopsis>pi</synopsis>
          <para>
	    The number pi, that is the ratio of a circle's circumference
	    to its diameter.  This is approximately 3.14159265359...
	  </para>
          <para>
	    See
	    <ulink url="http://en.wikipedia.org/wiki/Pi">Wikipedia</ulink> or
	    <ulink url="http://planetmath.org/encyclopedia/Pi.html">Planetmath</ulink> or
	    <ulink url="http://mathworld.wolfram.com/Pi.html">Mathworld</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

      </variablelist>
    </sect1>

    <sect1 id="genius-gel-function-list-numeric">
      <title>Numeric</title>
      <variablelist>
        <varlistentry>
         <term><anchor id="gel-function-AbsoluteValue"/>AbsoluteValue</term>
         <listitem>
          <synopsis>AbsoluteValue (x)</synopsis>
          <para>Aliases: <function>abs</function></para>
          <para>
	    Absolute value of a number and if <varname>x</varname> is
	    a complex value the modulus of <varname>x</varname>.  I.e. this
	    the distance of <varname>x</varname> to the origin.
	  </para>
          <para>
	    See
	    <ulink url="http://en.wikipedia.org/wiki/Absolute_value">Wikipedia</ulink>,
	    <ulink url="http://planetmath.org/encyclopedia/AbsoluteValue.html">Planetmath (absolute value)</ulink>,
	    <ulink url="http://planetmath.org/encyclopedia/ModulusOfComplexNumber.html">Planetmath (modulus)</ulink>,
	    <ulink url="http://mathworld.wolfram.com/AbsoluteValue.html">Mathworld (absolute value)</ulink> or
	    <ulink url="http://mathworld.wolfram.com/ComplexModulus.html">Mathworld (complex modulus)</ulink>
for more information.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-Chop"/>Chop</term>
         <listitem>
          <synopsis>Chop (x)</synopsis>
          <para>Replace very small number with zero.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-ComplexConjugate"/>ComplexConjugate</term>
         <listitem>
          <synopsis>ComplexConjugate (z)</synopsis>
          <para>Aliases: <function>conj</function> <function>Conj</function></para>
          <para>Calculates the complex conjugate of the complex number <varname>z</varname>.  If <varname>z</varname> is a vector or matrix,
all its elements are conjugated.</para>
          <para>
	    See
	    <ulink url="http://en.wikipedia.org/wiki/Complex_conjugate">Wikipedia</ulink> for more information.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-Denominator"/>Denominator</term>
         <listitem>
          <synopsis>Denominator (x)</synopsis>
          <para>Get the denominator of a rational number.</para>
          <para>
	    See
	    <ulink url="http://en.wikipedia.org/wiki/Denominator">Wikipedia</ulink> for more information.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-FractionalPart"/>FractionalPart</term>
         <listitem>
          <synopsis>FractionalPart (x)</synopsis>
          <para>Return the fractional part of a number.</para>
          <para>
	    See
	    <ulink url="http://en.wikipedia.org/wiki/Fractional_part">Wikipedia</ulink> for more information.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-Im"/>Im</term>
         <listitem>
          <synopsis>Im (z)</synopsis>
          <para>Aliases: <function>ImaginaryPart</function></para>
          <para>Get the imaginary part of a complex number.</para>
          <para>
	    See
	    <ulink url="http://en.wikipedia.org/wiki/Imaginary_part">Wikipedia</ulink> for more information.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-IntegerQuotient"/>IntegerQuotient</term>
         <listitem>
          <synopsis>IntegerQuotient (m,n)</synopsis>
          <para>Division without remainder.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-IsComplex"/>IsComplex</term>
         <listitem>
          <synopsis>IsComplex (num)</synopsis>
          <para>Check if argument is a complex (non-real) number.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-IsComplexRational"/>IsComplexRational</term>
         <listitem>
          <synopsis>IsComplexRational (num)</synopsis>
	  <para>Check if argument is a possibly complex rational number.  That is, if both real and imaginary parts are
	  given as rational numbers.  Of course rational simply means "not stored as a floating point number."</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-IsFloat"/>IsFloat</term>
         <listitem>
          <synopsis>IsFloat (num)</synopsis>
          <para>Check if argument is a floating point number (non-complex).</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-IsGaussInteger"/>IsGaussInteger</term>
         <listitem>
          <synopsis>IsGaussInteger (num)</synopsis>
          <para>Aliases: <function>IsComplexInteger</function></para>
          <para>Check if argument is a possibly complex integer.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-IsInteger"/>IsInteger</term>
         <listitem>
          <synopsis>IsInteger (num)</synopsis>
          <para>Check if argument is an integer (non-complex).</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-IsNonNegativeInteger"/>IsNonNegativeInteger</term>
         <listitem>
          <synopsis>IsNonNegativeInteger (num)</synopsis>
          <para>Check if argument is a non-negative real integer.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-IsPositiveInteger"/>IsPositiveInteger</term>
         <listitem>
          <synopsis>IsPositiveInteger (num)</synopsis>
          <para>Aliases: <function>IsNaturalNumber</function></para>
          <para>Check if argument is a positive real integer.  Note that
we accept the convention that 0 is not a natural number.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-IsRational"/>IsRational</term>
         <listitem>
          <synopsis>IsRational (num)</synopsis>
          <para>Check if argument is a rational number (non-complex).  Of course rational simply means "not stored as a floating point number."</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-IsReal"/>IsReal</term>
         <listitem>
          <synopsis>IsReal (num)</synopsis>
          <para>Check if argument is a real number.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-Numerator"/>Numerator</term>
         <listitem>
          <synopsis>Numerator (x)</synopsis>
          <para>Get the numerator of a rational number.</para>
          <para>
	    See
	    <ulink url="http://en.wikipedia.org/wiki/Numerator">Wikipedia</ulink> for more information.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-Re"/>Re</term>
         <listitem>
          <synopsis>Re (z)</synopsis>
          <para>Aliases: <function>RealPart</function></para>
          <para>Get the real part of a complex number.</para>
          <para>
	    See
	    <ulink url="http://en.wikipedia.org/wiki/Real_part">Wikipedia</ulink> for more information.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-Sign"/>Sign</term>
         <listitem>
          <synopsis>Sign (x)</synopsis>
          <para>Aliases: <function>sign</function></para>
          <para>Return the sign of a number.  That is returns
<literal>-1</literal> if value is negative,
<literal>0</literal> if value is zero and
<literal>1</literal> if value is positive.  If <varname>x</varname> is a complex
value then <function>Sign</function> returns the direction or 0.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-ceil"/>ceil</term>
         <listitem>
          <synopsis>ceil (x)</synopsis>
          <para>Aliases: <function>Ceiling</function></para>
	  <para>Get the lowest integer more than or equal to <varname>n</varname>. Examples:
          <screen><prompt>genius&gt;</prompt> <userinput>ceil(1.1)</userinput>
= 2
<prompt>genius&gt;</prompt> <userinput>ceil(-1.1)</userinput>
= -1
</screen>
           </para>
	   <para>Note that you should be careful and notice that floating point
		   numbers are stored an binary and so may not be what you
		   expect.  For example <userinput>ceil(420/4.2)</userinput>
		   returns 101 instead of the expected 100.  This is because
		   4.2 is actually very slightly less than 4.2.  Use rational
		   representation <userinput>42/10</userinput> if you want
		   exact arithmetic.
           </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-exp"/>exp</term>
         <listitem>
          <synopsis>exp (x)</synopsis>
          <para>
	    The exponential function.  This is the function
	    <userinput>e^x</userinput> where <varname>e</varname>
	    is the <link linkend="gel-function-e">base of the natural
	    logarithm</link>.
	  </para>
          <para>
	    See
	    <ulink url="http://en.wikipedia.org/wiki/Exponential_function">Wikipedia</ulink> or
	    <ulink url="http://planetmath.org/encyclopedia/LogarithmFunction.html">Planetmath</ulink> or
	    <ulink url="http://mathworld.wolfram.com/ExponentialFunction.html">Mathworld</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-float"/>float</term>
         <listitem>
          <synopsis>float (x)</synopsis>
          <para>Make number a floating point value.  That is returns the floating point representation of the number <varname>x</varname>.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-floor"/>floor</term>
         <listitem>
          <synopsis>floor (x)</synopsis>
          <para>Aliases: <function>Floor</function></para>
          <para>Get the highest integer less than or equal to <varname>n</varname>.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-ln"/>ln</term>
         <listitem>
          <synopsis>ln (x)</synopsis>
          <para>The natural logarithm, the logarithm to base <varname>e</varname>.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-log"/>log</term>
         <listitem>
          <synopsis>log (x)</synopsis>
          <synopsis>log (x,b)</synopsis>
          <para>Logarithm of <varname>x</varname> base <varname>b</varname> (calls <function>DiscreteLog</function> if in modulo mode), if base is not given, <varname>e</varname> is used.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-log10"/>log10</term>
         <listitem>
          <synopsis>log10 (x)</synopsis>
          <para>Logarithm of <varname>x</varname> base 10.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-log2"/>log2</term>
         <listitem>
          <synopsis>log2 (x)</synopsis>
          <para>Aliases: <function>lg</function></para>
          <para>Logarithm of <varname>x</varname> base 2.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-max"/>max</term>
         <listitem>
          <synopsis>max (a,args...)</synopsis>
          <para>Aliases: <function>Max</function> <function>Maximum</function></para>
          <para>Returns the maximum of arguments or matrix.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-min"/>min</term>
         <listitem>
          <synopsis>min (a,args...)</synopsis>
          <para>Aliases: <function>Min</function> <function>Minimum</function></para>
          <para>Returns the minimum of arguments or matrix.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-rand"/>rand</term>
         <listitem>
          <synopsis>rand (size...)</synopsis>
          <para>Generate random float in the range <literal>[0,1)</literal>.
If size is given then a matrix (if two numbers are specified) or vector (if one
number is specified) of the given size returned.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-randint"/>randint</term>
         <listitem>
          <synopsis>randint (max,size...)</synopsis>
          <para>Generate random integer in the range
<literal>[0,max)</literal>.
If size is given then a matrix (if two numbers are specified) or vector (if one
number is specified) of the given size returned.  For example,
          <screen><prompt>genius&gt;</prompt> <userinput>randint(4)</userinput>
= 3
<prompt>genius&gt;</prompt> <userinput>randint(4,2)</userinput>
=
[0      1]
<prompt>genius&gt;</prompt> <userinput>randint(4,2,3)</userinput>
=
[2      2       1
 0      0       3]
</screen>
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-round"/>round</term>
         <listitem>
          <synopsis>round (x)</synopsis>
          <para>Aliases: <function>Round</function></para>
          <para>Round a number.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-sqrt"/>sqrt</term>
         <listitem>
          <synopsis>sqrt (x)</synopsis>
          <para>Aliases: <function>SquareRoot</function></para>
          <para>The square root.  When operating modulo some integer will return either a <constant>null</constant> or a vector of the square roots.  Examples:
          <screen><prompt>genius&gt;</prompt> <userinput>sqrt(2)</userinput>
= 1.41421356237
<prompt>genius&gt;</prompt> <userinput>sqrt(-1)</userinput>
= 1i
<prompt>genius&gt;</prompt> <userinput>sqrt(4) mod 7</userinput>
=
[2      5]
<prompt>genius&gt;</prompt> <userinput>2*2 mod 7</userinput>
= 4
</screen>
	  </para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/SquareRoot.html">Planetmath</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-trunc"/>trunc</term>
         <listitem>
          <synopsis>trunc (x)</synopsis>
          <para>Aliases: <function>Truncate</function> <function>IntegerPart</function></para>
          <para>Truncate number to an integer (return the integer part).</para>
         </listitem>
        </varlistentry>

      </variablelist>
    </sect1>

    <sect1 id="genius-gel-function-list-trigonometry">
      <title>Trigonometry</title>
      <variablelist>
        <varlistentry>
         <term><anchor id="gel-function-acos"/>acos</term>
         <listitem>
          <synopsis>acos (x)</synopsis>
          <para>Aliases: <function>arccos</function></para>
          <para>The arccos (inverse cos) function.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-acosh"/>acosh</term>
         <listitem>
          <synopsis>acosh (x)</synopsis>
          <para>Aliases: <function>arccosh</function></para>
          <para>The arccosh (inverse cosh) function.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-acot"/>acot</term>
         <listitem>
          <synopsis>acot (x)</synopsis>
          <para>Aliases: <function>arccot</function></para>
          <para>The arccot (inverse cot) function.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-acoth"/>acoth</term>
         <listitem>
          <synopsis>acoth (x)</synopsis>
          <para>Aliases: <function>arccoth</function></para>
          <para>The arccoth (inverse coth) function.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-acsc"/>acsc</term>
         <listitem>
          <synopsis>acsc (x)</synopsis>
          <para>Aliases: <function>arccsc</function></para>
          <para>The inverse cosecant function.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-acsch"/>acsch</term>
         <listitem>
          <synopsis>acsch (x)</synopsis>
          <para>Aliases: <function>arccsch</function></para>
          <para>The inverse hyperbolic cosecant function.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-asec"/>asec</term>
         <listitem>
          <synopsis>asec (x)</synopsis>
          <para>Aliases: <function>arcsec</function></para>
          <para>The inverse secant function.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-asech"/>asech</term>
         <listitem>
          <synopsis>asech (x)</synopsis>
          <para>Aliases: <function>arcsech</function></para>
          <para>The inverse hyperbolic secant function.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-asin"/>asin</term>
         <listitem>
          <synopsis>asin (x)</synopsis>
          <para>Aliases: <function>arcsin</function></para>
          <para>The arcsin (inverse sin) function.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-asinh"/>asinh</term>
         <listitem>
          <synopsis>asinh (x)</synopsis>
          <para>Aliases: <function>arcsinh</function></para>
          <para>The arcsinh (inverse sinh) function.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-atan"/>atan</term>
         <listitem>
          <synopsis>atan (x)</synopsis>
          <para>Aliases: <function>arctan</function></para>
          <para>Calculates the arctan (inverse tan) function.</para>
          <para>
	    See
	    <ulink url="http://en.wikipedia.org/wiki/Arctangent">Wikipedia</ulink> or
	    <ulink url="http://mathworld.wolfram.com/InverseTangent.html">Mathworld</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-atanh"/>atanh</term>
         <listitem>
          <synopsis>atanh (x)</synopsis>
          <para>Aliases: <function>arctanh</function></para>
          <para>The arctanh (inverse tanh) function.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-atan2"/>atan2</term>
         <listitem>
          <synopsis>atan2 (y, x)</synopsis>
          <para>Aliases: <function>arctan2</function></para>
          <para>Calculates the arctan2 function.  If
	  <userinput>x&gt;0</userinput> then it returns
	  <userinput>atan(y/x)</userinput>.  If <userinput>x&lt;0</userinput>
	  then it returns <userinput>sign(y) * (pi - atan(|y/x|)</userinput>.
	  When <userinput>x=0</userinput> it returns <userinput>sign(y) *
	  pi/2</userinput>.  <userinput>atan2(0,0)</userinput> returns 0
	  rather then failing.
	  </para>
          <para>
	    See
	    <ulink url="http://en.wikipedia.org/wiki/Atan2">Wikipedia</ulink> or
	    <ulink url="http://mathworld.wolfram.com/InverseTangent.html">Mathworld</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-cos"/>cos</term>
         <listitem>
          <synopsis>cos (x)</synopsis>
          <para>Calculates the cosine function.</para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/DefinitionsInTrigonometry.html">Planetmath</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-cosh"/>cosh</term>
         <listitem>
          <synopsis>cosh (x)</synopsis>
          <para>Calculates the hyperbolic cosine function.</para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/HyperbolicFunctions.html">Planetmath</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-cot"/>cot</term>
         <listitem>
          <synopsis>cot (x)</synopsis>
          <para>The cotangent function.</para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/DefinitionsInTrigonometry.html">Planetmath</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-coth"/>coth</term>
         <listitem>
          <synopsis>coth (x)</synopsis>
          <para>The hyperbolic cotangent function.</para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/HyperbolicFunctions.html">Planetmath</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-csc"/>csc</term>
         <listitem>
          <synopsis>csc (x)</synopsis>
          <para>The cosecant function.</para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/DefinitionsInTrigonometry.html">Planetmath</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-csch"/>csch</term>
         <listitem>
          <synopsis>csch (x)</synopsis>
          <para>The hyperbolic cosecant function.</para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/HyperbolicFunctions.html">Planetmath</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-sec"/>sec</term>
         <listitem>
          <synopsis>sec (x)</synopsis>
          <para>The secant function.</para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/DefinitionsInTrigonometry.html">Planetmath</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-sech"/>sech</term>
         <listitem>
          <synopsis>sech (x)</synopsis>
          <para>The hyperbolic secant function.</para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/HyperbolicFunctions.html">Planetmath</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-sin"/>sin</term>
         <listitem>
          <synopsis>sin (x)</synopsis>
          <para>Calculates the sine function.</para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/DefinitionsInTrigonometry.html">Planetmath</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-sinh"/>sinh</term>
         <listitem>
          <synopsis>sinh (x)</synopsis>
          <para>Calculates the hyperbolic sine function.</para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/HyperbolicFunctions.html">Planetmath</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-tan"/>tan</term>
         <listitem>
          <synopsis>tan (x)</synopsis>
          <para>Calculates the tan function.</para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/DefinitionsInTrigonometry.html">Planetmath</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-tanh"/>tanh</term>
         <listitem>
          <synopsis>tanh (x)</synopsis>
          <para>The hyperbolic tangent function.</para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/HyperbolicFunctions.html">Planetmath</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

      </variablelist>
    </sect1>

    <sect1 id="genius-gel-function-list-number-theory">
      <title>Number Theory</title>
      <variablelist>
        <varlistentry>
         <term><anchor id="gel-function-AreRelativelyPrime"/>AreRelativelyPrime</term>
         <listitem>
          <synopsis>AreRelativelyPrime (a,b)</synopsis>
          <para>
	    Are the real integers <varname>a</varname> and <varname>b</varname> relatively prime?
	    Returns <constant>true</constant> or <constant>false</constant>.
	  </para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/RelativelyPrime.html">Planetmath</ulink> or
	    <ulink url="http://mathworld.wolfram.com/RelativelyPrime.html">Mathworld</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-BernoulliNumber"/>BernoulliNumber</term>
         <listitem>
          <synopsis>BernoulliNumber (n)</synopsis>
          <para>Return the <varname>n</varname>th Bernoulli number.</para>
          <para>
	    See
	    <ulink url="http://en.wikipedia.org/wiki/Bernoulli_number">Wikipedia</ulink> or
	    <ulink url="http://mathworld.wolfram.com/BernoulliNumber.html">Mathworld</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-ChineseRemainder"/>ChineseRemainder</term>
         <listitem>
          <synopsis>ChineseRemainder (a,m)</synopsis>
          <para>Aliases: <function>CRT</function></para>
	  <para>Find the <varname>x</varname> that solves the system given by
		the vector <varname>a</varname> and modulo the elements of
		<varname>m</varname>, using the Chinese Remainder Theorem.
	  </para>
          <para>
	    See
	    <ulink url="http://en.wikipedia.org/wiki/Chinese_remainder_theorem">Wikipedia</ulink> or
	    <ulink url="http://planetmath.org/encyclopedia/ChineseRemainderTheorem.html">Planetmath</ulink> or
	    <ulink url="http://mathworld.wolfram.com/ChineseRemainderTheorem.html">Mathworld</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-CombineFactorizations"/>CombineFactorizations</term>
         <listitem>
          <synopsis>CombineFactorizations (a,b)</synopsis>
	  <para>Given two factorizations, give the factorization of the
		product.</para>
	  <para>See <link linkend="gel-function-Factorize">Factorize</link>.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-ConvertFromBase"/>ConvertFromBase</term>
         <listitem>
          <synopsis>ConvertFromBase (v,b)</synopsis>
          <para>Convert a vector of values indicating powers of b to a number.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-ConvertToBase"/>ConvertToBase</term>
         <listitem>
          <synopsis>ConvertToBase (n,b)</synopsis>
          <para>Convert a number to a vector of powers for elements in base <varname>b</varname>.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-DiscreteLog"/>DiscreteLog</term>
         <listitem>
          <synopsis>DiscreteLog (n,b,q)</synopsis>
          <para>Find discrete log of <varname>n</varname> base <varname>b</varname> in
	    F<subscript>q</subscript>, the finite field of order <varname>q</varname>, where <varname>q</varname>
	    is a prime, using the Silver-Pohlig-Hellman algorithm.</para>
          <para>
	    See
	    <ulink url="http://en.wikipedia.org/wiki/Discrete_logarithm">Wikipedia</ulink> or
	    <ulink url="http://planetmath.org/encyclopedia/DiscreteLogarithm.html">Planetmath</ulink> or
	    <ulink url="http://mathworld.wolfram.com/DiscreteLogarithm.html">Mathworld</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-Divides"/>Divides</term>
         <listitem>
          <synopsis>Divides (m,n)</synopsis>
          <para>Checks divisibility (if <varname>m</varname> divides <varname>n</varname>).</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-EulerPhi"/>EulerPhi</term>
         <listitem>
          <synopsis>EulerPhi (n)</synopsis>
          <para>
	    Compute the Euler phi function for <varname>n</varname>, that is
	    the number of integers between 1 and <varname>n</varname>
	    relatively prime to <varname>n</varname>.
	  </para>
          <para>
	    See
	    <ulink url="http://en.wikipedia.org/wiki/Euler_phi">Wikipedia</ulink> or
	    <ulink url="http://planetmath.org/encyclopedia/EulerPhifunction.html">Planetmath</ulink> or
	    <ulink url="http://mathworld.wolfram.com/TotientFunction.html">Mathworld</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-ExactDivision"/>ExactDivision</term>
         <listitem>
          <synopsis>ExactDivision (n,d)</synopsis>
          <para>
	    Return <userinput>n/d</userinput> but only if <varname>d</varname>
	    divides <varname>n</varname>.  If <varname>d</varname>
	    does not divide <varname>n</varname> then this function returns
	    garbage.  This is a lot faster for very large numbers
	    than the operation <userinput>n/d</userinput>, but of course only
	    useful if you know that the division is exact.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-Factorize"/>Factorize</term>
         <listitem>
          <synopsis>Factorize (n)</synopsis>
          <para>
	    Return factorization of a number as a matrix.  The first
	    row is the primes in the factorization (including 1) and the
	    second row are the powers.  So for example:
	    <screen><prompt>genius&gt;</prompt> <userinput>Factorize(11*11*13)</userinput>
=
[1      11      13
 1      2       1]</screen>
	  </para>
          <para>
	    See
	    <ulink url="http://en.wikipedia.org/wiki/Factorization">Wikipedia</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-Factors"/>Factors</term>
         <listitem>
          <synopsis>Factors (n)</synopsis>
          <para>
	    Return all factors of <varname>n</varname> in a vector.  This
	    includes all the non-prime factors as well.  It includes 1 and the
	    number itself.  So for example to print all the perfect numbers
	    (those that are sums of their factors) up to the number 1000 you
	    could do (this is of course very inefficient)
	    <programlisting>for n=1 to 1000 do (
    if MatrixSum (Factors(n)) == 2*n then
        print(n)
)
</programlisting>
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-FermatFactorization"/>FermatFactorization</term>
         <listitem>
          <synopsis>FermatFactorization (n,tries)</synopsis>
          <para>
	    Attempt Fermat factorization of <varname>n</varname> into
	    <userinput>(t-s)*(t+s)</userinput>, returns <varname>t</varname>
	    and <varname>s</varname> as a vector if possible, <constant>null</constant> otherwise.
	    <varname>tries</varname> specifies the number of tries before
	    giving up.
	  </para>
          <para>
	    This is a fairly good factorization if your number is the product
	    of two factors that are very close to each other.
	  </para>
          <para>
	    See
	    <ulink url="http://en.wikipedia.org/wiki/Fermat_factorization">Wikipedia</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-FindPrimitiveElementMod"/>FindPrimitiveElementMod</term>
         <listitem>
          <synopsis>FindPrimitiveElementMod (q)</synopsis>
          <para>Find the first primitive element in F<subscript>q</subscript>, the finite
group of order <varname>q</varname>.  Of course <varname>q</varname> must be a prime.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-FindRandomPrimitiveElementMod"/>FindRandomPrimitiveElementMod</term>
         <listitem>
          <synopsis>FindRandomPrimitiveElementMod (q)</synopsis>
          <para>Find a random primitive element in F<subscript>q</subscript>, the finite
group of order <varname>q</varname> (q must be a prime).</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-IndexCalculus"/>IndexCalculus</term>
         <listitem>
          <synopsis>IndexCalculus (n,b,q,S)</synopsis>
          <para>Compute discrete log base <varname>b</varname> of n in F<subscript>q</subscript>, the finite
group of order <varname>q</varname> (<varname>q</varname> a prime), using the
factor base <varname>S</varname>.  <varname>S</varname> should be a column of
primes possibly with second column precalculated by
<function>IndexCalculusPrecalculation</function>.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-IndexCalculusPrecalculation"/>IndexCalculusPrecalculation</term>
         <listitem>
          <synopsis>IndexCalculusPrecalculation (b,q,S)</synopsis>
	  <para>Run the precalculation step of
<function>IndexCalculus</function> for logarithms base <varname>b</varname> in
F<subscript>q</subscript>, the finite group of order <varname>q</varname>
(<varname>q</varname> a prime), for the factor base <varname>S</varname> (where
<varname>S</varname> is a column vector of primes).  The logs will be
precalculated and returned in the second column.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-IsEven"/>IsEven</term>
         <listitem>
          <synopsis>IsEven (n)</synopsis>
          <para>Tests if an integer is even.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-IsMersennePrimeExponent"/>IsMersennePrimeExponent</term>
         <listitem>
          <synopsis>IsMersennePrimeExponent (p)</synopsis>
          <para>
	    Tests if a positive integer <varname>p</varname> is a
	    Mersenne prime exponent.  That is if 
            2<superscript>p</superscript>-1 is a prime.  It does this
	    by looking it up in a table of known values which is relatively
	    short.
	    See also
	    <link linkend="gel-function-MersennePrimeExponents">MersennePrimeExponents</link>
	    and
	    <link linkend="gel-function-LucasLehmer">LucasLehmer</link>.
	  </para>
          <para>
	    See
	    <ulink url="http://en.wikipedia.org/wiki/Mersenne_prime">Wikipedia</ulink>,
	    <ulink url="http://planetmath.org/encyclopedia/MersenneNumbers.html">Planetmath</ulink>,
	    <ulink url="http://mathworld.wolfram.com/MersennePrime.html">Mathworld</ulink> or 
	    <ulink url="http://www.mersenne.org/">GIMPS</ulink>
 for more information.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-IsNthPower"/>IsNthPower</term>
         <listitem>
          <synopsis>IsNthPower (m,n)</synopsis>
          <para>
	    Tests if a rational number <varname>m</varname> is a perfect
	    <varname>n</varname>th power.  See also
	    <link linkend="gel-function-IsPerfectPower">IsPerfectPower</link>
	    and
	    <link linkend="gel-function-IsPerfectSquare">IsPerfectSquare</link>.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-IsOdd"/>IsOdd</term>
         <listitem>
          <synopsis>IsOdd (n)</synopsis>
          <para>Tests if an integer is odd.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-IsPerfectPower"/>IsPerfectPower</term>
         <listitem>
          <synopsis>IsPerfectPower (n)</synopsis>
          <para>Check an integer is any perfect power, a<superscript>b</superscript>.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-IsPerfectSquare"/>IsPerfectSquare</term>
         <listitem>
          <synopsis>IsPerfectSquare (n)</synopsis>
          <para>
	    Check an integer for being a perfect square of an integer.  The number must
	    be a real integer.  Negative integers are of course never perfect
	    squares of real integers.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-IsPrime"/>IsPrime</term>
         <listitem>
          <synopsis>IsPrime (n)</synopsis>
          <para>
	    Tests primality of integers, for numbers less than 2.5e10 the
	    answer is deterministic (if Riemann hypothesis is true).  For
	    numbers larger, the probability of a false positive
	    depends on
	    <link linkend="gel-function-IsPrimeMillerRabinReps">
	    <function>IsPrimeMillerRabinReps</function></link>.  That
	    is the probability of false positive is 1/4 to the power
	    <function>IsPrimeMillerRabinReps</function>.  The default
	    value of 22 yields a probability of about 5.7e-14.
	  </para>
          <para>
	    If <constant>false</constant> is returned, you can be sure that
	    the number is a composite.  If you want to be absolutely sure
	    that you have a prime you can use 
	    <link linkend="gel-function-MillerRabinTestSure">
	    <function>MillerRabinTestSure</function></link> but it may take
	    a lot longer.
	  </para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/PrimeNumber.html">Planetmath</ulink> or
	    <ulink url="http://mathworld.wolfram.com/PrimeNumber.html">Mathworld</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-IsPrimitiveMod"/>IsPrimitiveMod</term>
         <listitem>
          <synopsis>IsPrimitiveMod (g,q)</synopsis>
          <para>Check if <varname>g</varname> is primitive in F<subscript>q</subscript>, the finite
group of order <varname>q</varname>, where <varname>q</varname> is a prime.  If <varname>q</varname> is not prime results are bogus.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-IsPrimitiveModWithPrimeFactors"/>IsPrimitiveModWithPrimeFactors</term>
         <listitem>
          <synopsis>IsPrimitiveModWithPrimeFactors (g,q,f)</synopsis>
          <para>Check if <varname>g</varname> is primitive in F<subscript>q</subscript>, the finite
group of order <varname>q</varname>, where <varname>q</varname> is a prime and
<varname>f</varname> is a vector of prime factors of <varname>q</varname>-1.
If <varname>q</varname> is not prime results are bogus.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-IsPseudoprime"/>IsPseudoprime</term>
         <listitem>
          <synopsis>IsPseudoprime (n,b)</synopsis>
          <para>If <varname>n</varname> is a pseudoprime base <varname>b</varname> but not a prime,
that is if <userinput>b^(n-1) == 1 mod n</userinput>.  This calls the <function>PseudoprimeTest</function></para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-IsStrongPseudoprime"/>IsStrongPseudoprime</term>
         <listitem>
          <synopsis>IsStrongPseudoprime (n,b)</synopsis>
          <para>Test if <varname>n</varname> is a strong pseudoprime to base <varname>b</varname> but not a prime.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-Jacobi"/>Jacobi</term>
         <listitem>
          <synopsis>Jacobi (a,b)</synopsis>
          <para>Aliases: <function>JacobiSymbol</function></para>
          <para>Calculate the Jacobi symbol (a/b) (b should be odd).</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-JacobiKronecker"/>JacobiKronecker</term>
         <listitem>
          <synopsis>JacobiKronecker (a,b)</synopsis>
          <para>Aliases: <function>JacobiKroneckerSymbol</function></para>
          <para>Calculate the Jacobi symbol (a/b) with the Kronecker extension (a/2)=(2/a) when a odd, or (a/2)=0 when a even.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-LeastAbsoluteResidue"/>LeastAbsoluteResidue</term>
         <listitem>
          <synopsis>LeastAbsoluteResidue (a,n)</synopsis>
          <para>Return the residue of <varname>a</varname> mod <varname>n</varname> with the least absolute value (in the interval -n/2 to n/2).</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-Legendre"/>Legendre</term>
         <listitem>
          <synopsis>Legendre (a,p)</synopsis>
          <para>Aliases: <function>LegendreSymbol</function></para>
          <para>Calculate the Legendre symbol (a/p).</para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/LegendreSymbol.html">Planetmath</ulink> or
	    <ulink url="http://mathworld.wolfram.com/LegendreSymbol.html">Mathworld</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-LucasLehmer"/>LucasLehmer</term>
         <listitem>
          <synopsis>LucasLehmer (p)</synopsis>
          <para>Test if 2<superscript>p</superscript>-1 is a Mersenne prime using the Lucas-Lehmer test.
	    See also
	    <link linkend="gel-function-MersennePrimeExponents">MersennePrimeExponents</link>
	    and
	    <link linkend="gel-function-IsMersennePrimeExponent">IsMersennePrimeExponent</link>.
          </para>
          <para>
	    See
	    <ulink url="http://en.wikipedia.org/wiki/Lucas%E2%80%93Lehmer_primality_test">Wikipedia</ulink> or
	    <ulink url="http://planetmath.org/encyclopedia/LucasLhemer.html">Planetmath</ulink> or
	    <ulink url="http://mathworld.wolfram.com/Lucas-LehmerTest.html">Mathworld</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-LucasNumber"/>LucasNumber</term>
         <listitem>
          <synopsis>LucasNumber (n)</synopsis>
          <para>Returns the <varname>n</varname>th Lucas number.</para>
          <para>
	    See
	    <ulink url="http://en.wikipedia.org/wiki/Lucas_number">Wikipedia</ulink> or
	    <ulink url="http://planetmath.org/encyclopedia/LucasNumbers.html">Planetmath</ulink> or
	    <ulink url="http://mathworld.wolfram.com/LucasNumber.html">Mathworld</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-MaximalPrimePowerFactors"/>MaximalPrimePowerFactors</term>
         <listitem>
          <synopsis>MaximalPrimePowerFactors (n)</synopsis>
          <para>Return all maximal prime power factors of a number.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-MersennePrimeExponents"/>MersennePrimeExponents</term>
         <listitem>
          <synopsis>MersennePrimeExponents</synopsis>
          <para>
	    A vector of known Mersenne prime exponents, that is
	    a list of positive integers
	    <varname>p</varname> such that
            2<superscript>p</superscript>-1 is a prime.
	    See also
	    <link linkend="gel-function-IsMersennePrimeExponent">IsMersennePrimeExponent</link>
	    and
	    <link linkend="gel-function-LucasLehmer">LucasLehmer</link>.
	  </para>
          <para>
	    See
	    <ulink url="http://en.wikipedia.org/wiki/Mersenne_prime">Wikipedia</ulink>,
	    <ulink url="http://planetmath.org/encyclopedia/MersenneNumbers.html">Planetmath</ulink>,
	    <ulink url="http://mathworld.wolfram.com/MersennePrime.html">Mathworld</ulink> or 
	    <ulink url="http://www.mersenne.org/">GIMPS</ulink>
 for more information.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-MillerRabinTest"/>MillerRabinTest</term>
         <listitem>
          <synopsis>MillerRabinTest (n,reps)</synopsis>
          <para>
	    Use the Miller-Rabin primality test on <varname>n</varname>,
	    <varname>reps</varname> number of times.  The probability of false
	    positive is <userinput>(1/4)^reps</userinput>.  It is probably
	    usually better to use
	    <link linkend="gel-function-IsPrime">
	    <function>IsPrime</function></link> since that is faster and
	    better on smaller integers.
	  </para>
          <para>
	    See
	    <ulink url="http://en.wikipedia.org/wiki/Miller%E2%80%93Rabin_primality_test">Wikipedia</ulink> or
	    <ulink url="http://planetmath.org/encyclopedia/MillerRabinPrimeTest.html">Planetmath</ulink> or
	    <ulink url="http://mathworld.wolfram.com/Rabin-MillerStrongPseudoprimeTest.html">Mathworld</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-MillerRabinTestSure"/>MillerRabinTestSure</term>
         <listitem>
          <synopsis>MillerRabinTestSure (n)</synopsis>
          <para>
	    Use the Miller-Rabin primality test on <varname>n</varname> with
	    enough bases that assuming the Generalized Reimann Hypothesis the
	    result is deterministic.
	  </para>
          <para>
	    See
	    <ulink url="http://en.wikipedia.org/wiki/Miller%E2%80%93Rabin_primality_test">Wikipedia</ulink> or
	    <ulink url="http://planetmath.org/encyclopedia/MillerRabinPrimeTest.html">Planetmath</ulink> or
	    <ulink url="http://mathworld.wolfram.com/Rabin-MillerStrongPseudoprimeTest.html">Mathworld</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-ModInvert"/>ModInvert</term>
         <listitem>
          <synopsis>ModInvert (n,m)</synopsis>
          <para>Returns inverse of n mod m.</para>
          <para>
	    See
	    <ulink url="http://mathworld.wolfram.com/ModularInverse.html">Mathworld</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-MoebiusMu"/>MoebiusMu</term>
         <listitem>
          <synopsis>MoebiusMu (n)</synopsis>
          <para>
	    Return the Moebius mu function evaluated in <varname>n</varname>.
	    That is, it returns 0 if <varname>n</varname> is not a product
	    of distinct primes and <userinput>(-1)^k</userinput> if it is
	    a product of <varname>k</varname> distinct primes.
	  </para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/MoebiusFunction.html">Planetmath</ulink> or
	    <ulink url="http://mathworld.wolfram.com/MoebiusFunction.html">Mathworld</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-NextPrime"/>NextPrime</term>
         <listitem>
          <synopsis>NextPrime (n)</synopsis>
          <para>
	    Returns the least prime greater than <varname>n</varname>.
	    Negatives of primes are considered prime and so to get the
	    previous prime you can use <userinput>-NextPrime(-n)</userinput>.
	  </para>
          <para>
	    This function uses the GMP's <function>mpz_nextprime</function>
	    which in turn uses the probabilistic Miller-Rabin test
	    (See also <link linkend="gel-function-MillerRabinTest">MillerRabinTest</link>).
	    The probability
	    of false positive is not tunable, but is low enough
	    for all practical purposes.
	  </para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/PrimeNumber.html">Planetmath</ulink> or
	    <ulink url="http://mathworld.wolfram.com/PrimeNumber.html">Mathworld</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-PadicValuation"/>PadicValuation</term>
         <listitem>
          <synopsis>PadicValuation (n,p)</synopsis>
          <para>Returns the p-adic valuation (number of trailing zeros in base <varname>p</varname>).</para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/PAdicValuation.html">Planetmath</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-PowerMod"/>PowerMod</term>
         <listitem>
          <synopsis>PowerMod (a,b,m)</synopsis>
          <para>
	    Compute <userinput>a^b mod m</userinput>.  The
	    <varname>b</varname>'s power of <varname>a</varname> modulo
	    <varname>m</varname>.  It is not neccessary to use this function
	    as it is automatically used in modulo mode.  Hence
	    <userinput>a^b mod m</userinput> is just as fast.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-Prime"/>Prime</term>
         <listitem>
          <synopsis>Prime (n)</synopsis>
          <para>Aliases: <function>prime</function></para>
          <para>Return the <varname>n</varname>th prime (up to a limit).</para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/PrimeNumber.html">Planetmath</ulink> or
	    <ulink url="http://mathworld.wolfram.com/PrimeNumber.html">Mathworld</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-PrimeFactors"/>PrimeFactors</term>
         <listitem>
          <synopsis>PrimeFactors (n)</synopsis>
          <para>Return all prime factors of a number as a vector.</para>
          <para>
	    See
	    <ulink url="http://mathworld.wolfram.com/PrimeFactor.html">Mathworld</ulink> for more information.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-PseudoprimeTest"/>PseudoprimeTest</term>
         <listitem>
          <synopsis>PseudoprimeTest (n,b)</synopsis>
	  <para>Pseudoprime test, returns <constant>true</constant> if and only if
		<userinput>b^(n-1) == 1  mod n</userinput></para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/Pseudoprime.html">Planetmath</ulink> or
	    <ulink url="http://mathworld.wolfram.com/Pseudoprime.html">Mathworld</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-RemoveFactor"/>RemoveFactor</term>
         <listitem>
          <synopsis>RemoveFactor (n,m)</synopsis>
          <para>Removes all instances of the factor <varname>m</varname> from the number <varname>n</varname>.  That is divides by the largest power of <varname>m</varname>, that divides <varname>n</varname>.</para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/Divisibility.html">Planetmath</ulink> or
	    <ulink url="http://mathworld.wolfram.com/Factor.html">Mathworld</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-SilverPohligHellmanWithFactorization"/>SilverPohligHellmanWithFactorization</term>
         <listitem>
          <synopsis>SilverPohligHellmanWithFactorization (n,b,q,f)</synopsis>
          <para>Find discrete log of <varname>n</varname> base <varname>b</varname> in F<subscript>q</subscript>, the finite group of order <varname>q</varname>, where <varname>q</varname> is a prime using the Silver-Pohlig-Hellman algorithm, given <varname>f</varname> being the factorization of <varname>q</varname>-1.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-SqrtModPrime"/>SqrtModPrime</term>
         <listitem>
          <synopsis>SqrtModPrime (n,p)</synopsis>
          <para>Find square root of <varname>n</varname> modulo <varname>p</varname> (where <varname>p</varname> is a prime).  Null is returned if not a quadratic residue.</para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/QuadraticResidue.html">Planetmath</ulink> or
	    <ulink url="http://mathworld.wolfram.com/QuadraticResidue.html">Mathworld</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-StrongPseudoprimeTest"/>StrongPseudoprimeTest</term>
         <listitem>
          <synopsis>StrongPseudoprimeTest (n,b)</synopsis>
          <para>Run the strong pseudoprime test base <varname>b</varname> on <varname>n</varname>.</para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/StrongPseudoprime.html">Planetmath</ulink> or
	    <ulink url="http://mathworld.wolfram.com/StrongPseudoprime.html">Mathworld</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-gcd"/>gcd</term>
         <listitem>
          <synopsis>gcd (a,args...)</synopsis>
          <para>Aliases: <function>GCD</function></para>
          <para>
	    Greatest common divisor of integers.  You can enter as many
	    integers in the argument list, or you can give a vector or a matrix
	    of integers.  If you give more than one matrix of the same
	    size then GCD is done element by element.
	  </para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/GreatestCommonDivisor.html">Planetmath</ulink> or
	    <ulink url="http://mathworld.wolfram.com/GreatestCommonDivisor.html">Mathworld</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-lcm"/>lcm</term>
         <listitem>
          <synopsis>lcm (a,args...)</synopsis>
          <para>Aliases: <function>LCM</function></para>
          <para>
	    Least common multiplier of integers.  You can enter as many
	    integers in the argument list, or you can give a vector or a matrix
	    of integers.  If you give more than one matrix of the same size
	    then LCM is done element by element.
	  </para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/LeastCommonMultiple.html">Planetmath</ulink> or
	    <ulink url="http://mathworld.wolfram.com/LeastCommonMultiple.html">Mathworld</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

      </variablelist>
    </sect1>

    <sect1 id="genius-gel-function-list-matrix">
      <title>Matrix Manipulation</title>
      <variablelist>
        <varlistentry>
         <term><anchor id="gel-function-ApplyOverMatrix"/>ApplyOverMatrix</term>
         <listitem>
          <synopsis>ApplyOverMatrix (a,func)</synopsis>
          <para>Apply a function over all entries of a matrix and return a matrix of the results.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-ApplyOverMatrix2"/>ApplyOverMatrix2</term>
         <listitem>
          <synopsis>ApplyOverMatrix2 (a,b,func)</synopsis>
          <para>Apply a function over all entries of 2 matrices (or 1 value and 1 matrix) and return a matrix of the results.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-ColumnsOf"/>ColumnsOf</term>
         <listitem>
          <synopsis>ColumnsOf (M)</synopsis>
          <para>Gets the columns of a matrix as a horizontal vector.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-ComplementSubmatrix"/>ComplementSubmatrix</term>
         <listitem>
          <synopsis>ComplementSubmatrix (m,r,c)</synopsis>
          <para>Remove column(s) and row(s) from a matrix.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-CompoundMatrix"/>CompoundMatrix</term>
         <listitem>
          <synopsis>CompoundMatrix (k,A)</synopsis>
          <para>Calculate the kth compound matrix of A.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-CountZeroColumns"/>CountZeroColumns</term>
         <listitem>
          <synopsis>CountZeroColumns (M)</synopsis>
          <para>
	   Count the number of zero columns in a matrix.  For example
	   once your column reduce a matrix you can use this to find
	   the nullity.  See <link linkend="gel-function-cref"><function>cref</function></link>
	   and <link linkend="gel-function-Nullity"><function>Nullity</function></link>.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-DeleteColumn"/>DeleteColumn</term>
         <listitem>
          <synopsis>DeleteColumn (M,col)</synopsis>
          <para>Delete a column of a matrix.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-DeleteRow"/>DeleteRow</term>
         <listitem>
          <synopsis>DeleteRow (M,row)</synopsis>
          <para>Delete a row of a matrix.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-DiagonalOf"/>DiagonalOf</term>
         <listitem>
          <synopsis>DiagonalOf (M)</synopsis>
          <para>Gets the diagonal entries of a matrix as a column vector.</para>
          <para>
	    See
	    <ulink url="http://en.wikipedia.org/wiki/Diagonal_of_a_matrix#Matrices">Wikipedia</ulink> for more information.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-DotProduct"/>DotProduct</term>
         <listitem>
          <synopsis>DotProduct (u,v)</synopsis>
	  <para>Get the dot product of two vectors.  The vectors must be of the
same size.  No conjugates are taken so this is a bilinear form even if working over the complex numbers.</para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/DotProduct.html">Planetmath</ulink> for more information.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-ExpandMatrix"/>ExpandMatrix</term>
         <listitem>
          <synopsis>ExpandMatrix (M)</synopsis>
          <para>
	    Expands a matrix just like we do on unquoted matrix input.
	    That is we expand any internal matrices as blocks.  This is
	    a way to construct matrices out of smaller ones and this is
	    normally done automatically on input unless the matrix is quoted.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-HermitianProduct"/>HermitianProduct</term>
         <listitem>
          <synopsis>HermitianProduct (u,v)</synopsis>
          <para>Aliases: <function>InnerProduct</function></para>
          <para>Get the Hermitian product of two vectors.  The vectors must be of the same size.  This is a sesquilinear form using the identity matrix.</para>
          <para>
	    See
	    <ulink url="http://mathworld.wolfram.com/HermitianInnerProduct.html">Mathworld</ulink> for more information.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-I"/>I</term>
         <listitem>
          <synopsis>I (n)</synopsis>
          <para>Aliases: <function>eye</function></para>
	  <para>Return an identity matrix of a given size, that is <varname>n</varname> by <varname>n</varname>.  If <varname>n</varname> is zero, returns <constant>null</constant>.</para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/IdentityMatrix.html">Planetmath</ulink> for more information.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-IndexComplement"/>IndexComplement</term>
         <listitem>
          <synopsis>IndexComplement (vec,msize)</synopsis>
          <para>Return the index complement of a vector of indexes.  Everything is one based.  For example for vector <userinput>[2,3]</userinput> and size
<userinput>5</userinput>, we return <userinput>[1,4,5]</userinput>.  If
<varname>msize</varname> is 0, we always return <constant>null</constant>.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-IsDiagonal"/>IsDiagonal</term>
         <listitem>
          <synopsis>IsDiagonal (M)</synopsis>
          <para>Is a matrix diagonal.</para>
          <para>
	    See
	    <ulink url="http://en.wikipedia.org/wiki/Diagonal_matrix">Wikipedia</ulink> or
	    <ulink url="http://planetmath.org/encyclopedia/DiagonalMatrix.html">Planetmath</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-IsIdentity"/>IsIdentity</term>
         <listitem>
          <synopsis>IsIdentity (x)</synopsis>
          <para>Check if a matrix is the identity matrix.  Automatically returns <constant>false</constant>
	    if the matrix is not square.  Also works on numbers, in which
	    case it is equivalent to <userinput>x==1</userinput>.  When <varname>x</varname> is
	    <constant>null</constant> (we could think of that as a 0 by 0 matrix),
	    no error is generated and <constant>false</constant> is returned.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-IsLowerTriangular"/>IsLowerTriangular</term>
         <listitem>
          <synopsis>IsLowerTriangular (M)</synopsis>
          <para>Is a matrix lower triangular. That is, are all the entries above the diagonal zero.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-IsMatrixInteger"/>IsMatrixInteger</term>
         <listitem>
          <synopsis>IsMatrixInteger (M)</synopsis>
          <para>Check if a matrix is a matrix of an integers (non-complex).</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-IsMatrixNonnegative"/>IsMatrixNonnegative</term>
         <listitem>
          <synopsis>IsMatrixNonnegative (M)</synopsis>
          <para>Check if a matrix is non-negative, that is if each element is non-negative.
	  Do not confuse positive matrices with positive semi-definite matrices.</para>
          <para>
	    See
	    <ulink url="http://en.wikipedia.org/wiki/Positive_matrix">Wikipedia</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-IsMatrixPositive"/>IsMatrixPositive</term>
         <listitem>
          <synopsis>IsMatrixPositive (M)</synopsis>
	  <para>Check if a matrix is positive, that is if each element is
positive (and hence real).  In particular, no element is 0.  Do not confuse
positive matrices with positive definite matrices.</para>
          <para>
	    See
	    <ulink url="http://en.wikipedia.org/wiki/Positive_matrix">Wikipedia</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-IsMatrixRational"/>IsMatrixRational</term>
         <listitem>
          <synopsis>IsMatrixRational (M)</synopsis>
          <para>Check if a matrix is a matrix of rational (non-complex)
numbers.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-IsMatrixReal"/>IsMatrixReal</term>
         <listitem>
          <synopsis>IsMatrixReal (M)</synopsis>
          <para>Check if a matrix is a matrix of real (non-complex) numbers.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-IsMatrixSquare"/>IsMatrixSquare</term>
         <listitem>
          <synopsis>IsMatrixSquare (M)</synopsis>
          <para>
	    Check if a matrix is square, that is its width is equal to
	    its height.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-IsUpperTriangular"/>IsUpperTriangular</term>
         <listitem>
          <synopsis>IsUpperTriangular (M)</synopsis>
          <para>Is a matrix upper triangular?  That is, a matrix is upper triangular if all the entries below the diagonal are zero.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-IsValueOnly"/>IsValueOnly</term>
         <listitem>
          <synopsis>IsValueOnly (M)</synopsis>
          <para>Check if a matrix is a matrix of numbers only.  Many internal
functions make this check.  Values can be any number including complex numbers.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-IsVector"/>IsVector</term>
         <listitem>
          <synopsis>IsVector (v)</synopsis>
          <para>
	    Is argument a horizontal or a vertical vector.  Genius does
	    not distinguish between a matrix and a vector and a vector
	    is just a 1 by <varname>n</varname> or <varname>n</varname> by 1 matrix.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-IsZero"/>IsZero</term>
         <listitem>
          <synopsis>IsZero (x)</synopsis>
          <para>Check if a matrix is composed of all zeros.  Also works on numbers, in which
	    case it is equivalent to <userinput>x==0</userinput>.  When <varname>x</varname> is
	    <constant>null</constant> (we could think of that as a 0 by 0 matrix),
	    no error is generated and <constant>true</constant> is returned as the condition is
	    vacuous.
	    </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-LowerTriangular"/>LowerTriangular</term>
         <listitem>
          <synopsis>LowerTriangular (M)</synopsis>
          <para>Returns a copy of the matrix <varname>M</varname> with all the entries above the diagonal set to zero.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-MakeDiagonal"/>MakeDiagonal</term>
         <listitem>
          <synopsis>MakeDiagonal (v,arg...)</synopsis>
          <para>Aliases: <function>diag</function></para>
	  <para>Make diagonal matrix from a vector.  Alternatively you can pass
		  in the values to put on the diagonal as arguments.  So
		  <userinput>MakeDiagonal([1,2,3])</userinput> is the same as
		  <userinput>MakeDiagonal(1,2,3)</userinput>.</para>
          <para>
	    See
	    <ulink url="http://en.wikipedia.org/wiki/Diagonal_matrix">Wikipedia</ulink> or
	    <ulink url="http://planetmath.org/encyclopedia/DiagonalMatrix.html">Planetmath</ulink> for more information.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-MakeVector"/>MakeVector</term>
         <listitem>
          <synopsis>MakeVector (A)</synopsis>
          <para>Make column vector out of matrix by putting columns above
		  each other.  Returns <constant>null</constant> when given <constant>null</constant>.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-MatrixProduct"/>MatrixProduct</term>
         <listitem>
          <synopsis>MatrixProduct (A)</synopsis>
          <para>
	    Calculate the product of all elements in a matrix or vector.
	    That is we multiply all the elements and return a number that
	    is the product of all the elements.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-MatrixSum"/>MatrixSum</term>
         <listitem>
          <synopsis>MatrixSum (A)</synopsis>
          <para>
	    Calculate the sum of all elements in a matrix or vector.  That is
	    we add all the elements and return a number that is the
	    sum of all the elements.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-MatrixSumSquares"/>MatrixSumSquares</term>
         <listitem>
          <synopsis>MatrixSumSquares (A)</synopsis>
          <para>Calculate the sum of squares of all elements in a matrix
	    or vector.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-OuterProduct"/>OuterProduct</term>
         <listitem>
          <synopsis>OuterProduct (u,v)</synopsis>
          <para>Get the outer product of two vectors.  That is, suppose that
<varname>u</varname> and <varname>v</varname> are vertical vectors, then
the outer product is <userinput>v * u.'</userinput>.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-ReverseVector"/>ReverseVector</term>
         <listitem>
          <synopsis>ReverseVector (v)</synopsis>
	  <para>Reverse elements in a vector.  Return <constant>null</constant> if given <constant>null</constant></para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-RowSum"/>RowSum</term>
         <listitem>
          <synopsis>RowSum (m)</synopsis>
          <para>Calculate sum of each row in a matrix and return a vertical
vector with the result.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-RowSumSquares"/>RowSumSquares</term>
         <listitem>
          <synopsis>RowSumSquares (m)</synopsis>
          <para>Calculate sum of squares of each row in a matrix and return a vertical vector with the results.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-RowsOf"/>RowsOf</term>
         <listitem>
          <synopsis>RowsOf (M)</synopsis>
	  <para>Gets the rows of a matrix as a vertical vector.  Each element
of the vector is a horizontal vector which is the corresponding row of
<varname>M</varname>.  This function is useful if you wish to loop over the
rows of a matrix.  For example, as <userinput>for r in RowsOf(M) do
something(r)</userinput>.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-SetMatrixSize"/>SetMatrixSize</term>
         <listitem>
          <synopsis>SetMatrixSize (M,rows,columns)</synopsis>
          <para>Make new matrix of given size from old one.  That is, a new
	  matrix will be returned to which the old one is copied.  Entries that
	  don't fit are clipped and extra space is filled with zeros.
	  If <varname>rows</varname> or <varname>columns</varname> are zero
	  then <constant>null</constant> is returned.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-ShuffleVector"/>ShuffleVector</term>
         <listitem>
          <synopsis>ShuffleVector (v)</synopsis>
	  <para>Shuffle elements in a vector.  Return <constant>null</constant> if given <constant>null</constant></para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-SortVector"/>SortVector</term>
         <listitem>
          <synopsis>SortVector (v)</synopsis>
          <para>Sort vector elements in an increasing order.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-StripZeroColumns"/>StripZeroColumns</term>
         <listitem>
          <synopsis>StripZeroColumns (M)</synopsis>
          <para>Removes any all-zero columns of <varname>M</varname>.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-StripZeroRows"/>StripZeroRows</term>
         <listitem>
          <synopsis>StripZeroRows (M)</synopsis>
          <para>Removes any all-zero rows of <varname>M</varname>.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-Submatrix"/>Submatrix</term>
         <listitem>
          <synopsis>Submatrix (m,r,c)</synopsis>
          <para>Return column(s) and row(s) from a matrix.  This is
just equivalent to <userinput>m@(r,c)</userinput>.  <varname>r</varname>
and <varname>c</varname> should be vectors of rows and columns (or single numbers if only one row or column is needed).</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-SwapRows"/>SwapRows</term>
         <listitem>
          <synopsis>SwapRows (m,row1,row2)</synopsis>
          <para>Swap two rows in a matrix.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-UpperTriangular"/>UpperTriangular</term>
         <listitem>
          <synopsis>UpperTriangular (M)</synopsis>
          <para>Returns a copy of the matrix <varname>M</varname> with all the entries below the diagonal set to zero.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-columns"/>columns</term>
         <listitem>
          <synopsis>columns (M)</synopsis>
          <para>Get the number of columns of a matrix.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-elements"/>elements</term>
         <listitem>
          <synopsis>elements (M)</synopsis>
          <para>Get the total number of elements of a matrix.  This is the
number of columns times the number of rows.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-ones"/>ones</term>
         <listitem>
          <synopsis>ones (rows,columns...)</synopsis>
	  <para>Make an matrix of all ones (or a row vector if only one argument is given).  Returns <constant>null</constant> if either rows or columns are zero.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-rows"/>rows</term>
         <listitem>
          <synopsis>rows (M)</synopsis>
          <para>Get the number of rows of a matrix.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-zeros"/>zeros</term>
         <listitem>
          <synopsis>zeros (rows,columns...)</synopsis>
	  <para>Make a matrix of all zeros (or a row vector if only one argument is given).  Returns <constant>null</constant> if either rows or columns are zero.</para>
         </listitem>
        </varlistentry>

      </variablelist>
    </sect1>

    <sect1 id="genius-gel-function-list-linear-algebra">
      <title>Linear Algebra</title>
      <variablelist>
        <varlistentry>
         <term><anchor id="gel-function-AuxiliaryUnitMatrix"/>AuxiliaryUnitMatrix</term>
         <listitem>
          <synopsis>AuxiliaryUnitMatrix (n)</synopsis>
          <para>Get the auxiliary unit matrix of size <varname>n</varname>.  This is a square matrix with that is all zero except the
superdiagonal being all ones.  It is the Jordan block matrix of one zero eigenvalue.</para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/JordanCanonicalFormTheorem.html">Planetmath</ulink> or
	    <ulink url="http://mathworld.wolfram.com/JordanBlock.html">Mathworld</ulink> for more information on Jordan Cannonical Form.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-BilinearForm"/>BilinearForm</term>
         <listitem>
          <synopsis>BilinearForm (v,A,w)</synopsis>
          <para>Evaluate (v,w) with respect to the bilinear form given by the matrix A.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-BilinearFormFunction"/>BilinearFormFunction</term>
         <listitem>
          <synopsis>BilinearFormFunction (A)</synopsis>
          <para>Return a function that evaluates two vectors with respect to the bilinear form given by A.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-CharacteristicPolynomial"/>CharacteristicPolynomial</term>
         <listitem>
          <synopsis>CharacteristicPolynomial (M)</synopsis>
          <para>Aliases: <function>CharPoly</function></para>
	  <para>Get the characteristic polynomial as a vector.  That is, return
the coefficients of the polynomial starting with the constant term.  This is
the polynomial defined by <userinput>det(M-xI)</userinput>.  The roots of this
polynomial are the eigenvalues of <varname>M</varname>.
See also <link linkend="gel-function-CharacteristicPolynomialFunction">CharacteristicPolynomialFunction</link>.
</para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/CharacteristicEquation.html">Planetmath</ulink> for more information.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-CharacteristicPolynomialFunction"/>CharacteristicPolynomialFunction</term>
         <listitem>
          <synopsis>CharacteristicPolynomialFunction (M)</synopsis>
	  <para>Get the characteristic polynomial as a function.  This is
the polynomial defined by <userinput>det(M-xI)</userinput>.  The roots of this
polynomial are the eigenvalues of <varname>M</varname>.
See also <link linkend="gel-function-CharacteristicPolynomial">CharacteristicPolynomial</link>.
</para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/CharacteristicEquation.html">Planetmath</ulink> for more information.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-ColumnSpace"/>ColumnSpace</term>
         <listitem>
          <synopsis>ColumnSpace (M)</synopsis>
	  <para>Get a basis matrix for the columnspace of a matrix.  That is,
return a matrix whose columns are the basis for the column space of
<varname>M</varname>.  That is the space spanned by the columns of
<varname>M</varname>.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-CommutationMatrix"/>CommutationMatrix</term>
         <listitem>
          <synopsis>CommutationMatrix (m, n)</synopsis>
	  <para>Return the commutation matrix K(m,n) which is the unique m*n by
m*n matrix such that K(m,n) * MakeVector(A) = MakeVector(A.') for all m by n
matrices A.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-CompanionMatrix"/>CompanionMatrix</term>
         <listitem>
          <synopsis>CompanionMatrix (p)</synopsis>
          <para>Companion matrix of a polynomial (as vector).</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-ConjugateTranspose"/>ConjugateTranspose</term>
         <listitem>
          <synopsis>ConjugateTranspose (M)</synopsis>
          <para>Conjugate transpose of a matrix (adjoint).  This is the
	  same as the <userinput>'</userinput> operator.</para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/ConjugateTranspose.html">Planetmath</ulink> for more information.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-Convolution"/>Convolution</term>
         <listitem>
          <synopsis>Convolution (a,b)</synopsis>
          <para>Aliases: <function>convol</function></para>
          <para>Calculate convolution of two horizontal vectors.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-ConvolutionVector"/>ConvolutionVector</term>
         <listitem>
          <synopsis>ConvolutionVector (a,b)</synopsis>
          <para>Calculate convolution of two horizontal vectors.  Return
result as a vector and not added together.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-CrossProduct"/>CrossProduct</term>
         <listitem>
          <synopsis>CrossProduct (v,w)</synopsis>
	  <para>CrossProduct of two vectors in R<superscript>3</superscript> as
		  a column vector.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-DeterminantalDivisorsInteger"/>DeterminantalDivisorsInteger</term>
         <listitem>
          <synopsis>DeterminantalDivisorsInteger (M)</synopsis>
          <para>Get the determinantal divisors of an integer matrix (not its characteristic).</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-DirectSum"/>DirectSum</term>
         <listitem>
          <synopsis>DirectSum (M,N...)</synopsis>
          <para>Direct sum of matrices.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-DirectSumMatrixVector"/>DirectSumMatrixVector</term>
         <listitem>
          <synopsis>DirectSumMatrixVector (v)</synopsis>
          <para>Direct sum of a vector of matrices.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-Eigenvalues"/>Eigenvalues</term>
         <listitem>
          <synopsis>Eigenvalues (M)</synopsis>
          <para>Aliases: <function>eig</function></para>
          <para>Get the eigenvalues of a square matrix.
	    Currently only works for matrices of size up to 4 by 4, or for
	    triangular matrices (for which the eigenvalues are on the
            diagonal).
	  </para>
          <para>
	    See
	    <ulink url="http://en.wikipedia.org/wiki/Eigenvalue">Wikipedia</ulink> or
	    <ulink url="http://planetmath.org/encyclopedia/Eigenvalue.html">Planetmath</ulink> or
	    <ulink url="http://mathworld.wolfram.com/Eigenvalue.html">Mathworld</ulink> for more information.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-Eigenvectors"/>Eigenvectors</term>
         <listitem>
          <synopsis>Eigenvectors (M)</synopsis>
          <synopsis>Eigenvectors (M, &amp;eigenvalues)</synopsis>
          <synopsis>Eigenvectors (M, &amp;eigenvalues, &amp;multiplicities)</synopsis>
	  <para>Get the eigenvectors of a square matrix.  Optionally get also
the eigenvalues and their algebraic multiplicities.
	    Currently only works for matrices of size up to 2 by 2.
	  </para>
          <para>
	    See
	    <ulink url="http://en.wikipedia.org/wiki/Eigenvector">Wikipedia</ulink> or
	    <ulink url="http://planetmath.org/encyclopedia/Eigenvector.html">Planetmath</ulink> or
	    <ulink url="http://mathworld.wolfram.com/Eigenvector.html">Mathworld</ulink> for more information.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-GramSchmidt"/>GramSchmidt</term>
         <listitem>
          <synopsis>GramSchmidt (v,B...)</synopsis>
	  <para>Apply the Gram-Schmidt process (to the columns) with respect to
inner product given by <varname>B</varname>.  If <varname>B</varname> is not
given then the standard Hermitian product is used.  <varname>B</varname> can
either be a sesquilinear function of two arguments or it can be a matrix giving
a sesquilinear form.  The vectors will be made orthonormal with respect to
<varname>B</varname>.</para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/GramSchmidtOrthogonalization.html">Planetmath</ulink> for more information.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-HankelMatrix"/>HankelMatrix</term>
         <listitem>
          <synopsis>HankelMatrix (c,r)</synopsis>
          <para>Hankel matrix.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-HilbertMatrix"/>HilbertMatrix</term>
         <listitem>
          <synopsis>HilbertMatrix (n)</synopsis>
          <para>Hilbert matrix of order <varname>n</varname>.</para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/HilbertMatrix.html">Planetmath</ulink> for more information.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-Image"/>Image</term>
         <listitem>
          <synopsis>Image (T)</synopsis>
          <para>Get the image (columnspace) of a linear transform.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-InfNorm"/>InfNorm</term>
         <listitem>
          <synopsis>InfNorm (v)</synopsis>
          <para>Get the Inf Norm of a vector, sometimes called the sup norm or the max norm.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-InvariantFactorsInteger"/>InvariantFactorsInteger</term>
         <listitem>
          <synopsis>InvariantFactorsInteger (M)</synopsis>
          <para>Get the invariant factors of a square integer matrix (not its characteristic).</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-InverseHilbertMatrix"/>InverseHilbertMatrix</term>
         <listitem>
          <synopsis>InverseHilbertMatrix (n)</synopsis>
          <para>Inverse Hilbert matrix of order <varname>n</varname>.</para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/HilbertMatrix.html">Planetmath</ulink> for more information.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-IsHermitian"/>IsHermitian</term>
         <listitem>
          <synopsis>IsHermitian (M)</synopsis>
          <para>Is a matrix Hermitian.  That is, is it equal to its conjugate transpose.</para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/HermitianMatrix.html">Planetmath</ulink> for more information.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-IsInSubspace"/>IsInSubspace</term>
         <listitem>
          <synopsis>IsInSubspace (v,W)</synopsis>
          <para>Test if a vector is in a subspace.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-IsInvertible"/>IsInvertible</term>
         <listitem>
          <synopsis>IsInvertible (n)</synopsis>
          <para>Is a matrix (or number) invertible (Integer matrix is invertible if and only if it is invertible over the integers).</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-IsInvertibleField"/>IsInvertibleField</term>
         <listitem>
          <synopsis>IsInvertibleField (n)</synopsis>
          <para>Is a matrix (or number) invertible over a field.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-IsNormal"/>IsNormal</term>
         <listitem>
          <synopsis>IsNormal (M)</synopsis>
          <para>Is <varname>M</varname> a normal matrix.  That is,
	  does <userinput>M*M' == M'*M</userinput>.</para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/NormalMatrix.html">Planetmath</ulink> or
	    <ulink url="http://mathworld.wolfram.com/NormalMatrix.html">Mathworld</ulink> for more information.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-IsPositiveDefinite"/>IsPositiveDefinite</term>
         <listitem>
          <synopsis>IsPositiveDefinite (M)</synopsis>
          <para>Is <varname>M</varname> a Hermitian positive definite matrix.  That is if
<userinput>HermitianProduct(M*v,v)</userinput> is always strictly positive for
any vector <varname>v</varname>.
<varname>M</varname> must be square and Hermitian to be positive definite.
The check that is performed is that every principal submatrix has a non-negative
determinant.
(See <link linkend="gel-function-HermitianProduct">HermitianProduct</link>)</para>
	  <para>
	    Note that some authors (for example Mathworld) do not require that
	    <varname>M</varname> be Hermitian, and then the condition is
	    on the real part of the inner product, but we do not take this
	    view.  If you wish to perform this check, just check the
	    Hermitian part of the matrix <varname>M</varname> as follows:
	    <userinput>IsPositiveDefinite(M+M')</userinput>.
	  </para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/PositiveDefinite.html">Planetmath</ulink> or
	    <ulink url="http://mathworld.wolfram.com/PositiveDefiniteMatrix.html">Mathworld</ulink> for more information.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-IsPositiveSemidefinite"/>IsPositiveSemidefinite</term>
         <listitem>
          <synopsis>IsPositiveSemidefinite (M)</synopsis>
          <para>Is <varname>M</varname> a Hermitian positive semidefinite matrix.  That is if
<userinput>HermitianProduct(M*v,v)</userinput> is always non-negative for
any vector <varname>v</varname>.
<varname>M</varname> must be square and Hermitian to be positive semidefinite.
The check that is performed is that every principal submatrix has a non-negative
determinant.
(See <link linkend="gel-function-HermitianProduct">HermitianProduct</link>)</para>
	  <para>
	    Note that some authors do not require that
	    <varname>M</varname> be Hermitian, and then the condition is
	    on the real part of the inner product, but we do not take this
	    view.  If you wish to perform this check, just check the
	    Hermitian part of the matrix <varname>M</varname> as follows:
	    <userinput>IsPositiveSemidefinite(M+M')</userinput>.
	  </para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/PositiveSemidefinite.html">Planetmath</ulink> or
	    <ulink url="http://mathworld.wolfram.com/PositiveSemidefiniteMatrix.html">Mathworld</ulink> for more information.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-IsSkewHermitian"/>IsSkewHermitian</term>
         <listitem>
          <synopsis>IsSkewHermitian (M)</synopsis>
          <para>Is a matrix skew-Hermitian.  That is, is the conjugate transpose equal to negative of the matrix.</para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/SkewHermitianMatrix.html">Planetmath</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-IsUnitary"/>IsUnitary</term>
         <listitem>
          <synopsis>IsUnitary (M)</synopsis>
          <para>Is a matrix unitary?  That is, does
	  <userinput>M'*M</userinput> and <userinput>M*M'</userinput>
	  equal the identity.</para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/UnitaryTransformation.html">Planetmath</ulink> or
	    <ulink url="http://mathworld.wolfram.com/UnitaryMatrix.html">Mathworld</ulink> for more information.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-JordanBlock"/>JordanBlock</term>
         <listitem>
          <synopsis>JordanBlock (n,lambda)</synopsis>
          <para>Aliases: <function>J</function></para>
          <para>Get the Jordan block corresponding to the eigenvalue
	  <varname>lambda</varname> with multiplicity <varname>n</varname>.
	  </para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/JordanCanonicalFormTheorem.html">Planetmath</ulink> or
	    <ulink url="http://mathworld.wolfram.com/JordanBlock.html">Mathworld</ulink> for more information.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-Kernel"/>Kernel</term>
         <listitem>
          <synopsis>Kernel (T)</synopsis>
          <para>Get the kernel (nullspace) of a linear transform.</para>
	  <para>
	  (See <link linkend="gel-function-NullSpace">NullSpace</link>)
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-LUDecomposition"/>LUDecomposition</term>
         <listitem>
          <synopsis>LUDecomposition (A, L, U)</synopsis>
          <para>
	    Get the LU decomposition of <varname>A</varname>
	    and store the result in the <varname>L</varname> and
	    <varname>U</varname> which should be references.  It returns <constant>true</constant>
	    if successful.
	    For example suppose that A is a square matrix, then after running:
	    <screen><prompt>genius&gt;</prompt> <userinput>LUDecomposition(A,&amp;L,&amp;U)</userinput>
</screen>
	    You will have the lower matrix stored in a variable called
	    <varname>L</varname> and the upper matrix in a variable called
	    <varname>U</varname>.
	  </para>
	  <para>
	    This is the LU decomposition of a matrix aka Crout and/or Cholesky
	    reduction.
	    (ISBN 0-201-11577-8 pp.99-103)
	    The upper triangular matrix features a diagonal
	    of values 1 (one).  This is not Doolittle's Method which features
	    the 1's diagonal on the lower matrix. 
	  </para>
	  <para>
	    Not all matrices have LU decompositions, for example
	    <userinput>[0,1;1,0]</userinput> does not and this function returns
	    <constant>false</constant> in this case and sets <varname>L</varname>
	    and <varname>U</varname> to <constant>null</constant>.
	  </para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/LUDecomposition.html">Planetmath</ulink> or
	    <ulink url="http://mathworld.wolfram.com/LUDecomposition.html">Mathworld</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-Minor"/>Minor</term>
         <listitem>
          <synopsis>Minor (M,i,j)</synopsis>
          <para>Get the <varname>i</varname>-<varname>j</varname> minor of a matrix.</para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/Minor.html">Planetmath</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-NonPivotColumns"/>NonPivotColumns</term>
         <listitem>
          <synopsis>NonPivotColumns (M)</synopsis>
          <para>Return the columns that are not the pivot columns of a matrix.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-Norm"/>Norm</term>
         <listitem>
          <synopsis>Norm (v,p...)</synopsis>
          <para>Aliases: <function>norm</function></para>
          <para>Get the p Norm (or 2 Norm if no p is supplied) of a vector.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-NullSpace"/>NullSpace</term>
         <listitem>
          <synopsis>NullSpace (T)</synopsis>
          <para>Get the nullspace of a matrix.  That is the kernel of the
	  linear mapping that the matrix represents.  This is returned
	  as a matrix whose column space is the nullspace of
	  <varname>T</varname>.</para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/Nullspace.html">Planetmath</ulink> for more information.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-Nullity"/>Nullity</term>
         <listitem>
          <synopsis>Nullity (M)</synopsis>
          <para>Aliases: <function>nullity</function></para>
          <para>Get the nullity of a matrix.  That is, return the dimension of
the nullspace; the dimension of the kernel of <varname>M</varname>.</para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/Nullity.html">Planetmath</ulink> for more information.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-OrthogonalComplement"/>OrthogonalComplement</term>
         <listitem>
          <synopsis>OrthogonalComplement (M)</synopsis>
          <para>Get the orthogonal complement of the columnspace.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-PivotColumns"/>PivotColumns</term>
         <listitem>
          <synopsis>PivotColumns (M)</synopsis>
          <para>Return pivot columns of a matrix, that is columns which have a leading 1 in row reduced form.  Also returns the row where they occur.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-Projection"/>Projection</term>
         <listitem>
          <synopsis>Projection (v,W,B...)</synopsis>
	  <para>Projection of vector <varname>v</varname> onto subspace
<varname>W</varname> with respect to inner product given by
<varname>B</varname>.  If <varname>B</varname> is not given then the standard
Hermitian product is used.  <varname>B</varname> can either be a sesquilinear
function of two arguments or it can be a matrix giving a sesquilinear form.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-QRDecomposition"/>QRDecomposition</term>
         <listitem>
          <synopsis>QRDecomposition (A, Q)</synopsis>
          <para>
	    Get the QR decomposition of a square matrix <varname>A</varname>,
	    returns the upper triangular matrix <varname>R</varname>
	    and sets <varname>Q</varname> to the orthogonal (unitary) matrix.
	    <varname>Q</varname> should be a reference or <constant>null</constant> if you don't
	    want any return.
	    For example:
	    <screen><prompt>genius&gt;</prompt> <userinput>R = QRDecomposition(A,&amp;Q)</userinput>
</screen>
	    You will have the upper triangular matrix stored in
	    a variable called
	    <varname>R</varname> and the orthogonal (unitary) matrix stored in
	    <varname>Q</varname>.
	  </para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/QRDecomposition.html">Planetmath</ulink> or
	    <ulink url="http://mathworld.wolfram.com/QRDecomposition.html">Mathworld</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-RayleighQuotient"/>RayleighQuotient</term>
         <listitem>
          <synopsis>RayleighQuotient (A,x)</synopsis>
          <para>Return the Rayleigh quotient (also called the Rayleigh-Ritz quotient or ratio) of a matrix and a vector.</para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/RayleighQuotient.html">Planetmath</ulink> for more information.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-RayleighQuotientIteration"/>RayleighQuotientIteration</term>
         <listitem>
          <synopsis>RayleighQuotientIteration (A,x,epsilon,maxiter,vecref)</synopsis>
          <para>Find eigenvalues of <varname>A</varname> using the Rayleigh
	        quotient iteration method.  <varname>x</varname> is a guess
		at a eigenvector and could be random.  It should have 
	        nonzero imaginary part if it will have any chance at finding
	        complex eigenvalues.  The code will run at most
		<varname>maxiter</varname> iterations and return <constant>null</constant>
		if we cannot get within an error of <varname>epsilon</varname>.
		<varname>vecref</varname> should either be <constant>null</constant> or a reference
		to a variable where the eigenvector should be stored.
		</para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/RayleighQuotient.html">Planetmath</ulink> for more information on Rayleigh quotient.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-Rank"/>Rank</term>
         <listitem>
          <synopsis>Rank (M)</synopsis>
          <para>Aliases: <function>rank</function></para>
          <para>Get the rank of a matrix.</para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/SylvestersLaw.html">Planetmath</ulink> for more information.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-RosserMatrix"/>RosserMatrix</term>
         <listitem>
          <synopsis>RosserMatrix ()</synopsis>
          <para>Returns the Rosser matrix, which is a classic symmetric eigenvalue test problem.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-Rotation2D"/>Rotation2D</term>
         <listitem>
          <synopsis>Rotation2D (angle)</synopsis>
          <para>Aliases: <function>RotationMatrix</function></para>
          <para>Return the matrix corresponding to rotation around origin in R<superscript>2</superscript>.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-Rotation3DX"/>Rotation3DX</term>
         <listitem>
          <synopsis>Rotation3DX (angle)</synopsis>
          <para>Return the matrix corresponding to rotation around origin in R<superscript>3</superscript> about the x-axis.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-Rotation3DY"/>Rotation3DY</term>
         <listitem>
          <synopsis>Rotation3DY (angle)</synopsis>
          <para>Return the matrix corresponding to rotation around origin in R<superscript>3</superscript> about the y-axis.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-Rotation3DZ"/>Rotation3DZ</term>
         <listitem>
          <synopsis>Rotation3DZ (angle)</synopsis>
          <para>Return the matrix corresponding to rotation around origin in R<superscript>3</superscript> about the z-axis.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-RowSpace"/>RowSpace</term>
         <listitem>
          <synopsis>RowSpace (M)</synopsis>
          <para>Get a basis matrix for the rowspace of a matrix.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-SesquilinearForm"/>SesquilinearForm</term>
         <listitem>
          <synopsis>SesquilinearForm (v,A,w)</synopsis>
          <para>Evaluate (v,w) with respect to the sesquilinear form given by the matrix A.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-SesquilinearFormFunction"/>SesquilinearFormFunction</term>
         <listitem>
          <synopsis>SesquilinearFormFunction (A)</synopsis>
          <para>Return a function that evaluates two vectors with respect to the sesquilinear form given by A.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-SmithNormalFormField"/>SmithNormalFormField</term>
         <listitem>
          <synopsis>SmithNormalFormField (A)</synopsis>
          <para>Smith Normal Form for fields (will end up with 1's on the diagonal).</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-SmithNormalFormInteger"/>SmithNormalFormInteger</term>
         <listitem>
          <synopsis>SmithNormalFormInteger (M)</synopsis>
          <para>Smith Normal Form for square integer matrices (not its characteristic).</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-SolveLinearSystem"/>SolveLinearSystem</term>
         <listitem>
          <synopsis>SolveLinearSystem (M,V,args...)</synopsis>
	  <para>Solve linear system Mx=V, return solution V if there is a unique solution, <constant>null</constant> otherwise.  Extra two reference parameters can optionally be used to get the reduced M and V.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-ToeplitzMatrix"/>ToeplitzMatrix</term>
         <listitem>
          <synopsis>ToeplitzMatrix (c, r...)</synopsis>
	  <para>Return the Toeplitz matrix constructed given the first column c
and (optionally) the first row r.  If only the column c is given then it is
conjugated and the nonconjugated version is used for the first row to give a
Hermitian matrix (if the first element is real of course).</para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/ToeplitzMatrix.html">Planetmath</ulink> for more information.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-Trace"/>Trace</term>
         <listitem>
          <synopsis>Trace (M)</synopsis>
          <para>Aliases: <function>trace</function></para>
          <para>Calculate the trace of a matrix.  That is the sum of the diagonal elements.</para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/Trace.html">Planetmath</ulink> for more information.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-Transpose"/>Transpose</term>
         <listitem>
          <synopsis>Transpose (M)</synopsis>
          <para>Transpose of a matrix.  This is the same as the
          <userinput>.'</userinput> operator.</para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/Transpose.html">Planetmath</ulink> for more information.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-VandermondeMatrix"/>VandermondeMatrix</term>
         <listitem>
          <synopsis>VandermondeMatrix (v)</synopsis>
          <para>Aliases: <function>vander</function></para>
          <para>Return the Vandermonde matrix.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-VectorAngle"/>VectorAngle</term>
         <listitem>
          <synopsis>VectorAngle (v,w,B...)</synopsis>
          <para>The angle of two vectors with respect to inner product given by
<varname>B</varname>.  If <varname>B</varname> is not given then the standard
Hermitian product is used.  <varname>B</varname> can either be a sesquilinear
function of two arguments or it can be a matrix giving a sesquilinear form.
</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-VectorSpaceDirectSum"/>VectorSpaceDirectSum</term>
         <listitem>
          <synopsis>VectorSpaceDirectSum (M,N)</synopsis>
          <para>The direct sum of the vector spaces M and N.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-VectorSubspaceIntersection"/>VectorSubspaceIntersection</term>
         <listitem>
          <synopsis>VectorSubspaceIntersection (M,N)</synopsis>
          <para>Intersection of the subspaces given by M and N.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-VectorSubspaceSum"/>VectorSubspaceSum</term>
         <listitem>
          <synopsis>VectorSubspaceSum (M,N)</synopsis>
          <para>The sum of the vector spaces M and N, that is {w | w=m+n, m in M, n in N}.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-adj"/>adj</term>
         <listitem>
          <synopsis>adj (m)</synopsis>
          <para>Aliases: <function>Adjugate</function></para>
          <para>Get the classical adjoint (adjugate) of a matrix.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-cref"/>cref</term>
         <listitem>
          <synopsis>cref (M)</synopsis>
          <para>Aliases: <function>CREF</function> <function>ColumnReducedEchelonForm</function></para>
          <para>Compute the Column Reduced Echelon Form.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-det"/>det</term>
         <listitem>
          <synopsis>det (M)</synopsis>
          <para>Aliases: <function>Determinant</function></para>
          <para>Get the determinant of a matrix.</para>
          <para>
	    See
	    <ulink url="http://en.wikipedia.org/wiki/Determinant">Wikipedia</ulink> or
	    <ulink url="http://planetmath.org/encyclopedia/Determinant2.html">Planetmath</ulink> for more information.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-ref"/>ref</term>
         <listitem>
          <synopsis>ref (M)</synopsis>
          <para>Aliases: <function>REF</function> <function>RowEchelonForm</function></para>
	  <para>Get the row echelon form of a matrix.  That is, apply gaussian
elimination but not backaddition to <varname>M</varname>.  The pivot rows are
divided to make all pivots 1.</para>
          <para>
	    See
	    <ulink url="http://en.wikipedia.org/wiki/Row_echelon_form">Wikipedia</ulink> or
	    <ulink url="http://planetmath.org/encyclopedia/RowEchelonForm.html">Planetmath</ulink> for more information.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-rref"/>rref</term>
         <listitem>
          <synopsis>rref (M)</synopsis>
          <para>Aliases: <function>RREF</function> <function>ReducedRowEchelonForm</function></para>
          <para>Get the reduced row echelon form of a matrix.  That is, apply gaussian elimination together with backaddition to <varname>M</varname>.</para>
          <para>
	    See
	    <ulink url="http://en.wikipedia.org/wiki/Reduced_row_echelon_form">Wikipedia</ulink> or
	    <ulink url="http://planetmath.org/encyclopedia/ReducedRowEchelonForm.html">Planetmath</ulink> for more information.
          </para>
         </listitem>
        </varlistentry>

      </variablelist>
    </sect1>

    <sect1 id="genius-gel-function-list-combinatorics">
      <title>Combinatorics</title>
      <variablelist>
        <varlistentry>
         <term><anchor id="gel-function-Catalan"/>Catalan</term>
         <listitem>
          <synopsis>Catalan (n)</synopsis>
          <para>Get <varname>n</varname>th Catalan number.</para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/CatalanNumbers.html">Planetmath</ulink> for more information.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-Combinations"/>Combinations</term>
         <listitem>
          <synopsis>Combinations (k,n)</synopsis>
          <para>Get all combinations of k numbers from 1 to n as a vector of vectors.
	  (See also <link linkend="gel-function-NextCombination">NextCombination</link>)
</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-DoubleFactorial"/>DoubleFactorial</term>
         <listitem>
          <synopsis>DoubleFactorial (n)</synopsis>
          <para>Double factorial: <userinput>n(n-2)(n-4)...</userinput></para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/DoubleFactorial.html">Planetmath</ulink> for more information.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-Factorial"/>Factorial</term>
         <listitem>
          <synopsis>Factorial (n)</synopsis>
          <para>Factorial: <userinput>n(n-1)(n-2)...</userinput></para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/Factorial.html">Planetmath</ulink> for more information.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-FallingFactorial"/>FallingFactorial</term>
         <listitem>
          <synopsis>FallingFactorial (n,k)</synopsis>
          <para>Falling factorial: <userinput>(n)_k = n(n-1)...(n-(k-1))</userinput></para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/FallingFactorial.html">Planetmath</ulink> for more information.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-Fibonacci"/>Fibonacci</term>
         <listitem>
          <synopsis>Fibonacci (x)</synopsis>
          <para>Aliases: <function>fib</function></para>
          <para>
	    Calculate <varname>n</varname>th Fibonacci number.  That
	    is the number defined recursively by
	    <userinput>Fibonacci(n) = Fibonacci(n-1) + Fibonacci(n-2)</userinput>
	    and 
	    <userinput>Fibonacci(1) = Fibonacci(2) = 1</userinput>.
	  </para>
          <para>
	    See
	    <ulink url="http://en.wikipedia.org/wiki/Fibonacci_number">Wikipedia</ulink> or
	    <ulink url="http://planetmath.org/encyclopedia/FibonacciSequence.html">Planetmath</ulink> or
	    <ulink url="http://mathworld.wolfram.com/FibonacciNumber.html">Mathworld</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-FrobeniusNumber"/>FrobeniusNumber</term>
         <listitem>
          <synopsis>FrobeniusNumber (v,arg...)</synopsis>
          <para>
	    Calculate the Frobenius number.  That is calculate smallest
	    number that cannot be given as a non-negative integer linear
	    combination of a given vector of non-negative integers.
	    The vector can be given as separate numbers or a single vector.
	    All the numbers given should have GCD of 1.
	  </para>
          <para>
	    See
	    <ulink url="http://mathworld.wolfram.com/FrobeniusNumber.html">Mathworld</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-GaloisMatrix"/>GaloisMatrix</term>
         <listitem>
          <synopsis>GaloisMatrix (combining_rule)</synopsis>
          <para>Galois matrix given a linear combining rule (a_1*x_+...+a_n*x_n=x_(n+1)).</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-GreedyAlgorithm"/>GreedyAlgorithm</term>
         <listitem>
          <synopsis>FrobeniusNumber (n,v)</synopsis>
          <para>
	    Find the vector <varname>c</varname> of non-negative integers
	    such that taking the dot product with <varname>v</varname> is
	    equal to n.  If not possible returns <constant>null</constant>.  <varname>v</varname>
	    should be given sorted in increasing order and should consist
	    of non-negative integers.
	  </para>
          <para>
	    See
	    <ulink url="http://mathworld.wolfram.com/GreedyAlgorithm.html">Mathworld</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-HarmonicNumber"/>HarmonicNumber</term>
         <listitem>
          <synopsis>HarmonicNumber (n,r)</synopsis>
          <para>Aliases: <function>HarmonicH</function></para>
          <para>Harmonic Number, the <varname>n</varname>th harmonic number of order <varname>r</varname>.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-Hofstadter"/>Hofstadter</term>
         <listitem>
          <synopsis>Hofstadter (n)</synopsis>
          <para>Hofstadter's function q(n) defined by q(1)=1, q(2)=1, q(n)=q(n-q(n-1))+q(n-q(n-2)).</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-LinearRecursiveSequence"/>LinearRecursiveSequence</term>
         <listitem>
          <synopsis>LinearRecursiveSequence (seed_values,combining_rule,n)</synopsis>
          <para>Compute linear recursive sequence using Galois stepping.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-Multinomial"/>Multinomial</term>
         <listitem>
          <synopsis>Multinomial (v,arg...)</synopsis>
          <para>Calculate multinomial coefficients.  Takes a vector of
	    <varname>k</varname>
	    non-negative integers and computes the multinomial coefficient.
	    This corresponds to the coefficient in the homogeneous polynomial
	    in <varname>k</varname> variables with the corresponding powers.
	  </para>
	  <para>
	    The formula for <userinput>Multinomial(a,b,c)</userinput>
	    can be written as:
<programlisting>(a+b+c)! / (a!b!c!)
</programlisting>
	    In other words, if we would have only two elements, then
<userinput>Multinomial(a,b)</userinput> is the same thing as
<userinput>Binomial(a+b,a)</userinput> or
<userinput>Binomial(a+b,b)</userinput>.
	  </para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/MultinomialTheorem.html">Planetmath</ulink>,
	    <ulink url="http://mathworld.wolfram.com/MultinomialCoefficient.html">Mathworld</ulink>, or
	    <ulink url="http://en.wikipedia.org/wiki/Multinomial_theorem">Wikipedia</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-NextCombination"/>NextCombination</term>
         <listitem>
          <synopsis>NextCombination (v,n)</synopsis>
	  <para>Get combination that would come after v in call to
combinations, first combination should be <userinput>[1:k]</userinput>.  This
function is useful if you have many combinations to go through and you don't
want to waste memory to store them all.
	  </para>
	  <para>
	    For example with Combination you would normally write a loop like:
          <screen><userinput>for n in Combinations (4,6) do (
  SomeFunction (n)
);</userinput>
</screen>
	    But with NextCombination you would write something like:
          <screen><userinput>n:=[1:4];
do (
  SomeFunction (n)
) while not IsNull(n:=NextCombination(n,6));</userinput>
</screen>
	  See also <link linkend="gel-function-Combinations">Combinations</link>.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-Pascal"/>Pascal</term>
         <listitem>
          <synopsis>Pascal (i)</synopsis>
          <para>Get the Pascal's triangle as a matrix.  This will return
	  an <varname>i</varname>+1 by <varname>i</varname>+1 lower diagonal
	  matrix which is the Pascal's triangle after <varname>i</varname>
	  iterations.</para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/PascalsTriangle.html">Planetmath</ulink> for more information.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-Permutations"/>Permutations</term>
         <listitem>
          <synopsis>Permutations (k,n)</synopsis>
          <para>Get all permutations of <varname>k</varname> numbers from 1 to <varname>n</varname> as a vector of vectors.</para>
          <para>
	    See
	    <ulink url="http://mathworld.wolfram.com/Permutation.html">Mathworld</ulink> or
	    <ulink url="http://en.wikipedia.org/wiki/Permutation">Wikipedia</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-RisingFactorial"/>RisingFactorial</term>
         <listitem>
          <synopsis>RisingFactorial (n,k)</synopsis>
          <para>Aliases: <function>Pochhammer</function></para>
          <para>(Pochhammer) Rising factorial: (n)_k = n(n+1)...(n+(k-1)).</para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/RisingFactorial.html">Planetmath</ulink> for more information.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-StirlingNumberFirst"/>StirlingNumberFirst</term>
         <listitem>
          <synopsis>StirlingNumberFirst (n,m)</synopsis>
          <para>Aliases: <function>StirlingS1</function></para>
          <para>Stirling number of the first kind.</para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/StirlingNumbersOfTheFirstKind.html">Planetmath</ulink> or
	    <ulink url="http://mathworld.wolfram.com/StirlingNumberoftheFirstKind.html">Mathworld</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-StirlingNumberSecond"/>StirlingNumberSecond</term>
         <listitem>
          <synopsis>StirlingNumberSecond (n,m)</synopsis>
          <para>Aliases: <function>StirlingS2</function></para>
          <para>Stirling number of the second kind.</para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/StirlingNumbersSecondKind.html">Planetmath</ulink> or
	    <ulink url="http://mathworld.wolfram.com/StirlingNumberoftheSecondKind.html">Mathworld</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-Subfactorial"/>Subfactorial</term>
         <listitem>
          <synopsis>Subfactorial (n)</synopsis>
          <para>Subfactorial: n! times sum_{k=1}^n (-1)^k/k!.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-Triangular"/>Triangular</term>
         <listitem>
          <synopsis>Triangular (nth)</synopsis>
          <para>Calculate the <varname>n</varname>th triangular number.</para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/TriangularNumbers.html">Planetmath</ulink> for more information.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-nCr"/>nCr</term>
         <listitem>
          <synopsis>nCr (n,r)</synopsis>
          <para>Aliases: <function>Binomial</function></para>
          <para>Calculate combinations, that is, the binomial coefficient.
	        <varname>n</varname> can be any real number.</para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/Choose.html">Planetmath</ulink> for more information.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-nPr"/>nPr</term>
         <listitem>
          <synopsis>nPr (n,r)</synopsis>
          <para>Calculate the number of permutations of size
	   <varname>r</varname>of numbers from 1 to <varname>n</varname>.</para>
          <para>
	    See
	    <ulink url="http://mathworld.wolfram.com/Permutation.html">Mathworld</ulink> or
	    <ulink url="http://en.wikipedia.org/wiki/Permutation">Wikipedia</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

      </variablelist>
    </sect1>

    <sect1 id="genius-gel-function-list-calculus">
      <title>Calculus</title>
      <variablelist>
        <varlistentry>
         <term><anchor id="gel-function-CompositeSimpsonsRule"/>CompositeSimpsonsRule</term>
         <listitem>
          <synopsis>CompositeSimpsonsRule (f,a,b,n)</synopsis>
          <para>Integration of f by Composite Simpson's Rule on the interval [a,b] with n subintervals with error of max(f'''')*h^4*(b-a)/180, note that n should be even.</para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/SimpsonsRule.html">Planetmath</ulink> for more information.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-CompositeSimpsonsRuleTolerance"/>CompositeSimpsonsRuleTolerance</term>
         <listitem>
          <synopsis>CompositeSimpsonsRuleTolerance (f,a,b,FourthDerivativeBound,Tolerance)</synopsis>
          <para>Integration of f by Composite Simpson's Rule on the interval [a,b] with the number of steps calculated by the fourth derivative bound and the desired tolerance.</para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/SimpsonsRule.html">Planetmath</ulink> for more information.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-Derivative"/>Derivative</term>
         <listitem>
          <synopsis>Derivative (f,x0)</synopsis>
          <para>Attempt to calculate derivative by trying first symbolically and then numerically.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-EvenPeriodicExtension"/>EvenPeriodicExtension</term>
         <listitem>
          <synopsis>EvenPeriodicExtension (f,L)</synopsis>
	  <para>Return a function which is even periodic extension of
<function>f</function> with half period <varname>L</varname>.  That
is a function defined on the interval <userinput>[0,L]</userinput>
extended to be even on <userinput>[-L,L]</userinput> and then
extended to be periodic with period <userinput>2*L</userinput>.</para>
	  <para>
	    See also
	    <link linkend="gel-function-OddPeriodicExtension">OddPeriodicExtension</link>
	    and
	    <link linkend="gel-function-PeriodicExtension">PeriodicExtension</link>.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-FourierSeriesFunction"/>FourierSeriesFunction</term>
         <listitem>
          <synopsis>FourierSeriesFunction (a,b,L)</synopsis>
	  <para>Return a function which is a Fourier series with the
coefficients given by the vectors <varname>a</varname> (sines) and
<varname>b</varname> (cosines).  Note that <userinput>a@(1)</userinput> is
the constant coefficient!  That is, <userinput>a@(n)</userinput> refers to
the term <userinput>cos(x*(n-1)*pi/L)</userinput>, while
<userinput>b@(n)</userinput> refers to the term
<userinput>sin(x*n*pi/L)</userinput>.  Either <varname>a</varname>
or <varname>b</varname> can be <constant>null</constant>.</para>
          <para>
	    See
	    <ulink url="http://en.wikipedia.org/wiki/Fourier_series">Wikipedia</ulink> or
	    <ulink url="http://mathworld.wolfram.com/FourierSeries.html">Mathworld</ulink> for more information.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-InfiniteProduct"/>InfiniteProduct</term>
         <listitem>
          <synopsis>InfiniteProduct (func,start,inc)</synopsis>
          <para>Try to calculate an infinite product for a single parameter function.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-InfiniteProduct2"/>InfiniteProduct2</term>
         <listitem>
          <synopsis>InfiniteProduct2 (func,arg,start,inc)</synopsis>
          <para>Try to calculate an infinite product for a double parameter function with func(arg,n).</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-InfiniteSum"/>InfiniteSum</term>
         <listitem>
          <synopsis>InfiniteSum (func,start,inc)</synopsis>
          <para>Try to calculate an infinite sum for a single parameter function.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-InfiniteSum2"/>InfiniteSum2</term>
         <listitem>
          <synopsis>InfiniteSum2 (func,arg,start,inc)</synopsis>
          <para>Try to calculate an infinite sum for a double parameter function with func(arg,n).</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-IsContinuous"/>IsContinuous</term>
         <listitem>
          <synopsis>IsContinuous (f,x0)</synopsis>
          <para>Try and see if a real-valued function is continuous at x0 by calculating the limit there.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-IsDifferentiable"/>IsDifferentiable</term>
         <listitem>
          <synopsis>IsDifferentiable (f,x0)</synopsis>
          <para>Test for differentiability by approximating the left and right limits and comparing.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-LeftLimit"/>LeftLimit</term>
         <listitem>
          <synopsis>LeftLimit (f,x0)</synopsis>
          <para>Calculate the left limit of a real-valued function at x0.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-Limit"/>Limit</term>
         <listitem>
          <synopsis>Limit (f,x0)</synopsis>
          <para>Calculate the limit of a real-valued function at x0.  Tries to calculate both left and right limits.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-MidpointRule"/>MidpointRule</term>
         <listitem>
          <synopsis>MidpointRule (f,a,b,n)</synopsis>
          <para>Integration by midpoint rule.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-NumericalDerivative"/>NumericalDerivative</term>
         <listitem>
          <synopsis>NumericalDerivative (f,x0)</synopsis>
          <para>Aliases: <function>NDerivative</function></para>
          <para>Attempt to calculate numerical derivative.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-NumericalFourierSeriesCoefficients"/>NumericalFourierSeriesCoefficients</term>
         <listitem>
          <synopsis>NumericalFourierSeriesCoefficients (f,L,N)</synopsis>
	  <para>Return a vector of vectors <userinput>[a,b]</userinput>
where <varname>a</varname> are the cosine coefficients and
<varname>b</varname> are the sine coefficients of
the Fourier series of
<function>f</function> with half-period <varname>L</varname> (that is defined
on <userinput>[-L,L]</userinput> and extended periodically) with coefficients
up to <varname>N</varname>th harmonic computed numerically.  The coefficients are
computed by numerical integration using
<function>NumericalIntegral</function>.</para>
          <para>
	    See
	    <ulink url="http://en.wikipedia.org/wiki/Fourier_series">Wikipedia</ulink> or
	    <ulink url="http://mathworld.wolfram.com/FourierSeries.html">Mathworld</ulink> for more information.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-NumericalFourierSeriesFunction"/>NumericalFourierSeriesFunction</term>
         <listitem>
          <synopsis>NumericalFourierSeriesFunction (f,L,N)</synopsis>
	  <para>Return a function which is the Fourier series of
<function>f</function> with half-period <varname>L</varname> (that is defined
on <userinput>[-L,L]</userinput> and extended periodically) with coefficients
up to <varname>N</varname>th harmonic computed numerically.  This is the
trigonometric real series composed of sines and cosines.  The coefficients are
computed by numerical integration using
<function>NumericalIntegral</function>.</para>
          <para>
	    See
	    <ulink url="http://en.wikipedia.org/wiki/Fourier_series">Wikipedia</ulink> or
	    <ulink url="http://mathworld.wolfram.com/FourierSeries.html">Mathworld</ulink> for more information.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-NumericalFourierCosineSeriesCoefficients"/>NumericalFourierCosineSeriesCoefficients</term>
         <listitem>
          <synopsis>NumericalFourierCosineSeriesCoefficients (f,L,N)</synopsis>
	  <para>Return a vector of coefficients of 
the cosine Fourier series of
<function>f</function> with half-period <varname>L</varname>.  That is,
we take <function>f</function> defined on <userinput>[0,L]</userinput>
take the even periodic extension and compute the Fourier series, which
only has cosine terms.  The series is computed up to the 
<varname>N</varname>th harmonic.  The coefficients are
computed by numerical integration using
<function>NumericalIntegral</function>.
Note that <userinput>a@(1)</userinput> is
the constant coefficient!  That is, <userinput>a@(n)</userinput> refers to
the term <userinput>cos(x*(n-1)*pi/L)</userinput>.</para>
          <para>
	    See
	    <ulink url="http://en.wikipedia.org/wiki/Fourier_series">Wikipedia</ulink> or
	    <ulink url="http://mathworld.wolfram.com/FourierCosineSeries.html">Mathworld</ulink> for more information.
          </para>
	  </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-NumericalFourierCosineSeriesFunction"/>NumericalFourierCosineSeriesFunction</term>
         <listitem>
          <synopsis>NumericalFourierCosineSeriesFunction (f,L,N)</synopsis>
	  <para>Return a function which is the cosine Fourier series of
<function>f</function> with half-period <varname>L</varname>.  That is,
we take <function>f</function> defined on <userinput>[0,L]</userinput>
take the even periodic extension and compute the Fourier series, which
only has cosine terms.  The series is computed up to the 
<varname>N</varname>th harmonic.  The coefficients are
computed by numerical integration using
<function>NumericalIntegral</function>.</para>
          <para>
	    See
	    <ulink url="http://en.wikipedia.org/wiki/Fourier_series">Wikipedia</ulink> or
	    <ulink url="http://mathworld.wolfram.com/FourierCosineSeries.html">Mathworld</ulink> for more information.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-NumericalFourierSineSeriesCoefficients"/>NumericalFourierSineSeriesCoefficients</term>
         <listitem>
          <synopsis>NumericalFourierSineSeriesCoefficients (f,L,N)</synopsis>
	  <para>Return a vector of coefficients of 
the sine Fourier series of
<function>f</function> with half-period <varname>L</varname>.  That is,
we take <function>f</function> defined on <userinput>[0,L]</userinput>
take the odd periodic extension and compute the Fourier series, which
only has sine terms.  The series is computed up to the 
<varname>N</varname>th harmonic.  The coefficients are
computed by numerical integration using
<function>NumericalIntegral</function>.</para>
          <para>
	    See
	    <ulink url="http://en.wikipedia.org/wiki/Fourier_series">Wikipedia</ulink> or
	    <ulink url="http://mathworld.wolfram.com/FourierSineSeries.html">Mathworld</ulink> for more information.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-NumericalFourierSineSeriesFunction"/>NumericalFourierSineSeriesFunction</term>
         <listitem>
          <synopsis>NumericalFourierSineSeriesFunction (f,L,N)</synopsis>
	  <para>Return a function which is the sine Fourier series of
<function>f</function> with half-period <varname>L</varname>.  That is,
we take <function>f</function> defined on <userinput>[0,L]</userinput>
take the odd periodic extension and compute the Fourier series, which
only has sine terms.  The series is computed up to the 
<varname>N</varname>th harmonic.  The coefficients are
computed by numerical integration using
<function>NumericalIntegral</function>.</para>
          <para>
	    See
	    <ulink url="http://en.wikipedia.org/wiki/Fourier_series">Wikipedia</ulink> or
	    <ulink url="http://mathworld.wolfram.com/FourierSineSeries.html">Mathworld</ulink> for more information.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-NumericalIntegral"/>NumericalIntegral</term>
         <listitem>
          <synopsis>NumericalIntegral (f,a,b)</synopsis>
          <para>Integration by rule set in NumericalIntegralFunction of f from a to b using NumericalIntegralSteps steps.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-NumericalLeftDerivative"/>NumericalLeftDerivative</term>
         <listitem>
          <synopsis>NumericalLeftDerivative (f,x0)</synopsis>
          <para>Attempt to calculate numerical left derivative.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-NumericalLimitAtInfinity"/>NumericalLimitAtInfinity</term>
         <listitem>
          <synopsis>NumericalLimitAtInfinity (_f,step_fun,tolerance,successive_for_success,N)</synopsis>
          <para>Attempt to calculate the limit of f(step_fun(i)) as i goes from 1 to N.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-NumericalRightDerivative"/>NumericalRightDerivative</term>
         <listitem>
          <synopsis>NumericalRightDerivative (f,x0)</synopsis>
          <para>Attempt to calculate numerical right derivative.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-OddPeriodicExtension"/>OddPeriodicExtension</term>
         <listitem>
          <synopsis>OddPeriodicExtension (f,L)</synopsis>
	  <para>Return a function which is odd periodic extension of
<function>f</function> with half period <varname>L</varname>.  That
is a function defined on the interval <userinput>[0,L]</userinput>
extended to be odd on <userinput>[-L,L]</userinput> and then
extended to be periodic with period <userinput>2*L</userinput>.</para>
	  <para>
	    See also
	    <link linkend="gel-function-EvenPeriodicExtension">EvenPeriodicExtension</link>
	    and
	    <link linkend="gel-function-PeriodicExtension">PeriodicExtension</link>.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-OneSidedFivePointFormula"/>OneSidedFivePointFormula</term>
         <listitem>
          <synopsis>OneSidedFivePointFormula (f,x0,h)</synopsis>
          <para>Compute one-sided derivative using five point formula.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-OneSidedThreePointFormula"/>OneSidedThreePointFormula</term>
         <listitem>
          <synopsis>OneSidedThreePointFormula (f,x0,h)</synopsis>
          <para>Compute one-sided derivative using three-point formula.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-PeriodicExtension"/>PeriodicExtension</term>
         <listitem>
          <synopsis>PeriodicExtension (f,a,b)</synopsis>
	  <para>Return a function which is the periodic extension of
<function>f</function> defined on the interval <userinput>[a,b]</userinput>
and has period <userinput>b-a</userinput>.</para>
	  <para>
	    See also
	    <link linkend="gel-function-OddPeriodicExtension">OddPeriodicExtension</link>
	    and
	    <link linkend="gel-function-EvenPeriodicExtension">EvenPeriodicExtension</link>.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-RightLimit"/>RightLimit</term>
         <listitem>
          <synopsis>RightLimit (f,x0)</synopsis>
          <para>Calculate the right limit of a real-valued function at x0.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-TwoSidedFivePointFormula"/>TwoSidedFivePointFormula</term>
         <listitem>
          <synopsis>TwoSidedFivePointFormula (f,x0,h)</synopsis>
          <para>Compute two-sided derivative using five-point formula.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-TwoSidedThreePointFormula"/>TwoSidedThreePointFormula</term>
         <listitem>
          <synopsis>TwoSidedThreePointFormula (f,x0,h)</synopsis>
          <para>Compute two-sided derivative using three-point formula.</para>
         </listitem>
        </varlistentry>

      </variablelist>
    </sect1>

    <sect1 id="genius-gel-function-list-functions">
      <title>Functions</title>
      <variablelist>
        <varlistentry>
         <term><anchor id="gel-function-Argument"/>Argument</term>
         <listitem>
          <synopsis>Argument (z)</synopsis>
          <para>Aliases: <function>Arg</function> <function>arg</function></para>
          <para>argument (angle) of complex number.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-BesselJ0"/>BesselJ0</term>
         <listitem>
          <synopsis>BesselJ0 (x)</synopsis>
          <para>Bessel function of the first kind of order 0.  Only implemented for real numbers.</para>
          <para>
	    See
	    <ulink url="http://en.wikipedia.org/wiki/Bessel_functions">Wikipedia</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-BesselJ1"/>BesselJ1</term>
         <listitem>
          <synopsis>BesselJ1 (x)</synopsis>
          <para>Bessel function of the first kind of order 1.  Only implemented for real numbers.</para>
          <para>
	    See
	    <ulink url="http://en.wikipedia.org/wiki/Bessel_functions">Wikipedia</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-BesselJn"/>BesselJn</term>
         <listitem>
          <synopsis>BesselJn (n,x)</synopsis>
	  <para>Bessel function of the first kind of order <varname>n</varname>.  Only implemented for real numbers.</para>
          <para>
	    See
	    <ulink url="http://en.wikipedia.org/wiki/Bessel_functions">Wikipedia</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-BesselY0"/>BesselY0</term>
         <listitem>
          <synopsis>BesselY0 (x)</synopsis>
          <para>Bessel function of the second kind of order 0.  Only implemented for real numbers.</para>
          <para>
	    See
	    <ulink url="http://en.wikipedia.org/wiki/Bessel_functions">Wikipedia</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-BesselY1"/>BesselY1</term>
         <listitem>
          <synopsis>BesselY1 (x)</synopsis>
          <para>Bessel function of the second kind of order 1.  Only implemented for real numbers.</para>
          <para>
	    See
	    <ulink url="http://en.wikipedia.org/wiki/Bessel_functions">Wikipedia</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-BesselYn"/>BesselYn</term>
         <listitem>
          <synopsis>BesselYn (n,x)</synopsis>
	  <para>Bessel function of the second kind of order <varname>n</varname>.  Only implemented for real numbers.</para>
          <para>
	    See
	    <ulink url="http://en.wikipedia.org/wiki/Bessel_functions">Wikipedia</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-DirichletKernel"/>DirichletKernel</term>
         <listitem>
          <synopsis>DirichletKernel (n,t)</synopsis>
          <para>Dirichlet kernel of order n.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-DiscreteDelta"/>DiscreteDelta</term>
         <listitem>
          <synopsis>DiscreteDelta (v)</synopsis>
          <para>Returns 1 if and only if all elements are zero.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-ErrorFunction"/>ErrorFunction</term>
         <listitem>
          <synopsis>ErrorFunction (x)</synopsis>
          <para>Aliases: <function>erf</function></para>
          <para>The error function, 2/sqrt(pi) * int_0^x e^(-t^2) dt.</para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/ErrorFunction.html">Planetmath</ulink> for more information.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-FejerKernel"/>FejerKernel</term>
         <listitem>
          <synopsis>FejerKernel (n,t)</synopsis>
          <para>Fejer kernel of order <varname>n</varname> evaluated at
	        <varname>t</varname></para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/FejerKernel.html">Planetmath</ulink> for more information.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-GammaFunction"/>GammaFunction</term>
         <listitem>
          <synopsis>GammaFunction (x)</synopsis>
          <para>Aliases: <function>Gamma</function></para>
          <para>The Gamma function.  Currently only implemented for real values.</para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/GammaFunction.html">Planetmath</ulink> for more information.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-KroneckerDelta"/>KroneckerDelta</term>
         <listitem>
          <synopsis>KroneckerDelta (v)</synopsis>
          <para>Returns 1 if and only if all elements are equal.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-MinimizeFunction"/>MinimizeFunction</term>
         <listitem>
          <synopsis>MinimizeFunction (func,x,incr)</synopsis>
          <para>Find the first value where f(x)=0.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-MoebiusDiskMapping"/>MoebiusDiskMapping</term>
         <listitem>
          <synopsis>MoebiusDiskMapping (a,z)</synopsis>
          <para>Moebius mapping of the disk to itself mapping a to 0.</para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/MobiusTransformation.html">Planetmath</ulink> for more information.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-MoebiusMapping"/>MoebiusMapping</term>
         <listitem>
          <synopsis>MoebiusMapping (z,z2,z3,z4)</synopsis>
          <para>Moebius mapping using the cross ratio taking z2,z3,z4 to 1,0, and infinity respectively.</para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/MobiusTransformation.html">Planetmath</ulink> for more information.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-MoebiusMappingInftyToInfty"/>MoebiusMappingInftyToInfty</term>
         <listitem>
          <synopsis>MoebiusMappingInftyToInfty (z,z2,z3)</synopsis>
          <para>Moebius mapping using the cross ratio taking infinity to infinity and z2,z3 to 1 and 0 respectively.</para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/MobiusTransformation.html">Planetmath</ulink> for more information.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-MoebiusMappingInftyToOne"/>MoebiusMappingInftyToOne</term>
         <listitem>
          <synopsis>MoebiusMappingInftyToOne (z,z3,z4)</synopsis>
          <para>Moebius mapping using the cross ratio taking infinity to 1 and z3,z4 to 0 and infinity respectively.</para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/MobiusTransformation.html">Planetmath</ulink> for more information.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-MoebiusMappingInftyToZero"/>MoebiusMappingInftyToZero</term>
         <listitem>
          <synopsis>MoebiusMappingInftyToZero (z,z2,z4)</synopsis>
          <para>Moebius mapping using the cross ratio taking infinity to 0 and z2,z4 to 1 and infinity respectively.</para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/MobiusTransformation.html">Planetmath</ulink> for more information.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-PoissonKernel"/>PoissonKernel</term>
         <listitem>
          <synopsis>PoissonKernel (r,sigma)</synopsis>
          <para>Poisson kernel on D(0,1) (not normalized to 1, that is integral of this is 2pi).</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-PoissonKernelRadius"/>PoissonKernelRadius</term>
         <listitem>
          <synopsis>PoissonKernelRadius (r,sigma)</synopsis>
          <para>Poisson kernel on D(0,R) (not normalized to 1).</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-RiemannZeta"/>RiemannZeta</term>
         <listitem>
          <synopsis>RiemannZeta (x)</synopsis>
          <para>Aliases: <function>zeta</function></para>
          <para>The Riemann zeta function.  Currently only implemented for real values.</para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/RiemannZetaFunction.html">Planetmath</ulink> for more information.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-UnitStep"/>UnitStep</term>
         <listitem>
          <synopsis>UnitStep (x)</synopsis>
          <para>The unit step function is 0 for x&lt;0, 1 otherwise.  This is the integral of the Dirac Delta function.  Also called the Heaviside function.</para>
          <para>
	    See
	    <ulink url="http://en.wikipedia.org/wiki/Unit_step">Wikipedia</ulink> for more information.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-cis"/>cis</term>
         <listitem>
          <synopsis>cis (x)</synopsis>
          <para>
	    The <function>cis</function> function, that is the same as
	    <userinput>cos(x)+1i*sin(x)</userinput>
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-deg2rad"/>deg2rad</term>
         <listitem>
          <synopsis>deg2rad (x)</synopsis>
          <para>Convert degrees to radians.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-rad2deg"/>rad2deg</term>
         <listitem>
          <synopsis>rad2deg (x)</synopsis>
          <para>Convert radians to degrees.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-sinc"/>sinc</term>
         <listitem>
          <synopsis>sinc (x)</synopsis>
	  <para>Calculates the unnormalized sinc function, that is
		  <userinput>sin(x)/x</userinput>.
		  If you want the normalized function call <userinput>sinc(pi*x)</userinput>.</para>
          <para>
	    See
	    <ulink url="http://en.wikipedia.org/wiki/Sinc">Wikipedia</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

      </variablelist>
    </sect1>

    <sect1 id="genius-gel-function-list-equation-solving">
      <title>Equation Solving</title>
      <variablelist>

        <varlistentry>
         <term><anchor id="gel-function-CubicFormula"/>CubicFormula</term>
         <listitem>
          <synopsis>CubicFormula (p)</synopsis>
          <para>
	    Compute roots of a cubic (degree 3) polynomial using the
	    cubic formula.  The polynomial should be given as a
	    vector of coefficients.  That is
	    <userinput>4*x^3 + 2*x + 1</userinput> corresponds to the vector
            <userinput>[1,2,0,4]</userinput>.
	    Returns a column vector of the three solutions.  The first solution is always
	    the real one as a cubic always has one real solution.
	  </para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/CubicFormula.html">Planetmath</ulink>,
	    <ulink url="http://mathworld.wolfram.com/CubicFormula.html">Mathworld</ulink>, or
	    <ulink url="http://en.wikipedia.org/wiki/Cubic_equation">Wikipedia</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-EulersMethod"/>EulersMethod</term>
         <listitem>
          <synopsis>EulersMethod (f,x0,y0,x1,n)</synopsis>
          <para>
	    Use classical Euler's method to numerically solve y'=f(x,y) for
	    initial <varname>x0</varname>, <varname>y0</varname> going to
	    <varname>x1</varname> with <varname>n</varname> increments,
	    returns <varname>y</varname> at <varname>x1</varname>.
	  </para>
	  <para>
	    Systems can be solved by just having <varname>y</varname> be a
	    (column) vector everywhere.  That is, <varname>y0</varname> can
	    be a vector in which case <varname>f</varname> should take a number
	    <varname>x</varname> and a vector of the same size for the second
	    argument and should return a vector of the same size.
	  </para>
          <para>
	    See
	    <ulink url="http://mathworld.wolfram.com/EulerForwardMethod.html">Mathworld</ulink>, or
	    <ulink url="http://en.wikipedia.org/wiki/Eulers_method">Wikipedia</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-EulersMethodFull"/>EulersMethodFull</term>
         <listitem>
          <synopsis>EulersMethodFull (f,x0,y0,x1,n)</synopsis>
          <para>
	    Use classical Euler's method to numerically solve y'=f(x,y) for
	    initial <varname>x0</varname>, <varname>y0</varname> going to
	    <varname>x1</varname> with <varname>n</varname> increments,
	    returns a 2 by <userinput>n+1</userinput> matrix with the
	    <varname>x</varname> and <varname>y</varname> values.  Suitable
	    for plugging into 
	    <link linkend="gel-function-LinePlotDrawLine">LinePlotDrawLine</link>.
	  </para>
	  <para>
	    Systems can be solved by just having <varname>y</varname> be a
	    (column) vector everywhere.  That is, <varname>y0</varname> can
	    be a vector in which case <varname>f</varname> should take a number
	    <varname>x</varname> and a vector of the same size for the second
	    argument and should return a vector of the same size.
	  </para>
          <para>
	    See
	    <ulink url="http://mathworld.wolfram.com/EulerForwardMethod.html">Mathworld</ulink>, or
	    <ulink url="http://en.wikipedia.org/wiki/Eulers_method">Wikipedia</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-FindRootBisection"/>FindRootBisection</term>
         <listitem>
          <synopsis>FindRootBisection (f,a,b,TOL,N)</synopsis>
          <para>Find root of a function using the bisection method.
		  <varname>a</varname> and <varname>b</varname> are the initial guess interval,
		  <userinput>f(a)</userinput> and <userinput>f(b)</userinput> should have opposite signs.
	    <varname>TOL</varname> is the desired tolerance and
<varname>N</varname> is the limit on the number of iterations to run, 0 means no limit.  The function returns a vector <userinput>[success,value,iteration]</userinput>, where <varname>success</varname> is a boolean indicating success, <varname>value</varname> is the last value computed, and <varname>iteration</varname> is the number of iterations done.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-FindRootFalsePosition"/>FindRootFalsePosition</term>
         <listitem>
          <synopsis>FindRootFalsePosition (f,a,b,TOL,N)</synopsis>
          <para>Find root of a function using the method of false position.
		  <varname>a</varname> and <varname>b</varname> are the initial guess interval,
		  <userinput>f(a)</userinput> and <userinput>f(b)</userinput> should have opposite signs.
	    <varname>TOL</varname> is the desired tolerance and
<varname>N</varname> is the limit on the number of iterations to run, 0 means no limit.  The function returns a vector <userinput>[success,value,iteration]</userinput>, where <varname>success</varname> is a boolean indicating success, <varname>value</varname> is the last value computed, and <varname>iteration</varname> is the number of iterations done.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-FindRootMullersMethod"/>FindRootMullersMethod</term>
         <listitem>
          <synopsis>FindRootMullersMethod (f,x0,x1,x2,TOL,N)</synopsis>
          <para>Find root of a function using the Muller's method.
	    <varname>TOL</varname> is the desired tolerance and
<varname>N</varname> is the limit on the number of iterations to run, 0 means no limit.  The function returns a vector <userinput>[success,value,iteration]</userinput>, where <varname>success</varname> is a boolean indicating success, <varname>value</varname> is the last value computed, and <varname>iteration</varname> is the number of iterations done.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-FindRootSecant"/>FindRootSecant</term>
         <listitem>
          <synopsis>FindRootSecant (f,a,b,TOL,N)</synopsis>
          <para>Find root of a function using the secant method.
		  <varname>a</varname> and <varname>b</varname> are the initial guess interval,
		  <userinput>f(a)</userinput> and <userinput>f(b)</userinput> should have opposite signs.
	    <varname>TOL</varname> is the desired tolerance and
<varname>N</varname> is the limit on the number of iterations to run, 0 means no limit.  The function returns a vector <userinput>[success,value,iteration]</userinput>, where <varname>success</varname> is a boolean indicating success, <varname>value</varname> is the last value computed, and <varname>iteration</varname> is the number of iterations done.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-PolynomialRoots"/>PolynomialRoots</term>
         <listitem>
          <synopsis>PolynomialRoots (p)</synopsis>
          <para>
	    Compute roots of a polynomial (degrees 1 through 4)
	    using one of the formulas for such polynomials.
	    The polynomial should be given as a
	    vector of coefficients.  That is
	    <userinput>4*x^3 + 2*x + 1</userinput> corresponds to the vector
            <userinput>[1,2,0,4]</userinput>.
	    Returns a column vector of the solutions.
	  </para>
	  <para>
	    The function calls
	    <link linkend="gel-function-QuadraticFormula">QuadraticFormula</link>,
	    <link linkend="gel-function-CubicFormula">CubicFormula</link>, and
	    <link linkend="gel-function-QuarticFormula">QuarticFormula</link>.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-QuadraticFormula"/>QuadraticFormula</term>
         <listitem>
          <synopsis>QuadraticFormula (p)</synopsis>
          <para>
	    Compute roots of a quadratic (degree 2) polynomial using the
	    quadratic formula.  The polynomial should be given as a
	    vector of coefficients.  That is
	    <userinput>3*x^2 + 2*x + 1</userinput> corresponds to the vector
            <userinput>[1,2,3]</userinput>.
	    Returns a column vector of the two solutions.
	  </para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/QuadraticFormula.html">Planetmath</ulink> or
	    <ulink url="http://mathworld.wolfram.com/QuadraticFormula.html">Mathworld</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-QuarticFormula"/>QuarticFormula</term>
         <listitem>
          <synopsis>QuarticFormula (p)</synopsis>
          <para>
	    Compute roots of a quartic (degree 4) polynomial using the
	    quartic formula.  The polynomial should be given as a
	    vector of coefficients.  That is
	    <userinput>5*x^4 + 2*x + 1</userinput> corresponds to the vector
            <userinput>[1,2,0,0,5]</userinput>.
	    Returns a column vector of the four solutions.
	  </para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/QuarticFormula.html">Planetmath</ulink>,
	    <ulink url="http://mathworld.wolfram.com/QuarticEquation.html">Mathworld</ulink>, or
	    <ulink url="http://en.wikipedia.org/wiki/Quartic_equation">Wikipedia</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-RungeKutta"/>RungeKutta</term>
         <listitem>
          <synopsis>RungeKutta (f,x0,y0,x1,n)</synopsis>
          <para>
	    Use classical non-adaptive fourth order Runge-Kutta method to
	    numerically solve
	    y'=f(x,y) for initial <varname>x0</varname>, <varname>y0</varname>
	    going to <varname>x1</varname> with <varname>n</varname>
	    increments, returns <varname>y</varname> at <varname>x1</varname>.
	  </para>
	  <para>
	    Systems can be solved by just having <varname>y</varname> be a
	    (column) vector everywhere.  That is, <varname>y0</varname> can
	    be a vector in which case <varname>f</varname> should take a number
	    <varname>x</varname> and a vector of the same size for the second
	    argument and should return a vector of the same size.
	  </para>
          <para>
	    See
	    <ulink url="http://mathworld.wolfram.com/Runge-KuttaMethod.html">Mathworld</ulink>, or
	    <ulink url="http://en.wikipedia.org/wiki/Runge-Kutta_methods">Wikipedia</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-RungeKuttaFull"/>RungeKuttaFull</term>
         <listitem>
          <synopsis>RungeKuttaFull (f,x0,y0,x1,n)</synopsis>
          <para>
	    Use classical non-adaptive fourth order Runge-Kutta method to
	    numerically solve
	    y'=f(x,y) for initial <varname>x0</varname>, <varname>y0</varname>
	    going to <varname>x1</varname> with <varname>n</varname>
	    increments,
	    returns a 2 by <userinput>n+1</userinput> matrix with the
	    <varname>x</varname> and <varname>y</varname> values.  Suitable
	    for plugging into 
	    <link linkend="gel-function-LinePlotDrawLine">LinePlotDrawLine</link>.
	  </para>
	  <para>
	    Systems can be solved by just having <varname>y</varname> be a
	    (column) vector everywhere.  That is, <varname>y0</varname> can
	    be a vector in which case <varname>f</varname> should take a number
	    <varname>x</varname> and a vector of the same size for the second
	    argument and should return a vector of the same size.
	  </para>
          <para>
	    See
	    <ulink url="http://mathworld.wolfram.com/Runge-KuttaMethod.html">Mathworld</ulink>, or
	    <ulink url="http://en.wikipedia.org/wiki/Runge-Kutta_methods">Wikipedia</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>


      </variablelist>
    </sect1>

    <sect1 id="genius-gel-function-list-statistics">
      <title>Statistics</title>
      <variablelist>
        <varlistentry>
         <term><anchor id="gel-function-Average"/>Average</term>
         <listitem>
          <synopsis>Average (m)</synopsis>
          <para>Aliases: <function>average</function> <function>Mean</function> <function>mean</function></para>
          <para>Calculate average of an entire matrix.</para>
          <para>
	    See
	    <ulink url="http://mathworld.wolfram.com/ArithmeticMean.html">Mathworld</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-GaussDistribution"/>GaussDistribution</term>
         <listitem>
          <synopsis>GaussDistribution (x,sigma)</synopsis>
	  <para>Integral of the GaussFunction from 0 to <varname>x</varname> (area under the normal curve).</para>
          <para>
	    See
	    <ulink url="http://mathworld.wolfram.com/NormalDistribution.html">Mathworld</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-GaussFunction"/>GaussFunction</term>
         <listitem>
          <synopsis>GaussFunction (x,sigma)</synopsis>
          <para>The normalized Gauss distribution function (the normal curve).</para>
          <para>
	    See
	    <ulink url="http://mathworld.wolfram.com/NormalDistribution.html">Mathworld</ulink> for more information.
	  </para>

         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-Median"/>Median</term>
         <listitem>
          <synopsis>Median (m)</synopsis>
          <para>Aliases: <function>median</function></para>
          <para>Calculate median of an entire matrix.</para>
          <para>
	    See
	    <ulink url="http://mathworld.wolfram.com/StatisticalMedian.html">Mathworld</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-PopulationStandardDeviation"/>PopulationStandardDeviation</term>
         <listitem>
          <synopsis>PopulationStandardDeviation (m)</synopsis>
          <para>Aliases: <function>stdevp</function></para>
          <para>Calculate the population standard deviation of a whole matrix.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-RowAverage"/>RowAverage</term>
         <listitem>
          <synopsis>RowAverage (m)</synopsis>
          <para>Aliases: <function>RowMean</function></para>
          <para>Calculate average of each row in a matrix.</para>
          <para>
	    See
	    <ulink url="http://mathworld.wolfram.com/ArithmeticMean.html">Mathworld</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-RowMedian"/>RowMedian</term>
         <listitem>
          <synopsis>RowMedian (m)</synopsis>
          <para>Calculate median of each row in a matrix and return a column
	  vector of the medians.</para>
          <para>
	    See
	    <ulink url="http://mathworld.wolfram.com/StatisticalMedian.html">Mathworld</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-RowPopulationStandardDeviation"/>RowPopulationStandardDeviation</term>
         <listitem>
          <synopsis>RowPopulationStandardDeviation (m)</synopsis>
          <para>Aliases: <function>rowstdevp</function></para>
          <para>Calculate the population standard deviations of rows of a matrix and return a vertical vector.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-RowStandardDeviation"/>RowStandardDeviation</term>
         <listitem>
          <synopsis>RowStandardDeviation (m)</synopsis>
          <para>Aliases: <function>rowstdev</function></para>
          <para>Calculate the standard deviations of rows of a matrix and return a vertical vector.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
	 <term><anchor id="gel-function-StandardDeviation"/>StandardDeviation</term>
         <listitem>
          <synopsis>StandardDeviation (m)</synopsis>
          <para>Aliases: <function>stdev</function></para>
          <para>Calculate the standard deviation of a whole matrix.</para>
         </listitem>
        </varlistentry>

      </variablelist>
    </sect1>

    <sect1 id="genius-gel-function-list-polynomials">
      <title>Polynomials</title>
      <variablelist>
        <varlistentry>
         <term><anchor id="gel-function-AddPoly"/>AddPoly</term>
         <listitem>
          <synopsis>AddPoly (p1,p2)</synopsis>
          <para>Add two polynomials (vectors).</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-DividePoly"/>DividePoly</term>
         <listitem>
          <synopsis>DividePoly (p,q,&amp;r)</synopsis>
          <para>Divide two polynomials (as vectors) using long division.
	   Returns the quotient
	   of the two polynomials.  The optional argument <varname>r</varname>
	   is used to return the remainder.  The remainder will have lower
	   degree than <varname>q</varname>.</para>
          <para>
	    See
	    <ulink url="http://planetmath.org/encyclopedia/PolynomialLongDivision.html">Planetmath</ulink> for more information.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-IsPoly"/>IsPoly</term>
         <listitem>
          <synopsis>IsPoly (p)</synopsis>
          <para>Check if a vector is usable as a polynomial.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-MultiplyPoly"/>MultiplyPoly</term>
         <listitem>
          <synopsis>MultiplyPoly (p1,p2)</synopsis>
          <para>Multiply two polynomials (as vectors).</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-NewtonsMethodPoly"/>NewtonsMethodPoly</term>
         <listitem>
          <synopsis>NewtonsMethodPoly (poly,guess,epsilon,maxn)</synopsis>
	  <para>Run newton's method on a polynomial to attempt to find a root, returns after two successive values are within epsilon or after maxn tries (then returns <constant>null</constant>).</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-Poly2ndDerivative"/>Poly2ndDerivative</term>
         <listitem>
          <synopsis>Poly2ndDerivative (p)</synopsis>
          <para>Take second polynomial (as vector) derivative.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-PolyDerivative"/>PolyDerivative</term>
         <listitem>
          <synopsis>PolyDerivative (p)</synopsis>
          <para>Take polynomial (as vector) derivative.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-PolyToFunction"/>PolyToFunction</term>
         <listitem>
          <synopsis>PolyToFunction (p)</synopsis>
          <para>Make function out of a polynomial (as vector).</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-PolyToString"/>PolyToString</term>
         <listitem>
          <synopsis>PolyToString (p,var...)</synopsis>
          <para>Make string out of a polynomial (as vector).</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-SubtractPoly"/>SubtractPoly</term>
         <listitem>
          <synopsis>SubtractPoly (p1,p2)</synopsis>
          <para>Subtract two polynomials (as vectors).</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-TrimPoly"/>TrimPoly</term>
         <listitem>
          <synopsis>TrimPoly (p)</synopsis>
          <para>Trim zeros from a polynomial (as vector).</para>
         </listitem>
        </varlistentry>

      </variablelist>
    </sect1>

    <sect1 id="genius-gel-function-list-set-theory">
      <title>Set Theory</title>
      <variablelist>
        <varlistentry>
         <term><anchor id="gel-function-Intersection"/>Intersection</term>
         <listitem>
          <synopsis>Intersection (X,Y)</synopsis>
          <para>Returns a set theoretic intersection of X and Y (X and Y are vectors pretending to be sets).</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-IsIn"/>IsIn</term>
         <listitem>
          <synopsis>IsIn (x,X)</synopsis>
	  <para>Returns <constant>true</constant> if the element x is in the set X (where X is a vector pretending to be a set).</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-IsSubset"/>IsSubset</term>
         <listitem>
          <synopsis>IsSubset (X, Y)</synopsis>
	  <para>Returns <constant>true</constant> if X is a subset of Y (X and Y are vectors pretending to be sets).</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-MakeSet"/>MakeSet</term>
         <listitem>
          <synopsis>MakeSet (X)</synopsis>
          <para>Returns a vector where every element of X appears only once.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-SetMinus"/>SetMinus</term>
         <listitem>
          <synopsis>SetMinus (X,Y)</synopsis>
          <para>Returns a set theoretic difference X-Y (X and Y are vectors pretending to be sets).</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-Union"/>Union</term>
         <listitem>
          <synopsis>Union (X,Y)</synopsis>
          <para>Returns a set theoretic union of X and Y (X and Y are vectors pretending to be sets).</para>
         </listitem>
        </varlistentry>

      </variablelist>
    </sect1>

    <sect1 id="genius-gel-function-list-commutative-algebra">
      <title>Commutative Algebra</title>
      <variablelist>
        <varlistentry>
         <term><anchor id="gel-function-MacaulayBound"/>MacaulayBound</term>
         <listitem>
          <synopsis>MacaulayBound (c,d)</synopsis>
          <para>For a Hilbert function that is c for degree d, given the Macaulay bound for the Hilbert function of degree d+1 (The c^&lt;d&gt; operator from Green's proof).</para>
         </listitem>
        </varlistentry>
	
        <varlistentry>
         <term><anchor id="gel-function-MacaulayLowerOperator"/>MacaulayLowerOperator</term>
         <listitem>
          <synopsis>MacaulayLowerOperator (c,d)</synopsis>
          <para>The c_&lt;d&gt; operator from Green's proof of Macaulay's Theorem.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-MacaulayRep"/>MacaulayRep</term>
         <listitem>
          <synopsis>MacaulayRep (c,d)</synopsis>
          <para>Return the dth Macaulay representation of a positive integer c.</para>
         </listitem>
        </varlistentry>
      </variablelist>
    </sect1>

    <sect1 id="genius-gel-function-list-miscellaneous">
      <title>Miscellaneous</title>
      <variablelist>
        <varlistentry>
         <term><anchor id="gel-function-ASCIIToString"/>ASCIIToString</term>
         <listitem>
          <synopsis>ASCIIToString (vec)</synopsis>
          <para>Convert a vector of ASCII values to a string.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-AlphabetToString"/>AlphabetToString</term>
         <listitem>
          <synopsis>AlphabetToString (vec,alphabet)</synopsis>
          <para>Convert a vector of 0-based alphabet values (positions in the alphabet string) to a string.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-StringToASCII"/>StringToASCII</term>
         <listitem>
          <synopsis>StringToASCII (str)</synopsis>
          <para>Convert a string to a vector of ASCII values.</para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-StringToAlphabet"/>StringToAlphabet</term>
         <listitem>
          <synopsis>StringToAlphabet (str,alphabet)</synopsis>
          <para>Convert a string to a vector of 0-based alphabet values (positions in the alphabet string), -1's for unknown letters.</para>
         </listitem>
        </varlistentry>

      </variablelist>
    </sect1>

    <sect1 id="genius-gel-function-list-symbolic">
      <title>Symbolic Operations</title>
      <variablelist>
        <varlistentry>
         <term><anchor id="gel-function-SymbolicDerivative"/>SymbolicDerivative</term>
         <listitem>
          <synopsis>SymbolicDerivative (f)</synopsis>
          <para>Attempt to symbolically differentiate the function f, where f is a function of one variable.</para>
          <para>
	    Examples:
          <screen><prompt>genius&gt;</prompt> <userinput>SymbolicDerivative(sin)</userinput>
= (`(x)=cos(x))
<prompt>genius&gt;</prompt> <userinput>SymbolicDerivative(`(x)=7*x^2)</userinput>
= (`(x)=(7*(2*x)))
</screen>
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-SymbolicDerivativeTry"/>SymbolicDerivativeTry</term>
         <listitem>
          <synopsis>SymbolicDerivativeTry (f)</synopsis>
	  <para>Attempt to symbolically differentiate the function f, where f is a function of one variable, returns <constant>null</constant> if unsuccessful but is silent.
	  (See <link linkend="gel-function-SymbolicDerivative"><function>SymbolicDerivative</function></link>)
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-SymbolicNthDerivative"/>SymbolicNthDerivative</term>
         <listitem>
          <synopsis>SymbolicNthDerivative (f,n)</synopsis>
          <para>Attempt to symbolically differentiate a function n times.
	  (See <link linkend="gel-function-SymbolicDerivative"><function>SymbolicDerivative</function></link>)
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-SymbolicNthDerivativeTry"/>SymbolicNthDerivativeTry</term>
         <listitem>
          <synopsis>SymbolicNthDerivativeTry (f,n)</synopsis>
	  <para>Attempt to symbolically differentiate a function n times quietly and return <constant>null</constant> on failure
	  (See <link linkend="gel-function-SymbolicNthDerivative"><function>SymbolicNthDerivative</function></link>)
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-SymbolicTaylorApproximationFunction"/>SymbolicTaylorApproximationFunction</term>
         <listitem>
          <synopsis>SymbolicTaylorApproximationFunction (f,x0,n)</synopsis>
	  <para>Attempt to construct the Taylor approximation function around x0 to the nth degree.
	  (See <link linkend="gel-function-SymbolicDerivative"><function>SymbolicDerivative</function></link>)
          </para>
         </listitem>
        </varlistentry>
      </variablelist>
    </sect1>

    <sect1 id="genius-gel-function-list-plotting">
      <title>Plotting</title>
      <variablelist>
        <varlistentry>
         <term><anchor id="gel-function-ExportPlot"/>ExportPlot</term>
         <listitem>
          <synopsis>ExportPlot (file,type)</synopsis>
          <synopsis>ExportPlot (file)</synopsis>
          <para>
		  Export the contents of the plotting window to a file.
		  The type is a string that specifies the file type to
		  use, "png", "eps", or "ps".  If the type is not
		  specified, then it is taken to be the extension, in
		  which case the extension must be ".png", ".eps", or ".ps".
	  </para>
	  <para>
		  Note that files are overwritten without asking.
	  </para>
	  <para>
		  On successful export, true is returned.  Otherwise
		  error is printed and exception is raised.
	  </para>
          <para>
	    Examples:
          <screen><prompt>genius&gt;</prompt> <userinput>ExportPlot("file.png")</userinput>
<prompt>genius&gt;</prompt> <userinput>ExportPlot("/directory/file","eps")</userinput>
</screen>
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-LinePlot"/>LinePlot</term>
         <listitem>
          <synopsis>LinePlot (func1,func2,func3,...)</synopsis>
          <synopsis>LinePlot (func1,func2,func3,x1,x2)</synopsis>
          <synopsis>LinePlot (func1,func2,func3,x1,x2,y1,y2)</synopsis>
          <synopsis>LinePlot (func1,func2,func3,[x1,x2])</synopsis>
          <synopsis>LinePlot (func1,func2,func3,[x1,x2,y1,y2])</synopsis>
          <para>
	    Plot a function (or several functions) with a line.
	    First (up to 10) arguments are functions, then optionally
            you can specify the limits of the plotting window as
	    <varname>x1</varname>, <varname>x2</varname>,
	    <varname>y1</varname>, <varname>y2</varname>.  If limits are not
	    specified, then the currently set limits apply
	    (See <link linkend="gel-function-LinePlotWindow"><function>LinePlotWindow</function></link>)
	    If the y limits are not specified, then the functions are computed and then the maxima and minima
	    are used.
          </para>
          <para>
	    The parameter
	    <link linkend="gel-function-LinePlotDrawLegends"><function>LinePlotDrawLegends</function></link>
	    controls the drawing of the legend.
	  </para>
          <para>
	    Examples:
          <screen><prompt>genius&gt;</prompt> <userinput>LinePlot(sin,cos)</userinput>
<prompt>genius&gt;</prompt> <userinput>LinePlot(`(x)=x^2,-1,1,0,1)</userinput>
</screen>
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-LinePlotClear"/>LinePlotClear</term>
         <listitem>
          <synopsis>LinePlotClear ()</synopsis>
          <para>
            Show the line plot window and clear out functions and any other
            lines that were drawn.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-LinePlotDrawLine"/>LinePlotDrawLine</term>
         <listitem>
          <synopsis>LinePlotDrawLine (x1,y1,x2,y2,...)</synopsis>
          <synopsis>LinePlotDrawLine (v,...)</synopsis>
          <para>
	    Draw a line from <varname>x1</varname>,<varname>y1</varname> to
	    <varname>x2</varname>,<varname>y2</varname>.
	    <varname>x1</varname>,<varname>y1</varname>,
	    <varname>x2</varname>,<varname>y2</varname> can be replaced by an
	    <varname>n</varname> by 2 matrix for a longer polyline.
          </para>
          <para>
	    Extra parameters can be added to specify line color, thickness,
	    arrows, and the plotting window.
	    You can do this by adding a string <userinput>"color"</userinput>, 
	    <userinput>"thickness"</userinput>,
	    <userinput>"window"</userinput>, or
	    <userinput>"arrow"</userinput>, and after it either
	    the color string, the thicknes as an integer, the window
	    as 4-vector, and for arrow either 
	    <userinput>"origin"</userinput>,
	    <userinput>"end"</userinput>,
	    <userinput>"both"</userinput>, or
	    <userinput>"none"</userinput>.  For 
	    <userinput>"window"</userinput> we can specify 
	    <userinput>"fit"</userinput> rather than a vector in which case,
	    the x range will be set precisely and the y range will be set with
	    five percent borders around the line.  Finally, the legend
	    can be specified by adding
	    <userinput>"legend"</userinput> and the string with the legend.
          </para>
	  <para>
	  Examples:
          <screen><prompt>genius&gt;</prompt> <userinput>LinePlotDrawLine(0,0,1,1,"color","blue","thickness",3)</userinput>
<prompt>genius&gt;</prompt> <userinput>LinePlotDrawLine([0,0;1,-1;-1,-1])</userinput>
<prompt>genius&gt;</prompt> <userinput>LinePlotDrawLine([0,0;1,1],"arrow","end")</userinput>
<prompt>genius&gt;</prompt> <userinput>LinePlotDrawLine(EulersMethodFull(`(x,y)=y,0,3,100),"color","blue","legend","The Solution")</userinput>
</screen>
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-LinePlotParametric"/>LinePlotParametric</term>
         <listitem>
          <synopsis>LinePlotParametric (xfunc,yfunc,...)</synopsis>
          <synopsis>LinePlotParametric (xfunc,yfunc,t1,t2,tinc)</synopsis>
          <synopsis>LinePlotParametric (xfunc,yfunc,t1,t2,tinc,x1,x2,y1,y2)</synopsis>
          <synopsis>LinePlotParametric (xfunc,yfunc,t1,t2,tinc,[x1,x2,y1,y2])</synopsis>
          <synopsis>LinePlotParametric (xfunc,yfunc,t1,t2,tinc,"fit")</synopsis>
          <para>
	    Plot a parametric function with a line.  First come the functions
for <varname>x</varname> and <varname>y</varname> then optionally the <varname>t</varname> limits as <userinput>t1,t2,tinc</userinput>, then optionally the
limits as <userinput>x1,x2,y1,y2</userinput>.
          </para>
	  <para>
	    If x and y limits are not
	    specified, then the currently set limits apply
	    (See <link linkend="gel-function-LinePlotWindow"><function>LinePlotWindow</function></link>).
	    If instead the string "fit" is given for the x and y limits, then the limits are the maximum extent of
	    the graph
          </para>
          <para>
	    The parameter
	    <link linkend="gel-function-LinePlotDrawLegends"><function>LinePlotDrawLegends</function></link>
	    controls the drawing of the legend.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-LinePlotCParametric"/>LinePlotCParametric</term>
         <listitem>
          <synopsis>LinePlotCParametric (func,...)</synopsis>
          <synopsis>LinePlotCParametric (func,t1,t2,tinc)</synopsis>
          <synopsis>LinePlotCParametric (func,t1,t2,tinc,x1,x2,y1,y2)</synopsis>
          <para>
	    Plot a parametric complex valued function with a line.  First comes
the function that returns <computeroutput>x+iy</computeroutput>,
then optionally the <varname>t</varname> limits as <userinput>t1,t2,tinc</userinput>, then
optionally the limits as <userinput>x1,x2,y1,y2</userinput>.
          </para>
	  <para>
	    If limits are not
	    specified, then the currently set limits apply
	    (See <link linkend="gel-function-LinePlotWindow"><function>LinePlotWindow</function></link>).
	    If instead the string "fit" is given for the x and y limits, then the limits are the maximum extent of
	    the graph
          </para>
          <para>
	    The parameter
	    <link linkend="gel-function-LinePlotDrawLegends"><function>LinePlotDrawLegends</function></link>
	    controls the drawing of the legend.
	  </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-SlopefieldClearSolutions"/>SlopefieldClearSolutions</term>
         <listitem>
          <synopsis>SlopefieldClearSolutions ()</synopsis>
          <para>
	    Clears the solutions drawn by the
	    <link linkend="gel-function-SlopefieldDrawSolution"><function>SlopefieldDrawSolution</function></link>
	    function.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-SlopefieldDrawSolution"/>SlopefieldDrawSolution</term>
         <listitem>
          <synopsis>SlopefieldDrawSolution (x, y, dx)</synopsis>
          <para>
	    When a slope field plot is active, draw a solution with
	    the specified initial condition.  The standard
	    Runge-Kutta method is used with increment <varname>dx</varname>.
	    Solutions stay on the graph until a different plot is shown or until
	    you call 
	    <link linkend="gel-function-SlopefieldClearSolutions"><function>SlopefieldClearSolutions</function></link>.
	    You can also use the graphical interface to draw solutions and specify
	    initial conditions with the mouse.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-SlopefieldPlot"/>SlopefieldPlot</term>
         <listitem>
          <synopsis>SlopefieldPlot (func)</synopsis>
          <synopsis>SlopefieldPlot (func,x1,x2,y1,y2)</synopsis>
          <para>
	    Plot a slope field.  The function <varname>func</varname>
	    should take two real numbers <varname>x</varname>
	    and <varname>y</varname>, or a single complex
	    number.
            Optionally you can specify the limits of the plotting window as
	    <varname>x1</varname>, <varname>x2</varname>,
	    <varname>y1</varname>, <varname>y2</varname>.  If limits are not
	    specified, then the currently set limits apply
	    (See <link linkend="gel-function-LinePlotWindow"><function>LinePlotWindow</function></link>).
          </para>
          <para>
	    The parameter
	    <link linkend="gel-function-LinePlotDrawLegends"><function>LinePlotDrawLegends</function></link>
	    controls the drawing of the legend.
	  </para>
          <para>
	    Examples:
          <screen><prompt>genius&gt;</prompt> <userinput>Slopefield(`(x,y)=sin(x-y),-5,5,-5,5)</userinput>
</screen>
          </para>
         </listitem>
        </varlistentry>

	<varlistentry>
	 <term><anchor id="gel-function-SurfacePlot"/>SurfacePlot</term>
         <listitem>
          <synopsis>SurfacePlot (func)</synopsis>
          <synopsis>SurfacePlot (func,x1,x2,y1,y2,z1,z2)</synopsis>
          <synopsis>SurfacePlot (func,x1,x2,y1,y2)</synopsis>
          <synopsis>SurfacePlot (func,[x1,x2,y1,y2,z1,z2])</synopsis>
          <synopsis>SurfacePlot (func,[x1,x2,y1,y2])</synopsis>
          <para>
	    Plot a surface function which takes either two arguments or a complex number.  First comes the function then optionally limits as <varname>x1</varname>, <varname>x2</varname>,
	    <varname>y1</varname>, <varname>y2</varname>,
	    <varname>z1</varname>, <varname>z2</varname>.  If limits are not
	    specified, then the currently set limits apply
	    (See <link linkend="gel-function-SurfacePlotWindow"><function>SurfacePlotWindow</function></link>).
	    Genius can only plot a single surface function at this time.
          </para>
          <para>
	    If the z limits are not specified then the maxima and minima of the function are used.
	  </para>
          <para>
	    Examples:
          <screen><prompt>genius&gt;</prompt> <userinput>SurfacePlot(|sin|,-1,1,-1,1,0,1.5)</userinput>
<prompt>genius&gt;</prompt> <userinput>SurfacePlot(`(x,y)=x^2+y,-1,1,-1,1,-2,2)</userinput>
<prompt>genius&gt;</prompt> <userinput>SurfacePlot(`(z)=|z|^2,-1,1,-1,1,0,2)</userinput>
</screen>
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-SurfacePlotData"/>SurfacePlotData</term>
         <listitem>
          <synopsis>SurfacePlotData (data)</synopsis>
          <synopsis>SurfacePlotData (data,label)</synopsis>
          <synopsis>SurfacePlotData (data,x1,x2,y1,y2,z1,z2)</synopsis>
          <synopsis>SurfacePlotData (data,label,x1,x2,y1,y2,z1,z2)</synopsis>
          <synopsis>SurfacePlotData (data,[x1,x2,y1,y2,z1,z2])</synopsis>
          <synopsis>SurfacePlotData (data,label,[x1,x2,y1,y2,z1,z2])</synopsis>
          <para>
		  Plot a surface from data.  The data is an n by 3 matrix whose
		  rows are the x, y and z coordinates.  The data can also be
		  simply a vector whose length is a multiple of 3 and so
		  contains the tripples of x, y, z.  The data should contain at
		  least 3 points.
	  </para>
          <para>
		  Optionally we can give the label and also optionally the
		  limits.  If limits are not given, they are computed from
		  the data, <link linkend="gel-function-SurfacePlotWindow"><function>SurfacePlotWindow</function></link>
		  is not used, if you want to use it, pass it in explicitly.
		  If label is not given then empty label is used.
	  </para>
          <para>
	    Examples:
          <screen><prompt>genius&gt;</prompt> <userinput>SurfacePlotData([0,0,0;1,0,1;0,1,1;1,1,3])</userinput>
<prompt>genius&gt;</prompt> <userinput>SurfacePlotData(data,"My data")</userinput>
<prompt>genius&gt;</prompt> <userinput>SurfacePlotData(data,-1,1,-1,1,0,10)</userinput>
<prompt>genius&gt;</prompt> <userinput>SurfacePlotData(data,SurfacePlotWindow)</userinput>
</screen>
          </para>
	  <para>
		  Here's an example of how to plot in polar coordinates,
		  in particular how to plot the function
		  <userinput>-r^2 * theta</userinput>:
          <screen><prompt>genius&gt;</prompt> <userinput>d:=null; for r=0 to 1 by 0.1 do for theta=0 to 2*pi by pi/5 do d=[d;[r*cos(theta),r*sin(theta),-r^2*theta]];</userinput>
<prompt>genius&gt;</prompt> <userinput>SurfacePlotData(d)</userinput>
</screen>
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-SurfacePlotDataGrid"/>SurfacePlotDataGrid</term>
         <listitem>
          <synopsis>SurfacePlotDataGrid (data,[x1,x2,y1,y2])</synopsis>
          <synopsis>SurfacePlotDataGrid (data,[x1,x2,y1,y2,z1,z2])</synopsis>
          <synopsis>SurfacePlotDataGrid (data,[x1,x2,y1,y2],label)</synopsis>
          <synopsis>SurfacePlotDataGrid (data,[x1,x2,y1,y2,z1,z2],label)</synopsis>
          <para>
		  Plot a surface from regular rectangular data.
		  The data is given in a n by m matrix where the rows are the
		  x coordinate and the columns are the y coordinate.
		  The x coordinate is divided into equal n-1 subintervals
		  and y coordinate is divided into equal m-1 subintervals.
		  The limits <varname>x1</varname> and <varname>x2</varname>
		  give the interval on the x-axis that we use, and 
		  the limits <varname>y1</varname> and <varname>y2</varname>
		  give the interval on the y-axis that we use.
		  If the limits <varname>z1</varname> and <varname>z2</varname>
		  are not given they are computed from the data (to be
		  the extreme values from the data).
	  </para>
          <para>
		  Optionally we can give the label, if label is not given then
		  empty label is used.
	  </para>
          <para>
	    Examples:
          <screen><prompt>genius&gt;</prompt> <userinput>SurfacePlotDataGrid([1,2;3,4],[0,1,0,1])</userinput>
<prompt>genius&gt;</prompt> <userinput>SurfacePlotDataGrid(data,[-1,1,-1,1],"My data")</userinput>
<prompt>genius&gt;</prompt> <userinput>d:=null; for i=1 to 20 do for j=1 to 10 d@(i,j) = (0.1*i-1)^2-(0.1*j)^2;</userinput>
<prompt>genius&gt;</prompt> <userinput>SurfacePlotDataGrid(d,[-1,1,0,1],"half a saddle")</userinput>
</screen>
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-VectorfieldClearSolutions"/>VectorfieldClearSolutions</term>
         <listitem>
          <synopsis>VectorfieldClearSolutions ()</synopsis>
          <para>
	    Clears the solutions drawn by the
	    <link linkend="gel-function-VectorfieldDrawSolution"><function>VectorfieldDrawSolution</function></link>
	    function.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-VectorfieldDrawSolution"/>VectorfieldDrawSolution</term>
         <listitem>
          <synopsis>VectorfieldDrawSolution (x, y, dt, tlen)</synopsis>
          <para>
	    When a vector field plot is active, draw a solution with
	    the specified initial condition.  The standard
	    Runge-Kutta method is used with increment <varname>dt</varname>
	    for an interval of length <varname>tlen</varname>.
	    Solutions stay on the graph until a different plot is shown or until
	    you call 
	    <link linkend="gel-function-VectorfieldClearSolutions"><function>VectorfieldClearSolutions</function></link>.
	    You can also use the graphical interface to draw solutions and specify
	    initial conditions with the mouse.
          </para>
         </listitem>
        </varlistentry>

        <varlistentry>
         <term><anchor id="gel-function-VectorfieldPlot"/>VectorfieldPlot</term>
         <listitem>
          <synopsis>VectorfieldPlot (funcx, funcy)</synopsis>
          <synopsis>VectorfieldPlot (funcx, funcy, x1, x2, y1, y2)</synopsis>
          <para>
	    Plot a two dimensional vector field.  The function
	    <varname>funcx</varname>
	    should be the dx/dt of the vectorfield and the function
	    <varname>funcy</varname> should be the dy/dt of the vectorfield.
	    The functions
	    should take two real numbers <varname>x</varname>
	    and <varname>y</varname>, or a single complex
	    number.  When the parameter
	    <link linkend="gel-function-VectorfieldNormalized"><function>VectorfieldNormalized</function></link>
	    is <constant>true</constant>, then the magnitude of the vectors is normalized.  That is, only
	    the direction and not the magnitude is shown.
	  </para>
	  <para>
            Optionally you can specify the limits of the plotting window as
	    <varname>x1</varname>, <varname>x2</varname>,
	    <varname>y1</varname>, <varname>y2</varname>.  If limits are not
	    specified, then the currently set limits apply
	    (See <link linkend="gel-function-LinePlotWindow"><function>LinePlotWindow</function></link>).
          </para>
          <para>
	    The parameter
	    <link linkend="gel-function-LinePlotDrawLegends"><function>LinePlotDrawLegends</function></link>
	    controls the drawing of the legend.
	  </para>
          <para>
	    Examples:
          <screen><prompt>genius&gt;</prompt> <userinput>VectorfieldPlot(`(x,y)=x^2-y, `(x,y)=y^2-x, -1, 1, -1, 1)</userinput>
</screen>
          </para>
         </listitem>
        </varlistentry>

      </variablelist>
    </sect1>

  </chapter>

  <!-- ============= GEL examples ============================= -->
  <chapter id="genius-gel-example-programs">
    <title>Exemple de programmes en GEL</title>

    <para>
Here is a function that calculates factorials:
<programlisting><![CDATA[function f(x) = if x <= 1 then 1 else (f(x-1)*x)
]]></programlisting>
    </para>
    <para>
With indentation it becomes:
<programlisting><![CDATA[function f(x) = (
  if x <= 1 then
    1
  else
    (f(x-1)*x)
)
]]></programlisting>
    </para>
    <para>
This is a direct port of the factorial function from the <application>bc</application> manpage. The syntax seems similar to <application>bc</application>, but different in that in GEL, the last expression is the one that is returned. Using the <literal>return</literal> function instead, it would be:
<programlisting><![CDATA[function f(x) = (
  if (x <= 1) then return (1);
  return (f(x-1) * x)
)
]]></programlisting>
    </para>

    <para>
By far the easiest way to define a factorial function would be using
the product loop as follows.  This is not only the shortest and fastest,
but also probably the most readable version.
<programlisting>function f(x) = prod k=1 to x do k
</programlisting>
    </para>

    <para>
Here is a larger example, this basically redefines the internal
<function>ref</function> function to calculate the row echelon form of a
matrix.  The function <function>ref</function> is built in and much faster,
but this example demonstrates some of the more complex features of GEL.
<programlisting><![CDATA[# Calculate the row-echelon form of a matrix
function MyOwnREF(m) = (
  if not IsMatrix(m) or not IsValueOnly(m) then
    (error("MyOwnREF: argument not a value only matrix");bailout);
  s := min(rows(m), columns(m));
  i := 1;
  d := 1;
  while d <= s and i <= columns(m) do (

    # This just makes the anchor element non-zero if at
    # all possible
    if m@(d,i) == 0 then (
      j := d+1;
      while j <= rows(m) do (
        if m@(j,i) == 0 then
          (j=j+1;continue);
        a := m@(j,);
        m@(j,) := m@(d,);
        m@(d,) := a;
        j := j+1;
        break
      )
    );
    if m@(d,i) == 0 then
      (i:=i+1;continue);
    
    # Here comes the actual zeroing of all but the anchor
    # element rows
    j := d+1;
    while j <= rows(m)) do (
      if m@(j,i) != 0 then (
        m@(j,) := m@(j,)-(m@(j,i)/m@(d,i))*m@(d,)
      );
      j := j+1
    );
    m@(d,) := m@(d,) * (1/m@(d,i));
    d := d+1;
    i := i+1
  );
  m
)
]]></programlisting>
    </para>

  </chapter>

  <!-- ============= Customization ============================ -->
  <chapter id="genius-prefs"> 
    <title>Paramètres</title> 

    <para>
      To configure <application>Genius Mathematics Tool</application>, choose
      <menuchoice><guimenu>Settings</guimenu>
      <guimenuitem>Preferences</guimenuitem></menuchoice>.
      There are several basic parameters provided by the calculator in addition
      to the ones provided by the standard library.  These control how the
      calculator behaves.
    </para>

    <note>
      <title>Changing Settings with GEL</title>
      <para>
	Many of the settings in Genius are simply global variables, and can
	be evaluated and assigned to in the same way as normal variables. See
	<xref linkend="genius-gel-variables"/> about evaluating and assigning
	to variables, and <xref linkend="genius-gel-function-parameters"/> for
	a list of settings that can be modified in this way.
      </para>
      <para>
As an example, you can set the maximum number of digits in a result to 12 by typing:
<programlisting>MaxDigits = 12
</programlisting>
      </para>
    </note>

    <sect1 id="genius-prefs-output"> 
      <title>Output</title> 
      <variablelist> 
	<varlistentry>
	  <term> 
	    <guilabel>Maximum digits to output</guilabel>
      </term> 
	  <listitem>
        <para>The maximum digits in a result (<function>MaxDigits</function>)</para>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term> 
	    <guilabel>Results as floats</guilabel>
      </term> 
	  <listitem>
        <para>If the results should be always printed as floats (<function>ResultsAsFloats</function>)</para>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term> 
	    <guilabel>Floats in scientific notation</guilabel>
      </term> 
	  <listitem>
        <para>If floats should be in scientific notation (<function>ScientificNotation</function>)</para>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term> 
	    <guilabel>Always print full expressions</guilabel>
      </term> 
	  <listitem>
        <para>Should we print out full expressions for non-numeric return values (longer than a line) (<function>FullExpressions</function>)</para>
	  </listitem>
	</varlistentry>

	<varlistentry>
	  <term> 
	    <guilabel>Use mixed fractions</guilabel>
      </term> 
	  <listitem>
        <para>If fractions should be printed as mixed fractions such as "1 1/3" rather than "4/3". (<function>MixedFractions</function>)</para>
	  </listitem>
	</varlistentry>

	<varlistentry>
	  <term> 
	    <guilabel>Display 0.0 when floating point number is less than 10^-x (0=never chop)</guilabel>
      </term> 
	  <listitem>
	  <para>How to chop output.  But only when other numbers nearby are large.
	   See the documentation of the paramter
          <link linkend="gel-function-OutputChopExponent"><function>OutputChopExponent</function></link>. </para>
	  </listitem>
	</varlistentry>

	<varlistentry>
	  <term> 
            <guilabel>Only chop numbers when another number is greater than 10^-x</guilabel>
      </term> 
	  <listitem>
	  <para>When to chop output.  This is set by the paramter <function>OutputChopWhenExponent</function>.
	   See the documentation of the paramter
          <link linkend="gel-function-OutputChopExponent"><function>OutputChopExponent</function></link>. </para>
	  </listitem>
	</varlistentry>

	<varlistentry>
	  <term> 
	    <guilabel>Remember output settings across sessions</guilabel>
      </term> 
	  <listitem>
        <para>Should the output settings in the <guilabel>Number/Expression output options</guilabel> frame
	      be remembered for next session.  Does not apply to the <guilabel>Error/Info output options</guilabel> frame.</para>
	      <para>
		 If unchecked,
	   either the default or any previously saved settings are used each time Genius starts
	   up.  Note that
	   settings are saved at the end of the session, so if you wish to change the defaults
	   check this box, restart <application>Genius Mathematics Tool</application> and then uncheck it again.
	      </para>
	  </listitem>
	</varlistentry>

	<varlistentry>
	  <term> 
	    <guilabel>Display errors in a dialog</guilabel>
      </term> 
	  <listitem>
        <para>If set the errors will be displayed in a separate dialog, if
	unset the errors will be printed on the console.</para>
	  </listitem>
	</varlistentry>

	<varlistentry>
	  <term> 
	    <guilabel>Display information messages in a dialog</guilabel>
      </term> 
	  <listitem>
	<para>If set the information messages will be displayed in a separate
	dialog, if unset the information messages will be printed on the
	console.</para>
	  </listitem>
	</varlistentry>

	<varlistentry>
	  <term> 
	    <guilabel>Maximum errors to display</guilabel>
      </term> 
	  <listitem>
        <para>
	  The maximum number of errors to return on one evaluation
	  (<function>MaxErrors</function>).  If you set this to 0 then
	  all errors are always returned.  Usually if some loop causes
	  many errors, then it is unlikely that you will be able to make
	  sense out of more than a few of these, so seeing a long list
	  of errors is usually not helpful.
	  </para>
	  </listitem>
	</varlistentry>
      </variablelist> 

      <para>
	In addition to these preferences, there are some preferences that can
	only be changed by setting them in the workspace console.  For others
	that may affect the output see <xref linkend="genius-gel-function-parameters"/>.
      </para>

      <variablelist> 
	<varlistentry>
	  <term> 
	    <function>IntegerOutputBase</function>
      </term> 
	  <listitem>
        <para>The base that will be used to output integers</para>
	  </listitem>
	</varlistentry>

	<varlistentry>
	  <term> 
	    <function>OutputStyle</function>
      </term> 
	  <listitem>
	<para>A string, can be <literal>"normal"</literal>,
<literal>"latex"</literal>, <literal>"mathml"</literal> or
<literal>"troff"</literal> and it will affect how matrices (and perhaps other
stuff) is printed, useful for pasting into documents.  Normal style is the
default human readable printing style of <application>Genius Mathematics Tool</application>.  The other styles are for
typsetting in LaTeX, MathML (XML), or in Troff.</para>
	  </listitem>
	</varlistentry>
      </variablelist> 
   </sect1> 

    <sect1 id="genius-prefs-precision"> 
      <title>Precision</title> 
      <variablelist> 
	<varlistentry>
	  <term> 
	    <guilabel>Floating point precision</guilabel>
      </term> 
	  <listitem>
        <para>
	  The floating point precision in bits
	  (<function>FloatPrecision</function>).
	  Note that changing this only affects newly computed quantities.
	  Old values stored in variables are obviously still in the old
	  precision and if you want to have them more precise you will have
	  to recompute them.  Exceptions to this are the system constants
	  such as <function>pi</function> or
	  <function>e</function>.
	  </para>
	  </listitem>
	</varlistentry>

	<varlistentry>
	  <term> 
	    <guilabel>Remember precision setting across sessions</guilabel>
      </term> 
	  <listitem>
        <para>
	   Should the precision setting be remembered for the next session.  If unchecked,
	   either the default or any previously saved setting is used each time Genius starts
	   up.  Note that
	   settings are saved at the end of the session, so if you wish to change the default
	   check this box, restart genius and then uncheck it again.
	  </para>
	  </listitem>
	</varlistentry>
      </variablelist> 
    </sect1> 

    <sect1 id="genius-prefs-terminal"> 
      <title>Terminal</title> 

      <para>
      	Terminal refers to the console in the work area.
      </para>

      <variablelist> 
	<varlistentry>
	  <term> 
	    <guilabel>Scrollback lines</guilabel>
      </term> 
	  <listitem>
        <para>Lines of scrollback in the terminal.</para>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term> 
	    <guilabel>Font</guilabel>
      </term> 
	  <listitem>
        <para>The font to use on the terminal.</para>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term> 
	    <guilabel>Black on white</guilabel>
      </term> 
	  <listitem>
        <para>If to use black on white on the terminal.</para>
	  </listitem>
	</varlistentry>
	<varlistentry>
	  <term> 
	    <guilabel>Blinking cursor</guilabel>
      </term> 
	  <listitem>
        <para>If the cursor in the terminal should blink when the terminal is in focus.  This can sometimes be annoying and it generates idle traffic if you are using Genius remotely.</para>
	  </listitem>
	</varlistentry>
      </variablelist> 
    </sect1> 

    <sect1 id="genius-prefs-memory"> 
      <title>Memory</title> 
      <variablelist> 
	<varlistentry>
	  <term> 
	    <guilabel>Maximum number of nodes to allocate</guilabel>
      </term> 
	  <listitem>
        <para>
	   Internally all data is put onto small nodes in memory.  This gives
	   a limit on the maximum number of nodes to allocate for
	   computations.  This avoids the problem of running out of memory
	   if you do something by mistake which uses too much memory, such
	   as a recursion without end.  This could slow your computer and make
	   it hard to even interrupt the program.
	  </para>
        <para>
	   Once the limit is reached, <application>Genius Mathematics Tool</application> asks if you wish to interrupt
	   the computation or if you wish to continue.  If you continue, no
	   limit is applied and it will be possible to run your computer
	   out of memory.  The limit will be applied again next time you
	   execute a program or an expression on the Console regardless of how
	   you answered the question.
        </para>
        <para>
	   Setting the limit to zero means there is no limit to the amount of
	   memory that genius uses.
        </para>
	  </listitem>
	</varlistentry>

      </variablelist> 
    </sect1> 

  </chapter>

<!-- ============= About ====================================== -->
  <chapter id="genius-about"> 
    <title>À propos de l'<application>Outil de maths Genius</application></title> 

    <para> <application>Genius Mathematics Tool</application> was written by Jiří (George) Lebl
(<email>jirka@5z.com</email>).  The history of <application>Genius Mathematics Tool</application> goes back to late
1997.  It was the first calculator program for GNOME, but it then grew
beyond being just a desktop calculator.  To find more information about
<application>Genius Mathematics Tool</application>, please visit the <ulink url="http://www.jirka.org/genius.html" type="http">Genius Web page</ulink>.
    </para>
    <para>
      To report a bug or make a suggestion regarding this application or
      this manual, send email to me (the author) or post to the mailing
      list (see the web page).
    </para>

    <para> This program is distributed under the terms of the GNU
      General Public license as published by the Free Software
      Foundation; either version 3 of the License, or (at your option)
      any later version. A copy of this license can be found at this
      <ulink url="ghelp:gpl" type="help">link</ulink>, or in the file
      COPYING included with the source code of this program. </para>

    <para>Jiří Lebl was during various parts of the development
      partially supported for the work by NSF grant DMS 0900885, 
      the University of Illinois at Urbana-Champaign,
      the University of California at San Diego, and
      the University of Wisconsin-Madison.  The software has
      been used for both teaching and research.</para>

  </chapter>

</book>
