[genius] different version of docbook2txt or some such nonsense ...
- From: George Lebl <jirka src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [genius] different version of docbook2txt or some such nonsense ...
- Date: Tue, 26 Aug 2014 17:17:02 +0000 (UTC)
commit 2b8d5780664caed64e9a3254aa938a48828f8950
Author: Jiri (George) Lebl <jiri lebl gmail com>
Date: Tue Aug 26 12:12:36 2014 -0500
different version of docbook2txt or some such nonsense ...
help/genius.txt | 776 ++++++++++++++++++++++++++-----------------------------
1 files changed, 365 insertions(+), 411 deletions(-)
---
diff --git a/help/genius.txt b/help/genius.txt
index 0e9ee03..551849f 100644
--- a/help/genius.txt
+++ b/help/genius.txt
@@ -1,6 +1,6 @@
Genius Manual
-Jiř Lebl
+Jiří Lebl
Oklahoma State University
@@ -12,12 +12,10 @@ Kai Willadsen
<kaiw itee uq edu au>
- Copyright © 1997-2014 Jiř (George) Lebl
+ Copyright © 1997-2014 Jiří (George) Lebl
Copyright © 2004 Kai Willadsen
- Manual for the Genius Math Tool.
-
Permission is granted to copy, distribute and/or modify this
document under the terms of the GNU Free Documentation License
(GFDL), Version 1.1 or any later version published by the Free
@@ -77,141 +75,134 @@ Kai Willadsen
To report a bug or make a suggestion regarding the Genius
Mathematics Tool application or this manual, please visit the
Genius Web page or email me at <jirka 5z com>.
+ This manual describes version 1.0.18 of Genius.
__________________________________________________________
Table of Contents
- 1. Introduction
- 2. Getting Started
+ Introduction
+ Getting Started
+
+ To Start Genius Mathematics Tool
+ When You Start Genius
+
+ Basic Usage
+
+ Using the Work Area
+ To Create a New Program
+ To Open and Run a Program
+
+ Plotting
+
+ Line Plots
+ Parametric Plots
+ Slopefield Plots
+ Vectorfield Plots
+ Surface Plots
+
+ GEL Basics
+
+ Values
+
+ Numbers
+ Booleans
+ Strings
+ Null
+
+ Using Variables
+
+ Setting Variables
+ Built-in Variables
+ Previous Result Variable
+
+ Using Functions
+
+ Defining Functions
+ Variable Argument Lists
+ Passing Functions to Functions
+ Operations on Functions
+
+ Absolute Value / Modulus
+ Separator
+ Comments
+ Modular Evaluation
+ List of GEL Operators
+
+ Programming with GEL
+
+ Conditionals
+ Loops
+
+ While Loops
+ For Loops
+ Foreach Loops
+ Break and Continue
+
+ Sums and Products
+ Comparison Operators
+ Global Variables and Scope of Variables
+ Parameter variables
+ Returning
+ References
+ Lvalues
+
+ Advanced Programming with GEL
+
+ Error Handling
+ Toplevel Syntax
+ Returning Functions
+ True Local Variables
+ GEL Startup Procedure
+ Loading Programs
+
+ Matrices in GEL
+
+ Entering Matrices
+ Conjugate Transpose and Transpose Operator
+ Linear Algebra
- 2.1. To Start Genius Mathematics Tool
- 2.2. When You Start Genius
+ Polynomials in GEL
- 3. Basic Usage
+ Using Polynomials
- 3.1. Using the Work Area
- 3.2. To Create a New Program
- 3.3. To Open and Run a Program
+ Set Theory in GEL
- 4. Plotting
+ Using Sets
- 4.1. Line Plots
- 4.2. Parametric Plots
- 4.3. Slopefield Plots
- 4.4. Vectorfield Plots
- 4.5. Surface Plots
+ List of GEL functions
- 5. GEL Basics
+ Commands
+ Basic
+ Parameters
+ Constants
+ Numeric
+ Trigonometry
+ Number Theory
+ Matrix Manipulation
+ Linear Algebra
+ Combinatorics
+ Calculus
+ Functions
+ Equation Solving
+ Statistics
+ Polynomials
+ Set Theory
+ Commutative Algebra
+ Miscellaneous
+ Symbolic Operations
+ Plotting
- 5.1. Values
+ Example Programs in GEL
+ Settings
+
+ Output
+ Precision
+ Terminal
+ Memory
- 5.1.1. Numbers
- 5.1.2. Booleans
- 5.1.3. Strings
- 5.1.4. Null
-
- 5.2. Using Variables
-
- 5.2.1. Setting Variables
- 5.2.2. Built-in Variables
- 5.2.3. Previous Result Variable
-
- 5.3. Using Functions
-
- 5.3.1. Defining Functions
- 5.3.2. Variable Argument Lists
- 5.3.3. Passing Functions to Functions
- 5.3.4. Operations on Functions
-
- 5.4. Absolute Value / Modulus
- 5.5. Separator
- 5.6. Comments
- 5.7. Modular Evaluation
- 5.8. List of GEL Operators
-
- 6. Programming with GEL
-
- 6.1. Conditionals
- 6.2. Loops
-
- 6.2.1. While Loops
- 6.2.2. For Loops
- 6.2.3. Foreach Loops
- 6.2.4. Break and Continue
-
- 6.3. Sums and Products
- 6.4. Comparison Operators
- 6.5. Global Variables and Scope of Variables
- 6.6. Parameter variables
- 6.7. Returning
- 6.8. References
- 6.9. Lvalues
-
- 7. Advanced Programming with GEL
-
- 7.1. Error Handling
- 7.2. Toplevel Syntax
- 7.3. Returning Functions
- 7.4. True Local Variables
- 7.5. GEL Startup Procedure
- 7.6. Loading Programs
-
- 8. Matrices in GEL
-
- 8.1. Entering Matrices
- 8.2. Conjugate Transpose and Transpose Operator
- 8.3. Linear Algebra
-
- 9. Polynomials in GEL
-
- 9.1. Using Polynomials
-
- 10. Set Theory in GEL
-
- 10.1. Using Sets
-
- 11. List of GEL functions
-
- 11.1. Commands
- 11.2. Basic
- 11.3. Parameters
- 11.4. Constants
- 11.5. Numeric
- 11.6. Trigonometry
- 11.7. Number Theory
- 11.8. Matrix Manipulation
- 11.9. Linear Algebra
- 11.10. Combinatorics
- 11.11. Calculus
- 11.12. Functions
- 11.13. Equation Solving
- 11.14. Statistics
- 11.15. Polynomials
- 11.16. Set Theory
- 11.17. Commutative Algebra
- 11.18. Miscellaneous
- 11.19. Symbolic Operations
- 11.20. Plotting
-
- 12. Example Programs in GEL
- 13. Settings
-
- 13.1. Output
- 13.2. Precision
- 13.3. Terminal
- 13.4. Memory
-
- 14. About Genius Mathematics Tool
-
- List of Figures
- 2-1. Genius Mathematics Tool Window
- 4-1. Create Plot Window
- 4-2. Plot Window
- 4-3. Parametric Plot Tab
- 4-4. Parametric Plot
- 4-5. Surface Plot
+ About Genius Mathematics Tool
__________________________________________________________
-Chapter 1. Introduction
+Introduction
The Genius Mathematics Tool application is a general calculator
for use as a desktop calculator, an educational tool in
@@ -244,9 +235,9 @@ Chapter 1. Introduction
file.
__________________________________________________________
-Chapter 2. Getting Started
+Getting Started
-2.1. To Start Genius Mathematics Tool
+To Start Genius Mathematics Tool
You can start Genius Mathematics Tool in the following ways:
@@ -275,15 +266,15 @@ Chapter 2. Getting Started
plotting will not be available.
__________________________________________________________
-2.2. When You Start Genius
+When You Start Genius
When you start the GNOME edition of Genius Mathematics Tool,
- the window pictured in Figure 2-1 is displayed.
-
- Figure 2-1. Genius Mathematics Tool Window
+ the window pictured in Figure 1 is displayed.
[genius_window.png]
+ Figure 1. Genius Mathematics Tool Window
+
The Genius Mathematics Tool window contains the following
elements:
@@ -326,9 +317,9 @@ Chapter 2. Getting Started
for later retrieval.
__________________________________________________________
-Chapter 3. Basic Usage
+Basic Usage
-3.1. Using the Work Area
+Using the Work Area
Normally you interact with the calculator in the Console tab of
the work area. If you are running the text only version then
@@ -373,7 +364,7 @@ genius> load path/to/program.gel
directory do cd directory as in the unix command shell.
__________________________________________________________
-3.2. To Create a New Program
+To Create a New Program
To start writing a new program, choose File->New Program. A new
tab will appear in the work area. You can write a GEL program
@@ -392,7 +383,7 @@ genius> load path/to/program.gel
As...
__________________________________________________________
-3.3. To Open and Run a Program
+To Open and Run a Program
To open a file, choose File->Open. A new tab containing the
file will appear in the work area. You can use this to edit the
@@ -403,7 +394,7 @@ genius> load path/to/program.gel
This is equivalent to the load command.
__________________________________________________________
-Chapter 4. Plotting
+Plotting
Plotting support is only available in the graphical GNOME
version. All plotting accessible from the graphical interface
@@ -411,11 +402,11 @@ Chapter 4. Plotting
window by either clicking on the Plot button on the toolbar or
selecting Plot from the Calculator menu. You can also access
the plotting functionality by using the plotting functions of
- the GEL language. See Chapter 5 to find out how to enter
- expressions that Genius understands.
+ the GEL language. See the Chapter called GEL Basics to find out
+ how to enter expressions that Genius understands.
__________________________________________________________
-4.1. Line Plots
+Line Plots
To graph real valued functions of one variable open the Create
Plot window. You can also use the LinePlot function on the
@@ -424,12 +415,12 @@ Chapter 4. Plotting
Once you click the Plot button, a window opens up with some
notebooks in it. You want to be in the Function line plot
notebook tab, and inside you want to be on the Functions /
- Expressions notebook tab. See Figure 4-1.
-
- Figure 4-1. Create Plot Window
+ Expressions notebook tab. See Figure 1.
[line_plot.png]
+ Figure 1. Create Plot Window
+
Type expressions with x as the independent variable into the
textboxes. Alternatively you can give names of functions such
as cos rather then having to type cos(x). You can graph up to
@@ -441,12 +432,12 @@ Chapter 4. Plotting
dialog. The y (dependent) range can be set automatically by
turning on the Fit dependent axis checkbox. The names of the
variables can also be changed. Pressing the Plot button
- produces the graph shown in Figure 4-2.
-
- Figure 4-2. Plot Window
+ produces the graph shown in Figure 2.
[line_plot_graph.png]
+ Figure 2. Plot Window
+
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
@@ -456,7 +447,7 @@ Chapter 4. Plotting
the LinePlot function.
__________________________________________________________
-4.2. Parametric Plots
+Parametric Plots
In the create plot window, you can also choose the Parametric
notebook tab to create two dimensional parametric plots. This
@@ -466,24 +457,24 @@ Chapter 4. Plotting
variable t is given explicitly, and the function is sampled
according to the given increment. The x and y range can be set
automatically by turning on the Fit dependent axis checkbox, or
- it can be specified explicitly. See Figure 4-3.
-
- Figure 4-3. Parametric Plot Tab
+ it can be specified explicitly. See Figure 3.
[parametric.png]
- An example of a parametric plot is given in Figure 4-4. Similar
+ Figure 3. Parametric Plot Tab
+
+ An example of a parametric plot is given in Figure 4. 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 LinePlotParametric or LinePlotCParametric
function.
- Figure 4-4. Parametric Plot
-
[parametric_graph.png]
+
+ Figure 4. Parametric Plot
__________________________________________________________
-4.3. Slopefield Plots
+Slopefield Plots
In the create plot window, you can also choose the Slope field
notebook tab to create a two dimensional slope field plot.
@@ -509,7 +500,7 @@ Chapter 4. Plotting
from the command line or programs.
__________________________________________________________
-4.4. Vectorfield Plots
+Vectorfield Plots
In the create plot window, you can also choose the Vector field
notebook tab to create a two dimensional vector field plot.
@@ -538,7 +529,7 @@ Chapter 4. Plotting
command line or programs.
__________________________________________________________
-4.5. Surface Plots
+Surface Plots
Genius can also plot surfaces. Select the Surface plot tab in
the main notebook of the Create Plot window. Here you can
@@ -547,18 +538,18 @@ Chapter 4. Plotting
is the real part of z and y is the imaginary part). For example
to plot the modulus of the cosine function for complex
parameters, you could enter |cos(z)|. This would be equivalent
- to |cos(x+1i*y)|. See Figure 4-5. For plotting using the
- command line see the documentation of the SurfacePlot function.
+ to |cos(x+1i*y)|. See Figure 5. For plotting using the command
+ line see the documentation of the SurfacePlot function.
The z range can be set automatically by turning on the Fit
dependent axis checkbox.
- Figure 4-5. Surface Plot
-
[surface_graph.png]
+
+ Figure 5. Surface Plot
__________________________________________________________
-Chapter 5. GEL Basics
+GEL Basics
GEL stands for Genius Extension Language. It is the language
you use to write programs in Genius. A program in GEL is simply
@@ -569,7 +560,7 @@ Chapter 5. GEL Basics
possible, especially for use as a calculator.
__________________________________________________________
-5.1. Values
+Values
Values in GEL can be numbers, Booleans, or strings. GEL also
treats matrices as values. Values can be used in calculations,
@@ -577,7 +568,7 @@ Chapter 5. GEL Basics
uses.
__________________________________________________________
-5.1.1. Numbers
+Numbers
Integers are the first type of number in GEL. Integers are
written in the normal way.
@@ -630,19 +621,19 @@ Chapter 5. GEL Basics
8.01i
77*e^(1.3i)
-Important
+ Important
- When entering imaginary numbers, a number must be in front of
- the i. If you use i by itself, Genius will interpret this as
- referring to the variable i. If you need to refer to i by
- itself, use 1i instead.
+ When entering imaginary numbers, a number must be in front of
+ the i. If you use i by itself, Genius will interpret this as
+ referring to the variable i. If you need to refer to i by
+ itself, use 1i instead.
- In order to use mixed fraction notation with imaginary numbers
- you must have the mixed fraction in parentheses. (i.e., (1
- 2/5)i)
+ In order to use mixed fraction notation with imaginary numbers
+ you must have the mixed fraction in parentheses. (i.e., (1
+ 2/5)i)
__________________________________________________________
-5.1.2. Booleans
+Booleans
Genius also supports native Boolean values. The two Boolean
constants are defined as true and false; these identifiers can
@@ -673,7 +664,7 @@ Important
before being compared to true.
__________________________________________________________
-5.1.3. Strings
+Strings
Like numbers and Booleans, strings in GEL can be stored as
values inside variables and passed to functions. You can also
@@ -708,7 +699,7 @@ string(22)
and <=> (comparison) operators
__________________________________________________________
-5.1.4. Null
+Null
There is a special value called null. No operations can be
performed on it, and nothing is printed when it is returned.
@@ -727,7 +718,7 @@ x=5;
or an empty reference.
__________________________________________________________
-5.2. Using Variables
+Using Variables
Syntax:
VariableName
@@ -740,24 +731,25 @@ genius> e
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 Section 5.3.1).
+ functions that take arguments (see the Section called Defining
+ Functions).
Tip Using Tab completion
- 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 Tab.
+ 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 Tab.
Important Variable names are case sensitive
- The names of variables are case sensitive. That means that
- variables named hello, HELLO and Hello are all different
- variables.
+ The names of variables are case sensitive. That means that
+ variables named hello, HELLO and Hello are all different
+ variables.
__________________________________________________________
-5.2.1. Setting Variables
+Setting Variables
Syntax:
<identifier> = <value>
@@ -781,21 +773,24 @@ a = b = 5
where a Boolean expression is expected.
For more information about the scope of variables, that is when
- are what variables visible, see Section 6.5.
+ are what variables visible, see the Section called Global
+ Variables and Scope of Variables in the Chapter called
+ Programming with GEL.
__________________________________________________________
-5.2.2. Built-in Variables
+Built-in Variables
GEL has a number of built-in ‘variables’, such as e, pi or
GoldenRatio. 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 Section 11.4 for a full
- list. Note that i is not by default the square root of negative
- one (the imaginary number), and is undefined. If you wish to
- write the imaginary number you need to use 1i.
+ number of other built-in variables. See the Section called
+ Constants in the Chapter called List of GEL functions for a
+ full list. Note that i is not by default the square root of
+ negative one (the imaginary number), and is undefined. If you
+ wish to write the imaginary number you need to use 1i.
__________________________________________________________
-5.2.3. Previous Result Variable
+Previous Result Variable
The Ans and ans variables can be used to get the result of the
last expression. For example, if you had performed some
@@ -803,7 +798,7 @@ a = b = 5
Ans+389
__________________________________________________________
-5.3. Using Functions
+Using Functions
Syntax:
FunctionName(argument1, argument2, ...)
@@ -821,24 +816,25 @@ gcd(921,317)
There are many built-in functions, such as sin, cos and tan.
You can use the help built-in command to get a list of
- available functions, or see Chapter 11 for a full listing.
+ available functions, or see the Chapter called List of GEL
+ functions for a full listing.
Tip Using Tab completion
- 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 Tab.
+ 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 Tab.
- Important Function names are case sensitive
+ Important Function names are case sensitive
- The names of functions are case sensitive. That means that
- functions named dosomething, DOSOMETHING and DoSomething are
- all different functions.
+ The names of functions are case sensitive. That means that
+ functions named dosomething, DOSOMETHING and DoSomething are
+ all different functions.
__________________________________________________________
-5.3.1. Defining Functions
+Defining Functions
Syntax:
function <identifier>(<comma separated arguments>) = <function body>
@@ -858,7 +854,7 @@ function addup(a,b,c) = a+b+c
then addup(1,4,9) yields 14
__________________________________________________________
-5.3.2. Variable Argument Lists
+Variable Argument Lists
If you include ... after the last argument name in the function
declaration, then Genius will allow any number of arguments to
@@ -871,7 +867,7 @@ function f(a,b...) = b
Then f(1,2,3) yields [2,3], while f(1) yields a null.
__________________________________________________________
-5.3.3. Passing Functions to Functions
+Passing Functions to Functions
In Genius, it is possible to pass a function as an argument to
another function. This can be done using either ‘function
@@ -886,8 +882,9 @@ function b(x) = x*x;
f(b,2)
To pass functions that are not defined, you can use an
- anonymous function (see Section 5.3.1). That is, you want to
- pass a function without giving it a name. Syntax:
+ anonymous function (see the Section called Defining Functions).
+ That is, you want to pass a function without giving it a name.
+ Syntax:
function(<comma separated arguments>) = <function body>
`(<comma separated arguments>) = <function body>
@@ -898,7 +895,7 @@ f(`(x) = x*x,2)
This will return 5.
__________________________________________________________
-5.3.4. Operations on Functions
+Operations on Functions
Some functions allow arithmetic operations, and some single
argument functions such as exp or ln, to operate on the
@@ -920,23 +917,23 @@ LinePlot(sin^2)
Warning
- 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.
+ 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.
__________________________________________________________
-5.4. Absolute Value / Modulus
+Absolute Value / Modulus
You can make an absolute value of something by putting the |'s
around it. For example:
-|a-b|
+ |a-b|
In case the expression is a complex number the result will be
the modulus (distance from the origin). For example: |3 *
e^(1i*pi)| returns 3.
__________________________________________________________
-5.5. Separator
+Separator
In GEL if you want to type more than one command you have to
use the ; operator, which is a way to separate expressions,
@@ -961,7 +958,7 @@ LinePlot(sin^2)
there is one more operator involved.
__________________________________________________________
-5.6. Comments
+Comments
GEL is similar to other scripting languages in that # denotes a
comments, that is text that is not meant to be evaluated.
@@ -973,11 +970,11 @@ LinePlot(sin^2)
x=123;
__________________________________________________________
-5.7. Modular Evaluation
+Modular Evaluation
Genius implements modular arithmetic. To use it you just add
"mod <integer>" after the expression. Example:
-2^(5!) * 3^(6!) mod 5
+ 2^(5!) * 3^(6!) mod 5
It could be possible to do modular arithmetic by computing with
integers and then modding in the end with the % operator, which
@@ -1028,43 +1025,37 @@ genius> 2*2 mod 7
mod.
__________________________________________________________
-5.8. List of GEL Operators
+List of GEL Operators
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.
-a;b
-
+ a;b
The separator, just evaluates both a and b, but returns
only the result of b.
-a=b
-
+ a=b
The assignment operator. This assigns b to a (a must be
a valid lvalue) (note however that this operator may be
translated to == if used in a place where boolean
expression is expected)
-a:=b
-
+ a:=b
The assignment operator. Assigns b to a (a must be a
valid lvalue). This is different from = because it never
gets translated to a ==.
-|a|
-
+ |a|
Absolute value or modulus (if a is a complex number).
See Mathworld for more information.
-a^b
-
+ a^b
Exponentiation, raises a to the bth power.
-a.^b
-
+ a.^b
Element by element exponentiation. Raise each element of
a matrix a to the bth power. Or if b is a matrix of the
same size as a, then do the operation element by
@@ -1072,200 +1063,166 @@ a.^b
creates matrix of the same size as b with a raised to
all the different powers in b.
-a+b
-
+ a+b
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.
-a-b
-
+ a-b
Subtraction. Subtract two numbers, matrices or
functions.
-a*b
-
+ a*b
Multiplication. This is the normal matrix
multiplication.
-a.*b
-
+ a.*b
Element by element multiplication if a and b are
matrices.
-a/b
-
+ a/b
Division. When a and b are just numbers this is the
normal division. When they are matrices, then this is
equivalent to a*b^-1.
-a./b
-
+ a./b
Element by element division. Same as a/b for numbers,
but operarates element by element on matrices.
-a\b
-
+ a\b
Back division. That is this is the same as b/a.
-a.\b
-
+ a.\b
Element by element back division.
-a%b
-
+ a%b
The mod operator. This does not turn on the modular
mode, but just returns the remainder of a/b.
-a.%b
-
+ a.%b
Element by element the mod operator. Returns the
remainder after element by element integer a./b.
-a mod b
-
+ a mod b
Modular evaluation operator. The expression a is
- evaluated modulo b. See Section 5.7. Some functions and
- operators behave differently modulo an integer.
-
-a!
+ evaluated modulo b. See the Section called Modular
+ Evaluation. Some functions and operators behave
+ differently modulo an integer.
+ a!
Factorial operator. This is like 1*...*(n-2)*(n-1)*n.
-a!!
-
+ a!!
Double factorial operator. This is like
1*...*(n-4)*(n-2)*n.
-a==b
-
+ a==b
Equality operator. Returns true or false depending on a
and b being equal or not.
-a!=b
-
+ a!=b
Inequality operator, returns true if a does not equal b
else returns false.
-a<>b
-
+ a<>b
Alternative inequality operator, returns true if a does
not equal b else returns false.
-a<=b
-
+ a<=b
Less than or equal operator, returns true if a is less
than or equal to b else returns false. These can be
chained as in a <= b <= c (can also be combined with the
less than operator).
-a>=b
-
+ a>=b
Greater than or equal operator, returns true if a is
greater than or equal to b else returns false. These can
be chained as in a >= b >= c (can also be combine with
the greater than operator).
-a<b
-
+ a<b
Less than operator, returns true if a is less than b
else returns false. These can be chained as in a < b < c
(can also be combine with the less than or equal to
operator).
-a>b
-
+ a>b
Greater than operator, returns true if a is greater than
b else returns false. These can be chained as in a > b >
c (can also be combine with the greater than or equal to
operator).
-a<=>b
-
+ a<=>b
Comparison operator. If a is equal to b it returns 0, if
a is less than b it returns -1 and if a is greater than
b it returns 1.
-a and b
-
+ a and b
Logical and. Returns true if both a and b are true, else
returns false. If given numbers, nonzero numbers are
treated as true.
-a or b
-
+ a or b
Logical or. Returns true if both a or b are true, else
returns false. If given numbers, nonzero numbers are
treated as true.
-a xor b
-
+ a xor b
Logical xor. Returns true exactly one of a or b is true,
else returns false. If given numbers, nonzero numbers
are treated as true.
-not a
-
+ not a
Logical not. Returns the logical negation of a
--a
-
+ -a
Negation operator. Returns the negative of a number or a
matrix (works elementwise on a matrix).
-&a
-
+ &a
Variable referencing (to pass a reference to a
- variable). See Section 6.8.
-
-*a
+ variable). See the Section called References in the
+ Chapter called Programming with GEL.
+ *a
Variable dereferencing (to access a referenced
- variable). See Section 6.8.
-
-a'
+ variable). See the Section called References in the
+ Chapter called Programming with GEL.
+ a'
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 a is x+iy, then
the j,i element of a' is x-iy.
-a.'
-
+ a.'
Matrix transpose, does not conjugate the entries. That
is, the i,j element of a becomes the j,i element of a.'.
-a@(b,c)
-
+ a@(b,c)
Get element of a matrix in row b and column c. If b, c
are vectors, then this gets the corresponding rows
columns or submatrices.
-a@(b,)
-
+ a@(b,)
Get row of a matrix (or multiple rows if b is a vector).
-a@(b,:)
-
+ a@(b,:)
Same as above.
-a@(,c)
-
+ a@(,c)
Get column of a matrix (or columns if c is a vector).
-a@(:,c)
-
+ a@(:,c)
Same as above.
-a@(b)
-
+ a@(b)
Get an element from a matrix treating it as a vector.
This will traverse the matrix row-wise.
-a:b
-
+ a:b
Build a vector from a to b (or specify a row, column
region for the @ operator). For example to get rows 2 to
4 of matrix A we could do
@@ -1274,8 +1231,7 @@ A@(2:4,)
as 2:4 will return a vector [2,3,4].
-a:b:c
-
+ a:b:c
Build a vector from a to c with b as a step. That is for
example
@@ -1303,34 +1259,29 @@ genius> 1:2:9
floating point numbers and is ever so slightly more
precise than 1.0:0.4:3.0.
-(a)i
-
+ (a)i
Make a imaginary number (multiply a by the imaginary).
Note that normally the number i is written as 1i. So the
above is equal to
(a)*1i
-`a
-
+ `a
Quote an identifier so that it doesn't get evaluated. Or
quote a matrix so that it doesn't get expanded.
-a swapwith b
-
+ a swapwith b
Swap value of a with the value of b. Currently does not
operate on ranges of matrix elements. It returns null.
Available from version 1.0.13.
-increment a
-
+ increment a
Increment the variable a by 1. If a is a matrix, then
increment each element. This is equivalent to a=a+1, but
it is somewhat faster. It returns null. Available from
version 1.0.13.
-increment a by b
-
+ increment a by b
Increment the variable a by b. If a is a matrix, then
increment each element. This is equivalent to a=a+b, but
it is somewhat faster. It returns null. Available from
@@ -1338,34 +1289,34 @@ increment a by b
Note
- 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.
+ 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.
Note
- The comparison operators (except for the <=> operator, which
- behaves normally), are not strictly binary operators, they can
- in fact be grouped in the normal mathematical way, e.g.:
- (1<x<=y<5) is a legal boolean expression and means just what it
- should, that is (1<x and x≤y and y<5)
+ The comparison operators (except for the <=> operator, which
+ behaves normally), are not strictly binary operators, they can
+ in fact be grouped in the normal mathematical way, e.g.:
+ (1<x<=y<5) is a legal boolean expression and means just what it
+ should, that is (1<x and x≤y and y<5)
Note
- 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 -1^k is
- really (-1)^k, but -foo(1)^k is really -(foo(1)^k). So be
- careful how you use it and if in doubt, add parentheses.
+ 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 -1^k is
+ really (-1)^k, but -foo(1)^k is really -(foo(1)^k). So be
+ careful how you use it and if in doubt, add parentheses.
__________________________________________________________
-Chapter 6. Programming with GEL
+Programming with GEL
-6.1. Conditionals
+Conditionals
Syntax:
if <expression1> then <expression2> [else <expression3>]
@@ -1387,9 +1338,9 @@ if a=5 then a=a-1
if a==5 then a:=a-1
__________________________________________________________
-6.2. Loops
+Loops
-6.2.1. While Loops
+While Loops
Syntax:
while <expression1> do <expression2>
@@ -1404,7 +1355,7 @@ do <expression2> until <expression1>
is translated into == just as for the if statement.
__________________________________________________________
-6.2.2. For Loops
+For Loops
Syntax:
for <identifier> = <from> to <to> do <body>
@@ -1441,10 +1392,10 @@ for x = 0 to 1 by 1/10 do print(x)
execution of your code may differ on older versions.
__________________________________________________________
-6.2.3. Foreach Loops
+Foreach Loops
Syntax:
-for <identifier> in <matrix> do <body>
+ for <identifier> in <matrix> do <body>
For each element in the matrix, going row by row from left to
right we execute the body with the identifier set to the
@@ -1460,7 +1411,7 @@ for n in RowsOf ([1,2:3,4]) do print(n)
will print out [1,2] and then [3,4].
__________________________________________________________
-6.2.4. Break and Continue
+Break and Continue
You can also use the break and continue commands in loops. The
continue continue command will restart the current loop at its
@@ -1472,7 +1423,7 @@ while(<expression1>) do (
)
__________________________________________________________
-6.3. Sums and Products
+Sums and Products
Syntax:
sum <identifier> = <from> to <to> do <body>
@@ -1491,10 +1442,10 @@ prod <identifier> in <matrix> do <body>
sum returns 0 and prod returns 1 as is the standard convention.
For floating point numbers the same roundoff error protection
- is done as in the for loop. See Section 6.2.2.
+ is done as in the for loop. See the Section called For Loops.
__________________________________________________________
-6.4. Comparison Operators
+Comparison Operators
The following standard comparison operators are supported in
GEL and have the obvious meaning: ==, >=, <=, !=, <>, <, >.
@@ -1526,7 +1477,7 @@ if a==b then c
a=1 will not set a=1 since the first argument was true.
__________________________________________________________
-6.5. Global Variables and Scope of Variables
+Global Variables and Scope of Variables
GEL is a dynamically scoped language. We will explain what this
means below. That is, normal variables and functions are
@@ -1619,7 +1570,7 @@ set("a",3)
Variables and Returning Functions.
__________________________________________________________
-6.6. Parameter variables
+Parameter variables
As we said before, there exist special variables called
parameters that exist in all scopes. To declare a parameter
@@ -1637,7 +1588,7 @@ parameter foo = 1
genius.
__________________________________________________________
-6.7. Returning
+Returning
Normally a function is one or several expressions separated by
a semicolon, and the value of the last expression is returned.
@@ -1658,7 +1609,7 @@ function f(x) = (
)
__________________________________________________________
-6.8. References
+References
It may be necessary for some functions to return more than one
value. This may be accomplished by returning a vector of
@@ -1693,7 +1644,7 @@ t=&f;
gives us 4.
__________________________________________________________
-6.9. Lvalues
+Lvalues
An lvalue is the left hand side of an assignment. In other
words, an lvalue is what you assign something to. Valid lvalues
@@ -1724,9 +1675,9 @@ a@(4:8,3) := [1,2,3,4,5]'
comparison.
__________________________________________________________
-Chapter 7. Advanced Programming with GEL
+Advanced Programming with GEL
-7.1. Error Handling
+Error Handling
If you detect an error in your function, you can bail out of
it. For normal errors, such as wrong types of arguments, you
@@ -1745,7 +1696,7 @@ function f(M) = (
)
__________________________________________________________
-7.2. Toplevel Syntax
+Toplevel Syntax
The synatax is slightly different if you enter statements on
the top level versus when they are inside parentheses or inside
@@ -1778,7 +1729,7 @@ if Something() then (
)
__________________________________________________________
-7.3. Returning Functions
+Returning Functions
It is possible to return functions as value. This way you can
build functions that construct special purpose functions
@@ -1872,7 +1823,7 @@ g(10)
of 5 was added to the private dictionary.
__________________________________________________________
-7.4. True Local Variables
+True Local Variables
When passing functions into other functions, the normal scoping
of variables might be undesired. For example:
@@ -1924,7 +1875,7 @@ function f(g,x) = (
function does not see implementation details and get confused.
__________________________________________________________
-7.5. GEL Startup Procedure
+GEL Startup Procedure
First the program looks for the installed library file (the
compiled version lib.cgel) in the installed directory, then it
@@ -1936,7 +1887,7 @@ function f(g,x) = (
lib.cgel
__________________________________________________________
-7.6. Loading Programs
+Loading Programs
Sometimes you have a larger program you wrote into a file and
want to read that file into Genius Mathematics Tool. In these
@@ -1962,14 +1913,14 @@ cd directory_with_gel_programs
ls *.gel
__________________________________________________________
-Chapter 8. Matrices in GEL
+Matrices in GEL
Genius has support for vectors and matrices and posesses a
sizable library of matrix manipulation and linear algebra
functions.
__________________________________________________________
-8.1. Entering Matrices
+Entering Matrices
To enter matrixes, you can use one of the following two
syntaxes. You can either enter the matrix on one line,
@@ -2020,12 +1971,12 @@ b = [ a, 10
Note
- Be careful about using returns for expressions inside the [ ]
- brackets, as they have a slightly different meaning there. You
- will start a new row.
+ Be careful about using returns for expressions inside the [ ]
+ brackets, as they have a slightly different meaning there. You
+ will start a new row.
__________________________________________________________
-8.2. Conjugate Transpose and Transpose Operator
+Conjugate Transpose and Transpose Operator
You can conjugate transpose a matrix by using the ' operator.
That is the entry in the ith column and the jth row will be the
@@ -2045,7 +1996,7 @@ b = [ a, 10
with real matrices and vectors.
__________________________________________________________
-8.3. Linear Algebra
+Linear Algebra
Genius implements many useful linear algebra and matrix
manipulation routines. See the Linear Algebra and Matrix
@@ -2081,14 +2032,14 @@ b = [ a, 10
will be very fast.
__________________________________________________________
-Chapter 9. Polynomials in GEL
+Polynomials in GEL
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.
__________________________________________________________
-9.1. Using Polynomials
+Using Polynomials
Currently polynomials in one variable are just horizontal
vectors with value only nodes. The power of the term is the
@@ -2120,18 +2071,19 @@ f(2)
function such as FindRootBisection, FindRootFalsePosition,
FindRootMullersMethod, or FindRootSecant.
- See Section 11.15 in the function list for the rest of
- functions acting on polynomials.
+ See the Section called Polynomials in the Chapter called List
+ of GEL functions in the function list for the rest of functions
+ acting on polynomials.
__________________________________________________________
-Chapter 10. Set Theory in GEL
+Set Theory in GEL
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.
__________________________________________________________
-10.1. Using Sets
+Using Sets
Just like vectors, objects in sets can include numbers,
strings, null, matrices and vectors. It is planned in the
@@ -2165,13 +2117,13 @@ genius> IsIn (1, [0,1,2])
IsSubset(null,X) is always true.
__________________________________________________________
-Chapter 11. List of GEL functions
+List of GEL functions
To get help on a specific function from the console type:
help FunctionName
__________________________________________________________
-11.1. Commands
+Commands
help
@@ -2214,7 +2166,7 @@ plugin plugin_name
the system in the proper directory.
__________________________________________________________
-11.2. Basic
+Basic
AskButtons
@@ -2657,7 +2609,7 @@ warranty
Gives the warranty information.
__________________________________________________________
-11.3. Parameters
+Parameters
ChopTolerance
@@ -2929,7 +2881,7 @@ VectorfieldTicks = [vertical,horizontal]
Version 1.0.10 onwards.
__________________________________________________________
-11.4. Constants
+Constants
CatalanConstant
@@ -2993,7 +2945,7 @@ pi
information.
__________________________________________________________
-11.5. Numeric
+Numeric
AbsoluteValue
@@ -3311,7 +3263,7 @@ trunc (x)
Truncate number to an integer (return the integer part).
__________________________________________________________
-11.6. Trigonometry
+Trigonometry
acos
@@ -3521,7 +3473,7 @@ tanh (x)
See Planetmath for more information.
__________________________________________________________
-11.7. Number Theory
+Number Theory
AreRelativelyPrime
@@ -4026,7 +3978,7 @@ lcm (a,args...)
See Planetmath or Mathworld for more information.
__________________________________________________________
-11.8. Matrix Manipulation
+Matrix Manipulation
ApplyOverMatrix
@@ -4449,7 +4401,7 @@ zeros (rows,columns...)
columns are zero.
__________________________________________________________
-11.9. Linear Algebra
+Linear Algebra
AuxiliaryUnitMatrix
@@ -5151,7 +5103,7 @@ rref (M)
See Wikipedia or Planetmath for more information.
__________________________________________________________
-11.10. Combinatorics
+Combinatorics
Catalan
@@ -5390,7 +5342,7 @@ nPr (n,r)
See Mathworld or Wikipedia for more information.
__________________________________________________________
-11.11. Calculus
+Calculus
CompositeSimpsonsRule
@@ -5696,7 +5648,7 @@ TwoSidedThreePointFormula (f,x0,h)
Compute two-sided derivative using three-point formula.
__________________________________________________________
-11.12. Functions
+Functions
Argument
@@ -5960,7 +5912,7 @@ sinc (x)
Version 1.0.16 onwards.
__________________________________________________________
-11.13. Equation Solving
+Equation Solving
CubicFormula
@@ -6232,7 +6184,7 @@ d","Second");
Version 1.0.10 onwards.
__________________________________________________________
-11.14. Statistics
+Statistics
Average
@@ -6327,7 +6279,7 @@ StandardDeviation (m)
Calculate the standard deviation of a whole matrix.
__________________________________________________________
-11.15. Polynomials
+Polynomials
AddPoly
@@ -6414,7 +6366,7 @@ TrimPoly (p)
Trim zeros from a polynomial (as vector).
__________________________________________________________
-11.16. Set Theory
+Set Theory
Intersection
@@ -6459,7 +6411,7 @@ Union (X,Y)
vectors pretending to be sets).
__________________________________________________________
-11.17. Commutative Algebra
+Commutative Algebra
MacaulayBound
@@ -6490,7 +6442,7 @@ MacaulayRep (c,d)
Version 1.0.15 onwards.
__________________________________________________________
-11.18. Miscellaneous
+Miscellaneous
ASCIIToString
@@ -6520,7 +6472,7 @@ StringToAlphabet (str,alphabet)
letters.
__________________________________________________________
-11.19. Symbolic Operations
+Symbolic Operations
SymbolicDerivative
@@ -6567,7 +6519,7 @@ SymbolicTaylorApproximationFunction (f,x0,n)
around x0 to the nth degree. (See SymbolicDerivative)
__________________________________________________________
-11.20. Plotting
+Plotting
ExportPlot
@@ -6992,7 +6944,7 @@ VectorfieldPlot (funcx, funcy, x1, x2, y1, y2)
genius> VectorfieldPlot(`(x,y)=x^2-y, `(x,y)=y^2-x, -1, 1, -1, 1)
__________________________________________________________
-Chapter 12. Example Programs in GEL
+Example Programs in GEL
Here is a function that calculates factorials:
function f(x) = if x <= 1 then 1 else (f(x-1)*x)
@@ -7067,28 +7019,30 @@ function MyOwnREF(m) = (
)
__________________________________________________________
-Chapter 13. Settings
+Settings
To configure Genius Mathematics Tool, choose
Settings->Preferences. 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.
- Note Changing Settings with GEL
+ Note Changing Settings with GEL
- 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 Section 5.2 about evaluating and assigning to
- variables, and Section 11.3 for a list of settings that can be
- modified in this way.
+ 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 the Section called Using Variables in the
+ Chapter called GEL Basics about evaluating and assigning to
+ variables, and the Section called Parameters in the Chapter
+ called List of GEL functions for a list of settings that can be
+ modified in this way.
- As an example, you can set the maximum number of digits in a
- result to 12 by typing:
- MaxDigits = 12
+ As an example, you can set the maximum number of digits in a
+ result to 12 by typing:
+MaxDigits = 12
__________________________________________________________
-13.1. Output
+Output
Maximum digits to output
The maximum digits in a result (MaxDigits)
@@ -7151,8 +7105,8 @@ Chapter 13. Settings
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 Section
- 11.3.
+ console. For others that may affect the output see the Section
+ called Parameters in the Chapter called List of GEL functions.
IntegerOutputBase
The base that will be used to output integers
@@ -7166,7 +7120,7 @@ Chapter 13. Settings
for typsetting in LaTeX, MathML (XML), or in Troff.
__________________________________________________________
-13.2. Precision
+Precision
Floating point precision
The floating point precision in bits (FloatPrecision).
@@ -7185,7 +7139,7 @@ Chapter 13. Settings
box, restart genius and then uncheck it again.
__________________________________________________________
-13.3. Terminal
+Terminal
Terminal refers to the console in the work area.
@@ -7205,7 +7159,7 @@ Chapter 13. Settings
remotely.
__________________________________________________________
-13.4. Memory
+Memory
Maximum number of nodes to allocate
Internally all data is put onto small nodes in memory.
@@ -7228,9 +7182,9 @@ Chapter 13. Settings
amount of memory that genius uses.
__________________________________________________________
-Chapter 14. About Genius Mathematics Tool
+About Genius Mathematics Tool
- Genius Mathematics Tool was written by Jiř (George) Lebl
+ Genius Mathematics Tool was written by Jiří (George) Lebl
(<jirka 5z com>). The history of Genius Mathematics Tool goes
back to late 1997. It was the first calculator program for
GNOME, but it then grew beyond being just a desktop calculator.
@@ -7248,7 +7202,7 @@ Chapter 14. About Genius Mathematics Tool
in the file COPYING included with the source code of this
program.
- Jiř Lebl was during various parts of the development partially
+ 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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]