~ubuntu-branches/ubuntu/hoary/scilab/hoary

« back to all changes in this revision

Viewing changes to tests/scilab.tst

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2005-01-09 22:58:21 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050109225821-473xr8vhgugxxx5j
Tags: 3.0-12
changed configure.in to build scilab's own malloc.o, closes: #255869

Show diffs side-by-side

added added

removed removed

Lines of Context:
329
329
// matdsr  matdsc
330
330
a=rand(4,4);ac=a+i*rand(4,4);t=a*a';tc=ac*ac';
331
331
tc=triu(tc,1)+triu(tc,1)'+diag(real(diag(tc)));
332
 
//
333
 
//hess
334
 
[u,h]=hess(a);
335
 
if norm(u*h*u'-a,1) > 20*%eps then pause,end
336
 
if abs(norm(h-hess(a),1))> 10*%eps then pause,end
337
 
[u,h]=hess(ac);
338
 
if norm(u*h*u'-ac,1) > 200*%eps then pause,end
339
 
if abs(norm(h-hess(ac),1))> 10*%eps then pause,end
340
 
[u,h]=hess(t);
341
 
if norm(u*h*u'-t,1)  > 200*%eps then pause,end
342
 
if abs(norm(h-hess(t),1))> 10*%eps then pause,end
343
 
[u,h]=hess(tc);
344
 
if norm(u*h*u'-tc,1)  > 200*%eps then pause,end
345
 
if abs(norm(h-hess(tc),1))> 10*%eps then pause,end
346
 
//schur
347
 
[u,s]=schur(a);
348
 
if norm(u*s*u'-a,1 ) > 200*%eps then pause,end
349
 
if norm(s-schur(a),1 ) > 200*%eps then pause,end
350
 
if norm(spec(a)-spec(s),1)> 200*%eps then pause,end
351
 
[u,s]=schur(ac);
352
 
if norm(u*s*u'-ac,1 ) > 200*%eps then pause,end
353
 
if norm(s-schur(ac),1 ) > 200*%eps then pause,end
354
 
if norm(spec(ac)-spec(s),1)> 200*%eps then pause,end
355
 
[u,s]=schur(t);
356
 
if norm(u*s*u'-t,1 ) > 200*%eps then pause,end
357
 
if norm(s-schur(t),1 ) > 200*%eps then pause,end
358
 
if norm(diag(s)-spec(t),1)> 200*%eps then pause,end
359
 
[u,s]=schur(tc);
360
 
if norm(u*s*u'-tc,1 ) > 200*%eps then pause,end
361
 
if norm(s-schur(tc),1 ) > 200*%eps then pause,end
362
 
if norm(diag(s)-spec(tc),1) > 200*%eps then pause,end
 
332
tc=tc/max(abs(spec(tc))+1);
 
333
 
363
334
// fonctions matricielles
364
335
s=sqrtm(t);
365
 
if norm(t-s*s,1) > 200*%eps then pause,end
 
336
if norm(t-s*s,1) > 500*%eps then pause,end
366
337
s=logm(t);
367
 
if norm(t-expm(s)) > 200*%eps then pause,end
 
338
if norm(t-expm(s)) > 500*%eps then pause,end
368
339
s=sqrtm(tc);
369
 
if norm(tc-s*s,1) > 220*%eps then pause,end
 
340
if norm(tc-s*s,1) > 500*%eps then pause,end
370
341
s=expm(tc);s=triu(s,1)+triu(s,1)'+diag(real(diag(s)));
371
 
if norm(logm(s)-tc,1)> 1.e-9 then pause,end
372
 
if norm(sinm(t)**2+cosm(t)**2-eye(),1) > 22*%eps then pause,end
373
 
// jpc --> 20 remplace par 25 pour gc-win32 
374
 
if norm(sinm(tc)**2+cosm(tc)**2-eye(),1) > 25*%eps then pause,end
 
342
if norm(logm(s)-tc,1)> 500*%eps then pause,end
 
343
if norm(sinm(t)**2+cosm(t)**2-eye(),1) > 50*%eps then pause,end
 
344
if norm(sinm(tc)**2+cosm(tc)**2-eye(),1) > 50*%eps then pause,end
375
345
//poly et root
376
346
p=rand(5,1);pc=p+i*rand(5,1);x=poly(0,'x');
377
347
if norm(sort(p )-sort(real(roots(poly(p,'x'))))) > 1000*%eps then pause,end
378
 
if norm(sort(imag(pc))-sort(real(roots(poly(imag(pc),'x'))))) > 1000*%eps then pause,end
 
348
if norm(sort(imag(pc))-sort(real(roots(poly(imag(pc),'x'))))) > 10000*%eps then pause,end
379
349
//**
380
350
if norm(t^(-1)-inv(t),1) > 200*%eps then pause,end
381
351
if norm(tc**(-1)-inv(tc),1) > 200*%eps then pause,end