[genius] Tue Jul 28 14:04:33 2009 Jiri (George) Lebl <jirka 5z com>
- From: George Lebl <jirka src gnome org>
- To: svn-commits-list gnome org
- Subject: [genius] Tue Jul 28 14:04:33 2009 Jiri (George) Lebl <jirka 5z com>
- Date: Tue, 28 Jul 2009 19:08:50 +0000 (UTC)
commit c8ab96114732082e518533a465b8e645ebc453cd
Author: Jiri (George) Lebl <jirka 5z com>
Date: Tue Jul 28 14:05:45 2009 -0500
Tue Jul 28 14:04:33 2009 Jiri (George) Lebl <jirka 5z com>
* NEWS: update,
* help/C/gel-function-list.xml: add more docs on the root finding
functions. There aren't very nice, but ...
* lib/equation_solving/find_root.gel: use true/false for booleans
rather than 0/1
ChangeLog | 10 ++++++++++
NEWS | 8 ++++----
help/C/gel-function-list.xml | 16 ++++++++++++----
help/C/genius.txt | 28 ++++++++++++++++++++++++----
lib/equation_solving/find_root.gel | 16 ++++++++--------
5 files changed, 58 insertions(+), 20 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index c3978ec..046c030 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+Tue Jul 28 14:04:33 2009 Jiri (George) Lebl <jirka 5z com>
+
+ * NEWS: update,
+
+ * help/C/gel-function-list.xml: add more docs on the root finding
+ functions. There aren't very nice, but ...
+
+ * lib/equation_solving/find_root.gel: use true/false for booleans
+ rather than 0/1
+
Mon Jul 27 15:22:57 2009 Jiri (George) Lebl <jirka 5z com>
* help/C/genius.xml, help/C/gel-function-list.xml: Update
diff --git a/NEWS b/NEWS
index 647ca51..eea883e 100644
--- a/NEWS
+++ b/NEWS
@@ -19,11 +19,11 @@ Changes to 1.0.7
NumericalFourierCosineSeriesCoefficients, PeriodicExtension,
EvenPeriodicExtension, OddPeriodicExtension
* Fix changing floating point precision!
-* Fix uninitialied variable in graphing (Matthias Drochner)
+* Fix uninitialized variable in graphing (Matthias Drochner)
* Improve variable substitution for returned functions to be more efficient.
Slightly changes behaviour with respect to global functions and variables
used.
-* Plot windows now not treated annoingly as dialogs
+* Plot windows now not treated annoyingly as dialogs
* Fix compilation/decompilation of all function attributes.
* Parse/Evaluate with a syntax error at end of string no longer terminate
genius
@@ -61,7 +61,7 @@ Changes to 1.0.6
Changes to 1.0.5
* Fix buffer overrun in print (Simon Munton)
-* Fix EulersMethod (and also fix it's documentation)
+* Fix EulersMethod (and also fix its documentation)
* EulersMethod and RungeKutta now solve systems by accepting vectors
* Fix several memory leaks
* Translation update (Jorge Gonzalez, Javier F. Serrador)
@@ -261,7 +261,7 @@ Changes to 0.7.5
* SEMANTICS: DotProduct is now the normal (real) DotProduct not the
hermitian product, places that used DotProduct now use HermitianProduct,
InnerProduct is now an alias for HermitianProduct
-* GramSchmidt now normalizes it's vectors
+* GramSchmidt now normalizes its vectors
* GramSchmidt, Projection, VectorAngle have the inner product as optional
argument now and all take it in the same way
* OuterProduct now actually does outer product
diff --git a/help/C/gel-function-list.xml b/help/C/gel-function-list.xml
index dae8e29..4db8fbe 100644
--- a/help/C/gel-function-list.xml
+++ b/help/C/gel-function-list.xml
@@ -4581,7 +4581,9 @@ and has period <userinput>b-a</userinput>.</para>
<term>FindRootBisection</term>
<listitem>
<synopsis>FindRootBisection (f,a,b,TOL,N)</synopsis>
- <para>Find root of a function using the bisection method.</para>
+ <para>Find root of a function using the bisection 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>
@@ -4589,7 +4591,9 @@ and has period <userinput>b-a</userinput>.</para>
<term>FindRootFalsePosition</term>
<listitem>
<synopsis>FindRootFalsePosition (f,a,b,TOL,N)</synopsis>
- <para>Find root of a function using the method of false position.</para>
+ <para>Find root of a function using the method of false position.
+ <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>
@@ -4597,7 +4601,9 @@ and has period <userinput>b-a</userinput>.</para>
<term>FindRootMullersMethod</term>
<listitem>
<synopsis>FindRootMullersMethod (f,x1,x2,x3,TOL,N)</synopsis>
- <para>Find root of a function using the Muller's method.</para>
+ <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>
@@ -4605,7 +4611,9 @@ and has period <userinput>b-a</userinput>.</para>
<term>FindRootSecant</term>
<listitem>
<synopsis>FindRootSecant (f,a,b,TOL,N)</synopsis>
- <para>Find root of a function using the secant method.</para>
+ <para>Find root of a function using the secant 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>
diff --git a/help/C/genius.txt b/help/C/genius.txt
index 5793ad4..14256bf 100644
--- a/help/C/genius.txt
+++ b/help/C/genius.txt
@@ -5399,25 +5399,45 @@
FindRootBisection (f,a,b,TOL,N)
- Find root of a function using the bisection method.
+ Find root of a function using the bisection method. TOL is the
+ desired tolerance and N is the limit on the number of iterations
+ to run, 0 means no limit. The function returns a vector
+ [success,value,iteration], where success is a boolean indicating
+ success, value is the last value computed, and iteration is the
+ number of iterations done.
FindRootFalsePosition
FindRootFalsePosition (f,a,b,TOL,N)
- Find root of a function using the method of false position.
+ Find root of a function using the method of false position. TOL is
+ the desired tolerance and N is the limit on the number of
+ iterations to run, 0 means no limit. The function returns a vector
+ [success,value,iteration], where success is a boolean indicating
+ success, value is the last value computed, and iteration is the
+ number of iterations done.
FindRootMullersMethod
FindRootMullersMethod (f,x1,x2,x3,TOL,N)
- Find root of a function using the Muller's method.
+ Find root of a function using the Muller's method. TOL is the
+ desired tolerance and N is the limit on the number of iterations
+ to run, 0 means no limit. The function returns a vector
+ [success,value,iteration], where success is a boolean indicating
+ success, value is the last value computed, and iteration is the
+ number of iterations done.
FindRootSecant
FindRootSecant (f,a,b,TOL,N)
- Find root of a function using the secant method.
+ Find root of a function using the secant method. TOL is the
+ desired tolerance and N is the limit on the number of iterations
+ to run, 0 means no limit. The function returns a vector
+ [success,value,iteration], where success is a boolean indicating
+ success, value is the last value computed, and iteration is the
+ number of iterations done.
PolynomialRoots
diff --git a/lib/equation_solving/find_root.gel b/lib/equation_solving/find_root.gel
index b78dfcb..79efd02 100644
--- a/lib/equation_solving/find_root.gel
+++ b/lib/equation_solving/find_root.gel
@@ -44,11 +44,11 @@ function FindRootBisection(f,a,b,TOL,N) =
(
diff=(b-a)/2;
p=a+diff;
- if(f(p)==0 or diff<TOL) then (return [1,p,iteration]);
+ if(f(p)==0 or diff<TOL) then (return [true,p,iteration]);
iteration=iteration+1;
if(f(a)*f(b)>0) then (a=p) else (b=p)
);
- [0,p,iteration]
+ [false,p,iteration]
)
#function root_find_newton
@@ -81,14 +81,14 @@ function FindRootSecant(f,a,b,TOL,N) =
while((iteration <= N) or (N==0)) do
(
p=b-qb*(b-a)/(qb-qa);
- if(|p-b|<TOL) then (return [1,p,iteration]);
+ if(|p-b|<TOL) then (return [true,p,iteration]);
iteration=iteration+1;
a=b;
qa=qb;
b=p;
qb=f(p);
);
- [0,p,iteration]
+ [false,p,iteration]
)
# The Method of False Position, Section 2.3, Algorithm 2.5, p. 64
@@ -117,14 +117,14 @@ function FindRootFalsePosition(f,a,b,TOL,N) =
while((iteration <= N) or (N==0)) do
(
p=b-qb*(b-a)/(qb-qa);
- if(|p-b|<TOL) then (return [1,p,iteration]);
+ if(|p-b|<TOL) then (return [true,p,iteration]);
iteration=iteration+1;
q=f(p);
if(q*qb<0) then (a=b;qa=qb);
b=p;
qb=q;
);
- [0,p,iteration]
+ [false,p,iteration]
)
# FIXME: This doesn't work right
@@ -159,7 +159,7 @@ function FindRootMullersMethod(f,x1,x2,x3,TOL,N) =
if (|b-D|<|b+d|) then (E=b+D) else (E=b-D);
h=-2*f(x2)/E;
p=x2+h;
- if (|h|<TOL) then (return[1,p,iteration]);
+ if (|h|<TOL) then (return[true,p,iteration]);
x0=x1;
x1=x2;
x2=p;
@@ -170,5 +170,5 @@ function FindRootMullersMethod(f,x1,x2,x3,TOL,N) =
d=(d2-d1)/(h2+h1);
i=i+1;
);
- [0,p,iteration]
+ [false,p,iteration]
)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]