summaryrefslogtreecommitdiffstats
path: root/scilab/modules/linear_algebra
diff options
context:
space:
mode:
authorSylvestre Ledru <sylvestre.ledru@scilab.org>2010-02-16 11:30:53 +0100
committerSylvestre Ledru <sylvestre.ledru@scilab.org>2010-02-16 11:30:53 +0100
commitf5d810984d61e289c9b0ab532fdd78130155bd7b (patch)
tree7e7ab64034caf909f2e169abeb6613bc52efc458 /scilab/modules/linear_algebra
parent857280b48897ee74a8214eae841edeef7eb8a328 (diff)
parentec1b0f087e72d7ad26dc8d9146a45d2f0b156482 (diff)
downloadscilab-f5d810984d61e289c9b0ab532fdd78130155bd7b.zip
scilab-f5d810984d61e289c9b0ab532fdd78130155bd7b.tar.gz
Merge remote branch 'origin/5.2'
Conflicts: scilab/CHANGES_5.2.X scilab/configure scilab/m4/docbook.m4
Diffstat (limited to 'scilab/modules/linear_algebra')
-rw-r--r--scilab/modules/linear_algebra/help/en_US/schur.xml5
-rw-r--r--scilab/modules/linear_algebra/help/pt_BR/schur.xml40
2 files changed, 24 insertions, 21 deletions
diff --git a/scilab/modules/linear_algebra/help/en_US/schur.xml b/scilab/modules/linear_algebra/help/en_US/schur.xml
index e05807d..e397096 100644
--- a/scilab/modules/linear_algebra/help/en_US/schur.xml
+++ b/scilab/modules/linear_algebra/help/en_US/schur.xml
@@ -292,6 +292,7 @@ function t=mytest(Ev),t=abs(Ev)<0.95,endfunction
292T(1:dim,1:dim) 292T(1:dim,1:dim)
293 293
294// The same function in C (a Compiler is required) 294// The same function in C (a Compiler is required)
295cd TMPDIR;
295C=['int mytest(double *EvR, double *EvI) {' //the C code 296C=['int mytest(double *EvR, double *EvI) {' //the C code
296 'if (*EvR * *EvR + *EvI * *EvI < 0.9025) return 1;' 297 'if (*EvR * *EvR + *EvI * *EvI < 0.9025) return 1;'
297 'else return 0; }';] 298 'else return 0; }';]
@@ -299,7 +300,7 @@ mputl(C,TMPDIR+'/mytest.c')
299 300
300 301
301//build and link 302//build and link
302lp=ilib_for_link('mytest','mytest.c',[],'c',TMPDIR+'/Makefile'); 303lp=ilib_for_link('mytest','mytest.c',[],'c');
303link(lp,'mytest','c'); 304link(lp,'mytest','c');
304 305
305//run it 306//run it
@@ -328,7 +329,7 @@ ftn=['integer function mytestf(ar,ai,b)' //the fortran code
328mputl(' '+ftn,TMPDIR+'/mytestf.f') 329mputl(' '+ftn,TMPDIR+'/mytestf.f')
329 330
330//build and link 331//build and link
331lp=ilib_for_link('mytestf','mytestf.f',[],'F',TMPDIR+'/Makefile'); 332lp=ilib_for_link('mytestf','mytestf.f',[],'F');
332link(lp,'mytestf','f'); 333link(lp,'mytestf','f');
333 334
334//run it 335//run it
diff --git a/scilab/modules/linear_algebra/help/pt_BR/schur.xml b/scilab/modules/linear_algebra/help/pt_BR/schur.xml
index 48ace26..bb8cb41 100644
--- a/scilab/modules/linear_algebra/help/pt_BR/schur.xml
+++ b/scilab/modules/linear_algebra/help/pt_BR/schur.xml
@@ -356,32 +356,33 @@
356 <title>Exemplos</title> 356 <title>Exemplos</title>
357 357
358 <programlisting role="example"><![CDATA[ 358 <programlisting role="example"><![CDATA[
359//FORMA SCHUR DE UMA MATRIZ 359//SCHUR FORM OF A MATRIX
360//---------------------- 360//----------------------
361A=diag([-0.9,-2,2,0.9]);X=rand(A);A=inv(X)*A*X; 361A=diag([-0.9,-2,2,0.9]);X=rand(A);A=inv(X)*A*X;
362[U,T]=schur(A);T 362[U,T]=schur(A);T
363 363
364[U,dim,T]=schur(A,'c'); 364[U,dim,T]=schur(A,'c');
365T(1:dim,1:dim) //autovalores estáveis contínuos 365T(1:dim,1:dim) //stable cont. eigenvalues
366 366
367function t=mytest(Ev),t=abs(Ev)<0.95,endfunction 367function t=mytest(Ev),t=abs(Ev)<0.95,endfunction
368[U,dim,T]=schur(A,mytest); 368[U,dim,T]=schur(A,mytest);
369T(1:dim,1:dim) 369T(1:dim,1:dim)
370 370
371// A mesma função em C (um compilador é requerido) 371// The same function in C (a Compiler is required)
372C=['int mytest(double *EvR, double *EvI) {' //o codigo C 372cd TMPDIR;
373C=['int mytest(double *EvR, double *EvI) {' //the C code
373 'if (*EvR * *EvR + *EvI * *EvI < 0.9025) return 1;' 374 'if (*EvR * *EvR + *EvI * *EvI < 0.9025) return 1;'
374 'else return 0; }';] 375 'else return 0; }';]
375mputl(C,TMPDIR+'/mytest.c') 376mputl(C,TMPDIR+'/mytest.c')
376 377
377 378
378//construindo e ligando 379//build and link
379lp=ilib_for_link('mytest','mytest.c',[],'c',TMPDIR+'/Makefile'); 380lp=ilib_for_link('mytest','mytest.c',[],'c');
380link(lp,'mytest','c'); 381link(lp,'mytest','c');
381 382
382//executando 383//run it
383[U,dim,T]=schur(A,'mytest'); 384[U,dim,T]=schur(A,'mytest');
384//FORMA SCHUR DE UM FEIXE 385//SCHUR FORM OF A PENCIL
385//---------------------- 386//----------------------
386F=[-1,%s, 0, 1; 387F=[-1,%s, 0, 1;
387 0,-1,5-%s, 0; 388 0,-1,5-%s, 0;
@@ -389,25 +390,26 @@ F=[-1,%s, 0, 1;
389 1, 0, 0, -2+%s]; 390 1, 0, 0, -2+%s];
390A=coeff(F,0);E=coeff(F,1); 391A=coeff(F,0);E=coeff(F,1);
391[As,Es,Q,Z]=schur(A,E); 392[As,Es,Q,Z]=schur(A,E);
392Q'*F*Z //isto é As+%s*Es 393Q'*F*Z //It is As+%s*Es
394
393 395
394[As,Es,Z,dim] = schur(A,E,'c') 396[As,Es,Z,dim] = schur(A,E,'c')
395function t=mytest(Alpha,Beta),t=real(Alpha)&lt;0,endfunction 397function t=mytest(Alpha,Beta),t=real(Alpha)<0,endfunction
396[As,Es,Z,dim] = schur(A,E,mytest) 398[As,Es,Z,dim] = schur(A,E,mytest)
397 399
398//a mesma função em FORTRAN (um compilador é requerido) 400//the same function in Fortran (a Compiler is required)
399ftn=['funcao inteira mytestf(ar,ai,b)' //codigo FORTRAN 401ftn=['integer function mytestf(ar,ai,b)' //the fortran code
400 'double precision ar,ai,b' 402 'double precision ar,ai,b'
401 'mytestf=0' 403 'mytestf=0'
402 'if(ar.lt.0.0d0) mytestf=1' 404 'if(ar.lt.0.0d0) mytestf=1'
403 'end'] 405 'end']
404mputl(' '+ftn,TMPDIR+'/mytestf.f') 406mputl(' '+ftn,TMPDIR+'/mytestf.f')
405 407
406//construíndo e ligando 408//build and link
407lp=ilib_for_link('mytestf','mytestf.f',[],'F',TMPDIR+'/Makefile'); 409lp=ilib_for_link('mytestf','mytestf.f',[],'F');
408link(lp,'mytestf','f'); 410link(lp,'mytestf','f');
409 411
410//executando 412//run it
411 413
412[As,Es,Z,dim] = schur(A,E,'mytestf') 414[As,Es,Z,dim] = schur(A,E,'mytestf')
413 ]]></programlisting> 415 ]]></programlisting>