51
d=[1 2 3 4;4 5 6 7;8 9 10 11;12 13 14 15]
65
e1=[[1 2] [3 4];[5 6 7 8];[9;10;11;12]']
72
f([1 3 5],[1 2 3])=[-1 -2 -3;-4 -5 -6;-7 -8 -9]
114
p='apcdefghijklmnopqrstuvwxyz0123456789'
117
apcdefghijklmnopqrstuvwxyz0123456789
165
apcdefghijklmnopqrstuvwxyz0123456789
239
[1 2 3;4 5 6]-[1 2 3;4 5 6]
245
[1 2 3;4 5 6]+2*[1 2 3;4 5 6]-[1 2 3;4 5 6]*3
251
[1 i 3;4 5 i]+2*[1 i 3;4 5 i]-[1 i 3;4 5 i]*3
257
[2*i -4*i 2*i]+2*[i -2*i i]+i*[2 -4 2]-[i -2*i i]*2 -2*[2 -4 2]*i
269
i\[2*i 2 i*4]/i-[-i*2 -2 -4*i]
274
// element wise operations
276
[1 2;3 4;5 6].*[1 2;3 4;5 6]-[1 4;9 16;25 36]
283
[1 2;3 4;5 6*i].*[1 2;3 4;5 6]-[1 4;9 16;25 36*i]
290
[1 2;3 4;5 6].*[1 2;3 4;5 6*i]-[1 4;9 16;25 36*i]
297
[1 2;3 4;5 6*i].*[1 2;3 4;5 6*i]-[1 4;9 16;25 -36]
306
[2 9 8;3 10 15]./[2 3 4;3 5 5]-[1 3 2;1 2 3]
312
[2 9*i 8;3 10 15]./[2 3 4;3 5 5]-[1 3*i 2;1 2 3]
318
[2 9 8;3 10 15]./[2*i 3 4;3 5 5]-[-i 3 2;1 2 3]
324
[2*i 9 8;3 10 15]./[2*i 3 4;3 5 5]-[1 3 2;1 2 3]
332
[2 3 4;3 5 5].\[2 9 8;3 10 15]-[1 3 2;1 2 3]
338
[2 i 4;3 5 5].\[2 9 8;3 10 15]-[1 -9*i 2 ;1 2 3]
344
[2 3 4;3 5 5].\[i 9 8;3 10 15]-[.5*i 3 2;1 2 3]
350
[i 3 4;3 5 5].\[i 9 8;3 10 15]-[1 3 2;1 2 3]
358
[1 2 3;4 5 6]*[3;2;1]-[10;28]
364
[1 i 3;4 5 6]*[3;2;1]-[6+2*i;28]
370
[1 2 3;4 5 6]*[i;2;1]-[i+7;4*i+16]
376
[1 i 3;2*i,-i,1]*[i;-i;i]-[4*i+1;-3+i]
392
//a+-b*eye a*eye+-b a+-eye*b eye*a+-b
394
-2*eye()+[1 2;3 4]+eye()*2-[1 2;3 4]
400
-2*i*eye()+[1 2;3 4]+eye()*2*i-[1 2;3 4]
411
! 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. !
419
! 1. 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 !
427
for k=1:3,for l=1:2,a(k,l)=k+l;end;end;a
434
diag([1 2 3])-[1 0 0;0 2 0;0 0 3]
441
diag([1 i 2])-[1 0 0;0 i 0;0 0 2]
558
! 0.2113249 0.0002211 0.6653811 0.8497452 !
559
! 0.7560439 0.3303271 0.6283918 0.6857310 !
567
! 0.8782165 + 0.2312237i 0.5608486 + 0.8833888i !
568
! 0.0683740 + 0.2164633i 0.6623569 + 0.6525135i !
572
! 0.7263507 + 0.3076091i 0.5442573 + 0.2146008i !
573
! 0.1985144 + 0.9329616i 0.2320748 + 0.312642i !
578
! 0.3616361 0.4826472 0.5015342 !
579
! 0.2922267 0.3321719 0.4368588 !
580
! 0.5664249 0.5935095 0.2693125 !
585
! 0.6325745 0.0437334 !
586
! 0.4051954 0.4818509 !
587
! 0.9184708 0.2639556 !
780
a=rand(4,4);b=rand(5,4);ac=a+i*rand(4,4);bc=b+i*rand(5,4);
784
if abs((1/a)*a-eye())> 10*%eps then bugmes();quit;end
786
if abs((i/a)*a-i*eye())> 10*%eps then bugmes();quit;end
788
if abs((1/ac)*ac-eye())> 10*%eps then bugmes();quit;end
790
if abs((i/ac)*ac-i*eye())> 10*%eps then bugmes();quit;end
792
if abs(a*(a\1)-eye())> 10*%eps then bugmes();quit;end
794
if abs(a*(a\i)-i*eye())> 10*%eps then bugmes();quit;end
796
if abs(ac*(ac\1)-eye())> 10*%eps then bugmes();quit;end
798
if abs(ac*(ac\i)-eye()*i)> 10*%eps then bugmes();quit;end
802
if abs(inv(a)*a-eye())> 10*%eps then bugmes();quit;end
804
if abs(inv(ac)*ac-eye())> 10*%eps then bugmes();quit;end
808
if abs((b/a)*a-b)> 10*%eps then bugmes();quit;end
810
if abs((b/ac)*ac-b)> 10*%eps then bugmes();quit;end
812
if abs((bc/a)*a-bc)> 10*%eps then bugmes();quit;end
814
if abs((bc/ac)*ac-bc)> 10*%eps then bugmes();quit;end
818
if abs(a*(a\b')-b')> 10*%eps then bugmes();quit;end
820
if abs(ac*(ac\b')-b')> 10*%eps then bugmes();quit;end
822
if abs(a*(a\bc')-bc')> 10*%eps then bugmes();quit;end
824
if abs(ac*(ac\bc')-bc')> 10*%eps then bugmes();quit;end
830
if abs(l*u-a)> 10*%eps then bugmes();quit;end
834
if abs(l*u-ac)> 10*%eps then bugmes();quit;end
838
h1(5,5)=0;for k=1:5,for l=1:5, h1(k,l)=1/(k+l-1);end;end;
840
if abs(inv(h1)-testmatrix('hilb',5))> 1.e-7 then bugmes();quit;end
844
if abs(det(testmatrix('magic',5))-5070000)> 1.e-7 then bugmes();quit;end
850
if abs(h'*h-b)> 10*%eps then bugmes();quit;end
852
bc=triu(ac*ac');bc=bc+bc'-diag(real(diag(bc)));;h=chol(bc);
854
if abs(h'*h-bc)> 10*%eps then bugmes();quit;end
858
a=rand(3,4);b=rand(3,4);ac=a+i*rand(3,4);bc=b+i*rand(3,4);
862
if abs(a*(1/a)*a-a)> 10*%eps then bugmes();quit;end
864
if abs(a*(i/a)*a-i*a)> 10*%eps then bugmes();quit;end
866
if abs(a*(a\ 1)*a-a)> 10*%eps then bugmes();quit;end
868
if abs(a*(a\ i)*a-i*a)> 10*%eps then bugmes();quit;end
870
if abs(ac*(1/ac)*ac-ac)> 10*%eps then bugmes();quit;end
872
if abs(ac*(i/ac)*ac-i*ac)> 10*%eps then bugmes();quit;end
874
if abs(ac*(ac\ 1)*ac-ac)> 10*%eps then bugmes();quit;end
876
if abs(ac*(ac\ i)*ac-i*ac)> 10*%eps then bugmes();quit;end
880
if abs(a/b-a*(1/b))> 10*%eps then bugmes();quit;end
882
if abs(ac/b-ac*(1/b))> 10*%eps then bugmes();quit;end
884
if abs(a/bc-a*(1/bc))> 10*%eps then bugmes();quit;end
886
if abs(ac/bc-ac*(1/bc))> 10*%eps then bugmes();quit;end
890
if abs(a\ b -(a\ 1)*b)> 10*%eps then bugmes();quit;end
892
if abs(a\ bc-(a\ 1)*bc)> 10*%eps then bugmes();quit;end
894
if abs(ac\ b-(ac\ 1)*b)> 10*%eps then bugmes();quit;end
896
if abs(ac\ bc-(ac\ 1)*bc)> 10*%eps then bugmes();quit;end
902
a=rand(3,2);ai=a+rand(3,2)*%i;
906
if norm(ai.*de-ai*de,1) >1000*%eps then bugmes();quit;end
908
if norm(de.*ai-de*ai,1) >1000*%eps then bugmes();quit;end
910
if norm(ai.*de-ai*de,1) >1000*%eps then bugmes();quit;end
912
if norm(de.*ai-de*ai,1) >1000*%eps then bugmes();quit;end
916
if norm(ai.*de-ai*de,1) >1000*%eps then bugmes();quit;end
918
if norm(de.*ai-de*ai,1) >1000*%eps then bugmes();quit;end
920
if norm(ai.*de-ai*de,1) >1000*%eps then bugmes();quit;end
922
if norm(de.*ai-de*ai,1) >1000*%eps then bugmes();quit;end
928
if norm(a./de-a./def,1) >1000*%eps then bugmes();quit;end
930
if norm(ai./de-ai./def,1) >1000*%eps then bugmes();quit;end
934
de=2+3*%i;def=de*ones(a);
936
if norm(a./de-a./def,1) >1000*%eps then bugmes();quit;end
938
if norm(ai./de-ai./def,1) >1000*%eps then bugmes();quit;end
942
if norm(a.\de-a.\def,1) >1000*%eps then bugmes();quit;end
944
if norm(ai.\de-ai.\def,1) >1000*%eps then bugmes();quit;end
948
de=2+3*%i;def=de*ones(a);
950
if norm(a.\de-a.\def,1) >1000*%eps then bugmes();quit;end
952
if norm(ai.\de-ai.\def,1) >1000*%eps then bugmes();quit;end
959
if norm(de.\a-de.\a,1) >1000*%eps then bugmes();quit;end
961
if norm(de.\ai-def.\ai,1) >1000*%eps then bugmes();quit;end
965
de=2+3*%i;def=de*ones(a);
967
if norm(de.\a-def.\a,1) >1000*%eps then bugmes();quit;end
969
if norm(de.\ai-def.\ai,1) >1000*%eps then bugmes();quit;end
973
if norm(de./a-def./a,1) >1000*%eps then bugmes();quit;end
975
if norm(de./ai-def./ai,1) >1000*%eps then bugmes();quit;end
979
de=2+3*%i;def=de*ones(a);
981
if norm(de./a-def./a,1) >1000*%eps then bugmes();quit;end
983
if norm(de./ai-def./ai,1) >1000*%eps then bugmes();quit;end
989
if abs(p*r-a)> 10*%eps then bugmes();quit;end
993
if abs(p*r-a')> 10*%eps then bugmes();quit;end
997
if abs(p*r*x'-a)> 10*%eps then bugmes();quit;end
1001
if abs(p*r-ac)> 10*%eps then bugmes();quit;end
1005
if abs(p*r-ac*x)> 10*%eps then bugmes();quit;end
1009
if abs(cond(diag([1 2 3 4]))-4)> 10*%eps then bugmes();quit;end
1011
if abs(cond(diag([1 i 3 4]))-4)> 10*%eps then bugmes();quit;end
1015
if abs(norm(v,1)-15)> 10*%eps then bugmes();quit;end
1017
if abs(norm(v,'inf')-5)> 10*%eps then bugmes();quit;end
1019
if abs(norm(v,2)-sqrt(55))> 10*%eps then bugmes();quit;end
1021
if abs(norm(v,'fro')-sqrt(55))> 10*%eps then bugmes();quit;end
1025
if abs(norm(v,1)-15)> 10*%eps then bugmes();quit;end
1027
if abs(norm(v,'inf')-5)> 10*%eps then bugmes();quit;end
1029
if abs(norm(v,2)-sqrt(55))> 10*%eps then bugmes();quit;end
1031
if abs(norm(v,'fro')-sqrt(55))> 10*%eps then bugmes();quit;end
1035
if abs(norm(v,'inf')-5)> 10*%eps then bugmes();quit;end
1037
if abs(norm(v,2)-sqrt(55))> 10*%eps then bugmes();quit;end
1039
if abs(norm(v,'fro')-sqrt(55))> 10*%eps then bugmes();quit;end
1043
if abs(norm(v,1)-15)> 10*%eps then bugmes();quit;end
1045
if abs(norm(v,'inf')-5)> 10*%eps then bugmes();quit;end
1047
if abs(norm(v,2)-sqrt(55))> 10*%eps then bugmes();quit;end
1049
if abs(norm(v,'fro')-sqrt(55))> 10*%eps then bugmes();quit;end
1051
a=[diag([1 2 3]);[0 0 0]];
1053
if abs(norm(a,1)-3)> 10*%eps then bugmes();quit;end
1055
if abs(norm(a,'inf')-3)> 10*%eps then bugmes();quit;end
1057
if abs(norm(a,2)-3)> 10*%eps then bugmes();quit;end
1059
if abs(norm(a,'fro')-sqrt(14))> 10*%eps then bugmes();quit;end
1063
if abs(norm(a,1)-3)> 10*%eps then bugmes();quit;end
1065
if abs(norm(a,'inf')-3)> 10*%eps then bugmes();quit;end
1067
if abs(norm(a,2)-3)> 10*%eps then bugmes();quit;end
1069
if abs(norm(a,'fro')-sqrt(14))> 10*%eps then bugmes();quit;end
1071
a=[diag([i,2,3]),[0;0;0]];
1073
if abs(norm(a,'inf')-3)> 10*%eps then bugmes();quit;end
1075
if abs(norm(a,2)-3)> 10*%eps then bugmes();quit;end
1077
if abs(norm(a,'fro')-sqrt(14))> 10*%eps then bugmes();quit;end
1081
if abs(norm(a,1)-3)> 10*%eps then bugmes();quit;end
1083
if abs(norm(a,'inf')-3)> 10*%eps then bugmes();quit;end
1085
if abs(norm(a,2)-3)> 10*%eps then bugmes();quit;end
1087
if abs(norm(a,'fro')-sqrt(14))> 10*%eps then bugmes();quit;end
1091
a=rand(3,5);ac=a+i*rand(3,5);
1093
[u,s,v]=svd(a);u*s*v'-a;
1095
if abs(svd(a)-diag(s))> 10*%eps then bugmes();quit;end
1097
[u,s,v]=svd(ac);u*s*v'-ac;
1099
if abs(svd(ac)-diag(s))> 10*%eps then bugmes();quit;end
1103
[u,s,v]=svd(a,0);u*s*v'-a;
1105
if abs(svd(a,0)-diag(s,0))> 10*%eps then bugmes();quit;end
1107
[u,s,v]=svd(ac,0);u*s*v'-ac;
1109
if abs(svd(ac,0)-diag(s))> 10*%eps then bugmes();quit;end
1113
a=rand(3,5);ac=a+i*rand(3,5);
1115
[u,s,v]=svd(a);u*s*v'-a;
1117
if abs(svd(a)-diag(s))> 10*%eps then bugmes();quit;end
1119
[u,s,v]=svd(ac);u*s*v'-ac;
1121
if abs(svd(ac)-diag(s))> 10*%eps then bugmes();quit;end
1125
[u,s,v]=svd(a,0);u*s*v'-a;
1127
if abs(svd(a,0)-diag(s,0))> 10*%eps then bugmes();quit;end
1129
[u,s,v]=svd(ac,0);u*s*v'-ac;
1131
if abs(svd(ac,0)-diag(s))> 10*%eps then bugmes();quit;end
1135
if abs(a*pinv(a)*a-a)> 10*%eps then bugmes();quit;end
1137
if abs(ac*pinv(ac)*ac -ac)> 10*%eps then bugmes();quit;end
1141
if abs(a*pinv(a)*a-a)> 10*%eps then bugmes();quit;end
1143
if abs(ac*pinv(ac)*ac-ac)> 10*%eps then bugmes();quit;end
1147
if abs(rank(a)-3)> 10*%eps then bugmes();quit;end
1149
if abs(rank(ac)-3)> 10*%eps then bugmes();quit;end
1155
a=rand(4,4);ac=a+i*rand(4,4);t=a*a';tc=ac*ac';
1157
tc=triu(tc,1)+triu(tc,1)'+diag(real(diag(tc)));
1165
if norm(u*h*u'-a,1) > 20*%eps then bugmes();quit;end
1167
if abs(norm(h-hess(a),1))> 10*%eps then bugmes();quit;end
1171
if norm(u*h*u'-ac,1) > 200*%eps then bugmes();quit;end
1173
if abs(norm(h-hess(ac),1))> 10*%eps then bugmes();quit;end
1177
if norm(u*h*u'-t,1) > 200*%eps then bugmes();quit;end
1179
if abs(norm(h-hess(t),1))> 10*%eps then bugmes();quit;end
1183
if norm(u*h*u'-tc,1) > 200*%eps then bugmes();quit;end
1185
if abs(norm(h-hess(tc),1))> 10*%eps then bugmes();quit;end
1191
if norm(u*s*u'-a,1 ) > 200*%eps then bugmes();quit;end
1193
if norm(s-schur(a),1 ) > 200*%eps then bugmes();quit;end
1195
if norm(spec(a)-spec(s),1)> 200*%eps then bugmes();quit;end
1199
if norm(u*s*u'-ac,1 ) > 200*%eps then bugmes();quit;end
1201
if norm(s-schur(ac),1 ) > 200*%eps then bugmes();quit;end
1203
if norm(spec(ac)-spec(s),1)> 200*%eps then bugmes();quit;end
1207
if norm(u*s*u'-t,1 ) > 200*%eps then bugmes();quit;end
1209
if norm(s-schur(t),1 ) > 200*%eps then bugmes();quit;end
1211
if norm(diag(s)-spec(t),1)> 200*%eps then bugmes();quit;end
1215
if norm(u*s*u'-tc,1 ) > 200*%eps then bugmes();quit;end
1217
if norm(s-schur(tc),1 ) > 200*%eps then bugmes();quit;end
1219
if norm(diag(s)-spec(tc),1) > 200*%eps then bugmes();quit;end
1221
// fonctions matricielles
1225
if norm(t-s*s,1) > 200*%eps then bugmes();quit;end
1229
if norm(t-expm(s)) > 200*%eps then bugmes();quit;end
1233
if norm(tc-s*s,1) > 220*%eps then bugmes();quit;end
1235
s=expm(tc);s=triu(s,1)+triu(s,1)'+diag(real(diag(s)));
1237
if norm(logm(s)-tc,1)> 1.e-9 then bugmes();quit;end
1239
if norm(sinm(t)**2+cosm(t)**2-eye(),1) > 22*%eps then bugmes();quit;end
1241
// jpc --> 20 remplace par 25 pour gc-win32
1243
if norm(sinm(tc)**2+cosm(tc)**2-eye(),1) > 25*%eps then bugmes();quit;end
1247
p=rand(5,1);pc=p+i*rand(5,1);x=poly(0,'x');
1249
if norm(sort(p )-sort(real(roots(poly(p,'x'))))) > 1000*%eps then bugmes();quit;end
1251
if norm(sort(imag(pc))-sort(real(roots(poly(imag(pc),'x'))))) > 1000*%eps then bugmes();quit;end
1255
if norm(t^(-1)-inv(t),1) > 200*%eps then bugmes();quit;end
1257
if norm(tc**(-1)-inv(tc),1) > 200*%eps then bugmes();quit;end
1261
if norm((t**x)*(t^(-x))-eye(),1) > 200*%eps then bugmes();quit;end
1263
if norm((tc**x)*(tc**(-x))-eye(),1) > 200*%eps then bugmes();quit;end
1267
if norm(sin([0 pi/2 pi 3*pi/2])-[0 1 0 -1],1) > 10*%eps then bugmes();quit;end
1269
if norm(cos([0 pi/2 pi 3*pi/2])-[1 0 -1 0],1) > 10*%eps then bugmes();quit;end
1271
if norm(log([e 1/e e**2])-[1 -1 2],1) > 10*%eps then bugmes();quit;end
1273
if norm(exp([1 -1 2])-[e 1/e e**2],1) > 10*%eps then bugmes();quit;end
1275
if norm(sqrt([1 -1 4])-[1 i 2],1) > 10*%eps then bugmes();quit;end
1277
if norm(sin(x)-(exp(i*x)-exp(-i*x))/(2*i),1) > 10*%eps then bugmes();quit;end
1279
if norm(cos(x)-(exp(i*x)+exp(-i*x))/2,1) > 10*%eps then bugmes();quit;end
1281
if norm(sqrt(x)^2-x,1) > 10*%eps then bugmes();quit;end
1283
if norm(log(exp(x))-x,1) > 10*%eps then bugmes();quit;end
1287
z=poly(0,'z');a=[z 1 -z+1 8;z*z 10*z 5 -z;3 7 z+1 -1-z];
1289
[m,n]=size(a);mn=mini([m n]);a1=a;l=1;
1294
if norm(coeff(triu(a,dg)-a1),1)>%eps then dg,bugmes();quit;end,
1295
for k=1:l,a1(-dg+k,k)=0;end,l=mini([l+1,mn]);end
1298
if norm(coeff(triu(a,dg)-a1),1)>%eps then dg,bugmes();quit;end,
1299
if dg>(n-m),l=l-1;end;for k=1:l,a1(k,dg+k)=0;end;end;
1303
a=a';a1=a;[m,n]=size(a);mn=mini([m,n]);l=1;
1306
if norm(coeff(triu(a,dg)-a1),1)>%eps then dg,bugmes();quit;end,
1307
for k=1:l,a1(-dg+k,k)=0;end,l=mini([l+1,mn]);end
1310
if norm(coeff(triu(a,dg)-a1),1)>%eps then dg,bugmes();quit;end,
1311
if dg>(n-m),l=l-1;end;for k=1:l,a1(k,dg+k)=0;end;end;
1315
a=a+%i*[1 2 3 4;5 6 7 8;9 10 11 12]';
1317
[m,n]=size(a);mn=mini([m n]);a1=a;l=1;
1322
if norm(coeff(triu(a,dg)-a1),1)>%eps then dg,bugmes();quit;end,
1323
for k=1:l,a1(-dg+k,k)=0;end,l=mini([l+1,mn]);end
1326
if norm(coeff(triu(a,dg)-a1),1)>%eps then dg,bugmes();quit;end,
1327
if dg>(n-m),l=l-1;end;for k=1:l,a1(k,dg+k)=0;end;end;
1331
a=a';a1=a;[m,n]=size(a);mn=mini([m,n]);l=1;
1334
if norm(coeff(triu(a,dg)-a1),1)>%eps then dg,bugmes();quit;end,
1335
for k=1:l,a1(-dg+k,k)=0;end,l=mini([l+1,mn]);end
1338
if norm(coeff(triu(a,dg)-a1),1)>%eps then dg,bugmes();quit;end,
1339
if dg>(n-m),l=l-1;end;for k=1:l,a1(k,dg+k)=0;end;end;
1346
clear x,if exists('x')==1 then bugmes();quit;end
1350
clear x y,if exists('x')==1| exists('y')==1 then bugmes();quit;end
1354
clear X Y,if exists('X')==1| exists('Y')==1 then bugmes();quit;end
1358
//test with scalar vector and matrices
1367
if or(x1^2<>[1 4 9]) then bugmes();quit;end
1369
if or(x0^2<>[0 1 4]) then bugmes();quit;end
1371
if or(x1^0<>[1 1 1]) then bugmes();quit;end
1374
if norm(x1^(2*(1+%eps))-x1^2)>100*%eps then bugmes();quit;end
1376
if norm(x0^(2*(1+%eps))-x0^2)>100*%eps then bugmes();quit;end
1379
if norm(x1^(-2)-[1 0.25 1/9])>100*%eps then bugmes();quit;end
1381
if norm(x1^(-2*(1+%eps))-[1 0.25 1/9])>100*%eps then bugmes();quit;end
1388
if norm(x1^p-x1^2)>100*%eps then bugmes();quit;end
1390
if norm(x0^p-x0^2)>100*%eps then bugmes();quit;end
1392
if norm(x1^(-p)-x1^(-2))>100*%eps then bugmes();quit;end
1395
y=%eps*%eps*ones(1,3);x1=x1+y;x0=x0+y;
1397
if norm(x1^2-[1 4 9])>100*%eps then bugmes();quit;end
1399
if norm(x0^2-[0 1 4])>100*%eps then bugmes();quit;end
1402
x1^2.000000001;x0^2.000000001;
1404
if norm(x1^2-[1 4 9])>100*%eps then bugmes();quit;end
1406
if norm(x0^2-[0 1 4])>100*%eps then bugmes();quit;end
1409
if norm(x1^(-2)-[1 0.25 1/9])>100*%eps then bugmes();quit;end
1411
if norm(x1^(-2*(1+%eps))-[1 0.25 1/9])>100*%eps then bugmes();quit;end
1413
if norm(x1^p-x1^2)>100*%eps then bugmes();quit;end
1415
if norm(x0^p-x0^2)>100*%eps then bugmes();quit;end
1417
if norm(x1^(-p)-x1^(-2))>100*%eps then bugmes();quit;end
1420
//0.^ TEST WITH REAL VECTORS
1427
if or(x1.^2<>[1 4 9]) then bugmes();quit;end
1429
if or(x0.^2<>[0 1 4]) then bugmes();quit;end
1431
if or(x1.^0<>[1 1 1]) then bugmes();quit;end
1434
if norm(x1.^(2*(1+%eps))-x1.^2)>100*%eps then bugmes();quit;end
1436
if norm(x0.^(2*(1+%eps))-x0.^2)>100*%eps then bugmes();quit;end
1439
if norm(x1.^(-2)-[1 0.25 1/9])>100*%eps then bugmes();quit;end
1441
if norm(x1.^(-2*(1+%eps))-[1 0.25 1/9])>100*%eps then bugmes();quit;end
1444
//0.^ TEST WITH COMPLEX VECTORS
1449
if norm(x1.^p-x1.^2)>100*%eps then bugmes();quit;end
1451
if norm(x0.^p-x0.^2)>100*%eps then bugmes();quit;end
1453
if norm(x1.^(-p)-x1.^(-2))>100*%eps then bugmes();quit;end
1456
y=%eps*%eps*ones(1,3);x1=x1+y;x0=x0+y;
1458
if norm(x1.^2-[1 4 9])>100*%eps then bugmes();quit;end
1460
if norm(x0.^2-[0 1 4])>100*%eps then bugmes();quit;end
1463
x1.^2.000000001;x0.^2.000000001;
1465
if norm(x1.^2-[1 4 9])>100*%eps then bugmes();quit;end
1467
if norm(x0.^2-[0 1 4])>100*%eps then bugmes();quit;end
1470
if norm(x1.^(-2)-[1 0.25 1/9])>100*%eps then bugmes();quit;end
1472
if norm(x1.^(-2*(1+%eps))-[1 0.25 1/9])>100*%eps then bugmes();quit;end
1474
if norm(x1.^p-x1.^2)>100*%eps then bugmes();quit;end
1476
if norm(x0.^p-x0.^2)>100*%eps then bugmes();quit;end
1478
if norm(x1.^(-p)-x1.^(-2))>100*%eps then bugmes();quit;end
1486
if []^1 <> [] then bugmes();quit;end
1488
if []^[1 2 3] <> [] then bugmes();quit;end
1490
if [1 2 3]^[] <> [] then bugmes();quit;end
1492
if []^[] <> [] then bugmes();quit;end
1502
if or(x1^1<>x1) then bugmes();quit;end
1504
if or(x1^(-1)<>inv(x1)) then bugmes();quit;end
1506
if or(x1^2<>x1*x1) then bugmes();quit;end
1508
if or(x1^(-2)<>inv(x1)^2) then bugmes();quit;end
1513
if or(x1^2<>x1*x1) then bugmes();quit;end
1515
if or(x1^(-2)<>inv(x1)^2) then bugmes();quit;end
1517
if or(x1^1<>x1) then bugmes();quit;end
1519
if or(x1^(-1)<>inv(x1)) then bugmes();quit;end
1522
if or(rand(4,4)^0<>eye(4,4)) then bugmes();quit;end
1526
x1=[1 2;2 3];x2=x1^(1/2);
1528
if norm(x2^(2)-x1)>100*%eps then bugmes();quit;end
1532
if norm(x2^(-2)-x1)>100*%eps then bugmes();quit;end
1539
if norm(x2^(2)-x1)>100*%eps then bugmes();quit;end
1543
if norm(x2^(-2)-x1)>100*%eps then bugmes();quit;end
1546
//TEST WITH POLYNOMIAL VECTOR AND MATRICES
1548
//---------------------------------------
1552
if or(coeff(s^3+1)<>[1 0 0 1]) then bugmes();quit;end
1558
if or(x1^2<>[1 1+2*s+s^2 1+2*s^3+s^6]) then bugmes();quit;end
1560
if or(coeff(x1^0)<>[1 1 1]) then bugmes();quit;end
1562
if or(x1^3<>[1,1+3*s+3*s^2+s^3,1+3*s^3+3*s^6+s^9]) then bugmes();quit;end
1564
if or((x1^(-1)-[1 1/(1+s) 1/(1+s^3)])<>0) then bugmes();quit;end
1569
if or(x1.^2<>[1 1+2*s+s.^2 1+2*s.^3+s.^6]) then bugmes();quit;end
1571
if or(coeff(x1.^0)<>[1 1 1]) then bugmes();quit;end
1573
if or(x1.^3<>[1,1+3*s+3*s^2+s^3,1+3*s^3+3*s^6+s^9]) then bugmes();quit;end
1575
if or((x1.^(-1)-[1 1/(1+s) 1/(1+s.^3)])<>0) then bugmes();quit;end
1581
x1=[s+1 2*s;3+4*s^2 4];
1583
if or(x1^1<>x1) then bugmes();quit;end
1585
if or(x1^(-1)<>inv(x1)) then bugmes();quit;end
1587
if or(x1^2<>x1*x1) then bugmes();quit;end
1589
if or(x1^(-2)<>inv(x1)^2) then bugmes();quit;end
1594
if or(x1^2<>x1*x1) then bugmes();quit;end
1596
//if or(x1^(-2)<>inv(x1)^2) then bugmes();quit;end //simp complexe non implemented
1598
if or(x1^1<>x1) then bugmes();quit;end
1600
//if or(x1^(-1)<>inv(x1)) then bugmes();quit;end //simp complexe non implemented
1606
if 1==0 then bugmes();quit;end
1608
if 1<0 then bugmes();quit;end
1610
if 1<=0 then bugmes();quit;end
1612
if 1==1 then,else bugmes();quit;end
1614
if ~(1==1) then bugmes();quit;end
1616
if 0>1 then bugmes();quit;end
1618
if 0>=1 then bugmes();quit;end
1620
if 1<>1 then bugmes();quit;end
1622
if 0<>1 then,else bugmes();quit;end
1624
if '1'=='0' then bugmes();quit;end
1626
if '1'<>'1' then bugmes();quit;end
1631
if %s==0 then bugmes();quit;end
1633
if 0==%s then bugmes();quit;end
1635
if %s==%s then,else bugmes();quit;end
1637
if %s<>%s then bugmes();quit;end
1639
if %s==%s+1 then bugmes();quit;end
1641
if %s+1==%s then bugmes();quit;end
1644
if 1/%s==0 then bugmes();quit;end
1646
if 0==1/%s then bugmes();quit;end
1648
if 1/%s==1/%s then,else bugmes();quit;end
1650
if 1/%s<>1/%s then bugmes();quit;end
1652
if 1/%s==1/%s+1 then bugmes();quit;end
1654
if 1/%s+1==1/%s then bugmes();quit;end
1656
if 1/%s<>1/%s+1 then , else bugmes();quit;end
1658
if 1/%s+1<>1/%s then , else bugmes();quit;end
1661
l=list(1,[1 23],'adssa')
1677
l1=list(123,'sdwqqwq')
1689
if l==0 then bugmes();quit;end
1691
if 0==l then bugmes();quit;end
1693
if l==l then,else bugmes();quit;end
1695
if l<>l then bugmes();quit;end
1697
if l==l1 then bugmes();quit;end
1699
if l1==l then bugmes();quit;end
1701
if l<>l1 then , else bugmes();quit;end
1703
if l1<>l then , else bugmes();quit;end
1707
if %t&1==2 then bugmes();quit;end
1709
if %t|1==2 then, else bugmes();quit;end
1711
if %t&-1==2 then bugmes();quit;end
1713
if %t|-1==2 then, else bugmes();quit;end
1715
if 1<2&1==2 then bugmes();quit;end
1717
if 1<2|1==2 then, else bugmes();quit;end
1719
if 1<2&-1==2 then bugmes();quit;end
1721
if 1<2|-1==2 then, else bugmes();quit;end
1723
if 2>1&1==2 then bugmes();quit;end
1725
if 2>1|1==2 then, else bugmes();quit;end
1727
if 2>1&-1==2 then bugmes();quit;end
1729
if 2>1|-1==2 then, else bugmes();quit;end
1731
if 1==1&1==2 then bugmes();quit;end
1733
if 1==1|1==2 then, else bugmes();quit;end
1735
if 1==1&-1==2 then bugmes();quit;end
1737
if 1==1|-1==2 then, else bugmes();quit;end
1739
if 1<>2&1==2 then bugmes();quit;end
1741
if 1<>2|1==2 then, else bugmes();quit;end
1743
if 1<>2&-1==2 then bugmes();quit;end
1745
if 1<>2|-1==2 then, else bugmes();quit;end
1748
if %t&1>2 then bugmes();quit;end
1750
if %t|1>2 then, else bugmes();quit;end
1752
if %t&-1>2 then bugmes();quit;end
1754
if %t|-1>2 then, else bugmes();quit;end
1756
if 1<2&1>2 then bugmes();quit;end
1758
if 1<2|1>2 then, else bugmes();quit;end
1760
if 1<2&-1>2 then bugmes();quit;end
1762
if 1<2|-1>2 then, else bugmes();quit;end
1764
if 2>1&1>2 then bugmes();quit;end
1766
if 2>1|1>2 then, else bugmes();quit;end
1768
if 2>1&-1>2 then bugmes();quit;end
1770
if 2>1|-1>2 then, else bugmes();quit;end
1772
if 1==1&1>2 then bugmes();quit;end
1774
if 1==1|1>2 then, else bugmes();quit;end
1776
if 1==1&-1>2 then bugmes();quit;end
1778
if 1==1|-1>2 then, else bugmes();quit;end
1780
if 1<>2&1>2 then bugmes();quit;end
1782
if 1<>2|1>2 then, else bugmes();quit;end
1784
if 1<>2&-1>2 then bugmes();quit;end
1786
if 1<>2|-1>2 then, else bugmes();quit;end