summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAllan Cornet <allan.cornet@scilab.org>2007-02-20 14:34:34 +0000
committerAllan Cornet <allan.cornet@scilab.org>2007-02-20 14:34:34 +0000
commit6f3366ac469f462a69db8ef492d265225954b67f (patch)
treea64fe8c5fc2809010a613340e27e4465fe5842b1 /tests
parent4cf65c7788af3874a6ae4a22aaae7d4c050fb5c1 (diff)
downloadscilab-6f3366ac469f462a69db8ef492d265225954b67f.zip
scilab-6f3366ac469f462a69db8ef492d265225954b67f.tar.gz
updates ref.
Diffstat (limited to 'tests')
-rw-r--r--tests/basic_tests/algebra.dia.ref28
-rw-r--r--tests/basic_tests/algebra.tst7
-rw-r--r--tests/basic_tests/externals.f113
-rw-r--r--tests/basic_tests/links.dia.ref85
-rw-r--r--tests/basic_tests/links.tst63
-rw-r--r--tests/basic_tests/matsys.dia.ref2
-rw-r--r--tests/basic_tests/matsys.tst2
-rw-r--r--tests/basic_tests/result149
8 files changed, 163 insertions, 286 deletions
diff --git a/tests/basic_tests/algebra.dia.ref b/tests/basic_tests/algebra.dia.ref
index c4c8237..3393941 100644
--- a/tests/basic_tests/algebra.dia.ref
+++ b/tests/basic_tests/algebra.dia.ref
@@ -1094,6 +1094,8 @@ if Err(rcond(eye(50,50)*(1+%i))-1)>10*%eps then bugmes();quit;end
1094 1094
1095//========================================================================== 1095//==========================================================================
1096 1096
1097clear sel
1098
1097function t=sel(R),t=real(R)<0 ,endfunction 1099function t=sel(R),t=real(R)<0 ,endfunction
1098 1100
1099//Empty matrix 1101//Empty matrix
@@ -1537,9 +1539,9 @@ if Err(Es-Q'*E*Z) >200*%eps then bugmes();quit;end
1537 1539
1538//ordered sel 1540//ordered sel
1539 1541
1540function t=sel(Alpha,Beta),t=real(Alpha)>-0.2*real(Beta) ,endfunction 1542clear sel
1541Warning :redefining function: sel
1542 1543
1544function t=sel(Alpha,Beta),t=real(Alpha)>-0.2*real(Beta) ,endfunction
1543 1545
1544 1546
1545dim=schur(A,E,sel); 1547dim=schur(A,E,sel);
@@ -1661,9 +1663,9 @@ if Err(Es-Q'*E*Z) >200*%eps then bugmes();quit;end
1661 1663
1662//ordered sel 1664//ordered sel
1663 1665
1664function t=sel(Alpha,Beta),t=imag(Alpha)>0 ,endfunction 1666clear sel
1665Warning :redefining function: sel
1666 1667
1668function t=sel(Alpha,Beta),t=imag(Alpha)>0 ,endfunction
1667 1669
1668 1670
1669dim=schur(A,E,sel); 1671dim=schur(A,E,sel);
@@ -1789,12 +1791,12 @@ if Err(Es-Q'*E*Z) >200*%eps then bugmes();quit;end
1789 1791
1790//ordered sel 1792//ordered sel
1791 1793
1792function t=sel(Alpha,Beta),t=real(Alpha)>-0.2*real(Beta) ,endfunction 1794clear sel
1793Warning :redefining function: sel
1794 1795
1796function t=sel(Alpha,Beta),t=real(Alpha)>-0.2*real(Beta) ,endfunction
1795 1797
1796 1798
1797dim=schur(A,E,sel); 1799dim=schur(A,E,sel); // plante ici DGGES LAPACK 3.1
1798 1800
1799if dim<>12 then bugmes();quit;end 1801if dim<>12 then bugmes();quit;end
1800 1802
@@ -1913,9 +1915,9 @@ if Err(Es-Q'*E*Z) >1000*%eps then bugmes();quit;end
1913 1915
1914//ordered sel 1916//ordered sel
1915 1917
1916function t=sel(Alpha,Beta),t=imag(Alpha)>0 ,endfunction 1918clear sel
1917Warning :redefining function: sel
1918 1919
1920function t=sel(Alpha,Beta),t=imag(Alpha)>0 ,endfunction
1919 1921
1920 1922
1921dim=schur(A,E,sel); 1923dim=schur(A,E,sel);
@@ -3334,7 +3336,7 @@ if Err(diag(diag(X))-X)>200*%eps then bugmes();quit;end
3334 3336
3335if Err(Ab-inv(X)*A*X)>200*%eps then bugmes();quit;end 3337if Err(Ab-inv(X)*A*X)>200*%eps then bugmes();quit;end
3336 warning 3338 warning
3337 matrix is close to singular or badly scaled. rcond = 2.2737D-13 3339 matrix is close to singular or badly scaled. rcond = 8.8818D-16
3338 3340
3339 3341
3340 3342
@@ -3348,7 +3350,7 @@ if Err(diag(diag(X))-X)>200*%eps then bugmes();quit;end
3348 3350
3349if Err(Ab-inv(X)*A*X)>200*%eps then bugmes();quit;end 3351if Err(Ab-inv(X)*A*X)>200*%eps then bugmes();quit;end
3350 warning 3352 warning
3351 matrix is close to singular or badly scaled. rcond = 2.2737D-13 3353 matrix is close to singular or badly scaled. rcond = 8.8818D-16
3352 3354
3353 3355
3354 3356
@@ -3362,7 +3364,7 @@ if Err(diag(diag(X))-X)>200*%eps then bugmes();quit;end
3362 3364
3363if Err(Ab-inv(X)*A*X)>1000*%eps then bugmes();quit;end 3365if Err(Ab-inv(X)*A*X)>1000*%eps then bugmes();quit;end
3364 warning 3366 warning
3365 matrix is close to singular or badly scaled. rcond = 8.6736D-19 3367 matrix is close to singular or badly scaled. rcond = 1.6313D-55
3366 3368
3367 3369
3368 3370
@@ -3376,7 +3378,7 @@ if Err(diag(diag(X))-X)>200*%eps then bugmes();quit;end
3376 3378
3377if Err(Ab-inv(X)*A*X)>1000*%eps then bugmes();quit;end 3379if Err(Ab-inv(X)*A*X)>1000*%eps then bugmes();quit;end
3378 warning 3380 warning
3379 matrix is close to singular or badly scaled. rcond = 8.6736D-19 3381 matrix is close to singular or badly scaled. rcond = 1.6313D-55
3380 3382
3381 3383
3382 3384
diff --git a/tests/basic_tests/algebra.tst b/tests/basic_tests/algebra.tst
index 8cd3d00..93603ed 100644
--- a/tests/basic_tests/algebra.tst
+++ b/tests/basic_tests/algebra.tst
@@ -605,6 +605,7 @@ if Err(rcond(eye(50,50)*(1+%i))-1)>10*%eps then pause,end
605//========================================================================== 605//==========================================================================
606//============================== schur ============================== 606//============================== schur ==============================
607//========================================================================== 607//==========================================================================
608clear sel
608function t=sel(R),t=real(R)<0 ,endfunction 609function t=sel(R),t=real(R)<0 ,endfunction
609//Empty matrix 610//Empty matrix
610A=[]; 611A=[];
@@ -851,6 +852,7 @@ if Err(As-Q'*A*Z) >200*%eps then pause,end
851if Err(Es-Q'*E*Z) >200*%eps then pause,end 852if Err(Es-Q'*E*Z) >200*%eps then pause,end
852 853
853//ordered sel 854//ordered sel
855clear sel
854function t=sel(Alpha,Beta),t=real(Alpha)>-0.2*real(Beta) ,endfunction 856function t=sel(Alpha,Beta),t=real(Alpha)>-0.2*real(Beta) ,endfunction
855 857
856dim=schur(A,E,sel); 858dim=schur(A,E,sel);
@@ -917,6 +919,7 @@ if Err(As-Q'*A*Z) >200*%eps then pause,end
917if Err(Es-Q'*E*Z) >200*%eps then pause,end 919if Err(Es-Q'*E*Z) >200*%eps then pause,end
918 920
919//ordered sel 921//ordered sel
922clear sel
920function t=sel(Alpha,Beta),t=imag(Alpha)>0 ,endfunction 923function t=sel(Alpha,Beta),t=imag(Alpha)>0 ,endfunction
921 924
922dim=schur(A,E,sel); 925dim=schur(A,E,sel);
@@ -986,9 +989,10 @@ if Err(As-Q'*A*Z) >200*%eps then pause,end
986if Err(Es-Q'*E*Z) >200*%eps then pause,end 989if Err(Es-Q'*E*Z) >200*%eps then pause,end
987 990
988//ordered sel 991//ordered sel
992clear sel
989function t=sel(Alpha,Beta),t=real(Alpha)>-0.2*real(Beta) ,endfunction 993function t=sel(Alpha,Beta),t=real(Alpha)>-0.2*real(Beta) ,endfunction
990 994
991dim=schur(A,E,sel); 995dim=schur(A,E,sel); // plante ici DGGES LAPACK 3.1
992if dim<>12 then pause,end 996if dim<>12 then pause,end
993[Z,dim]=schur(A,E,sel); 997[Z,dim]=schur(A,E,sel);
994if Err(Z*Z'-eye(Z)) >200*%eps then pause,end 998if Err(Z*Z'-eye(Z)) >200*%eps then pause,end
@@ -1052,6 +1056,7 @@ if Err(As-Q'*A*Z) >1000*%eps then pause,end
1052if Err(Es-Q'*E*Z) >1000*%eps then pause,end 1056if Err(Es-Q'*E*Z) >1000*%eps then pause,end
1053 1057
1054//ordered sel 1058//ordered sel
1059clear sel
1055function t=sel(Alpha,Beta),t=imag(Alpha)>0 ,endfunction 1060function t=sel(Alpha,Beta),t=imag(Alpha)>0 ,endfunction
1056 1061
1057dim=schur(A,E,sel); 1062dim=schur(A,E,sel);
diff --git a/tests/basic_tests/externals.f b/tests/basic_tests/externals.f
index 966b99e..da73efc 100644
--- a/tests/basic_tests/externals.f
+++ b/tests/basic_tests/externals.f
@@ -1,4 +1,6 @@
1c -------------------------------------------
1 subroutine ext1f(n,a,b,c) 2 subroutine ext1f(n,a,b,c)
3c -------------------------------------------
2c (very) simple example 1 4c (very) simple example 1
3c -->link('ext1f.o','ext1f'); 5c -->link('ext1f.o','ext1f');
4c -->a=[1,2,3];b=[4,5,6];n=3; 6c -->a=[1,2,3];b=[4,5,6];n=3;
@@ -10,7 +12,10 @@ c c=a+b
10 1 continue 12 1 continue
11 return 13 return
12 end 14 end
15c
16c -------------------------------------------
13 subroutine ext2f(n,a,b,c) 17 subroutine ext2f(n,a,b,c)
18c -------------------------------------------
14c simple example 2 (using sin and cos) 19c simple example 2 (using sin and cos)
15c -->link('ext2f.o','ext2f'); 20c -->link('ext2f.o','ext2f');
16c -->a=[1,2,3];b=[4,5,6];n=3; 21c -->a=[1,2,3];b=[4,5,6];n=3;
@@ -22,8 +27,10 @@ c -->c=sin(a)+cos(b)
22 1 continue 27 1 continue
23 return 28 return
24 end 29 end
30c
31c -------------------------------------------
25 subroutine ext3f(ch,n,a,b,c) 32 subroutine ext3f(ch,n,a,b,c)
26c ---------------------------- 33c -------------------------------------------
27c example 3 (passing a chain) 34c example 3 (passing a chain)
28c -->link('ext3f.o','ext3f'); 35c -->link('ext3f.o','ext3f');
29c -->a=[1,2,3];b=[4,5,6];n=3; 36c -->a=[1,2,3];b=[4,5,6];n=3;
@@ -43,7 +50,10 @@ c -------------------------------------
43 endif 50 endif
44 return 51 return
45 end 52 end
53c
54c -------------------------------------------
46 subroutine ext4f(n,a,b,c) 55 subroutine ext4f(n,a,b,c)
56c -------------------------------------------
47c example 4 (reading a chain) 57c example 4 (reading a chain)
48c -->link('ext4f.o','ext4f'); 58c -->link('ext4f.o','ext4f');
49c -->a=[1,2,3];b=[4,5,6];n=3;yes='yes' 59c -->a=[1,2,3];b=[4,5,6];n=3;yes='yes'
@@ -72,8 +82,10 @@ c *********************************
72 endif 82 endif
73 return 83 return
74 end 84 end
75 85c
86c -------------------------------------------
76 subroutine ext5f(b,c) 87 subroutine ext5f(b,c)
88c -------------------------------------------
77c example 5 89c example 5
78c reading a vector in scilab internal stack using creadmat 90c reading a vector in scilab internal stack using creadmat
79c (see SCIDIR/system2/creadmat.f) 91c (see SCIDIR/system2/creadmat.f)
@@ -94,7 +106,10 @@ c If 'a' exists reads it else return
94 1 continue 106 1 continue
95 return 107 return
96 end 108 end
109c
110c -------------------------------------------
97 subroutine ext6f(aname,b,c) 111 subroutine ext6f(aname,b,c)
112c -------------------------------------------
98c example 6 113c example 6
99c reading a vector in scilab internal stack using readmat interface 114c reading a vector in scilab internal stack using readmat interface
100c -->link('ext6f.o','ext6f') 115c -->link('ext6f.o','ext6f')
@@ -114,7 +129,10 @@ c [m,n]=size(a) here m=1 n=3
114 1 continue 129 1 continue
115 return 130 return
116 end 131 end
132c
133c -------------------------------------------
117 subroutine ext7f(a,b) 134 subroutine ext7f(a,b)
135c -------------------------------------------
118c example 7 136c example 7
119c creating vector c in scilab internal stack 137c creating vector c in scilab internal stack
120c -->link('ext7f.o','ext7f') 138c -->link('ext7f.o','ext7f')
@@ -135,26 +153,10 @@ c sending string 'test' (size 4) to Scilab variable d
135 if (.not.cwritechain('d'//char(0),4,'test')) return 153 if (.not.cwritechain('d'//char(0),4,'test')) return
136 return 154 return
137 end 155 end
138 subroutine ext8f(y) 156c
139c ------------------------------------------- 157c -------------------------------------------
140c same example with call to cmatptr 158 subroutine ext8f(n, t, y, ydot)
141c -->param=[1,2,3]; 159c -------------------------------------------
142c -->link('ext8c.o','ext8c','C');
143c -->y=call('ext8c','out',size(param),1,'d');
144 logical cmatptr
145 double precision y(*)
146 include 'stack.h'
147c If variable 'param' exists gets its pointer in
148c internal stack else return
149 if(.not.cmatptr('param'//char(0),m,n,lp)) return
150c ********************************
151c param entries are in stk(lp+i),i=0,m*n
152 do 10 i=1,m*n
153 y(i) = stk(lp+i-1)
154 10 continue
155 return
156 end
157 subroutine ext9f(n, t, y, ydot)
158c argument function for ode 160c argument function for ode
159c input variables n, t, y 161c input variables n, t, y
160c n = dimension of state vector y 162c n = dimension of state vector y
@@ -169,12 +171,12 @@ c ...
169c i.e. ydot vector of derivative of state y 171c i.e. ydot vector of derivative of state y
170c 172c
171c Example: 173c Example:
172c call this ext9f routine: 174c call this ext8f routine:
173c ode([1;0;0],0,[0.4,4],'ext9f') 175c ode([1;0;0],0,[0.4,4],'ext9f')
174c 176c
175c With dynamic link: 177c With dynamic link:
176c -->link('ext9f.o','ext9f') 178c -->link('ext8f.o','ext8f')
177c -->ode([1;0;0],0,[0.4,4],'ext9f') 179c -->ode([1;0;0],0,[0.4,4],'ext8f')
178c 180c
179 double precision t, y, ydot 181 double precision t, y, ydot
180 dimension y(3), ydot(3) 182 dimension y(3), ydot(3)
@@ -182,8 +184,10 @@ c
182 ydot(3) = 3.0d+7*y(2)*y(2) 184 ydot(3) = 3.0d+7*y(2)*y(2)
183 ydot(2) = -ydot(1) - ydot(3) 185 ydot(2) = -ydot(1) - ydot(3)
184 end 186 end
185 187c
186 subroutine ext10f(n, t, y, ydot) 188c -------------------------------------------
189 subroutine ext9f(n, t, y, ydot)
190c -------------------------------------------
187c external fonction for ode 191c external fonction for ode
188c input variables n, t, y 192c input variables n, t, y
189c n = dimension of state vector y 193c n = dimension of state vector y
@@ -198,9 +202,9 @@ c ...
198c i.e. ydot vector of derivative of state y 202c i.e. ydot vector of derivative of state y
199c 203c
200c With dynamic link: 204c With dynamic link:
201c link('ext10f.o','ext10f') 205c link('ext9f.o','ext9f')
202c 206c
203c passing a parameter to ext10f routine by a list: 207c passing a parameter to ext9f routine by a list:
204c -->param=[0.04,10000,3d+7]; 208c -->param=[0.04,10000,3d+7];
205c -->y=ode([1;0;0],0,[0.4,4],list('ext10f',param)) 209c -->y=ode([1;0;0],0,[0.4,4],list('ext10f',param))
206c param is retrieved in ext10f by: 210c param is retrieved in ext10f by:
@@ -217,12 +221,14 @@ c
217 ydot(3) = param(3)*y(2)*y(2) 221 ydot(3) = param(3)*y(2)*y(2)
218 ydot(2) = -ydot(1) - ydot(3) 222 ydot(2) = -ydot(1) - ydot(3)
219 end 223 end
220 subroutine ext11f(neq, t, y, ydot) 224c
225c -------------------------------------------
226 subroutine ext10f(neq, t, y, ydot)
221c ------------------------------------------- 227c -------------------------------------------
222c exemple with a call to readmat routine 228c exemple with a call to readmat routine
223c -->param=[0.04,10000,3d+7]; 229c -->param=[0.04,10000,3d+7];
224c -->link('ext11f.o','ext11f') 230c -->link('ext10f.o','ext10f')
225c -->y=ode([1;0;0],0,[0.4,4],'ext11f') 231c -->y=ode([1;0;0],0,[0.4,4],'ext10f')
226c param must be defined as a scilab variable 232c param must be defined as a scilab variable
227 double precision t, y, ydot, param 233 double precision t, y, ydot, param
228 logical creadmat 234 logical creadmat
@@ -237,46 +243,23 @@ c ***********************************
237 ydot(2) = -ydot(1) - ydot(3) 243 ydot(2) = -ydot(1) - ydot(3)
238 return 244 return
239 end 245 end
240 subroutine ext12f(neq, t, y, ydot) 246c
241c ------------------------------------------- 247c -------------------------------------------
242c same example with call to cmatptr 248 subroutine ext11f(n,a)
243c param must be defined as a scilab variable 249c -------------------------------------------
244c exemple with a call to cmatptr function
245c -->param=[0.04,10000,3d+7];
246c -->link('ext12f.o','ext12f')
247c -->y=ode([1;0;0],0,[0.4,4],'ext12f')
248 double precision t, y, ydot
249 logical cmatptr
250 dimension y(3), ydot(3)
251c
252 include 'stack.h'
253c
254
255c If variable 'param' exists gets its pointer in
256c internal stack else return
257 if(.not.cmatptr('param'//char(0),m,n,lp)) return
258c ********************************
259c param entries are in stk(lp),stk(lp+1),stk(lp+2)
260c i.e. param(1)= stk(lp), ...
261c m,n = dimensions of param = 3,1 (or 1,3 if row v.)
262
263c (note that vector param not used in this example)
264 ydot(1) = -stk(lp)*y(1) + stk(lp+1)*y(2)*y(3)
265 ydot(3) = stk(lp+2)*y(2)*y(2)
266 ydot(2) = -ydot(1) - ydot(3)
267 return
268 end
269
270 subroutine ext13f(n,a)
271 common/cmntest/b(10) 250 common/cmntest/b(10)
272 real a(*) 251 real a(*)
273 do 1 k=1,max(n,10) 252 do 1 k=1,max(n,10)
274 1 b(k)=a(k) 253 1 b(k)=a(k)
275 end 254 end
276 subroutine ext14f(n,c) 255c
256c -------------------------------------------
257 subroutine ext12f(n,c)
258c -------------------------------------------
277 common/cmntest/b(10) 259 common/cmntest/b(10)
278 real c(*) 260 real c(*)
279 do 1 k=1,max(n,10) 261 do 1 k=1,max(n,10)
280 1 c(k)=b(k) 262 1 c(k)=b(k)
281 end 263 end
282 264c -------------------------------------------
265c
diff --git a/tests/basic_tests/links.dia.ref b/tests/basic_tests/links.dia.ref
index cf02528..00001e6 100644
--- a/tests/basic_tests/links.dia.ref
+++ b/tests/basic_tests/links.dia.ref
@@ -1,16 +1,19 @@
1 1
2//===========================================================
3
2// Copyright INRIA 4// Copyright INRIA
3 5
6//===========================================================
4 7
5pref='ext'; 8pref='ext';
6 9
7suf='f'; 10suf='f';
8 11
9routines=[pref(ones(1,14))+string(1:14)+suf(ones(1,14))]; 12routines=[pref(ones(1,12))+string(1:12)+suf(ones(1,12))];
10 13
11ilib_for_link(routines,'externals.o',[],"f"); 14ilib_for_link(routines,'externals.o',[],"f");
12 generate a loader file 15 generate a loader file
13 generate a Makefile: Makelib 16 generate a Makefile
14 running the makefile 17 running the makefile
15 compilation of externals 18 compilation of externals
16 building shared library (be patient) 19 building shared library (be patient)
@@ -19,8 +22,12 @@ exec loader.sce ;
19shared archive loaded 22shared archive loaded
20Link done 23Link done
21 24
25//===========================================================
26
22//(very) simple example 1 27//(very) simple example 1
23 28
29//===========================================================
30
24a=[1,2,3];b=[4,5,6];n=3; 31a=[1,2,3];b=[4,5,6];n=3;
25 32
26c=call('ext1f',n,1,'i',a,2,'d',b,3,'d','out',[1,3],4,'d'); 33c=call('ext1f',n,1,'i',a,2,'d',b,3,'d','out',[1,3],4,'d');
@@ -28,8 +35,12 @@ c=call('ext1f',n,1,'i',a,2,'d',b,3,'d','out',[1,3],4,'d');
28if norm(c-(a+b)) > %eps then bugmes();quit;end 35if norm(c-(a+b)) > %eps then bugmes();quit;end
29 36
30 37
38//===========================================================
39
31//Simple example #2 40//Simple example #2
32 41
42//===========================================================
43
33a=[1,2,3];b=[4,5,6];n=3; 44a=[1,2,3];b=[4,5,6];n=3;
34 45
35c=call('ext2f',n,1,'i',a,2,'d',b,3,'d','out',[1,3],4,'d'); 46c=call('ext2f',n,1,'i',a,2,'d',b,3,'d','out',[1,3],4,'d');
@@ -37,8 +48,12 @@ c=call('ext2f',n,1,'i',a,2,'d',b,3,'d','out',[1,3],4,'d');
37if norm(c-(sin(a)+cos(b))) > %eps then bugmes();quit;end 48if norm(c-(sin(a)+cos(b))) > %eps then bugmes();quit;end
38 49
39 50
51//===========================================================
52
40//Example #3 53//Example #3
41 54
55//===========================================================
56
42a=[1,2,3];b=[4,5,6];n=3; 57a=[1,2,3];b=[4,5,6];n=3;
43 58
44c=call('ext3f','yes',1,'c',n,2,'i',a,3,'d',b,4,'d','out',[1,3],5,'d'); 59c=call('ext3f','yes',1,'c',n,2,'i',a,3,'d',b,4,'d','out',[1,3],5,'d');
@@ -50,8 +65,12 @@ c=call('ext3f','no',1,'c',n,2,'i',a,3,'d',b,4,'d','out',[1,3],5,'d');
50if norm(c-(a+b)) > %eps then bugmes();quit;end 65if norm(c-(a+b)) > %eps then bugmes();quit;end
51 66
52 67
68//===========================================================
69
53//Example #4 70//Example #4
54 71
72//===========================================================
73
55a=[1,2,3];b=[4,5,6];n=3;yes='yes'; 74a=[1,2,3];b=[4,5,6];n=3;yes='yes';
56 75
57c=call('ext4f',n,1,'i',a,2,'d',b,3,'d','out',[1,3],4,'d'); 76c=call('ext4f',n,1,'i',a,2,'d',b,3,'d','out',[1,3],4,'d');
@@ -67,8 +86,12 @@ if norm(c-(a+b)) > %eps then bugmes();quit;end
67//clear yes --> undefined variable : yes 86//clear yes --> undefined variable : yes
68 87
69 88
89//===========================================================
90
70//Example #5 91//Example #5
71 92
93//===========================================================
94
72// reading vector a in scilab internal stack 95// reading vector a in scilab internal stack
73 96
74a=[1,2,3];b=[2,3,4]; 97a=[1,2,3];b=[2,3,4];
@@ -78,8 +101,12 @@ c=call('ext5f',b,1,'d','out',[1,3],2,'d');
78if norm(c-(a+2*b)) > %eps then bugmes();quit;end 101if norm(c-(a+2*b)) > %eps then bugmes();quit;end
79 102
80 103
104//===========================================================
105
81//Example #6 106//Example #6
82 107
108//===========================================================
109
83//reading vector with name='a' in scilab internal stack 110//reading vector with name='a' in scilab internal stack
84 111
85a=[1,2,3];b=[2,3,4]; 112a=[1,2,3];b=[2,3,4];
@@ -89,9 +116,12 @@ c=call('ext6f','a',1,'c',b,2,'d','out',[1,3],3,'d');
89if norm(c-(a+2*b)) > %eps then bugmes();quit;end 116if norm(c-(a+2*b)) > %eps then bugmes();quit;end
90 117
91 118
119//===========================================================
92 120
93//Example #7 121//Example #7
94 122
123//===========================================================
124
95//creating vector c in scilab internal stack 125//creating vector c in scilab internal stack
96 126
97clear c; 127clear c;
@@ -113,62 +143,54 @@ if norm(c-(a+2*b)) > %eps then bugmes();quit;end
113if d<>"test" then bugmes();quit;end 143if d<>"test" then bugmes();quit;end
114 144
115 145
146//===========================================================
147
116//Example #8 148//Example #8
117 149
118//param must be defined as a scilab variable 150//===========================================================
119 151
120param=[1,2,3]; 152//call ext8f argument function with dynamic link
121 153
122y=call('ext8f','out',size(param),1,'d'); 154yref=ode([1;0;0],0,[0.4,4],'ext8f');
123 155
124if norm(y-param) > %eps then bugmes();quit;end
125 156
157//===========================================================
126 158
127//Example #9 159//Example #9
128 160
129//call ext9f argument function with dynamic link 161//===========================================================
130 162
131yref=ode([1;0;0],0,[0.4,4],'ext9f'); 163//passing a parameter to ext9f routine by a list:
132
133
134//Example #10
135
136//passing a parameter to ext10f routine by a list:
137 164
138param=[0.04,10000,3d+7]; 165param=[0.04,10000,3d+7];
139 166
140y=ode([1;0;0],0,[0.4,4],list('ext10f',param)); 167y=ode([1;0;0],0,[0.4,4],list('ext9f',param));
141 168
142if norm(y-yref) > 10000*%eps then bugmes();quit;end 169if norm(y-yref) > 10000*%eps then bugmes();quit;end
143 170
144 171
145//Example #11 172//===========================================================
173
174//Example #10
175
176//===========================================================
146 177
147//Passing a parameter to argument funtion of ode 178//Passing a parameter to argument funtion of ode
148 179
149param=[0.04,10000,3d+7]; 180param=[0.04,10000,3d+7];
150 181
151y=ode([1;0;0],0,[0.4,4],'ext11f'); 182y=ode([1;0;0],0,[0.4,4],'ext10f');
152 183
153//param must be defined as a scilab variable upon calling ode 184//param must be defined as a scilab variable upon calling ode
154 185
155if norm(y-yref) > 10000*%eps then bugmes();quit;end 186if norm(y-yref) > 10000*%eps then bugmes();quit;end
156 187
157 188
158//Example #12 189//===========================================================
159
160//same example as # 10 with call to matptr
161
162//param must be defined as a scilab variable
163
164param=[0.04,10000,3d+7];
165
166y=ode([1;0;0],0,[0.4,4],'ext12f');
167
168if norm(y-yref) > 10000*%eps then bugmes();quit;end
169 190
191//Example #11
170 192
171//Example #13 193//===========================================================
172 194
173//sharing common data 195//sharing common data
174 196
@@ -176,9 +198,12 @@ a=1:10;
176 198
177n=10;a=1:10; 199n=10;a=1:10;
178 200
179call('ext13f',n,1,'i',a,2,'r','out',2); //loads b with a 201call('ext11f',n,1,'i',a,2,'r','out',2); //loads b with a
180 202
181c=call('ext14f',n,1,'i','out',[1,10],2,'r'); //loads c with b 203c=call('ext12f',n,1,'i','out',[1,10],2,'r'); //loads c with b
182 204
183if norm(c-a) > %eps then bugmes();quit;end 205if norm(c-a) > %eps then bugmes();quit;end
184 206
207
208//===========================================================
209
diff --git a/tests/basic_tests/links.tst b/tests/basic_tests/links.tst
index 24001e1..3148fb3 100644
--- a/tests/basic_tests/links.tst
+++ b/tests/basic_tests/links.tst
@@ -1,28 +1,37 @@
1//===========================================================
1// Copyright INRIA 2// Copyright INRIA
2 3//===========================================================
3pref='ext'; 4pref='ext';
4suf='f'; 5suf='f';
5routines=[pref(ones(1,14))+string(1:14)+suf(ones(1,14))]; 6routines=[pref(ones(1,12))+string(1:12)+suf(ones(1,12))];
6ilib_for_link(routines,'externals.o',[],"f"); 7ilib_for_link(routines,'externals.o',[],"f");
7exec loader.sce ; 8exec loader.sce ;
9//===========================================================
8//(very) simple example 1 10//(very) simple example 1
11//===========================================================
9a=[1,2,3];b=[4,5,6];n=3; 12a=[1,2,3];b=[4,5,6];n=3;
10c=call('ext1f',n,1,'i',a,2,'d',b,3,'d','out',[1,3],4,'d'); 13c=call('ext1f',n,1,'i',a,2,'d',b,3,'d','out',[1,3],4,'d');
11if norm(c-(a+b)) > %eps then pause,end 14if norm(c-(a+b)) > %eps then pause,end
12 15
16//===========================================================
13//Simple example #2 17//Simple example #2
18//===========================================================
14a=[1,2,3];b=[4,5,6];n=3; 19a=[1,2,3];b=[4,5,6];n=3;
15c=call('ext2f',n,1,'i',a,2,'d',b,3,'d','out',[1,3],4,'d'); 20c=call('ext2f',n,1,'i',a,2,'d',b,3,'d','out',[1,3],4,'d');
16if norm(c-(sin(a)+cos(b))) > %eps then pause,end 21if norm(c-(sin(a)+cos(b))) > %eps then pause,end
17 22
23//===========================================================
18//Example #3 24//Example #3
25//===========================================================
19a=[1,2,3];b=[4,5,6];n=3; 26a=[1,2,3];b=[4,5,6];n=3;
20c=call('ext3f','yes',1,'c',n,2,'i',a,3,'d',b,4,'d','out',[1,3],5,'d'); 27c=call('ext3f','yes',1,'c',n,2,'i',a,3,'d',b,4,'d','out',[1,3],5,'d');
21if norm(c-(sin(a)+cos(b)))> %eps then pause,end 28if norm(c-(sin(a)+cos(b)))> %eps then pause,end
22c=call('ext3f','no',1,'c',n,2,'i',a,3,'d',b,4,'d','out',[1,3],5,'d'); 29c=call('ext3f','no',1,'c',n,2,'i',a,3,'d',b,4,'d','out',[1,3],5,'d');
23if norm(c-(a+b)) > %eps then pause,end 30if norm(c-(a+b)) > %eps then pause,end
24 31
32//===========================================================
25//Example #4 33//Example #4
34//===========================================================
26a=[1,2,3];b=[4,5,6];n=3;yes='yes'; 35a=[1,2,3];b=[4,5,6];n=3;yes='yes';
27c=call('ext4f',n,1,'i',a,2,'d',b,3,'d','out',[1,3],4,'d'); 36c=call('ext4f',n,1,'i',a,2,'d',b,3,'d','out',[1,3],4,'d');
28if norm(c-(sin(a)+cos(b))) > %eps then pause,end 37if norm(c-(sin(a)+cos(b))) > %eps then pause,end
@@ -31,20 +40,25 @@ c=call('ext4f',n,1,'i',a,2,'d',b,3,'d','out',[1,3],4,'d');
31if norm(c-(a+b)) > %eps then pause,end 40if norm(c-(a+b)) > %eps then pause,end
32//clear yes --> undefined variable : yes 41//clear yes --> undefined variable : yes
33 42
43//===========================================================
34//Example #5 44//Example #5
45//===========================================================
35// reading vector a in scilab internal stack 46// reading vector a in scilab internal stack
36a=[1,2,3];b=[2,3,4]; 47a=[1,2,3];b=[2,3,4];
37c=call('ext5f',b,1,'d','out',[1,3],2,'d'); 48c=call('ext5f',b,1,'d','out',[1,3],2,'d');
38if norm(c-(a+2*b)) > %eps then pause,end 49if norm(c-(a+2*b)) > %eps then pause,end
39 50
51//===========================================================
40//Example #6 52//Example #6
53//===========================================================
41//reading vector with name='a' in scilab internal stack 54//reading vector with name='a' in scilab internal stack
42a=[1,2,3];b=[2,3,4]; 55a=[1,2,3];b=[2,3,4];
43c=call('ext6f','a',1,'c',b,2,'d','out',[1,3],3,'d'); 56c=call('ext6f','a',1,'c',b,2,'d','out',[1,3],3,'d');
44if norm(c-(a+2*b)) > %eps then pause,end 57if norm(c-(a+2*b)) > %eps then pause,end
45 58
46 59//===========================================================
47//Example #7 60//Example #7
61//===========================================================
48//creating vector c in scilab internal stack 62//creating vector c in scilab internal stack
49clear c; 63clear c;
50a=[1,2,3]; b=[2,3,4]; 64a=[1,2,3]; b=[2,3,4];
@@ -56,40 +70,37 @@ if norm(c-(a+2*b)) > %eps then pause,end
56//d exists 70//d exists
57if d<>"test" then pause,end 71if d<>"test" then pause,end
58 72
59//Example #8 73//===========================================================
60//param must be defined as a scilab variable 74//Example #8
61param=[1,2,3]; 75//===========================================================
62y=call('ext8f','out',size(param),1,'d'); 76//call ext8f argument function with dynamic link
63if norm(y-param) > %eps then pause,end 77yref=ode([1;0;0],0,[0.4,4],'ext8f');
64 78
79//===========================================================
65//Example #9 80//Example #9
66//call ext9f argument function with dynamic link 81//===========================================================
67yref=ode([1;0;0],0,[0.4,4],'ext9f'); 82//passing a parameter to ext9f routine by a list:
68
69//Example #10
70//passing a parameter to ext10f routine by a list:
71param=[0.04,10000,3d+7]; 83param=[0.04,10000,3d+7];
72y=ode([1;0;0],0,[0.4,4],list('ext10f',param)); 84y=ode([1;0;0],0,[0.4,4],list('ext9f',param));
73if norm(y-yref) > 10000*%eps then pause,end 85if norm(y-yref) > 10000*%eps then pause,end
74 86
75//Example #11 87//===========================================================
88//Example #10
89//===========================================================
76//Passing a parameter to argument funtion of ode 90//Passing a parameter to argument funtion of ode
77param=[0.04,10000,3d+7]; 91param=[0.04,10000,3d+7];
78y=ode([1;0;0],0,[0.4,4],'ext11f'); 92y=ode([1;0;0],0,[0.4,4],'ext10f');
79//param must be defined as a scilab variable upon calling ode 93//param must be defined as a scilab variable upon calling ode
80if norm(y-yref) > 10000*%eps then pause,end 94if norm(y-yref) > 10000*%eps then pause,end
81 95
82//Example #12 96//===========================================================
83//same example as # 10 with call to matptr 97//Example #11
84//param must be defined as a scilab variable 98//===========================================================
85param=[0.04,10000,3d+7];
86y=ode([1;0;0],0,[0.4,4],'ext12f');
87if norm(y-yref) > 10000*%eps then pause,end
88
89//Example #13
90//sharing common data 99//sharing common data
91a=1:10; 100a=1:10;
92n=10;a=1:10; 101n=10;a=1:10;
93call('ext13f',n,1,'i',a,2,'r','out',2); //loads b with a 102call('ext11f',n,1,'i',a,2,'r','out',2); //loads b with a
94c=call('ext14f',n,1,'i','out',[1,10],2,'r'); //loads c with b 103c=call('ext12f',n,1,'i','out',[1,10],2,'r'); //loads c with b
95if norm(c-a) > %eps then pause,end 104if norm(c-a) > %eps then pause,end
105
106//===========================================================
diff --git a/tests/basic_tests/matsys.dia.ref b/tests/basic_tests/matsys.dia.ref
index 01597fd..41ceb03 100644
--- a/tests/basic_tests/matsys.dia.ref
+++ b/tests/basic_tests/matsys.dia.ref
@@ -312,7 +312,7 @@ errclear();errcatch();
312 312
313//whereis 313//whereis
314 314
315if whereis('sci2exp')<>'libm2sci' then bugmes();quit;end 315if whereis('sci2exp')<>'m2scilib' then bugmes();quit;end
316 316
317if whereis('aaa')<>[] then bugmes();quit;end 317if whereis('aaa')<>[] then bugmes();quit;end
318 318
diff --git a/tests/basic_tests/matsys.tst b/tests/basic_tests/matsys.tst
index 38119ec..8bc723f 100644
--- a/tests/basic_tests/matsys.tst
+++ b/tests/basic_tests/matsys.tst
@@ -157,7 +157,7 @@ if iserror()<>1 then pause,end
157errclear();errcatch(); 157errclear();errcatch();
158 158
159//whereis 159//whereis
160if whereis('sci2exp')<>'libm2sci' then pause,end 160if whereis('sci2exp')<>'m2scilib' then pause,end
161if whereis('aaa')<>[] then pause,end 161if whereis('aaa')<>[] then pause,end
162 162
163//where 163//where
diff --git a/tests/basic_tests/result b/tests/basic_tests/result
deleted file mode 100644
index 3ff21d9..0000000
--- a/tests/basic_tests/result
+++ /dev/null
@@ -1,149 +0,0 @@
1------------------- File maxi.tst--------------------
2Test passed
3----------------------------------------------------------
4------------------- File norm.tst--------------------
5Test passed
6----------------------------------------------------------
7------------------- File matops.tst--------------------
8Test passed
9----------------------------------------------------------
10------------------- File scilab.tst--------------------
11Test passed
12----------------------------------------------------------
13------------------- File macro.tst--------------------
14Test passed
15----------------------------------------------------------
16------------------- File calpol.tst--------------------
17Test passed
18----------------------------------------------------------
19------------------- File clause.tst--------------------
20Test passed
21----------------------------------------------------------
22------------------- File sparse.tst--------------------
23Test passed
24----------------------------------------------------------
25------------------- File lsparse.tst--------------------
26Test passed
27----------------------------------------------------------
28------------------- File lstops.tst--------------------
29Test passed
30----------------------------------------------------------
31------------------- File polops.tst--------------------
32Test passed
33----------------------------------------------------------
34------------------- File break.tst--------------------
35Test passed
36----------------------------------------------------------
37------------------- File sprintf.tst--------------------
38Test passed
39----------------------------------------------------------
40------------------- File sscanf.tst--------------------
41Test passed
42----------------------------------------------------------
43------------------- File display.tst--------------------
44Test passed
45----------------------------------------------------------
46------------------- File matode.tst--------------------
47Test passed
48----------------------------------------------------------
49------------------- File matopt.tst--------------------
50Test passed
51----------------------------------------------------------
52------------------- File matelm.tst--------------------
53Test passed
54----------------------------------------------------------
55------------------- File polelm.tst--------------------
56Test passed
57----------------------------------------------------------
58------------------- File metanet.tst--------------------
59Test passed
60----------------------------------------------------------
61------------------- File matimp.tst--------------------
62Test passed
63----------------------------------------------------------
64------------------- File dassldasrt.tst--------------------
65Test passed
66----------------------------------------------------------
67------------------- File call.tst--------------------
68Test passed
69----------------------------------------------------------
70------------------- File bvode.tst--------------------
71Test passed
72----------------------------------------------------------
73------------------- File feval.tst--------------------
74Test passed
75----------------------------------------------------------
76------------------- File auto.tst--------------------
77Test passed
78----------------------------------------------------------
79------------------- File odedc.tst--------------------
80Test passed
81----------------------------------------------------------
82------------------- File sound.tst--------------------
83Test passed
84----------------------------------------------------------
85------------------- File listinsertion.tst--------------------
86Test passed
87----------------------------------------------------------
88------------------- File listextraction.tst--------------------
89Test passed
90----------------------------------------------------------
91------------------- File links.tst--------------------
92Test passed
93----------------------------------------------------------
94------------------- File strelm.tst--------------------
95Test passed
96----------------------------------------------------------
97------------------- File gsort.tst--------------------
98Test passed
99----------------------------------------------------------
100------------------- File odedi.tst--------------------
101Test passed
102----------------------------------------------------------
103------------------- File dcd.tst--------------------
104Test passed
105----------------------------------------------------------
106------------------- File grand.tst--------------------
107Test passed
108----------------------------------------------------------
109------------------- File grandb.tst--------------------
110Test passed
111----------------------------------------------------------
112------------------- File resume.tst--------------------
113Test passed
114----------------------------------------------------------
115------------------- File errcatch.tst--------------------
116Test passed
117----------------------------------------------------------
118------------------- File arma.tst--------------------
119Test passed
120----------------------------------------------------------
121------------------- File msscanf.tst--------------------
122Test passed
123----------------------------------------------------------
124------------------- File msprintf.tst--------------------
125Test passed
126----------------------------------------------------------
127------------------- File binary.tst--------------------
128Test failed ERROR DETECTED while executing binary.tst
129------------------- File mfprintf.tst--------------------
130Test passed
131----------------------------------------------------------
132------------------- File mfscanf.tst--------------------
133Test passed
134----------------------------------------------------------
135------------------- File fscanfMat.tst--------------------
136Test passed
137----------------------------------------------------------
138------------------- File global.tst--------------------
139Test passed
140----------------------------------------------------------
141------------------- File matsys.tst--------------------
142Test Failed SEE : diff -w matsys.dia matsys.dia.ref
143----------------------------------------------------------
144------------------- File saveload.tst--------------------
145Test passed
146----------------------------------------------------------
147------------------- File intops.tst--------------------
148Test passed
149----------------------------------------------------------