summaryrefslogtreecommitdiffstats
path: root/scilab/modules/linear_algebra
diff options
context:
space:
mode:
authorAllan CORNET <allan.cornet@scilab.org>2010-03-30 14:47:05 +0200
committerAllan CORNET <allan.cornet@scilab.org>2010-03-30 14:47:05 +0200
commit361e46c930dc2727759c7fead22952f3962e5cc8 (patch)
tree86bb12874572938da20ffa23668bb4d174383a70 /scilab/modules/linear_algebra
parentd54a6607a0cec29ee82a9bd7e99536a6f932fb71 (diff)
parent50dcdb32e319eea40a476af7678e70919a307ad6 (diff)
downloadscilab-361e46c930dc2727759c7fead22952f3962e5cc8.zip
scilab-361e46c930dc2727759c7fead22952f3962e5cc8.tar.gz
Merge remote branch 'refs/remotes/origin/5.2'
Diffstat (limited to 'scilab/modules/linear_algebra')
-rw-r--r--scilab/modules/linear_algebra/tests/nonreg_tests/bug_6783.dia.ref175
-rw-r--r--scilab/modules/linear_algebra/tests/nonreg_tests/bug_6783.tst192
2 files changed, 367 insertions, 0 deletions
diff --git a/scilab/modules/linear_algebra/tests/nonreg_tests/bug_6783.dia.ref b/scilab/modules/linear_algebra/tests/nonreg_tests/bug_6783.dia.ref
new file mode 100644
index 0000000..576fdb3
--- /dev/null
+++ b/scilab/modules/linear_algebra/tests/nonreg_tests/bug_6783.dia.ref
@@ -0,0 +1,175 @@
1// =============================================================================
2// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3// Copyright (C) 2009 - DIGITEO - Allan CORNET
4//
5// This file is distributed under the same license as the Scilab package.
6// =============================================================================
7// <-- JVM NOT MANDATORY -->
8// <-- Non-regression test for bug 6783 -->
9//
10// <-- Bugzilla URL -->
11// http://bugzilla.scilab.org/show_bug.cgi?id=6783
12//
13// <-- Short Description -->
14// Solving a system of linear equation by backslash ("\") will cause a crash to Scilab 5.2.1, when using complex numbers.
15// Replication Code
16S=[
171.3 24 4.1 29 0.9 33
180.6 258 0.7 265 0.2 39
190.5 2 1.4 351 0.5 323
200.7 63 1.2 19 0.4 318
2117.0 152 29.0 196 6.0 232
2223.0 18 40.0 62 14.0 104
238.0 213 20.0 177 8.0 147
2412.0 106 26.0 45 11.0 21
258.1 25 6.4 182 6.9 203
262.0 282 2.5 20 1.5 114
275.9 215 5.6 34 4.6 25
283.7 185 3.6 5 2.8 9
2927.0 134 30.0 290 18.0 321
3023.0 17 26.0 151 9.0 220
3134.0 330 26.0 164 24.0 140
3233.0 187 20.0 18 24.0 350
332.4 50 3.8 157 3.6 289
342.2 281 3.7 57 3.0 187
354.5 322 5.9 149 1.1 48
361.6 249 3.1 62 1.3 239
3713.0 152 18.0 286 24.0 52
3821.0 77 16.0 166 47.0 298
3941.0 48 34.0 239 4.0 140
4080.0 301 67.0 120 10.0 81
413.7 43 2.6 215 5.4 290
423.3 284 3.6 66 3.4 196
435.6 340 3.7 172 2.1 342
442.6 272 2.3 72 2.3 274
4534.0 154 23.0 332 32.0 47
4629.0 56 13.0 209 59.0 299
4743.0 62 39.0 241 13.0 89
4891.0 309 75.0 131 15.0 321
49];
50S0=[2.3 278
510.4 266
521.1 270
530 0
5429 141
5521 32
5616 97
5716 4
585.9 132
590.3 0
605.4 327
613.8 313
6240 244
6312 75
6447 101
6538 343
661.6 337
671.5 281
685.9 34
692.5 310
708 37
718 320
7232 134
7367 29
742.3 5
752 307
767.4 43
773.2 320
784 0
7910 357
8034 128
8181 26
82];
83S02=[0.85 258
840.26 0
850.33 226
860.04 0
8714.43 71
8811.48 294
8914.19 65
9016.00 311
911.74 345
920.70 178
932.35 191
941.74 170
959.18 105
964.27 289
9710.32 356
984.75 0
992.97 215
1002.87 126
1015.14 242
1024.75 149
10314.98 327
10411.71 193
10510.32 323
10614.82 190
1072.60 100
1082.10 43
1093.40 152
1103.00 65
11123.00 287
11221.00 111
11322.00 229
11452.00 99
115];
116fac=[10
11710
11810
11910
1201
1211
1221
1231
12410
12510
12610
12710
1281
1291
1301
1311
13230
13330
13430
13530
1362
1372
1382
1392
14080
14180
14280
14380
1444
1454
1464
1474];
148if isdef('without')==%T;
149S(without:8:$,:)=[];
150S0(without:8:$,:)=[];
151fac(without:8:$,:)=[];
152else
153end
154S0_a=fac.*S0(:,1);
155S0_w=S0(:,2).*%pi/180;
156S0c=S0_a.*exp(%i*S0_w);
157S0_c2=S0(:,1).*exp(%i*S0_w); // ohne Faktor!!!!
158S02_a=fac.*S02(:,1);
159S02_w=S02(:,2).*%pi/180;
160S02c=S02_a.*exp(%i*S02_w);
161S02_c2=S02(:,1).*exp(%i*S02_w); // ohne Faktor
162S_a=S(:,1:2:$).*[fac fac fac];
163S_wdeg=S(:,2:2:$);
164S_w=S_wdeg*%pi/180;
165M_test=[1000 0 0 0 0 0 760 258
166 0 0 1000 0 0 0 0 0
167 0 0 0 0 1000 0 760 210];
168M_a=M_test(:,1:2:$);
169M_wdeg=M_test(:,2:2:$);
170M_w=M_wdeg*%pi/180;
171Sc=[S_a.*exp(%i*S_w) S02c-S0c];
172Mc=M_a.*exp(%i*M_w);
173ierr = execstr("C=Mc''\Sc''","errcatch");
174if ierr <> 0 then bugmes();quit;end
175if size(C) <> [3 32] then bugmes();quit;end
diff --git a/scilab/modules/linear_algebra/tests/nonreg_tests/bug_6783.tst b/scilab/modules/linear_algebra/tests/nonreg_tests/bug_6783.tst
new file mode 100644
index 0000000..545547d
--- /dev/null
+++ b/scilab/modules/linear_algebra/tests/nonreg_tests/bug_6783.tst
@@ -0,0 +1,192 @@
1// =============================================================================
2// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3// Copyright (C) 2009 - DIGITEO - Allan CORNET
4//
5// This file is distributed under the same license as the Scilab package.
6// =============================================================================
7
8// <-- JVM NOT MANDATORY -->
9
10// <-- Non-regression test for bug 6783 -->
11//
12// <-- Bugzilla URL -->
13// http://bugzilla.scilab.org/show_bug.cgi?id=6783
14//
15// <-- Short Description -->
16// Solving a system of linear equation by backslash ("\") will cause a crash to Scilab 5.2.1, when using complex numbers.
17
18// Replication Code
19S=[
201.3 24 4.1 29 0.9 33
210.6 258 0.7 265 0.2 39
220.5 2 1.4 351 0.5 323
230.7 63 1.2 19 0.4 318
2417.0 152 29.0 196 6.0 232
2523.0 18 40.0 62 14.0 104
268.0 213 20.0 177 8.0 147
2712.0 106 26.0 45 11.0 21
288.1 25 6.4 182 6.9 203
292.0 282 2.5 20 1.5 114
305.9 215 5.6 34 4.6 25
313.7 185 3.6 5 2.8 9
3227.0 134 30.0 290 18.0 321
3323.0 17 26.0 151 9.0 220
3434.0 330 26.0 164 24.0 140
3533.0 187 20.0 18 24.0 350
362.4 50 3.8 157 3.6 289
372.2 281 3.7 57 3.0 187
384.5 322 5.9 149 1.1 48
391.6 249 3.1 62 1.3 239
4013.0 152 18.0 286 24.0 52
4121.0 77 16.0 166 47.0 298
4241.0 48 34.0 239 4.0 140
4380.0 301 67.0 120 10.0 81
443.7 43 2.6 215 5.4 290
453.3 284 3.6 66 3.4 196
465.6 340 3.7 172 2.1 342
472.6 272 2.3 72 2.3 274
4834.0 154 23.0 332 32.0 47
4929.0 56 13.0 209 59.0 299
5043.0 62 39.0 241 13.0 89
5191.0 309 75.0 131 15.0 321
52];
53
54
55S0=[2.3 278
560.4 266
571.1 270
580 0
5929 141
6021 32
6116 97
6216 4
635.9 132
640.3 0
655.4 327
663.8 313
6740 244
6812 75
6947 101
7038 343
711.6 337
721.5 281
735.9 34
742.5 310
758 37
768 320
7732 134
7867 29
792.3 5
802 307
817.4 43
823.2 320
834 0
8410 357
8534 128
8681 26
87];
88
89S02=[0.85 258
900.26 0
910.33 226
920.04 0
9314.43 71
9411.48 294
9514.19 65
9616.00 311
971.74 345
980.70 178
992.35 191
1001.74 170
1019.18 105
1024.27 289
10310.32 356
1044.75 0
1052.97 215
1062.87 126
1075.14 242
1084.75 149
10914.98 327
11011.71 193
11110.32 323
11214.82 190
1132.60 100
1142.10 43
1153.40 152
1163.00 65
11723.00 287
11821.00 111
11922.00 229
12052.00 99
121];
122
123
124fac=[10
12510
12610
12710
1281
1291
1301
1311
13210
13310
13410
13510
1361
1371
1381
1391
14030
14130
14230
14330
1442
1452
1462
1472
14880
14980
15080
15180
1524
1534
1544
1554];
156
157if isdef('without')==%T;
158S(without:8:$,:)=[];
159S0(without:8:$,:)=[];
160fac(without:8:$,:)=[];
161else
162end
163
164S0_a=fac.*S0(:,1);
165S0_w=S0(:,2).*%pi/180;
166S0c=S0_a.*exp(%i*S0_w);
167S0_c2=S0(:,1).*exp(%i*S0_w); // ohne Faktor!!!!
168
169S02_a=fac.*S02(:,1);
170S02_w=S02(:,2).*%pi/180;
171S02c=S02_a.*exp(%i*S02_w);
172S02_c2=S02(:,1).*exp(%i*S02_w); // ohne Faktor
173
174
175S_a=S(:,1:2:$).*[fac fac fac];
176S_wdeg=S(:,2:2:$);
177S_w=S_wdeg*%pi/180;
178
179M_test=[1000 0 0 0 0 0 760 258
180 0 0 1000 0 0 0 0 0
181 0 0 0 0 1000 0 760 210];
182
183M_a=M_test(:,1:2:$);
184M_wdeg=M_test(:,2:2:$);
185M_w=M_wdeg*%pi/180;
186
187Sc=[S_a.*exp(%i*S_w) S02c-S0c];
188Mc=M_a.*exp(%i*M_w);
189
190ierr = execstr("C=Mc''\Sc''","errcatch");
191if ierr <> 0 then pause,end
192if size(C) <> [3 32] then pause,end