[genius] Fri Oct 10 16:05:24 2014 Jiri (George) Lebl <jirka 5z com>
- From: George Lebl <jirka src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [genius] Fri Oct 10 16:05:24 2014 Jiri (George) Lebl <jirka 5z com>
- Date: Fri, 10 Oct 2014 21:05:37 +0000 (UTC)
commit 38143e9d4a25c73a6cb8f17a650c28f2bb655c45
Author: Jiri (George) Lebl <jiri lebl gmail com>
Date: Fri Oct 10 16:05:28 2014 -0500
Fri Oct 10 16:05:24 2014 Jiri (George) Lebl <jirka 5z com>
* lib/calculus/fourier.gel: Fix PeriodicExtension
* src/geniustests.txt: add a bunch of tests for the periodic
extensions stuff
ChangeLog | 7 +++++++
lib/calculus/fourier.gel | 4 ++--
src/geniustests.txt | 14 ++++++++++++++
3 files changed, 23 insertions(+), 2 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 3c49ac4..ec15a8a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Fri Oct 10 16:05:24 2014 Jiri (George) Lebl <jirka 5z com>
+
+ * lib/calculus/fourier.gel: Fix PeriodicExtension
+
+ * src/geniustests.txt: add a bunch of tests for the periodic
+ extensions stuff
+
Fri Oct 10 15:13:16 2014 Jiri (George) Lebl <jirka 5z com>
* src/gnome-genius.desktop.in: Add GTK Category, and add Keywords
diff --git a/lib/calculus/fourier.gel b/lib/calculus/fourier.gel
index 1d29b07..d8cf382 100644
--- a/lib/calculus/fourier.gel
+++ b/lib/calculus/fourier.gel
@@ -152,8 +152,8 @@ function PeriodicExtension(f,a,b) =
`(x)[f,a,b] = (
local *;
#This is pretty stupid, but simplest way to do this
- while x > L do increment x by -(b-a);
- while x < -L do increment x by (b-a);
+ while x > b do increment x by (a-b); #-(b-a)
+ while x < a do increment x by (b-a);
(f call (x))
)
)
diff --git a/src/geniustests.txt b/src/geniustests.txt
index 1d06972..4350cee 100644
--- a/src/geniustests.txt
+++ b/src/geniustests.txt
@@ -1170,6 +1170,20 @@ r=[1,2,3];function f() = (SetVElement(`r,3,99)); f(); r [1,2,99]
r=[1,2,3];function f() = (SetVElement(`r,4,99)); f(); r [1,2,3,99]
r=[1;2;3];function f() = (SetVElement("r",5,99)); f(); r [1;2;3;0;99]
SetElement("r",-1,2,99) SetElement("r",-1,2,99)
+|PeriodicExtension (`(x)=x^2,0.5,1) call (0.7) - (0.7)^2|<10^-20 true
+|PeriodicExtension (`(x)=x^2,0.5,1) call (0.7-0.5) - (0.7)^2|<10^-20 true
+|PeriodicExtension (`(x)=x^2,0.5,1) call (0.7+2*0.5) - (0.7)^2|<10^-20 true
+|PeriodicExtension (`(x)=x^2,0.5,1) call (0.7+5*0.5) - (0.7)^2|<10^-20 true
+|PeriodicExtension (`(x)=x^2,-1,1) call (0.7+5*2) - (0.7)^2|<10^-20 true
+|PeriodicExtension (`(x)=x^2,-1,1) call (0.7-4*2) - (0.7)^2|<10^-20 true
+|PeriodicExtension (`(x)=x^3,-1,1) call (0.7-1) - (0.7-1)^3|<10^-20 true
+|PeriodicExtension (`(x)=x^3,-1,1) call (0.7+3) - (0.7-1)^3|<10^-20 true
+|OddPeriodicExtension (`(x)=x^2,1) call (0.7+2) - (0.7)^2|<10^-20 true
+|OddPeriodicExtension (`(x)=x^2,1) call (0.7-3*2) - (0.7)^2|<10^-20 true
+|OddPeriodicExtension (`(x)=x^2,1) call (-0.7) - -(0.7)^2|<10^-20 true
+|EvenPeriodicExtension (`(x)=x^3,2) call (-0.7) - (0.7)^3|<10^-20 true
+|EvenPeriodicExtension (`(x)=x^3,2) call (-0.7+4) - (0.7)^3|<10^-20 true
+|EvenPeriodicExtension (`(x)=x^3,2) call (0.7+2) - (0.7)^3|<10^-20 false
load "nullspacetest.gel" true
load "longtest.gel" true
load "testprec.gel" true
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]