[genius] Thu Mar 29 10:35:45 2012 Jiri (George) Lebl <jirka 5z com>
- From: George Lebl <jirka src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [genius] Thu Mar 29 10:35:45 2012 Jiri (George) Lebl <jirka 5z com>
- Date: Thu, 29 Mar 2012 15:36:25 +0000 (UTC)
commit d645fd1b1493c4099b73c1b3aad5431086c08e4b
Author: Jiri (George) Lebl <jirka 5z com>
Date: Thu Mar 29 10:35:50 2012 -0500
Thu Mar 29 10:35:45 2012 Jiri (George) Lebl <jirka 5z com>
* src/calc.c, src/eval.c, src/funclib.c, lib/*/*.gel: fix some
spelling and capitalization
* help/C/gel-function-list.xml: fix spelling
* combinatorics/recursive_sequences.gel: Fix LinearRecursiveSequence,
and also allow it to take matrix argument
* src/geniustests.txt: add a few tests
* help/C/*.xml: Fixes from Luc Pionchon that I totally forgot about
for 1.0.15
ChangeLog | 15 ++++++++++++++
NEWS | 12 +++++++++++
configure.in | 2 +-
help/C/gel-function-list.xml | 29 +++++++++++++++------------
help/C/genius.xml | 31 +++++-----------------------
lib/combinatorics/factorial.gel | 4 +-
lib/combinatorics/misc.gel | 2 +-
lib/combinatorics/recursive_sequences.gel | 15 ++++++++++---
lib/functions/delta.gel | 7 +----
lib/library-strings.c | 26 ++++++++++++------------
lib/linear_algebra/linear_algebra.gel | 4 +-
lib/linear_algebra/misc.gel | 2 +-
lib/number_theory/factoring.gel | 2 +-
lib/number_theory/modulus.gel | 4 +-
lib/number_theory/primes.gel | 2 +-
lib/symbolic/differentiation.gel | 2 +-
src/calc.c | 2 +-
src/eval.c | 20 +++++++++---------
src/funclib.c | 6 ++--
src/geniustests.txt | 14 +++++++++++++
src/mpwrap.c | 18 ++++++++--------
21 files changed, 124 insertions(+), 95 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index ff11173..b7fcc14 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+Thu Mar 29 10:35:45 2012 Jiri (George) Lebl <jirka 5z com>
+
+ * src/calc.c, src/eval.c, src/funclib.c, lib/*/*.gel: fix some
+ spelling and capitalization
+
+ * help/C/gel-function-list.xml: fix spelling
+
+ * combinatorics/recursive_sequences.gel: Fix LinearRecursiveSequence,
+ and also allow it to take matrix argument
+
+ * src/geniustests.txt: add a few tests
+
+ * help/C/*.xml: Fixes from Luc Pionchon that I totally forgot about
+ for 1.0.15
+
Wed Mar 28 17:08:55 2012 Jiri (George) Lebl <jirka 5z com>
* src/calc.c: fix possible uninitialized use when reading
diff --git a/NEWS b/NEWS
index 50cfc70..69f5cfd 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,15 @@
+Changes to 1.0.16
+
+* Simpler output when typing "help foo" when foo is neither defined nor
+ documented.
+* Fix possible uninitialized crash when reading badly formed standard library
+ (should never happen but ...)
+* Fix LinearRecursiveSequence
+* Spelling fixes and documentation fixes (me, LucPionchon)
+
+* For some of the changes the author (Jiri) was partially supported by
+ NSF grant DMS 0900885 and the University of Wisconsin-Madison
+
Changes to 1.0.15
* New functions CurrentTime, MacaulayRep, MacaulayLowerOperator, MacaulayBound.
diff --git a/configure.in b/configure.in
index 51dd5d5..ca36da8 100644
--- a/configure.in
+++ b/configure.in
@@ -1,7 +1,7 @@
AC_INIT(src/calc.c)
AM_CONFIG_HEADER(config.h)
-AM_INIT_AUTOMAKE(genius,1.0.15)
+AM_INIT_AUTOMAKE(genius,1.0.16)
dnl make sure we keep ACLOCAL_FLAGS around for maintainer builds to work
AC_SUBST(ACLOCAL_AMFLAGS, "$ACLOCAL_FLAGS")
diff --git a/help/C/gel-function-list.xml b/help/C/gel-function-list.xml
index 1eff94e..e2ae973 100644
--- a/help/C/gel-function-list.xml
+++ b/help/C/gel-function-list.xml
@@ -1752,7 +1752,7 @@ number is specified) of the given size returned. For example,
<listitem>
<synopsis>FermatFactorization (n,tries)</synopsis>
<para>
- Attempt fermat factorization of <varname>n</varname> into
+ 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
@@ -2608,7 +2608,10 @@ functions make this check. Values can be any number including complex numbers.<
<listitem>
<synopsis>MakeDiagonal (v,arg...)</synopsis>
<para>Aliases: <function>diag</function></para>
- <para>Make diagonal matrix from a vector.</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
@@ -2690,7 +2693,7 @@ vector with the result.</para>
<term>RowSumSquares</term>
<listitem>
<synopsis>RowSumSquares (m)</synopsis>
- <para>Calculate sum of squares of each row in a matrix.</para>
+ <para>Calculate sum of squares of each row in a matrix and return a vertical vector with the results.</para>
</listitem>
</varlistentry>
@@ -3116,7 +3119,7 @@ a sesquilinear form. The vectors will be made orthonormal with respect to
<term>IsInvertible</term>
<listitem>
<synopsis>IsInvertible (n)</synopsis>
- <para>Is a matrix (or number) invertible (Integer matrix is invertible iff it's invertible over the integers).</para>
+ <para>Is a matrix (or number) invertible (Integer matrix is invertible if and only if it is invertible over the integers).</para>
</listitem>
</varlistentry>
@@ -3451,7 +3454,7 @@ function of two arguments or it can be a matrix giving a sesquilinear form.
<term>RosserMatrix</term>
<listitem>
<synopsis>RosserMatrix ()</synopsis>
- <para>Rosser matrix, a classic symmetric eigenvalue test problem.</para>
+ <para>Returns the Rosser matrix, which is a classic symmetric eigenvalue test problem.</para>
</listitem>
</varlistentry>
@@ -3694,7 +3697,7 @@ divided to make all pivots 1.</para>
<term>Catalan</term>
<listitem>
<synopsis>Catalan (n)</synopsis>
- <para>Get <varname>n</varname>'th catalan number.</para>
+ <para>Get <varname>n</varname>th Catalan number.</para>
<para>
See
<ulink url="http://planetmath.org/encyclopedia/CatalanNumbers.html">Planetmath</ulink> for more information.
@@ -3818,7 +3821,7 @@ divided to make all pivots 1.</para>
<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>
+ <para>Harmonic Number, the <varname>n</varname>th harmonic number of order <varname>r</varname>.</para>
</listitem>
</varlistentry>
@@ -3834,7 +3837,7 @@ divided to make all pivots 1.</para>
<term>LinearRecursiveSequence</term>
<listitem>
<synopsis>LinearRecursiveSequence (seed_values,combining_rule,n)</synopsis>
- <para>Compute linear recursive sequence using galois stepping.</para>
+ <para>Compute linear recursive sequence using Galois stepping.</para>
</listitem>
</varlistentry>
@@ -3974,7 +3977,7 @@ do (
<term>Triangular</term>
<listitem>
<synopsis>Triangular (nth)</synopsis>
- <para>Calculate the <varname>n</varname>'th triangular number.</para>
+ <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.
@@ -4425,7 +4428,7 @@ and has period <userinput>b-a</userinput>.</para>
<term>DiscreteDelta</term>
<listitem>
<synopsis>DiscreteDelta (v)</synopsis>
- <para>Returns 1 iff all elements are zero.</para>
+ <para>Returns 1 if and only if all elements are zero.</para>
</listitem>
</varlistentry>
@@ -4472,7 +4475,7 @@ and has period <userinput>b-a</userinput>.</para>
<term>KroneckerDelta</term>
<listitem>
<synopsis>KroneckerDelta (v)</synopsis>
- <para>Returns 1 iff all elements are equal.</para>
+ <para>Returns 1 if and only if all elements are equal.</para>
</listitem>
</varlistentry>
@@ -5252,7 +5255,7 @@ and has period <userinput>b-a</userinput>.</para>
<term>SymbolicTaylorApproximationFunction</term>
<listitem>
<synopsis>SymbolicTaylorApproximationFunction (f,x0,n)</synopsis>
- <para>Attempt to construct the taylor approximation function around x0 to the nth degree.
+ <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>
@@ -5312,7 +5315,7 @@ and has period <userinput>b-a</userinput>.</para>
<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 line.
+ <varname>n</varname> by 2 matrix for a longer polyline.
</para>
<para>
Extra parameters can be added to specify line color, thickness,
diff --git a/help/C/genius.xml b/help/C/genius.xml
index 422b8bc..9341f52 100644
--- a/help/C/genius.xml
+++ b/help/C/genius.xml
@@ -266,10 +266,6 @@ linkend="mainwindow-fig"/> is displayed.</para>
<imagedata fileref="figures/genius_window.png" format="PNG"
scale="50" scalefit="1"/>
</imageobject>
- <imageobject>
- <imagedata fileref="figures/genius_window.eps" format="EPS"
-scale="50" scalefit="1"/>
- </imageobject>
<textobject>
<phrase>Shows &app; main window. Contains titlebar, menubar,
toolbar and working area. Menubar contains <guilabel>File</guilabel>,
@@ -471,9 +467,6 @@ See <xref linkend="lineplot-fig"/>.
<imageobject>
<imagedata fileref="figures/line_plot.png" format="PNG" scale="50" scalefit="1"/>
</imageobject>
- <imageobject>
- <imagedata fileref="figures/line_plot.eps" format="EPS" scale="50" scalefit="1"/>
- </imageobject>
<textobject>
<phrase>Shows the line plotting window.</phrase>
</textobject>
@@ -500,9 +493,6 @@ See <xref linkend="lineplot-fig"/>.
<imageobject>
<imagedata fileref="figures/line_plot_graph.png" format="PNG" scale="50" scalefit="1"/>
</imageobject>
- <imageobject>
- <imagedata fileref="figures/line_plot_graph.eps" format="EPS" scale="50" scalefit="1"/>
- </imageobject>
<textobject>
<phrase>The graph produced.</phrase>
</textobject>
@@ -540,9 +530,6 @@ See <xref linkend="lineplot-fig"/>.
<imageobject>
<imagedata fileref="figures/parametric.png" format="PNG" scale="50" scalefit="1"/>
</imageobject>
- <imageobject>
- <imagedata fileref="figures/parametric.eps" format="EPS" scale="50" scalefit="1"/>
- </imageobject>
<textobject>
<phrase>Parametric plotting tab in the <guilabel>Create Plot</guilabel> window.</phrase>
</textobject>
@@ -552,7 +539,7 @@ See <xref linkend="lineplot-fig"/>.
<para>
An example of a parametric plot is given in
- <xref linkend="paramplot-fig"/>.
+ <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
@@ -567,9 +554,6 @@ See <xref linkend="lineplot-fig"/>.
<imageobject>
<imagedata fileref="figures/parametric_graph.png" format="PNG" scale="50" scalefit="1"/>
</imageobject>
- <imageobject>
- <imagedata fileref="figures/parametric_graph.eps" format="EPS" scale="50" scalefit="1"/>
- </imageobject>
<textobject>
<phrase>Parametric plot produced</phrase>
</textobject>
@@ -672,9 +656,6 @@ See <xref linkend="lineplot-fig"/>.
<imageobject>
<imagedata fileref="figures/surface_graph.png" format="PNG" scale="50" scalefit="1"/>
</imageobject>
- <imageobject>
- <imagedata fileref="figures/surface_graph.eps" format="EPS" scale="50" scalefit="1"/>
- </imageobject>
<textobject>
<phrase>Modulus of the complex cosine function.</phrase>
</textobject>
@@ -695,7 +676,7 @@ See <xref linkend="lineplot-fig"/>.
stands for George's Ego Leverage. --> It is the language you use
to write programs in &appname;. A program in GEL is simply an
expression that evaluates to a number.
- &app; can therefore be used as a simple calculator, or as a
+ &app; 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.
@@ -749,7 +730,7 @@ The next type if number is floating point. These are entered in a similar fashio
</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. The imaginary part ends with an <literal>i</literal>. Here are examples of entering complex numbers:
+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)
@@ -1525,7 +1506,7 @@ different from <literal>=</literal> because it never gets translated to a
<term><synopsis>*a</synopsis></term>
<listitem>
<para>
- Variable dereferencing (to access a referenced varible).
+ Variable dereferencing (to access a referenced variable).
See <xref linkend='genius-gel-references' />.
</para>
</listitem>
@@ -2309,7 +2290,7 @@ g(5)
</para>
<para>
When you want the function to not have any private dictionary
- when put empty square brackets after the argument list. Then
+ 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
@@ -2748,7 +2729,7 @@ 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("ref: argument not a value only matrix");bailout);
+ (error("MyOwnREF: argument not a value only matrix");bailout);
s := min(rows(m), columns(m));
i := 1;
d := 1;
diff --git a/lib/combinatorics/factorial.gel b/lib/combinatorics/factorial.gel
index 9133087..4fff94f 100644
--- a/lib/combinatorics/factorial.gel
+++ b/lib/combinatorics/factorial.gel
@@ -11,7 +11,7 @@ function Subfactorial(n) = (
(n!) * sum k=1 to n do ((-1)^k)/(k!)
)
-SetHelp("Catalan","combinatorics","Get n'th catalan number");
+SetHelp("Catalan","combinatorics","Get nth Catalan number");
function Catalan(n) = (
if(IsMatrix(n)) then
return ApplyOverMatrix(n,Catalan)
@@ -99,7 +99,7 @@ function Multinomial(v,arg...) = (
MatrixSum(m)!/MatrixProduct(ApplyOverMatrix(m,`(x)[]=x!))
)
-SetHelp("Pascal","combinatorics","Get the pascal's triangle as a matrix");
+SetHelp("Pascal","combinatorics","Get the Pascal's triangle as a matrix");
function Pascal(i) = (
if not IsNonNegativeInteger(i) then
(error("Pascal: argument not a non-negative integer");bailout);
diff --git a/lib/combinatorics/misc.gel b/lib/combinatorics/misc.gel
index 38cc517..1294341 100644
--- a/lib/combinatorics/misc.gel
+++ b/lib/combinatorics/misc.gel
@@ -25,7 +25,7 @@ function Hofstadter(n) = (
# return the Fibonacci number, calculated using an iterative method
-SetHelp("Fibonacci", "combinatorics", "Calculate n'th Fibonacci number");
+SetHelp("Fibonacci", "combinatorics", "Calculate nth Fibonacci number");
function Fibonacci(x) = (
if(IsMatrix(x)) then
return ApplyOverMatrix(x,fib)
diff --git a/lib/combinatorics/recursive_sequences.gel b/lib/combinatorics/recursive_sequences.gel
index 67992b4..2c9f79c 100644
--- a/lib/combinatorics/recursive_sequences.gel
+++ b/lib/combinatorics/recursive_sequences.gel
@@ -1,25 +1,32 @@
-# Compute linear recursive sequences using galois stepping (I think --
+# Compute linear recursive sequences using Galois stepping (I think --
# or maybe I have it backwards)
# FIXME: Check names for this stuff!
# Galois Matrix
# Given a linear combining rule (a_1*x_+...+a_n*x_n=x_(n+1)),
-# gives the galois stepping matrix
+# gives the Galois stepping matrix
SetHelp ("GaloisMatrix", "combinatorics", "Galois matrix given a linear combining rule (a_1*x_+...+a_n*x_n=x_(n+1))")
function GaloisMatrix(combining_rule) = (
[[0;I(columns(combining_rule)-1)],combining_rule.']
)
# Linear recursive sequence
-SetHelp ("LinearRecursiveSequence", "combinatorics", "Compute linear recursive sequence using galois stepping")
+SetHelp ("LinearRecursiveSequence", "combinatorics", "Compute linear recursive sequence using Galois stepping")
function LinearRecursiveSequence(seed_values,combining_rule,n) =
(
+ if IsNull(n) then return null;
+ if IsMatrix(n) then (
+ for j=1 to elements(n) do (
+ n@(j) = LinearRecursiveSequence(seed_values,combining_rule,n@(j))
+ );
+ return n
+ );
k=columns(seed_values);
if (k > n >= 0) then # If asks for one of the seed values, return it
seed_values@(n+1)
else # otherwise...
(
- G=galois_matrix(combining_rule); # form the galois matrix
+ G=GaloisMatrix(combining_rule); # form the Galois matrix
if (n >= k) then
(seed_values*G^(n-k+1))@(k) # ...and step it enough times
else if (IsInvertible(G)) then
diff --git a/lib/functions/delta.gel b/lib/functions/delta.gel
index 1ccef22..ee16590 100644
--- a/lib/functions/delta.gel
+++ b/lib/functions/delta.gel
@@ -6,11 +6,8 @@
## Discrete Delta
## Takes a vector v and returns 1 if any entry is non-zero, 0 otherwise
-## FIXME: Is this right?
-## FIXME: this works fine for vectors, but I need to cast matrices
-# as vectors to get it to work for matrices.
function DiscreteDelta(v) = KroneckerDelta([0,v])
-SetHelp("DiscreteDelta","functions","Returns 1 iff all elements are zero");
+SetHelp("DiscreteDelta","functions","Returns 1 if and only if all elements are zero");
## Kronecker Delta
## Takes a vector v and returns 1 if all entries are equal,
@@ -23,7 +20,7 @@ function KroneckerDelta(v) =
);
1
)
-SetHelp("KroneckerDelta","functions","Returns 1 iff all elements are equal");
+SetHelp("KroneckerDelta","functions","Returns 1 if and only if all elements are equal");
## Unit Step Function
## The integral of the Dirac Delta function
diff --git a/lib/library-strings.c b/lib/library-strings.c
index c378833..0a1dcef 100644
--- a/lib/library-strings.c
+++ b/lib/library-strings.c
@@ -44,10 +44,10 @@ char *fake = N_("Find the x that solves the system given by the vector a and mod
char *fake = N_("Given two factorizations, give the factorization of the product, see Factorize");
char *fake = N_("Convert a vector of values indicating powers of b to a number");
char *fake = N_("Convert a number to a vector of powers for elements in base b");
-char *fake = N_("Find discrete log of n base b in F_q where q is a prime using the Silver-Pohlig-Hellman algoritm");
+char *fake = N_("Find discrete log of n base b in F_q where q is a prime using the Silver-Pohlig-Hellman algorithm");
char *fake = N_("Compute phi(n), the Euler phi function, that is the number of integers between 1 and n relatively prime to n");
char *fake = N_("Return all factors of a number");
-char *fake = N_("Attempt fermat factorization of n into (t-s)*(t+s), returns t and s as a vector if possible, null otherwise");
+char *fake = N_("Attempt Fermat factorization of n into (t-s)*(t+s), returns t and s as a vector if possible, null otherwise");
char *fake = N_("Find the first primitive element in F_q (q must be a prime)");
char *fake = N_("Find a random primitive element in F_q (q must be a prime)");
char *fake = N_("Compute discrete log base b of n in F_q (q a prime) using the factor base S. S should be a column of primes possibly with second column precalculated by IndexCalculusPrecalculation.");
@@ -66,9 +66,9 @@ char *fake = N_("Return the Moebius mu function evaluated in n");
char *fake = N_("Returns the p-adic valuation (number of trailing zeros in base p).");
char *fake = N_("Compute a^b mod m");
char *fake = N_("Return all prime factors of a number");
-char *fake = N_("Pseudoprime test, true iff b^(n-1) == 1 (mod n)");
+char *fake = N_("Pseudoprime test, true if and only if b^(n-1) == 1 (mod n)");
char *fake = N_("Removes all instances of the factor m from the number n");
-char *fake = N_("Find discrete log of n base b in F_q where q is a prime using the Silver-Pohlig-Hellman algoritm, given f being the factorization of q-1");
+char *fake = N_("Find discrete log of n base b in F_q where q is a prime using the Silver-Pohlig-Hellman algorithm, given f being the factorization of q-1");
char *fake = N_("Find square root of n mod p (a prime). Null is returned if not a quadratic residue.");
char *fake = N_("Apply a function over all entries of a matrix and return a matrix of the results");
char *fake = N_("Apply a function over all entries of 2 matrices (or 1 value and 1 matrix) and return a matrix of the results");
@@ -119,14 +119,14 @@ char *fake = N_("Get the invariant factors of a square integer matrix (not its c
char *fake = N_("Inverse Hilbert matrix of order n");
char *fake = N_("Is a matrix Hermitian");
char *fake = N_("Test if a vector is in a subspace");
-char *fake = N_("Is a matrix (or number) invertible (Integer matrix is invertible iff it's invertible over the integers)");
+char *fake = N_("Is a matrix (or number) invertible (Integer matrix is invertible if and only if it is invertible over the integers)");
char *fake = N_("Is a matrix (or number) invertible over a field");
char *fake = N_("Is a matrix normal");
char *fake = N_("Is a matrix positive definite");
char *fake = N_("Is a matrix positive semidefinite");
char *fake = N_("Is a matrix skew-Hermitian");
char *fake = N_("Is a matrix unitary");
-char *fake = N_("Get the jordan block corresponding to lambda and n");
+char *fake = N_("Get the Jordan block corresponding to lambda and n");
char *fake = N_("Get the kernel (nullspace) of a linear transform");
char *fake = N_("Get the LU decomposition of A and store the result in the L and U which should be references. If not possible returns false.");
char *fake = N_("Get the i-j minor of a matrix");
@@ -159,19 +159,19 @@ char *fake = N_("Intersection of the subspaces given by M and N");
char *fake = N_("The sum of the vector spaces M and N, that is {w | w=m+n, m in M, n in N}");
char *fake = N_("Get the classical adjoint (adjugate) of a matrix");
char *fake = N_("Compute the Column Reduced Echelon Form");
-char *fake = N_("Get n'th catalan number");
+char *fake = N_("Get nth Catalan number");
char *fake = N_("Double factorial: n(n-2)(n-4)...");
char *fake = N_("Factorial: n(n-1)(n-2)...");
char *fake = N_("Falling factorial: (n)_k = n(n-1)...(n-(k-1))");
-char *fake = N_("Calculate n'th Fibonacci number");
+char *fake = N_("Calculate nth Fibonacci number");
char *fake = N_("Calculate the Frobenius number for a coin problem");
char *fake = N_("Galois matrix given a linear combining rule (a_1*x_+...+a_n*x_n=x_(n+1))");
char *fake = N_("Use greedy algorithm to find c, for c . v = n. (v must be sorted)");
char *fake = N_("Harmonic Number, the nth harmonic number of order r");
char *fake = N_("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))");
-char *fake = N_("Compute linear recursive sequence using galois stepping");
+char *fake = N_("Compute linear recursive sequence using Galois stepping");
char *fake = N_("Calculate multinomial coefficients");
-char *fake = N_("Get the pascal's triangle as a matrix");
+char *fake = N_("Get the Pascal's triangle as a matrix");
char *fake = N_("(Pochhammer) Rising factorial: (n)_k = n(n+1)...(n+(k-1))");
char *fake = N_("Stirling number of the first kind");
char *fake = N_("Stirling number of the second kind");
@@ -211,10 +211,10 @@ char *fake = N_("Compute two-sided derivative using five-point formula");
char *fake = N_("Compute two-sided derivative using three-point formula");
char *fake = N_("argument (angle) of complex number");
char *fake = N_("Dirichlet kernel of order n");
-char *fake = N_("Returns 1 iff all elements are zero");
+char *fake = N_("Returns 1 if and only if all elements are zero");
char *fake = N_("The error function, 2/sqrt(pi) * int_0^x e^(-t^2) dt");
char *fake = N_("Fejer kernel of order n");
-char *fake = N_("Returns 1 iff all elements are equal");
+char *fake = N_("Returns 1 if and only if all elements are equal");
char *fake = N_("Find the first value where f(x)=0");
char *fake = N_("Moebius mapping of the disk to itself mapping a to 0");
char *fake = N_("Moebius mapping using the cross ratio taking z2,z3,z4 to 1,0, and infinity respectively");
@@ -256,4 +256,4 @@ char *fake = N_("The c_<d> operator from Green's proof of Macaulay's Theorem");
char *fake = N_("Return the dth Macaulay representation of a positive integer c");
char *fake = N_("Attempt to symbolically differentiate a function n times");
char *fake = N_("Attempt to symbolically differentiate a function n times quietly and return null on failure");
-char *fake = N_("Attempt to construct the taylor approximation function around x0 to the nth degree.");
+char *fake = N_("Attempt to construct the Taylor approximation function around x0 to the nth degree.");
diff --git a/lib/linear_algebra/linear_algebra.gel b/lib/linear_algebra/linear_algebra.gel
index 02edd65..4223111 100644
--- a/lib/linear_algebra/linear_algebra.gel
+++ b/lib/linear_algebra/linear_algebra.gel
@@ -146,7 +146,7 @@ function DirectSum(M,N...) = (
# Note that given an integer matrix, returns true iff it is invertible OVER THE INTEGERS,
# so for instance [2,0;0,1] is not invertible
# FIXME: We need good coercion rules!
-SetHelp ("IsInvertible", "linear_algebra", "Is a matrix (or number) invertible (Integer matrix is invertible iff it's invertible over the integers)")
+SetHelp ("IsInvertible", "linear_algebra", "Is a matrix (or number) invertible (Integer matrix is invertible if and only if it is invertible over the integers)")
function IsInvertible(n) =
(
if IsNull (n) then return false
@@ -199,7 +199,7 @@ function AuxiliaryUnitMatrix(n) =
[0,I(n-1);0,0]
)
-SetHelp("JordanBlock", "linear_algebra", "Get the jordan block corresponding to lambda and n")
+SetHelp("JordanBlock", "linear_algebra", "Get the Jordan block corresponding to lambda and n")
function JordanBlock(n,lambda) =
(
if not IsInteger (n) or n < 1 then
diff --git a/lib/linear_algebra/misc.gel b/lib/linear_algebra/misc.gel
index 6771f55..4599df7 100644
--- a/lib/linear_algebra/misc.gel
+++ b/lib/linear_algebra/misc.gel
@@ -24,7 +24,7 @@ function ApplyOverMatrix2(a,b,func) = (
else if(IsMatrix(a) and IsMatrix(b) and
(rows(a)!=rows(b) or columns(a)!=columns(b))) then
- (error("ApplyOverMatrix2: cannot apply a function over two matrixes of different sizes");bailout);
+ (error("ApplyOverMatrix2: cannot apply a function over two matrices of different sizes");bailout);
if IsMatrix(a) and IsMatrix(b) then (
r = zeros(rows(a),columns(a));
diff --git a/lib/number_theory/factoring.gel b/lib/number_theory/factoring.gel
index a222e7a..ad07549 100644
--- a/lib/number_theory/factoring.gel
+++ b/lib/number_theory/factoring.gel
@@ -101,7 +101,7 @@ function Factors(n) =
r@(2:elements(r)-1)
)
-SetHelp("FermatFactorization", "number_theory", "Attempt fermat factorization of n into (t-s)*(t+s), returns t and s as a vector if possible, null otherwise")
+SetHelp("FermatFactorization", "number_theory", "Attempt Fermat factorization of n into (t-s)*(t+s), returns t and s as a vector if possible, null otherwise")
function FermatFactorization(n,tries) = (
if not IsPositiveInteger(n) or not IsPositiveInteger(tries) then
(error("FermatFactorization: arguments not positive integers");bailout);
diff --git a/lib/number_theory/modulus.gel b/lib/number_theory/modulus.gel
index 6323ee1..77c675e 100644
--- a/lib/number_theory/modulus.gel
+++ b/lib/number_theory/modulus.gel
@@ -15,7 +15,7 @@ function EulerPhi(n) =
# Silver-Pohlig-Hellman as described in
# Neil Koblitz, A Course in Number Theory and Cryptography, Springer, 1987
# page 102-103
-SetHelp("SilverPohligHellmanWithFactorization", "number_theory", "Find discrete log of n base b in F_q where q is a prime using the Silver-Pohlig-Hellman algoritm, given f being the factorization of q-1");
+SetHelp("SilverPohligHellmanWithFactorization", "number_theory", "Find discrete log of n base b in F_q where q is a prime using the Silver-Pohlig-Hellman algorithm, given f being the factorization of q-1");
function SilverPohligHellmanWithFactorization(n,b,q,f) = (
if not IsPositiveInteger(n) or
not IsPositiveInteger(b) or
@@ -62,7 +62,7 @@ function SilverPohligHellmanWithFactorization(n,b,q,f) = (
)
# compute the discrete log using the SilverPohligHellman alg
-SetHelp("DiscreteLog", "number_theory", "Find discrete log of n base b in F_q where q is a prime using the Silver-Pohlig-Hellman algoritm");
+SetHelp("DiscreteLog", "number_theory", "Find discrete log of n base b in F_q where q is a prime using the Silver-Pohlig-Hellman algorithm");
function DiscreteLog(n,b,q) = (
if not IsPositiveInteger(n) or
not IsPositiveInteger(b) or
diff --git a/lib/number_theory/primes.gel b/lib/number_theory/primes.gel
index 58dc14b..8fda2c7 100644
--- a/lib/number_theory/primes.gel
+++ b/lib/number_theory/primes.gel
@@ -12,7 +12,7 @@
# Returns true iff b^(n-1) == 1 (mod n).
# FIXME: Should we take |n| if n is negative?
# FIXME: is there a good name for an integer that is EITHER a pseudoprime OR a prime?
-SetHelp("PseudoprimeTest","number_theory","Pseudoprime test, true iff b^(n-1) == 1 (mod n)");
+SetHelp("PseudoprimeTest","number_theory","Pseudoprime test, true if and only if b^(n-1) == 1 (mod n)");
function PseudoprimeTest(n,b) =
(
b^(|n|-1) == 1 mod |n|
diff --git a/lib/symbolic/differentiation.gel b/lib/symbolic/differentiation.gel
index 59a0364..c6acf35 100644
--- a/lib/symbolic/differentiation.gel
+++ b/lib/symbolic/differentiation.gel
@@ -60,4 +60,4 @@ function SymbolicTaylorApproximationFunction(f,x0,n) =
tp = PolyToFunction (c);
`(x)[tp,x0] = (tp call (x - x0))
)
-SetHelp("SymbolicTaylorApproximationFunction","symbolic","Attempt to construct the taylor approximation function around x0 to the nth degree.");
+SetHelp("SymbolicTaylorApproximationFunction","symbolic","Attempt to construct the Taylor approximation function around x0 to the nth degree.");
diff --git a/src/calc.c b/src/calc.c
index bc6ba2f..0d61ff4 100644
--- a/src/calc.c
+++ b/src/calc.c
@@ -2589,7 +2589,7 @@ print_command_help (const char *cmd)
if (strcmp (cmd, "load") == 0) {
gel_output_full_string (gel_main_out,
- _("Load a file into the interpretor"));
+ _("Load a file into the interpreter"));
} else if (strcmp (cmd, "plugin") == 0) {
gel_output_full_string (gel_main_out,
_("Load a plugin"));
diff --git a/src/eval.c b/src/eval.c
index 9503b32..a49bc90 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -1448,7 +1448,7 @@ eqmatrix(GelETree *a, GelETree *b, int *error)
b->type == GEL_MATRIX_NODE) {
if G_UNLIKELY (!gel_is_matrix_value_or_bool_only(a->mat.matrix) ||
!gel_is_matrix_value_or_bool_only(b->mat.matrix)) {
- gel_errorout (_("Cannot compare non value or bool only matrixes"));
+ gel_errorout (_("Cannot compare non value or bool only matrices"));
*error = TRUE;
return 0;
}
@@ -1505,7 +1505,7 @@ eqmatrix(GelETree *a, GelETree *b, int *error)
GelETree *t = gel_matrixw_index(m,0,0);
if G_UNLIKELY (t->type != GEL_VALUE_NODE &&
t->type != GEL_BOOL_NODE) {
- gel_errorout (_("Cannot compare non value or bool only matrixes"));
+ gel_errorout (_("Cannot compare non value or bool only matrices"));
*error = TRUE;
return 0;
}
@@ -1520,7 +1520,7 @@ eqmatrix(GelETree *a, GelETree *b, int *error)
GelETree *t = gel_matrixw_index(m,0,0);
if G_UNLIKELY (t->type != GEL_VALUE_NODE &&
t->type != GEL_BOOL_NODE) {
- gel_errorout (_("Cannot compare non value or bool only matrixes"));
+ gel_errorout (_("Cannot compare non value or bool only matrices"));
*error = TRUE;
return 0;
}
@@ -1924,9 +1924,9 @@ pure_matrix_eltbyelt_op(GelCtx *ctx, GelETree *n, GelETree *l, GelETree *r)
n->op.oper == GEL_E_ELTPLUS ||
n->op.oper == GEL_E_MINUS ||
n->op.oper == GEL_E_ELTMINUS)
- gel_errorout (_("Can't add/subtract two matricies of different sizes"));
+ gel_errorout (_("Can't add/subtract two matrices of different sizes"));
else
- gel_errorout (_("Can't do element by element operations on two matricies of different sizes"));
+ gel_errorout (_("Can't do element by element operations on two matrices of different sizes"));
return TRUE;
}
l->mat.quoted = l->mat.quoted || r->mat.quoted;
@@ -1992,7 +1992,7 @@ pure_matrix_mul_op(GelCtx *ctx, GelETree *n, GelETree *l, GelETree *r)
m1 = l->mat.matrix;
m2 = r->mat.matrix;
if G_UNLIKELY ((gel_matrixw_width(m1) != gel_matrixw_height(m2))) {
- gel_errorout (_("Can't multiply matricies of wrong sizes"));
+ gel_errorout (_("Can't multiply matrices of wrong sizes"));
return TRUE;
}
m = gel_matrixw_new();
@@ -3607,7 +3607,7 @@ evalcomp(GelETree *n)
}
break;
default:
- gel_errorout (_("Cannot compare matrixes"));
+ gel_errorout (_("Cannot compare matrices"));
gel_error_num = GEL_NO_ERROR;
return;
}
@@ -6291,7 +6291,7 @@ iter_get_velement (GelETree *n)
GEL_GET_LR (n, m, index);
if G_UNLIKELY (m->type != GEL_MATRIX_NODE) {
- gel_errorout (_("Index works only on matricies"));
+ gel_errorout (_("Index works only on matrices"));
return;
}
@@ -6336,7 +6336,7 @@ iter_get_element (GelETree *n)
GEL_GET_LRR (n, m, index1, index2);
if G_UNLIKELY (m->type != GEL_MATRIX_NODE) {
- gel_errorout (_("Index works only on matricies"));
+ gel_errorout (_("Index works only on matrices"));
return;
} else if G_UNLIKELY (index1->type != GEL_NULL_NODE &&
index1->type != GEL_MATRIX_NODE &&
@@ -6427,7 +6427,7 @@ iter_get_region (GelETree *n, gboolean col)
GEL_GET_LR (n, m, index);
if G_UNLIKELY (m->type != GEL_MATRIX_NODE) {
- gel_errorout (_("Index works only on matricies"));
+ gel_errorout (_("Index works only on matrices"));
return;
} else if G_LIKELY (index->type == GEL_VALUE_NODE ||
index->type == GEL_MATRIX_NODE) {
diff --git a/src/funclib.c b/src/funclib.c
index 0f19714..131f3ac 100644
--- a/src/funclib.c
+++ b/src/funclib.c
@@ -819,7 +819,7 @@ gel_apply_func_to_matrixen (GelCtx *ctx,
if G_UNLIKELY (m2 && (gel_matrixw_width(m1) != gel_matrixw_width(m2) ||
gel_matrixw_height(m1) != gel_matrixw_height(m2))) {
- gel_errorout (_("Cannot apply function to two differently sized matrixes"));
+ gel_errorout (_("Cannot apply function to two differently sized matrices"));
return NULL;
}
@@ -6484,13 +6484,13 @@ gel_funclib_addall(void)
VALIAS (LCM, 2, lcm);
FUNC (IsPerfectSquare, 1, "n", "number_theory", N_("Check a number for being a perfect square"));
FUNC (IsPerfectPower, 1, "n", "number_theory", N_("Check a number for being any perfect power (a^b)"));
- FUNC (Prime, 1, "n", "number_theory", N_("Return the n'th prime (up to a limit)"));
+ FUNC (Prime, 1, "n", "number_theory", N_("Return the nth prime (up to a limit)"));
ALIAS (prime, 1, Prime);
FUNC (IsEven, 1, "n", "number_theory", N_("Tests if an integer is even"));
FUNC (IsOdd, 1, "n", "number_theory", N_("Tests if an integer is odd"));
FUNC (NextPrime, 1, "n", "number_theory", N_("Returns the least prime greater than n (if n is positive)"));
- FUNC (LucasNumber, 1, "n", "number_theory", N_("Returns the n'th Lucas number"));
+ FUNC (LucasNumber, 1, "n", "number_theory", N_("Returns the nth Lucas number"));
FUNC (ModInvert, 2, "n,m", "number_theory", N_("Returns inverse of n mod m"));
FUNC (Divides, 2, "m,n", "number_theory", N_("Checks divisibility (if m divides n)"));
FUNC (ExactDivision, 2, "n,d", "number_theory", N_("Return n/d but only if d divides n else returns garbage (this is faster than writing n/d)"));
diff --git a/src/geniustests.txt b/src/geniustests.txt
index 65698e8..9fa83f3 100644
--- a/src/geniustests.txt
+++ b/src/geniustests.txt
@@ -1090,6 +1090,20 @@ MacaulayLowerOperator(27,3) 13
(-8)^(-2/3) 1/4
(-1/8)^(-2/3) 4
(-2)^(-2/3) 0.629960524947
+KroneckerDelta([1,1,1]) 1
+KroneckerDelta([1;1;1]) 1
+KroneckerDelta([1;1,1]) 0
+KroneckerDelta([10,12]) 0
+DiscreteDelta([0,0]) 1
+DiscreteDelta([0;0]) 1
+DiscreteDelta([0,0;0,1]) 0
+DiscreteDelta([1,0;0,0]) 0
+LinearRecursiveSequence ([0,1],[1,1],6) 8
+LinearRecursiveSequence ([0,1],[1,1],[0,1,2,3,4,5,6]) [0,1,1,2,3,5,8]
+LinearRecursiveSequence ([0,1],[1,1],[0,1,2,3,4,5,6]) [0,1,1,2,3,5,8]
+LinearRecursiveSequence ([5,7],[1,2],2) 19
+LinearRecursiveSequence ([1,3,5],[1,2,-1],2) 2
+LinearRecursiveSequence ([1,3,5],[1,2,-1],null)+1 ((null)+1)
load "nullspacetest.gel" true
load "longtest.gel" true
load "testprec.gel" true
diff --git a/src/mpwrap.c b/src/mpwrap.c
index 215bf69..3dd5438 100644
--- a/src/mpwrap.c
+++ b/src/mpwrap.c
@@ -1514,7 +1514,7 @@ mpwl_jacobi(MpwRealNum *rop,MpwRealNum *op1,MpwRealNum *op2)
}
mpwl_set_si (rop, ret);
} else {
- gel_errorout (_("Can't get jacobi symbols of floats or rationals!"));
+ gel_errorout (_("Can't get Jacobi symbols of floats or rationals!"));
gel_error_num=GEL_NUMERICAL_MPW_ERROR;
}
}
@@ -1533,7 +1533,7 @@ mpwl_legendre(MpwRealNum *rop,MpwRealNum *op1,MpwRealNum *op2)
}
mpwl_set_si (rop, ret);
} else {
- gel_errorout (_("Can't get legendre symbols of floats or rationals!"));
+ gel_errorout (_("Can't get Legendre symbols of floats or rationals!"));
gel_error_num=GEL_NUMERICAL_MPW_ERROR;
}
}
@@ -1552,7 +1552,7 @@ mpwl_kronecker (MpwRealNum *rop, MpwRealNum *op1, MpwRealNum *op2)
}
mpwl_set_si (rop, ret);
} else {
- gel_errorout (_("Can't get jacobi symbol with Kronecker extension of floats or rationals!"));
+ gel_errorout (_("Can't get Jacobi symbol with Kronecker extension of floats or rationals!"));
gel_error_num=GEL_NUMERICAL_MPW_ERROR;
}
}
@@ -1567,12 +1567,12 @@ mpwl_lucnum (MpwRealNum *rop, MpwRealNum *op)
}
if G_UNLIKELY (mpz_cmp_ui(op->data.ival,G_MAXULONG)>0) {
- gel_errorout (_("Number too large to compute lucas number!"));
+ gel_errorout (_("Number too large to compute Lucas number!"));
gel_error_num=GEL_NUMERICAL_MPW_ERROR;
return;
}
if G_UNLIKELY (mpz_sgn(op->data.ival)<0) {
- gel_errorout (_("No such thing as negative lucas numbers!"));
+ gel_errorout (_("No such thing as negative Lucas numbers!"));
gel_error_num=GEL_NUMERICAL_MPW_ERROR;
return;
}
@@ -4043,7 +4043,7 @@ mpw_jacobi(mpw_ptr rop,mpw_ptr op1, mpw_ptr op2)
mpwl_jacobi(rop->r,op1->r,op2->r);
} else {
gel_error_num=GEL_NUMERICAL_MPW_ERROR;
- gel_errorout (_("Can't get jacobi symbols of complex numbers"));
+ gel_errorout (_("Can't get Jacobi symbols of complex numbers"));
}
}
void
@@ -4059,7 +4059,7 @@ mpw_legendre(mpw_ptr rop,mpw_ptr op1, mpw_ptr op2)
mpwl_legendre(rop->r,op1->r,op2->r);
} else {
gel_error_num=GEL_NUMERICAL_MPW_ERROR;
- gel_errorout (_("Can't get legendre symbols complex numbers"));
+ gel_errorout (_("Can't get Legendre symbols complex numbers"));
}
}
void
@@ -4075,7 +4075,7 @@ mpw_kronecker(mpw_ptr rop,mpw_ptr op1, mpw_ptr op2)
mpwl_kronecker(rop->r,op1->r,op2->r);
} else {
gel_error_num=GEL_NUMERICAL_MPW_ERROR;
- gel_errorout (_("Can't get jacobi symbol with Kronecker extension for complex numbers"));
+ gel_errorout (_("Can't get Jacobi symbol with Kronecker extension for complex numbers"));
}
}
void
@@ -4091,7 +4091,7 @@ mpw_lucnum (mpw_ptr rop, mpw_ptr op)
mpwl_lucnum (rop->r, op->r);
} else {
gel_error_num = GEL_NUMERICAL_MPW_ERROR;
- gel_errorout (_("Can't get lucas number for complex numbers"));
+ gel_errorout (_("Can't get Lucas number for complex numbers"));
}
}
void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]