diff options
Diffstat (limited to '2.3-1/tests/unit_tests/float')
82 files changed, 2306 insertions, 0 deletions
diff --git a/2.3-1/tests/unit_tests/float/test_float_Convol.sci b/2.3-1/tests/unit_tests/float/test_float_Convol.sci new file mode 100644 index 00000000..6b099b22 --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_Convol.sci @@ -0,0 +1,125 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT +function test_float_Convol() + + + disp(convol(4,4.5)); //d0d0Convold0 + disp(convol(%i + 3 ,2*%i + 4)); // z0z0Convolz0 + + + a = [1 2 3 4 5 %e %pi]; + b = [1 7 8 5 1 6 ]; + + disp(convol(a,b)); + disp(convol(b,b)); // d2d2Convold2 + + + disp(convol(4,a)); //d0d2Convold2 + disp(convol(a,4)); // d2d0Convold2 + + + c = [1 2 3 4 5 %e %pi] * %i; + d = [1 7 8 5 1 6 ] * %i; + + disp(convol(c,d)); + disp(convol(d,d)); // z2z2Convolz2 + + + disp(convol(%i + 3 ,c)); // z0z2Convolz2 + disp(convol(d ,2*%i + 4)); // z2z0Convolz2 + +// with 2 outputs + + +// [zz yy] = convol(4,4.5); //d0d0Convold0d0 +// disp( zz ); + //disp( yy ); + +// [xx ww ] = convol(%i + 3 ,2*%i + 4); // z0z0Convolz0z0 +// disp( xx); +// disp( ww ); + +// [vv uu] =convol(a,b); +// disp( vv); // d2d2Convold2d2 +// disp( uu ); + + +// [tt ss] = convol(4,a); //d0d2Convold2d2 +// disp( tt); +// disp( ss ); + + + +// [rr qq] = convol(a,4); // d2d0Convold2d2 +// disp( rr ); +// disp( qq ); + + + +// with 2 outputs + +// [pp oo] =convol(c,d); +// disp( pp); // z2z2Convolz2z2 +// disp( oo ); + + +// [mm nn] = convol(4,c); //z0z2Convolz2z2 +// disp( mm); +// disp( nn ); + + + +// [ll kk] = convol(c,4); // z2z0Convolz2z2 +// disp( ll ); + //disp( kk); + + +// three input i + +// with 2 outputs + + + //[zzz yyy] = convol(4,4.5,18); //d0d0d0Convold0d0 + //disp( zzz ); + //disp( yyy ); + + //[xxx www ] = convol(%i + 3 ,2*%i + 4,%i); // z0z0z0Convolz0z0 + //disp( xxx); + //disp( www ); + +// bbis = [4 7 9 10]; + + //[vvv uuu] =convol(a,b,bbis); +// disp( vvv); // d2d2d2Convold2d2 +// disp( uuu ); +// + + //[ttt sss] = convol(4,a, 8); //d0d2d0Convold2d0 + //disp( ttt); + //disp( sss ); + +// with 2 outputs +//dbis = [10 13 14] *%i; +// [ppp ooo] =convol(c,d, dbis); +// disp( ppp); // z2z2z2Convolz2z2 +// disp( ooo ); + + +// [mmm nnn] = convol(4 * %i ,c , %i); //z0z2z0Convolz2z0 +// disp( mmm); +// disp( nnn); + +//mixed up + +// disp(convol(a,c)); //d2z2Convolz2 +// disp(convol(c,a)); // z2d2Convolz2 +// disp(convol(4,c)); //d0z2Convolz2 +// disp(convol(%i + 3 ,a)); // z0d2Convolz2 + +// disp(convol(a, %i)); //d2z0Convolz2 +// disp(convol(c , 4)); // z2d0Convolz2 + + + + + +endfunction diff --git a/2.3-1/tests/unit_tests/float/test_float_Det.sci b/2.3-1/tests/unit_tests/float/test_float_Det.sci new file mode 100644 index 00000000..66519d97 --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_Det.sci @@ -0,0 +1,16 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT +function test_float_Det() + + a = [1 2 3; 4 %pi 5; 4.5 -3 2]; + disp(det(a)); + + b = %i * [1 2 3; 4 %pi 5; 4.5 -3 2]; + disp(det(b)); + + + disp(det(5)); + + disp(det(%i)); +endfunction + + diff --git a/2.3-1/tests/unit_tests/float/test_float_Disp.sci b/2.3-1/tests/unit_tests/float/test_float_Disp.sci new file mode 100644 index 00000000..2c6044ed --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_Disp.sci @@ -0,0 +1,14 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT +function test_float_Disp () + + disp(4.5); + disp(4+3*%i); + disp("a"); + + disp([1 2 3 4 5 ; 6 7 8 9 10]); + disp(%i*[1 2 3 4 5 ; 6 7 8 9 10]); + disp("plop"); + + +endfunction + diff --git a/2.3-1/tests/unit_tests/float/test_float_Expm.sci b/2.3-1/tests/unit_tests/float/test_float_Expm.sci new file mode 100644 index 00000000..239161a7 --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_Expm.sci @@ -0,0 +1,10 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT +function test_float_Expm() + b = [1 2 3 4 ; 5 6 7 8 ; 9 10 11 12 ; 13 14 15 16]; + c = b*%i ; + + disp(expm(b)); + disp(expm(c)); + + +endfunction diff --git a/2.3-1/tests/unit_tests/float/test_float_FFTShift.sci b/2.3-1/tests/unit_tests/float/test_float_FFTShift.sci new file mode 100644 index 00000000..e3a076f8 --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_FFTShift.sci @@ -0,0 +1,38 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT +function test_float_FFTShift() + + disp(fftshift(5.3));// d0*d0 + disp(fftshift(5.3*%i));// z0*z0 + disp(fftshift(5.3 + 5.6*%i ));// z0*z0 + + + a = fft ([10 1 15 3.5 ]); + disp(fftshift(a)); + + b = [ 14 15 2 6 ; 1 2 6 4 ; 48.5 3 9.3 1 ]; + disp(fftshift(b)); + disp(fftshift(b , 1)); + disp(fftshift(b , 2)); + //disp(fftshift(b , "all")); + + + c = [10 1 15 3.5 ]*%i; + disp(fftshift(c)); + + d = [ 14 15 2 6 ; 1 2 6 4 ; 48.5 3 9.3 1 ]*%i; + disp(fftshift(b)); + disp(fftshift(b , 1)); + disp(fftshift(b , 2)); + //disp(fftshift(b , "all")); + + + e = c + [10 1 15 3.5 ]*%i; + disp(fftshift(e)); + + f = [ 18 15 7 6 ; 1 5 6 4 ; 43.5 1 9.3 1 ] + [ 14 15 2 6 ; 1 2 6 4 ; 48.5 3 9.3 1 ]*%i; + disp(fftshift(f)); + disp(fftshift(f , 1)); + disp(fftshift(f , 2)); + //disp(fftshift(f , "all")); + +endfunction diff --git a/2.3-1/tests/unit_tests/float/test_float_Fft.sci b/2.3-1/tests/unit_tests/float/test_float_Fft.sci new file mode 100644 index 00000000..601e9587 --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_Fft.sci @@ -0,0 +1,173 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT +function test_float_Fft() + +disp(fft(4.4)) +disp(fft(%i + 3.4)) + + +// one input + a = [10 1 15 3.5 ]; //d2Fftz2 + disp(fft(a)); + disp(""); + b = [25 3.6]; // d2Fftd2 + disp(fft(b)); + disp(""); + c= [10 2 5 6 3 8 9 445 1 2 3 0 125 5 41 4 5 552 2.36 45656 72.3 ] + disp(fft(c)); + disp(""); + // pure imaginary + d = [10 1 15 3.5 ]*%i; //z2Fftz2 + disp(fft(d)); + disp(""); + e = [25 3.6]*%i; // z2Fftd2 + disp(fft(e)); + disp(""); + f= %i*[10 2 5 6 3 8 9 445 1 2 3 0 125 5 41 4 5 552 2.36 45656 72.3 ] + disp(fft(f)); + disp(""); + // full complex + + g = a + [10 1 15 3.5 ]*%i; //z2Fftz2 + disp(fft(g)); + disp(""); + h = b + [25 3.6]*%i; // z2Fftd2 + disp(fft(h)); + disp(""); + j= c + %i*[10 2 5 6 3 8 9 445 1 2 3 0 125 5 41 4 5 552 2.36 45656 72.3 ] + disp(fft(j)); + disp(""); + disp("*******************"); + disp("*******************"); + disp(""); +// two output +// call ifft + disp(fft(a,1)); + disp(""); + disp(fft(b,1)); + disp(""); + disp(fft(c,1)); + disp(""); + disp(fft(d,1)); + disp(""); + disp(fft(e,1)); + disp(""); + disp(fft(f,1)); + disp(""); + // full complex + disp(fft(g,1)); + disp(""); + disp(fft(h,1)); + disp(""); + disp(fft(j,1)); + disp(""); + disp(""); + disp("*******************"); + disp("*******************"); + disp(""); +// + disp(fft(a,-1)); + disp(""); + disp(fft(b,-1)); + disp(""); + disp(fft(c,-1)); + disp(""); + disp(fft(d,-1)); + disp(""); + disp(fft(e,-1)); + disp(""); + disp(fft(f,-1)); + disp(""); + // full complex + disp(fft(g,-1)); + disp(""); + disp(fft(h,-1)); + disp(""); + disp(fft(j,-1)); + disp(""); + + +// ******************** +// MATRIX +// ******************** +// one input + aa = [10 1 15 3.5 ; 5 3 9 6 ]; //d2Fftz2 + disp(fft(aa)); + disp(""); + bb = [25 3.6 ; 4 3.2]; // d2Fftd2 + disp(fft(bb)); + disp(""); + cc= [10 2 5 6 3 8 9 445 1 2 3 0 125 5 41 4 5 552 2.36 45656 72.3 ; 21 8 2 5 6 3 4 123 5 6 0 5 548 7 65 4 2 166 4.12 65546 1.78 ] + disp(fft(cc)); + disp(""); + // pure imaginary + dd = [10 1 15 3.5 ; 5 8 6 3 ]*%i; //z2Fftz2 + disp(fft(dd)); + disp(""); + ee = [25 3.6 ; 4 5.9 ]*%i; // z2Fftd2 + disp(fft(ee)); + disp(""); + ff = %i*[10 2 5 6 3 8 9 445 1 2 3 0 125 5 41 4 5 552 2.36 45656 72.3; 21 8 2 5 6 3 4 123 5 6 0 5 548 7 65 4 2 166 4.12 65546 1.78 ] + + disp(fft(ff)); + disp(""); + // full complex + + gg = aa + dd; //z2Fftz2 + disp(fft(gg)); + disp(""); + hh = bb + ee; // z2Fftd2 + disp(fft(hh)); + disp(""); + jj= cc + ff + disp(fft(jj)); + disp(""); + disp("*******************"); + disp("*******************"); + disp(""); +// two output +// call ifft + disp(fft(aa,1)); + disp(""); + disp(fft(bb,1)); + disp(""); + disp(fft(cc,1)); + disp(""); + disp(fft(dd,1)); + disp(""); + disp(fft(ee,1)); + disp(""); + disp(fft(ff,1)); + disp(""); + // full complex + disp(fft(gg,1)); + disp(""); + disp(fft(hh,1)); + disp(""); + disp(fft(jj,1)); + disp(""); + disp(""); + disp("*******************"); + disp("*******************"); + disp(""); +// + disp(fft(aa,-1)); + disp(""); + disp(fft(bb,-1)); + disp(""); + disp(fft(cc,-1)); + disp(""); + disp(fft(dd,-1)); + disp(""); + disp(fft(ee,-1)); + disp(""); + disp(fft(ff,-1)); + disp(""); + // full complex + disp(fft(gg,-1)); + disp(""); + disp(fft(hh,-1)); + disp(""); + disp(fft(jj,-1)); + disp(""); + +endfunction diff --git a/2.3-1/tests/unit_tests/float/test_float_Find.sci b/2.3-1/tests/unit_tests/float/test_float_Find.sci new file mode 100644 index 00000000..a8d642c0 --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_Find.sci @@ -0,0 +1,32 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT +function test_float_Find () + + disp (find( 1 == 3 )); // d0Findd0 + + a = [1 2 3; 4 5 6]; + b = [1 8 3; 9 5 6]; + disp (find( a == b )); // d2Findd2 + + [ z , j ] = find (1 == 3); // d0Findd0d0 + [ k , l ] = find (a == b); // d2Findd2d2 + + disp(z); + disp(j); + disp(k); + disp(l); + + disp ( find( 1 == 3 , 2 )); // d0d0Findd0 + + c = [1 2 3; 4 5 6]; + d = [1 8 3; 9 5 6]; + disp (find( c == d , 2 )); // d2d0Findd2 + + [ o , p ] = find (1 == 3 , 2); // d0d0Findd0d0 + [ q , s ] = find (c == d , 2); // d2d0Findd2d2 + + disp(o); + disp(p); + disp(q); + disp(s); + +endfunction diff --git a/2.3-1/tests/unit_tests/float/test_float_IFFT.sci b/2.3-1/tests/unit_tests/float/test_float_IFFT.sci new file mode 100644 index 00000000..196d3798 --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_IFFT.sci @@ -0,0 +1,90 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT +function test_float_IFFT() + + +disp(ifft(2)); // d0IFFTd0 +disp(ifft(%i + 4)) // z0IFFTz0 + +disp(ifft([1 2])); // d2IFFTd2 +disp(ifft([1 -2 3] + zeros(1 , 3)*%i )); // d2IFFTz2 +disp(ifft([1 2]*%i)); // z2IFFTz2 + +disp(ifft(4.4)) +disp(ifft(%i + 3.4)) + + +// one input + a = [10 1 15 3.5 ]; //d2Fftz2 + Abis = a + zeros(a)*%i ; + disp(ifft(Abis)); + disp("********1*******"); + b = [25 3.6]; // d2Fftd2 + disp(ifft(b)); + disp("********2*******"); + c= [10 2 5 6 3 8 9 445 1 2 3 0 125 5 41 4 5 552 2.36 45656 72.3 ] + cbis = c + zeros(c)*%i ; + disp(ifft(cbis)); + disp("********3*********"); + // pure imaginary + d = [10 1 15 3.5 ]*%i; //z2Fftz2 + disp(ifft(d)); + disp("********4*********"); + e = [25 3.6]*%i; // z2Fftd2 + disp(ifft(e)); + disp("********5***********"); + f= %i*[10 2 5 6 3 8 9 445 1 2 3 0 125 5 41 4 5 552 2.36 45656 72.3 ] + disp(ifft(f)); + disp("********6***********"); + // full complex + + g = a + [10 1 15 3.5 ]*%i; //z2Fftz2 + disp(ifft(g)); + disp("********7***********"); + h = b + [25 3.6]*%i; // z2Fftd2 + disp(ifft(h)); + disp("********8***********"); + j= c + %i*[10 2 5 6 3 8 9 445 1 2 3 0 125 5 41 4 5 552 2.36 45656 72.3 ] + disp(ifft(j)); + disp("********************"); + disp("*******************"); + disp("*******************"); + disp("********************"); + + +// ******************** +// MATRIX +// ******************** +// one input + aa = [10 1 15 3.5 ; 5 3 9 6 ]; //d2Fftz2 + disp(ifft(aa)); + disp("********9***********"); + bb = [25 3.6 ; 4 3.2]; // d2Fftd2 + disp(ifft(bb)); + disp("********10**********"); + cc= [10 2 5 6 3 8 9 445 1 2 3 0 125 5 41 4 5 552 2.36 45656 72.3 ; 21 8 2 5 6 3 4 123 5 6 0 5 548 7 65 4 2 166 4.12 65546 1.78 ] + disp(ifft(cc)); + disp("********11**********"); + // pure imaginary + dd = [10 1 15 3.5 ; 5 8 6 3 ]*%i; //z2Fftz2 + disp(ifft(dd)); + disp("********12**********"); + ee = [25 3.6 ; 4 5.9 ]*%i; // z2Fftd2 + disp(ifft(ee)); + disp("********13**********"); + ff = %i*[10 2 5 6 3 8 9 445 1 2 3 0 125 5 41 4 5 552 2.36 45656 72.3; 21 8 2 5 6 3 4 123 5 6 0 5 548 7 65 4 2 166 4.12 65546 1.78 ] + + disp(ifft(ff)); + disp("********14**********"); + // full complex + + gg = aa + dd; //z2Fftz2 + disp(ifft(gg)); + disp("********15**********"); + hh = bb + ee; // z2Fftd2 + disp(ifft(hh)); + disp("********16**********"); + jj= cc + ff + disp(ifft(jj)); + + +endfunction diff --git a/2.3-1/tests/unit_tests/float/test_float_Length.sci b/2.3-1/tests/unit_tests/float/test_float_Length.sci new file mode 100644 index 00000000..744dc5b1 --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_Length.sci @@ -0,0 +1,33 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT +function test_float_Length() + disp(length(4)); + disp(length(2+3*%i)); + disp(length([1 2 3 ; 4 5 6])); + disp(length([1 2 3 ; 4 5 6]*%i)); + e = %pi ; + disp(length(e)); // d0Lengthd0 + + f = e * %i; + disp(length(f));// z0Lengthd0 + + a = [1 2 3 ; 4 5 6]; + disp(length(a));// d2Lengthd0 + + b = [1 2 3 ; 4 5 6] * %i; + disp(length(b));// z2Lengthd0 + + + g = "pouet" ; + h = "a" ; + + disp(length(g)); // g0Lengthd0 + disp(length(h)); // g2Lengthd0 + + disp(length("pouet")); + disp(length("a")); + + + + + +endfunction diff --git a/2.3-1/tests/unit_tests/float/test_float_Lev.sci b/2.3-1/tests/unit_tests/float/test_float_Lev.sci new file mode 100644 index 00000000..195d0232 --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_Lev.sci @@ -0,0 +1,32 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT +function test_float_Lev() + + a = [1 2 3 4 5 6 7 8 9 10] ; + + disp(lev(a)) ; + + [aa aaa] = lev(a); + disp(aa); + disp(aaa) + + [a1 aa1 aaa1] = lev (a); + disp(a1); + disp(aa1); + disp(aaa1); + +// complex + b =%i * [1 2 3 4 5 6 7 8 9 10] ; + + disp(lev(b)) ; + + [bb bbb] = lev(b); + disp(bb); + disp(bbb) + + [b1 bb1 bbb1] = lev (b); + disp(b1); + disp(bb1); + disp(bbb1); + + +endfunction diff --git a/2.3-1/tests/unit_tests/float/test_float_Meanf.sci b/2.3-1/tests/unit_tests/float/test_float_Meanf.sci new file mode 100644 index 00000000..44b3dac4 --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_Meanf.sci @@ -0,0 +1,49 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT + +function test_float_Meanf() + + disp (meanf (4 , 5 )) ; + disp ("*******1*******"); + disp (meanf ([4 5 6], [1 2 3])); + disp ("*******2*******"); + disp (meanf (4 , 5*%i )) ; + disp ("*******3*******"); + disp (meanf ([4 5 6], [1 2 3]*%i)); + disp ("*******4*******"); + + + + disp (meanf ([4 5 6 ; 7 8 9], [1 2 3 ; 4 5 6],1)); + disp ("*******5*******"); + disp (meanf ([4 7; 5 8; 6 9], [1 4; 2 5; 3 6],2)); +// complex + disp ("*******6*******"); + disp (meanf (4 +4*%i , 5 )) ; + disp ("*******7*******"); + disp (meanf ([4*%i, 5+6*%i, 6], [1 2 3])); + disp ("*******8*******"); + disp (meanf (4 +4*%i , 5*%i )) ; + disp ("*******9*******"); + disp (meanf ([4*%i, 5+6*%i, 6], [1 2 3]*%i)); + disp ("******10*******"); + + + disp (meanf ([4 5 6 ; 7 8 9]*%i, [1 2 3 ; 4 5 6],1)); + disp ("******11*******"); + disp (meanf ([4 7; 5 8; 6 9], [1 4; 2 5; 3 6]*%i,2)); + disp ("******12*******"); + disp (meanf ([4 5 6 ; 7 8 9],[1 2 3 ; 4 8 9] + [1 2 3 ; 4 5 6]*%i,1)); + disp ("******13*******"); + disp (meanf ([4 7; 5 8; 6 9]*%i, [1 4; 2 5; 3 6],2)); + disp ("******14*******"); + + disp (meanf ([4 5 6 ; 7 8 9]*%i, [1 2 3 ; 4 5 6]*%i,1)); + disp ("******15*******"); + disp (meanf ([4 7; 5 8; 6 9]*%i, [1 4; 2 5; 3 6]*%i,2)); + disp ("******16*******"); +// + + +// + +endfunction diff --git a/2.3-1/tests/unit_tests/float/test_float_OpApex.sci b/2.3-1/tests/unit_tests/float/test_float_OpApex.sci new file mode 100644 index 00000000..6e8ec187 --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_OpApex.sci @@ -0,0 +1,12 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT +function test_float_OpApex() + d0 = %pi + d2 = [1 2 3 4 ; 5 6 7 8 ; 9 10 11 12 ; 13 14 15 16] + z0 = d0 + %i * d0 + z2 = d2 + %i * d2 + + disp(d0') + disp(d2') + disp(z0') + disp(z2') +endfunction diff --git a/2.3-1/tests/unit_tests/float/test_float_OpCc.sci b/2.3-1/tests/unit_tests/float/test_float_OpCc.sci new file mode 100644 index 00000000..e04ede06 --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_OpCc.sci @@ -0,0 +1,47 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT + + +function test_float_OpCc() + + a = [1 ; 2 ; 3 ; 4]; // d0d0OpCcs2 + b = [7 ; a];// d0d2OpCcs2 + c = [a ; 7];// d2d0OpCcs2 + d = [a ; b];// d2d2OpCcs2 + disp(a); + disp(b); + disp(c); + disp(d); + + e = [1*%i ; 2*%i ; 3*%i ; 4*%i ];// z0z0OpCcz2 + f = [7 ; e];// z0z2OpCcz2 + g = [e ; 7];// z2z0OpCcz2 + h = [e ; f];// z2z2OpCcz2 + + disp(e); + disp(f); + disp(g); + disp(h); + + + i = [%i ; 4.5]; // z0d0OpCcz2 + j = [4.5 ; %i ]; // d0z0OpCcz2 + k = [4.5 ; i ]; // d0z2OpCcz2 + l = [i ; 4.5]; // z2d0OpCcz2 + + disp(i); + disp(j); + disp(k); + disp(l); + + m = [1 ; 4.5]; + n = [%i ; m ]; // z0d2OpCcz2 + o = [m ; %i ]; // d0z2OpCcz2 + p = [m ; n ]; // d2z2OpCcz2 + q = [n ; m ]; // z2d2OpCcz2 + + disp(n); + disp(o); + disp(p); + disp(q); + +endfunction diff --git a/2.3-1/tests/unit_tests/float/test_float_OpColon.sci b/2.3-1/tests/unit_tests/float/test_float_OpColon.sci new file mode 100644 index 00000000..b87608b9 --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_OpColon.sci @@ -0,0 +1,42 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT +function test_float_OpColon() + + +// A = [1 2 3 4 ; 5 6 7 8 ; 9 10 11 12]; +// B = A * %i ; +d = %i ; +a = %pi ; +b = %e ; +c = [7 8 5 ]; +disp(zeros ( a , %e )); + +disp(zeros ( %pi , %e)); +disp(zeros(c)); +disp(zeros ([4 5 6 ; 4 5 6]) ); + + disp(0:1:3); + disp(1:1); + disp(4+53*%i:0); +// + + disp(2:5); + disp(4+3*%i:8+%i); +// + + disp(1:5:1); + disp(%i:%i+1:2); +// + + disp(2:7:5); + disp(4+3*%i:4:8+%i); +//a =4 + 53 *%i : 0 ; +endfunction +//OUT(1).SZ(2)= FA_INT( +// FA_ADD( +// FA_DIV( +// FA_SUB(FA_REAL(IN(3).VAL,IN(3).TP),FA_REAL(IN(1).VAL, IN(3).TP)) +// ,FA_REAL(IN(2).VAL,IN(2).TP) +// ) +// ,''1'' +// ) +// ) diff --git a/2.3-1/tests/unit_tests/float/test_float_OpDotApex.sci b/2.3-1/tests/unit_tests/float/test_float_OpDotApex.sci new file mode 100644 index 00000000..5d9ed92a --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_OpDotApex.sci @@ -0,0 +1,12 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT +function test_float_OpDotApex() + d0 = %pi + d2 = [1 2 3 4 ; 5 6 7 8 ; 9 10 11 12 ; 13 14 15 16] + z0 = d0 + %i * d0 + z2 = d2 + %i * d2 + + disp(d0.') + disp(d2.') + disp(z0.') + disp(z2.') +endfunction diff --git a/2.3-1/tests/unit_tests/float/test_float_OpDotBackSlas.sci b/2.3-1/tests/unit_tests/float/test_float_OpDotBackSlas.sci new file mode 100644 index 00000000..5df04b1e --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_OpDotBackSlas.sci @@ -0,0 +1,31 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT +function test_float_OpDotBackSlas() + d0 = %pi + d2 = [1 2 3 4 ; 5 6 7 8 ; 9 10 11 12 ; 13 14 15 16] + z0 = d0 + %i * d0 + z2 = d2 + %i * d2 + + disp(d0.\d0) + disp(z0.\z0) + disp(d2.\d0) + disp(z2.\z0) + + disp(d0.\d2) + disp(z0.\z2) + + disp(d2.\d2) + disp(z2.\z2) + + disp(d2.\z0) + disp(z2.\d0) + + disp(d0.\z2) + disp(z0.\d2) + + disp(d0.\z0) + disp(z0.\d0) + + disp(d2.\z2) + disp(z2.\d2) + +endfunction diff --git a/2.3-1/tests/unit_tests/float/test_float_OpDotHat.sci b/2.3-1/tests/unit_tests/float/test_float_OpDotHat.sci new file mode 100644 index 00000000..119af7b9 --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_OpDotHat.sci @@ -0,0 +1,30 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT +function test_float_OpDotHat() + d0 = %pi + d2 = [1 2 3 4 ; 5 6 7 8 ; 9 10 11 12 ; 13 14 15 16] + z0 = d0 + %i * d0 + z2 = d2 + %i * d2 + + disp(d0.^d0) + disp(z0.^z0) + disp(d2.^d0) + disp(z2.^z0) + + disp(d0.^d2) + disp(z0.^z2) + + disp(d2.^d2) + disp(z2.^z2) + + disp(d2.^z0) + disp(z2.^d0) + + disp(d0.^z2) + disp(z0.^d2) + + disp(d0.^z0) + disp(z0.^d0) + + disp(d2.^z2) + disp(z2.^d2) +endfunction diff --git a/2.3-1/tests/unit_tests/float/test_float_OpDotSlash.sci b/2.3-1/tests/unit_tests/float/test_float_OpDotSlash.sci new file mode 100644 index 00000000..d6efb3c5 --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_OpDotSlash.sci @@ -0,0 +1,27 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT +function test_float_OpDotSlash() + d0 = %pi + d2 = [1 2 3 4 ; 5 6 7 8 ; 9 10 11 12 ; 13 14 15 16] + z0 = d0 + %i * d0 + z2 = d2 + %i * d2 + + disp(d0./d0) + disp(d0./z0) + disp(d0./d2) + disp(d0./z2) + + disp(d2./d0) + disp(d2./z0) + disp(d2./d2) + disp(d2./z2) + + disp(z0./d0) + disp(z0./z0) + disp(z0./d2) + disp(z0./z2) + + disp(z2./d0) + disp(z2./z0) + disp(z2./d2) + disp(z2./z2) +endfunction diff --git a/2.3-1/tests/unit_tests/float/test_float_OpDotStar.sci b/2.3-1/tests/unit_tests/float/test_float_OpDotStar.sci new file mode 100644 index 00000000..e0392e9c --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_OpDotStar.sci @@ -0,0 +1,27 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT +function test_float_OpDotStar() + d0 = %pi + d2 = [1 2 3 4 ; 5 6 7 8 ; 9 10 11 12 ; 13 14 15 16] + z0 = d0 + %i * d0 + z2 = d2 + %i * d2 + + disp(d0.*d0) + disp(d0.*z0) + disp(d0.*d2) + disp(d0.*z2) + + disp(d2.*d0) + disp(d2.*z0) + disp(d2.*d2) + disp(d2.*z2) + + disp(z0.*d0) + disp(z0.*z0) + disp(z0.*d2) + disp(z0.*z2) + + disp(z2.*d0) + disp(z2.*z0) + disp(z2.*d2) + disp(z2.*z2) +endfunction diff --git a/2.3-1/tests/unit_tests/float/test_float_OpEqual.sci b/2.3-1/tests/unit_tests/float/test_float_OpEqual.sci new file mode 100644 index 00000000..494a5859 --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_OpEqual.sci @@ -0,0 +1,25 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT +function test_float_OpEqual() + + a = %pi; + disp(a); + + + b = %pi + %i; + disp(b); + + + c = "a"; + disp(c); + + + d =[ %pi 4 5]; + disp(d); + + e = [7 8 9]*%i; + disp(e); + + f = "plopilou" ; + disp(f); + +endfunction diff --git a/2.3-1/tests/unit_tests/float/test_float_OpExt.sci b/2.3-1/tests/unit_tests/float/test_float_OpExt.sci new file mode 100644 index 00000000..eaf0e43c --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_OpExt.sci @@ -0,0 +1,26 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT +function test_float_OpExt () + + a = [1 2 3 ; 4 5 6]; + + + disp(a(2)); + disp(a([3 5])); + disp(a(2,3)); + disp(a(2,[2 3])); + disp(a ([1 2],1)); + disp(a ([1 2],[2 3])); + + + b = [1 2 3 ; 4 5 6] * %i; + + + disp(b(2)); + disp(b([3 5])); + disp(b(2,3)); + disp(b(2,[2 3])); + disp(b ([1 2],1)); + disp(b ([1 2],[2 3])); + + +endfunction diff --git a/2.3-1/tests/unit_tests/float/test_float_OpHat.sci b/2.3-1/tests/unit_tests/float/test_float_OpHat.sci new file mode 100644 index 00000000..22dd5e93 --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_OpHat.sci @@ -0,0 +1,30 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT +function test_float_OpHat() + d0 = %pi + d2 = [1 2 3 4 ; 5 6 7 8 ; 9 10 11 12 ; 13 14 15 16] + z0 = d0 + %i * d0 + z2 = d2 + %i * d2 + +// disp(d0^d0) + // disp(z0^z0) + // disp(d2^d0) + //disp(z2^z0) + + //disp(d0^d2) + //disp(z0^z2) + + //disp(d2^d2) // ! Not implemented in Scilab ! + //disp(z2^z2) // ! Not implemented in Scilab ! + + //disp(d2^z0) + //disp(z2^d0) + + disp(d0^z2) + disp(z0^d2) + + //disp(d0^z0) + //disp(z0^d0) + + //disp(d2^z2) // ! Not implemented in Scilab ! + //disp(z2^d2) // ! Not implemented in Scilab ! +endfunction diff --git a/2.3-1/tests/unit_tests/float/test_float_OpIns.sci b/2.3-1/tests/unit_tests/float/test_float_OpIns.sci new file mode 100644 index 00000000..0fd6590c --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_OpIns.sci @@ -0,0 +1,130 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT +function test_float_OpIns() + //reals +a=[1 2 3; 4 5 6] + +a(3)=-2 +disp(a); + +a(3)=-4+%i +disp(a); + +a(1,3)=-12; +disp(a); + +a(1,3)=-5+%i; +disp(a); + +a([1,2],1)=-12; +disp(a); + +a([1,2],1)=-5+%i; +disp(a); + +a(2,[2,3])=-12; +disp(a); + +a(2,[2,3])=-5+%i; +disp(a); + +a([1 2],[1,2,3])=4; +disp(a); + +a([1 2],[1,2,3])=3+%i; +disp(a); + +a([1,3])=7; +disp(a); + +a([1,3])=2+%i; +disp(a); + +a([1,3])=[1,0]; +disp(a); + +a([1,3])=[3-%i,1+%i]; +disp(a); + +a(2,[1,3])=[-2,-7]; +disp(a); + +a(2,[1,3])=[-4+%i,-5+%i]; +disp(a); + +a([1,2],3)=[-9;-1]; +disp(a); + +a([1,2],3)=[-4+%i;-5+%i]; +disp(a); + +a([1,2],[2,3])=[-31 -45;-29 -51]; +disp(a); + +a([1,2],[2,3])=[-4+%i,-5+%i;-4+%i,-5+%i]; +disp(a); + + +//complexes + +b=[1-3*%i 2+%i 3+2*%i; 4 5+4*%i 6] + +b(3)=-2 +disp(b); + +b(3)=-4+%i +disp(b); + +b(1,3)=-12; +disp(b); + +b(1,3)=-5+%i; +disp(b); + +b([1,2],1)=-12; +disp(b); + +b([1,2],1)=-5+%i; +disp(b); + +b(2,[2,3])=-12; +disp(b); + +b(2,[2,3])=-5+%i; +disp(b); + +b([1 2],[1,2,3])=4; +disp(b); + +b([1 2],[1,2,3])=3+%i; +disp(b); + +b([1,3])=7; +disp(b); + +b([1,3])=2+%i; +disp(b); + +b([1,3])=[1,0]; +disp(b); + +b([1,3])=[3-%i,1+%i]; +disp(b); + +b(2,[1,3])=[-2,-7]; +disp(b); + +b(2,[1,3])=[-4+%i,-5+%i]; +disp(b); + +b([1,2],3)=[-9;-1]; +disp(b); + +b([1,2],3)=[-4+%i;-5+%i]; +disp(b); + +b([1,2],[2,3])=[-31 -45;-29 -51]; +disp(b); + +b([1,2],[2,3])=[-4+%i,-5+%i;-4+%i,-5+%i]; +disp(b); +endfunction
\ No newline at end of file diff --git a/2.3-1/tests/unit_tests/float/test_float_OpLogAnd.sci b/2.3-1/tests/unit_tests/float/test_float_OpLogAnd.sci new file mode 100644 index 00000000..3a919dc9 --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_OpLogAnd.sci @@ -0,0 +1,38 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT +function test_float_OpLogAnd() + d0 = %pi + d2 = [1 2 3 4 ; 5 6 7 8 ; 9 10 11 12 ; 13 14 15 16] + z0 = d0 + %i * d0 + z2 = d2 + %i * d2 + + disp(d0&d0) + disp(z0&z0) + disp(d2&d0) + disp(z2&z0) + + disp(d0&d2) + disp(z0&z2) + + disp(d2&d2) + disp(z2&z2) + + disp(d2&z0) + disp(z2&d0) + + disp(d0&z2) + disp(z0&d2) + + disp(d0&z0) + disp(z0&d0) + + disp(d2&z2) + disp(z2&d2) + + disp(''); + disp(%t&%f) + disp(%f&%t) + disp(%t&%t) + disp(%f&%f) + disp(''); + disp([%t %f] &%f) +endfunction diff --git a/2.3-1/tests/unit_tests/float/test_float_OpLogEq.sci b/2.3-1/tests/unit_tests/float/test_float_OpLogEq.sci new file mode 100644 index 00000000..8a753ec4 --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_OpLogEq.sci @@ -0,0 +1,34 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT +function test_float_OpLogEq() + d0 = %pi + d2 = [1 2 3 4 ; 5 6 7 8 ; 9 10 11 12 ; 13 14 15 16] + z0 = d0 + %i * d0 + z2 = d2 + %i * d2 + g0 = 'A' + g2 = "foo" + + //disp(g0==g0) // ! Unable to manage this case ! + + disp(d0==d0) + disp(z0==z0) + disp(d2==d0) + disp(z2==z0) + + disp(d0==d2) + disp(z0==z2) + + disp(d2==d2) + disp(z2==z2) + + disp(d2==z0) + disp(z2==d0) + + disp(d0==z2) + disp(z0==d2) + + disp(d0==z0) + disp(z0==d0) + + disp(d2==z2) + disp(z2==d2) +endfunction diff --git a/2.3-1/tests/unit_tests/float/test_float_OpLogGe.sci b/2.3-1/tests/unit_tests/float/test_float_OpLogGe.sci new file mode 100644 index 00000000..a1e0ef2f --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_OpLogGe.sci @@ -0,0 +1,30 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT +function test_float_OpLogGe() + d0 = %pi + d2 = [1 2 3 4 ; 5 6 7 8 ; 9 10 11 12 ; 13 14 15 16] + z0 = d0 + %i * d0 + z2 = d2 + %i * d2 + + disp(d0>=d0) + //disp(z0>=z0) + disp(d2>=d0) + //disp(z2>=z0) + + disp(d0>=d2) + //disp(z0>=z2) + + disp(d2>=d2) + //disp(z2>=z2) + + //disp(d2>=z0) + //disp(z2>=d0) + + //disp(d0>=z2) + //disp(z0>=d2) + + //disp(d0>=z0) + //disp(z0>=d0) + + //disp(d2>=z2) + //disp(z2>=d2) + endfunction diff --git a/2.3-1/tests/unit_tests/float/test_float_OpLogGt.sci b/2.3-1/tests/unit_tests/float/test_float_OpLogGt.sci new file mode 100644 index 00000000..f51b3195 --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_OpLogGt.sci @@ -0,0 +1,31 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT +function test_float_OpLogGt() + d0 = %pi + d2 = [1 2 3 4 ; 5 6 7 8 ; 9 10 11 12 ; 13 14 15 16] + z0 = d0 + %i * d0 + z2 = d2 + %i * d2 + + disp(d0>d0) + //disp(z0>z0) + disp(d2>d0) + //disp(z2>z0) + + disp(d0>d2) + //disp(z0>z2) + + disp(d2>d2) + //disp(z2>z2) + + //disp(d2>z0) + //disp(z2>d0) + + //disp(d0>z2) + //disp(z0>d2) + + //disp(d0>z0) + //disp(z0>d0) + + //disp(d2>z2) + //disp(z2>d2) + +endfunction diff --git a/2.3-1/tests/unit_tests/float/test_float_OpLogLe.sci b/2.3-1/tests/unit_tests/float/test_float_OpLogLe.sci new file mode 100644 index 00000000..435940c6 --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_OpLogLe.sci @@ -0,0 +1,30 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT +function test_float_OpLogLe() + d0 = %pi + d2 = [1 2 3 4 ; 5 6 7 8 ; 9 10 11 12 ; 13 14 15 16] + z0 = d0 + %i * d0 + z2 = d2 + %i * d2 + + disp(d0<=d0) + //disp(z0<=z0) + disp(d2<=d0) + //disp(z2<=z0) + + disp(d0<=d2) + //disp(z0<=z2) + + disp(d2<=d2) + //disp(z2<=z2) + + //disp(d2<=z0) + //disp(z2<=d0) + + //disp(d0<=z2) + //disp(z0<=d2) + + //disp(d0<=z0) + //disp(z0<=d0) + + //disp(d2<=z2) + //disp(z2<=d2) +endfunction
\ No newline at end of file diff --git a/2.3-1/tests/unit_tests/float/test_float_OpLogLt.sci b/2.3-1/tests/unit_tests/float/test_float_OpLogLt.sci new file mode 100644 index 00000000..02deb345 --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_OpLogLt.sci @@ -0,0 +1,30 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT +function test_float_OpLogLt() + d0 = %pi + d2 = [1 2 3 4 ; 5 6 7 8 ; 9 10 11 12 ; 13 14 15 16] + z0 = d0 + %i * d0 + z2 = d2 + %i * d2 + + disp(d0<d0) + //disp(z0<z0) + disp(d2<d0) + //disp(z2<z0) + + disp(d0<d2) + //disp(z0<z2) + + disp(d2<d2) + //disp(z2<z2) + + //disp(d2<z0) + //disp(z2<d0) + + //disp(d0<z2) + //disp(z0<d2) + + //disp(d0<z0) + //disp(z0<d0) + + //disp(d2<z2) + //disp(z2<d2) +endfunction diff --git a/2.3-1/tests/unit_tests/float/test_float_OpLogNe.sci b/2.3-1/tests/unit_tests/float/test_float_OpLogNe.sci new file mode 100644 index 00000000..858b9c8b --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_OpLogNe.sci @@ -0,0 +1,34 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT +function test_float_OpLogNe() + d0 = %pi + d2 = [1 2 3 4 ; 5 6 7 8 ; 9 10 11 12 ; 13 14 15 16] + z0 = d0 + %i * d0 + z2 = d2 + %i * d2 + g0 = 'A' + g2 = "foo" + + //disp(g0<>g0) + + disp(d0<>d0) + disp(z0<>z0) + disp(d2<>d0) + disp(z2<>z0) + + disp(d0<>d2) + disp(z0<>z2) + + disp(d2<>d2) + disp(z2<>z2) + + disp(d2<>z0) + disp(z2<>d0) + + disp(d0<>z2) + disp(z0<>d2) + + disp(d0<>z0) + disp(z0<>d0) + + disp(d2<>z2) + disp(z2<>d2) +endfunction diff --git a/2.3-1/tests/unit_tests/float/test_float_OpLogNot.sci b/2.3-1/tests/unit_tests/float/test_float_OpLogNot.sci new file mode 100644 index 00000000..b4fc390e --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_OpLogNot.sci @@ -0,0 +1,24 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT +function test_float_OpLogNot() +// test OpLogNot + + disp(~(-2)) + disp(~(0)) + disp(~(3)) + + disp(~(0-2*%i)) + disp(~(0+0*%i)) + disp(~(0+3*%i)) + disp(~(3-5*%i)) + disp(~(3+0*%i)) + disp(~(3+6*%i)) + + a=[-1 2 3; 0 -1 4; 2 -0 5]; + + disp(~(a)) + + b=[0+3*%i 2-%i 1 ; 0-2*%i 2+2*%i 1-%i; 0+0*%i 4+0*%i 5-0*%i] + + disp(~(b)) + +endfunction
\ No newline at end of file diff --git a/2.3-1/tests/unit_tests/float/test_float_OpLogOr.sci b/2.3-1/tests/unit_tests/float/test_float_OpLogOr.sci new file mode 100644 index 00000000..c2309b83 --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_OpLogOr.sci @@ -0,0 +1,37 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT +function test_float_OpLogOr() + d0 = %pi + d2 = [1 2 3 4 ; 5 6 7 8 ; 9 10 11 12 ; 13 14 15 16] + z0 = d0 + %i * d0 + z2 = d2 + %i * d2 + + disp(d0|d0) + disp(z0|z0) + disp(d2|d0) + disp(z2|z0) + + disp(d0|d2) +disp(z0|z2) + +disp(d2|d2) +disp(z2|z2) + +disp(d2|z0) +disp(z2|d0) + +disp(d0|z2) +disp(z0|d2) + + disp(d0|z0) + disp(z0|d0) + +disp(d2|z2) +disp(z2|d2) + disp(''); + disp(%t|%f) + disp(%f|%t) + disp(%t|%t) + disp(%f|%f) + disp(''); + disp([%t %f] |%f) +endfunction diff --git a/2.3-1/tests/unit_tests/float/test_float_OpMinus.sci b/2.3-1/tests/unit_tests/float/test_float_OpMinus.sci new file mode 100644 index 00000000..4dee75a6 --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_OpMinus.sci @@ -0,0 +1,46 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT +function test_float_OpMinus() + a = 1; + b = 2; + c = a - b; // d0d0OpMinusd0 + disp(c); + + d = 1 - %i; // d0z0OpMinusz0 + e = %i - 3; // z0d0OpMinusz0 + f = d - e; // z0z0OpMinusz0 + + disp(f); + + g = [1 2 3; 4 5 6]; + h = 10; + w = g - h; // d2d0OpMinusd2 + j = h - g; // d0d2OpMinusd2 + + disp(j); + + k = [9 8 7; 6 5 4; 3 2 1] + l = [1 2 3; 4 5 6; 7 8 9] + m = k - l // d2d2OpMinusd2 + + disp(m); + n = k - 2 * %i; //d2z0OpMinusz2 + o = 3 * %i - l; //z0d2OpMinusz2 + p = n - o; // z2z2OpMinusz2 + + disp(p); + q = [1 2 3 ; 4 5 6 ; 7 8 9] + r = %pi * %i; + s = q - r; // d2z0OpMinusz2 + t = r - q; // z0d2OpMinusz2 + + disp(s); + disp(t); + u = [1 2 3] - %i * [4 5 6] + v = [7 8 9] + x = u - v; // z2d2OpMinusz2 + y = v - u; // d2z2OpMinusz2 + + disp(x); + + disp(y); +endfunction diff --git a/2.3-1/tests/unit_tests/float/test_float_OpPlus.sci b/2.3-1/tests/unit_tests/float/test_float_OpPlus.sci new file mode 100644 index 00000000..0f2b96e8 --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_OpPlus.sci @@ -0,0 +1,49 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT +function test_float_OpPlus() + a = 1; + b = 2; + c = a + b; // d0d0OpPlusd0 + + d = 1 + %i; // d0z0OpPlusz0 + e = %i + 3; // z0d0OpPlusz0 + f = d + e; // z0z0OpPlusz0 + + g = [1 2 3; 4 5 6]; + h = 10; + w = g + h; // d2d0OpPlusd2 + j = h + g; // d0d2OpPlusd2 + + k = [9 8 7; 6 5 4; 3 2 1] + l = [1 2 3; 4 5 6; 7 8 9] + m = k + l // d2d2OpPlusd2 + + n = k + 2 * %i; //d2z0OpPlusz2 + o = 3 * %i + l; //z0d2OpPlusz2 + p = n + o; // z2z2OpPlusz2 + + q = [1 2 3 ; 4 5 6 ; 7 8 9] + r = 3 * %i; + s = q + r; // d2z0OpPlusz2 + t = r + q; // z0d2OpPlusz2 + + u = [1 2 3] + %i * [4 5 6] + v = [7 8 9] + x = u + v; // z2d2OpPlusz2 + y = v + u; // d2z2OpPlusz2 + + + disp(c); + disp(d); + disp(e); + disp(f); + disp(""); + disp(w); + disp(j); + disp(m); + disp(p); + disp(s); + disp(t); + disp(x); + disp(y); + +endfunction diff --git a/2.3-1/tests/unit_tests/float/test_float_OpRc.sci b/2.3-1/tests/unit_tests/float/test_float_OpRc.sci new file mode 100644 index 00000000..3e084595 --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_OpRc.sci @@ -0,0 +1,46 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT + +function test_float_OpRc() + + a = [1 , 2 , 3 , 4]; // d0d0OpRcs2 + b = [7 , a];// d0d2OpRcs2 + c = [a , 7];// d2d0OpRcs2 + d = [a , b];// d2d2OpRcs2 + disp(a); + disp(b); + disp(c); + disp(d); + + e = [1*%i , 2*%i , 3*%i , 4*%i ];// z0z0OpRcz2 + f = [7 , e];// z0z2OpRcz2 + g = [e , 7];// z2z0OpRcz2 + h = [e , f];// z2z2OpRcz2 + + disp(e); + disp(f); + disp(g); + disp(h); + + + i = [%i , 4.5]; // z0d0OpRcz2 + j = [4.5 , %i ]; // d0z0OpRcz2 + k = [4.5 , i ]; // d0z2OpRcz2 + l = [i , 4.5]; // z2d0OpRcz2 + + disp(i); + disp(j); + disp(k); + disp(l); + + m = [1 , 4.5]; + n = [%i , m ]; // z0d2OpRcz2 + o = [m , %i ]; // d0z2OpRcz2 + p = [m , n ]; // d2z2OpRcz2 + q = [n , m ]; // z2d2OpRcz2 + + disp(n); + disp(o); + disp(p); + disp(q); + +endfunction diff --git a/2.3-1/tests/unit_tests/float/test_float_OpSlash.sci b/2.3-1/tests/unit_tests/float/test_float_OpSlash.sci new file mode 100644 index 00000000..1312a72d --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_OpSlash.sci @@ -0,0 +1,33 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT +function test_float_OpSlash() + d0 = %pi + d2 = [1 2 3 4 ; 5 6 7 8 ; 9 10 11 12 ; 13 14 15 16] + z0 = d0 + %i * d0 + z2 = d2 + %i * d2 + + disp(d0/d0) + disp(d0/z0) + disp(z0/d0) + disp(z0/z0) + + disp(d2/d0) + disp(d2/z0) + disp(z2/d0) + disp(z2/z0) + + disp(d0/d2) + disp(d0/z2) + disp(z0/d2) + disp(z0/z2) + + disp(d2/d2) + disp(d2/z2) + disp(z2/d2) + disp(z2/z2) + + disp([1 2 3]/[1 2 3]) //d2d2OpSlashd0 + disp([1 2 3]/(%i * [1 2 3])) //d2z2OpSlashz0 + disp((%i * [1 2 3])/[1 2 3]) //z2d2OpSlashz0 + disp((%i * [1 2 3])/(%i * [1 2 3])) //z2z2OpSlashz0 + +endfunction diff --git a/2.3-1/tests/unit_tests/float/test_float_OpStar.sci b/2.3-1/tests/unit_tests/float/test_float_OpStar.sci new file mode 100644 index 00000000..fa6d388b --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_OpStar.sci @@ -0,0 +1,32 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT +function test_float_OpStar() + d0 = %pi + d2 = [1 2 3 4 ; 5 6 7 8 ; 9 10 11 12 ; 13 14 15 16] + z0 = d0 + %i * d0 + z2 = d2 + %i * d2 + + disp(d0*d0) + disp(d0*z0) + disp(z0*d0) + disp(z0*z0) + + disp(d2*d0) + disp(d2*z0) + disp(z2*d0) + disp(z2*z0) + + disp(d0*d2) + disp(d0*z2) + disp(z0*d2) + disp(z0*z2) + + disp(d2*d2) + disp(d2*z2) + disp(z2*d2) + disp(z2*z2) + + disp([1 2 3]*[1 2 3]') //d2d2OpStard0 + disp([1 2 3]*(%i * [1 2 3])') //d2z2OpStarz0 + disp((%i * [1 2 3])*[1 2 3]') //z2d2OpStarz0 + disp((%i * [1 2 3])*(%i * [1 2 3])') //z2z2OpStarz0 +endfunction
\ No newline at end of file diff --git a/2.3-1/tests/unit_tests/float/test_float_Size.sci b/2.3-1/tests/unit_tests/float/test_float_Size.sci new file mode 100644 index 00000000..cd80e8f0 --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_Size.sci @@ -0,0 +1,42 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT +function test_float_Size() + disp(size(4)); + disp(size([1 2])) + disp(size(2+3*%i)); + disp(size([1 2 3 ; 4 5 6])); + disp(size([1 2 3 ; 4 5 6]*%i)); + e = %pi ; + disp(size(e)); // d0Sized0 + + f = e * %i; + disp(size(f));// z0Sized0 + + a = [1 2 3 ; 4 5 6]; + disp(size(a));// d2Sized0 + + b = [1 2 3 ; 4 5 6] * %i; + disp(size(b));// z2Sized0 + +// with a second argument + o=1; + + disp(size(4,1)); + disp(size(2+3*%i,1)); + disp(size([1 2 3 ; 4 5 6],o)); + disp(size([1 2 3 ; 4 5 6]*%i,1)); + e = %pi ; + disp(size(e,1)); // d0Sized0 + + f = e * %i; + disp(size(f,1));// z0Sized0 + + a = [1 2 3 ; 4 5 6]; + disp(size(a,o));// d2Sized0 + + b = [1 2 3 ; 4 5 6] * %i; + disp(size(b,1));// z2Sized0 + + + + +endfunction diff --git a/2.3-1/tests/unit_tests/float/test_float_Spec.sci b/2.3-1/tests/unit_tests/float/test_float_Spec.sci new file mode 100644 index 00000000..42041925 --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_Spec.sci @@ -0,0 +1,42 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT +function test_float_Spec() + + + disp(spec(45)) ; // d0Spec + disp(spec(4+3*%i)); // z0Spec + + a = [1 2 3; -4 5 98 ; 7 8 5] ; + b = [1 2 3; -4 5 98 ; 7 -100000 5] ; + + + disp(spec(a)); + disp(spec(b)); + + disp(spec(a*%i)); + // 2 outputs + + [aa bb] = spec(45) ; // d0Spec + disp(aa); + disp(bb); + + [cc dd] = spec(4+3*%i); // z0Spec + + disp(cc); + disp(dd); + + a = [1 2 3; -4 5 98 ; 7 8 5] ; + b = [1 2 3; -4 5 98 ; 7 -100000 5] ; + + + [ee ff] = spec(a); + disp(ee); + disp(ff); + [gg hh] = spec(b); + disp(gg); + disp(hh); + + [ii jj] = spec(a*%i); + disp(ii); + disp(jj); + +endfunction diff --git a/2.3-1/tests/unit_tests/float/test_float_Stdevf.sci b/2.3-1/tests/unit_tests/float/test_float_Stdevf.sci new file mode 100644 index 00000000..d429e557 --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_Stdevf.sci @@ -0,0 +1,46 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT + +function test_float_Stdevf() + disp (stdevf (4 , 5 )) ; + disp ("*******1*******"); + disp (stdevf ([4 5 6], [1 2 3])); + disp ("*******2*******"); + disp (stdevf (4 , 5*%i )) ; + disp ("*******3*******"); + disp (stdevf ([4 5 6], [1 2 3]*%i)); + disp ("*******4*******"); + + + + disp (stdevf ([4 5 6 ; 7 8 9], [1 2 3 ; 4 5 6],1)); + disp ("*******5*******"); + disp (stdevf ([4 7; 5 8; 6 9], [1 4; 2 5; 3 6],2)); +// complex + disp ("*******6*******"); + disp (stdevf (4 +4*%i , 5 )) ; + disp ("*******7*******"); + disp (stdevf ([4*%i, 5+6*%i, 6], [1 2 3])); + disp ("*******8*******"); + disp (stdevf (4 +4*%i , 5*%i )) ; + disp ("*******9*******"); + disp (stdevf ([4*%i, 5+6*%i, 6], [1 2 3]*%i)); + disp ("******10*******"); + + + disp (stdevf ([4 5 6 ; 7 8 9]*%i, [1 2 3 ; 4 5 6],1)); + disp ("******11*******"); + disp (stdevf ([4 7; 5 8; 6 9], [1 4; 2 5; 3 6]*%i,2)); + disp (stdevf ([4 5 6 ; 7 8 9],[1 2 3 ; 4 8 9] + [1 2 3 ; 4 5 6]*%i,1)); + disp ("******12*******"); + disp (stdevf ([4 5 6 ; 7 8 9], [1 2 3 ; 4 5 6]*%i,1)); + disp ("******13*******"); + disp (stdevf ([4 7; 5 8; 6 9]*%i, [1 4; 2 5; 3 6],2)); + disp ("******14*******"); + + disp (stdevf ([4 5 6 ; 7 8 9]*%i, [1 2 3 ; 4 5 6]*%i,1)); + disp ("******15*******"); + disp (stdevf ([4 7; 5 8; 6 9]*%i, [1 4; 2 5; 3 6]*%i,2)); + disp ("******16*******"); +// + +endfunction diff --git a/2.3-1/tests/unit_tests/float/test_float_Trace.sci b/2.3-1/tests/unit_tests/float/test_float_Trace.sci new file mode 100644 index 00000000..74d20d93 --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_Trace.sci @@ -0,0 +1,14 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT +function test_float_Trace() + + a = [1 2 3; 4 %pi 5; 4.5 -3 2]; + disp(trace(a)); + + b = %i * [1 2 3; 4 %pi 5; 4.5 -3 2]; + disp(trace(b)); + + + disp(trace(5)); + + disp(trace(%i)); +endfunction diff --git a/2.3-1/tests/unit_tests/float/test_float_Type.sci b/2.3-1/tests/unit_tests/float/test_float_Type.sci new file mode 100644 index 00000000..7e10aaa7 --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_Type.sci @@ -0,0 +1,9 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT +function test_float_Type() + + disp(type(%pi)); + disp(type(%pi + %i)); + disp(type([%pi 4])); + disp(type([%pi %i])); + +endfunction diff --git a/2.3-1/tests/unit_tests/float/test_float_abs.sci b/2.3-1/tests/unit_tests/float/test_float_abs.sci new file mode 100644 index 00000000..05dfa95c --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_abs.sci @@ -0,0 +1,12 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT +function test_float_abs() + d0 = %pi + d2 = [1 2 3 4 ; 5 6 7 8 ; 9 10 11 12 ; 13 14 15 16] + z0 = d0 + %i * d0 + z2 = d2 + %i * d2 + + disp(abs(d0)) + disp(abs(z0)) + disp(abs(d2)) + disp(abs(z2)) +endfunction diff --git a/2.3-1/tests/unit_tests/float/test_float_acos.sci b/2.3-1/tests/unit_tests/float/test_float_acos.sci new file mode 100644 index 00000000..9abb6ba1 --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_acos.sci @@ -0,0 +1,12 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT +function test_float_acos() + d0 = %pi + d2 = [1 2 3 4 ; 4 5 1 8 ; 9 1 11 12 ; 13 14 15 16] + z0 = d0 + %i * d0 + z2 = d2 + %i * d2 + + disp(acos(d0)); + disp(acos(d2)); + disp(acos(z0)); + disp(acos(z2)); +endfunction diff --git a/2.3-1/tests/unit_tests/float/test_float_acosh.sci b/2.3-1/tests/unit_tests/float/test_float_acosh.sci new file mode 100644 index 00000000..1fa1556f --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_acosh.sci @@ -0,0 +1,12 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT +function test_float_acosh() + d0 = %pi + d2 = [1 2 3 4 ; 4 5 1 8 ; 9 1 11 12 ; 13 14 15 16] + z0 = d0 + %i * d0 + z2 = d2 + %i * d2 + + disp(acosh(d0)); + disp(acosh(d2)); + disp(acosh(z0)); + disp(acosh(z2)); +endfunction diff --git a/2.3-1/tests/unit_tests/float/test_float_asin.sci b/2.3-1/tests/unit_tests/float/test_float_asin.sci new file mode 100644 index 00000000..72b2234a --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_asin.sci @@ -0,0 +1,12 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT +function test_float_asin() + d0 = %pi + d2 = [1 2 3 4 ; 4 5 1 8 ; 9 1 11 12 ; 13 14 15 16] + z0 = d0 + %i * d0 + z2 = d2 + %i * d2 + + disp(asin(d0)); + disp(asin(d2)); + disp(asin(z0)); + disp(asin(z2)); +endfunction diff --git a/2.3-1/tests/unit_tests/float/test_float_asinh.sci b/2.3-1/tests/unit_tests/float/test_float_asinh.sci new file mode 100644 index 00000000..f952001e --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_asinh.sci @@ -0,0 +1,12 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT +function test_float_asinh() + d0 = %pi + d2 = [1 2 3 4 ; 4 5 1 8 ; 9 1 11 12 ; 13 14 15 16] + z0 = d0 + %i * d0 + z2 = d2 + %i * d2 + + disp(asinh(d0)); + disp(asinh(d2)); + disp(asinh(z0)); + disp(asinh(z2)); +endfunction diff --git a/2.3-1/tests/unit_tests/float/test_float_atan.sci b/2.3-1/tests/unit_tests/float/test_float_atan.sci new file mode 100644 index 00000000..864ea65e --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_atan.sci @@ -0,0 +1,15 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT +function test_float_atan() + d0 = %pi + d2 = [1 2 3 4 ; 4 5 1 8 ; 9 1 11 12 ; 13 14 15 16] + z0 = d0 + %i * d0 + z2 = d2 + %i * d2 + + disp(atan(d0)); + disp(atan(d2)); + disp(atan(z0)); + disp(atan(z2)); + + disp(atan(d0,d0)); + disp(atan(d2,d2)); +endfunction diff --git a/2.3-1/tests/unit_tests/float/test_float_atanh.sci b/2.3-1/tests/unit_tests/float/test_float_atanh.sci new file mode 100644 index 00000000..9f693a42 --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_atanh.sci @@ -0,0 +1,12 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT +function test_float_atanh() + d0 = %pi + d2 = [2 2 3 4 ; 4 5 6 8 ; 9 10 11 12 ; 13 14 15 16] + z0 = d0 + %i * d0 + z2 = d2 + %i * d2 + + disp(atanh(d0)); + disp(atanh(d2)); + disp(atanh(z0)); + disp(atanh(z2)); +endfunction diff --git a/2.3-1/tests/unit_tests/float/test_float_ceil.sci b/2.3-1/tests/unit_tests/float/test_float_ceil.sci new file mode 100644 index 00000000..0cda6c5e --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_ceil.sci @@ -0,0 +1,12 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT +function test_float_ceil() + d0 = %pi + d2 = [1 2 3 4 ; 4 5 1 8 ; 9 1 11 12 ; 13 14 15 16] + z0 = d0 + %i * d0 + z2 = d2 + %i * d2 + + disp(ceil(d0)); + disp(ceil(d2)); + disp(ceil(z0)); + disp(ceil(z2)); +endfunction diff --git a/2.3-1/tests/unit_tests/float/test_float_chol.sci b/2.3-1/tests/unit_tests/float/test_float_chol.sci new file mode 100644 index 00000000..d8306e6b --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_chol.sci @@ -0,0 +1,12 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT +function test_float_chol() + d0 = %pi + d2 = [1 2 3 4 ; 4 5 1 8 ; 9 1 11 12 ; 13 14 15 16] + z0 = d0 + %i * d0 + z2 = d2 + %i * d2 + + disp(chol(d0)); + disp(chol(d2*d2')); + disp(chol(z0)); + disp(chol(z2*z2')); +endfunction diff --git a/2.3-1/tests/unit_tests/float/test_float_conj.sci b/2.3-1/tests/unit_tests/float/test_float_conj.sci new file mode 100644 index 00000000..c3141379 --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_conj.sci @@ -0,0 +1,12 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT +function test_float_conj() + d0 = %pi + d2 = [1 2 3 4 ; 4 5 1 8 ; 9 1 11 12 ; 13 14 15 16] + z0 = d0 + %i * d0 + z2 = d2 + %i * d2 + + disp(conj(d0)); + disp(conj(d2)); + disp(conj(z0)); + disp(conj(z2)); +endfunction diff --git a/2.3-1/tests/unit_tests/float/test_float_cos.sci b/2.3-1/tests/unit_tests/float/test_float_cos.sci new file mode 100644 index 00000000..bcb53b36 --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_cos.sci @@ -0,0 +1,12 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT +function test_float_cos() + d0 = %pi + d2 = [1 2 3 4 ; 4 5 1 8 ; 9 1 11 12 ; 13 14 15 16] + z0 = d0 + %i * d0 + z2 = d2 + %i * d2 + + disp(cos(d0)); + disp(cos(d2)); + disp(cos(z0)); + disp(cos(z2)); +endfunction diff --git a/2.3-1/tests/unit_tests/float/test_float_cosh.sci b/2.3-1/tests/unit_tests/float/test_float_cosh.sci new file mode 100644 index 00000000..cd393494 --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_cosh.sci @@ -0,0 +1,12 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT +function test_float_cosh() + d0 = %pi + d2 = [1 2 3 4 ; 4 5 1 8 ; 9 1 11 12 ; 13 14 15 16] + z0 = d0 + %i * d0 + z2 = d2 + %i * d2 + + disp(cosh(d0)); + disp(cosh(d2)); + disp(cosh(z0)); + disp(cosh(z2)); +endfunction diff --git a/2.3-1/tests/unit_tests/float/test_float_exp.sci b/2.3-1/tests/unit_tests/float/test_float_exp.sci new file mode 100644 index 00000000..583a5fc9 --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_exp.sci @@ -0,0 +1,12 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT +function test_float_exp() + d0 = %pi + d2 = [1 2 3 4 ; 4 5 1 8 ; 9 1 11 12 ; 13 14 15 16] + z0 = d0 + %i * d0 + z2 = d2 + %i * d2 + + disp(exp(d0)); + disp(exp(d2)); + disp(exp(z0)); + disp(exp(z2)); +endfunction diff --git a/2.3-1/tests/unit_tests/float/test_float_eye.sci b/2.3-1/tests/unit_tests/float/test_float_eye.sci new file mode 100644 index 00000000..fe1c6d7f --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_eye.sci @@ -0,0 +1,15 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT +function test_float_eye() + d0 = %pi + d2 = [1 2 3 4 ; 4 5 1 8 ; 9 1 11 12 ; 13 14 15 16] + z0 = d0 + %i * d0 + z2 = d2 + %i * d2 + + disp(eye(d0)) + disp(eye(z0)) + disp(eye(d2)) + disp(eye(z2)) + //disp(eye(0,0)) // ! sci2c does not manage [] ! + disp(eye(1,1)) + disp(eye(d0,d0)) +endfunction
\ No newline at end of file diff --git a/2.3-1/tests/unit_tests/float/test_float_fix.sci b/2.3-1/tests/unit_tests/float/test_float_fix.sci new file mode 100644 index 00000000..cf6d5f1e --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_fix.sci @@ -0,0 +1,12 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT +function test_float_fix() + d0 = %pi + d2 = [1 2 3 4 ; 4 5 1 8 ; 9 1 11 12 ; 13 14 15 16] + z0 = d0 + %i * d0 + z2 = d2 + %i * d2 + + disp(fix(d0)); + disp(fix(d2)); + disp(fix(z0)); + disp(fix(z2)); +endfunction diff --git a/2.3-1/tests/unit_tests/float/test_float_floor.sci b/2.3-1/tests/unit_tests/float/test_float_floor.sci new file mode 100644 index 00000000..34723a21 --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_floor.sci @@ -0,0 +1,12 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT +function test_float_floor() + d0 = %pi + d2 = [1 2 3 4 ; 4 5 1 8 ; 9 1 11 12 ; 13 14 15 16] + z0 = d0 + %i * d0 + z2 = d2 + %i * d2 + + disp(floor(d0)); + disp(floor(d2)); + disp(floor(z0)); + disp(floor(z2)); +endfunction diff --git a/2.3-1/tests/unit_tests/float/test_float_imag.sci b/2.3-1/tests/unit_tests/float/test_float_imag.sci new file mode 100644 index 00000000..248588ed --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_imag.sci @@ -0,0 +1,12 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT +function test_float_imag() + d0 = %pi + d2 = [1 2 3 4 ; 5 6 7 8 ; 9 10 11 12 ; 13 14 15 16] + z0 = d0 + %i * d0 + z2 = d2 + %i * d2 + + disp(imag(d0)) + disp(imag(z0)) + disp(imag(d2)) + disp(imag(z2)) +endfunction diff --git a/2.3-1/tests/unit_tests/float/test_float_int.sci b/2.3-1/tests/unit_tests/float/test_float_int.sci new file mode 100644 index 00000000..43be0058 --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_int.sci @@ -0,0 +1,12 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT +function test_float_int() + d0 = %pi + d2 = [1 2 3 4 ; 4 5 1 8 ; 9 1 11 12 ; 13 14 15 16] + z0 = d0 + %i * d0 + z2 = d2 + %i * d2 + + disp(int(d0)); + disp(int(d2)); + disp(int(z0)); + disp(int(z2)); +endfunction diff --git a/2.3-1/tests/unit_tests/float/test_float_inv.sci b/2.3-1/tests/unit_tests/float/test_float_inv.sci new file mode 100644 index 00000000..84b79350 --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_inv.sci @@ -0,0 +1,12 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT +function test_float_inv() + d0 = %pi + d2 = [1 2 3 4 ; 4 5 1 8 ; 9 1 11 12 ; 13 14 15 16] + z0 = d0 + %i * d0 + z2 = d2 + %i * d2 + + disp(inv(d0)); + disp(inv(d2)); + disp(inv(z0)); + disp(inv(z2)); +endfunction diff --git a/2.3-1/tests/unit_tests/float/test_float_isnan.sci b/2.3-1/tests/unit_tests/float/test_float_isnan.sci new file mode 100644 index 00000000..e8c6edcb --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_isnan.sci @@ -0,0 +1,12 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT +function test_float_isnan() + d0 = %pi + d2 = [1 2 3 4 ; 5 6 7 8 ; 9 10 11 12 ; 13 14 15 16] + z0 = d0 + %i * d0 + z2 = d2 + %i * d2 + + disp(isnan(d0)) + disp(isnan(d2)) + disp(isnan(z0)) + disp(isnan(z2)) +endfunction diff --git a/2.3-1/tests/unit_tests/float/test_float_log.sci b/2.3-1/tests/unit_tests/float/test_float_log.sci new file mode 100644 index 00000000..e3fca7d1 --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_log.sci @@ -0,0 +1,12 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT +function test_float_log() + d0 = %pi + d2 = [1 2 3 4 ; 4 5 1 8 ; 9 1 11 12 ; 13 14 15 16] + z0 = d0 + %i * d0 + z2 = d2 + %i * d2 + + disp(log(d0)); + disp(log(d2)); + disp(log(z0)); + disp(log(z2)); +endfunction diff --git a/2.3-1/tests/unit_tests/float/test_float_log10.sci b/2.3-1/tests/unit_tests/float/test_float_log10.sci new file mode 100644 index 00000000..28831699 --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_log10.sci @@ -0,0 +1,12 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT + function test_float_log10() + d0 = %pi + d2 = [1 2 3 4 ; 4 5 1 8 ; 9 1 11 12 ; 13 14 15 16] + z0 = d0 + %i * d0 + z2 = d2 + %i * d2 + + disp(log10(d0)); + disp(log10(d2)); + disp(log10(z0)); + disp(log10(z2)); + endfunction
\ No newline at end of file diff --git a/2.3-1/tests/unit_tests/float/test_float_log1p.sci b/2.3-1/tests/unit_tests/float/test_float_log1p.sci new file mode 100644 index 00000000..64d154c3 --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_log1p.sci @@ -0,0 +1,13 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT +function test_float_log1p() + d0 = %pi + d2 = [1 2 3 4 ; 4 5 1 8 ; 9 1 11 12 ; 13 14 15 16] + z0 = d0 + %i * d0 + z2 = d2 + %i * d2 + + disp(log1p(d0)); + disp(log1p(d2)); + //disp(log1p(z0)); // ! Not Implemented in Scilab ! + //disp(log1p(z2)); // ! Not Implemented in Scilab ! + +endfunction
\ No newline at end of file diff --git a/2.3-1/tests/unit_tests/float/test_float_max.sci b/2.3-1/tests/unit_tests/float/test_float_max.sci new file mode 100644 index 00000000..5001e029 --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_max.sci @@ -0,0 +1,17 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT +function test_float_max() + d0 = %pi + d2 = [1 2 3 4 ; 5 6 7 8 ; 9 10 11 12 ; 13 14 15 16] + d3 = [1 2 9 4 ; 5 6 7 8 ; 9 10 17 12 ; 14 14 15 16] + + disp(max(d0)) + disp(max(d2)) + + disp(max(d0, 8)) + disp(max(d0, d2)) + disp(max(d2, 8)) + disp(max(d3, d2)) + + + +endfunction diff --git a/2.3-1/tests/unit_tests/float/test_float_mean.sci b/2.3-1/tests/unit_tests/float/test_float_mean.sci new file mode 100644 index 00000000..7da964a1 --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_mean.sci @@ -0,0 +1,32 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT +function test_float_mean() + d0 = %pi + d2 = [1 2 3 4 ; 4 5 1 8 ; 9 1 11 12 ; 13 14 15 16] + z0 = d0 + %i * d0 + z2 = d2 + %i * d2 + + disp(mean(d0)) + disp(mean(z0)) + disp(mean(d2)) + disp(mean(z2)) + + disp(mean(d0, 1)) + disp(mean(z0, 1)) + disp(mean(d2, 1)) + disp(mean(z2, 1)) + + disp(mean(d0, 2)) + disp(mean(z0, 2)) + disp(mean(d2, 2)) + disp(mean(z2, 2)) + +disp(mean(d0, 'r')) +disp(mean(z0, 'r')) +disp(mean(d2, 'r')) +disp(mean(z2, 'r')) + +disp(mean(d0, 'c')) +disp(mean(z0, 'c')) +disp(mean(d2, 'c')) +disp(mean(z2, 'c')) +endfunction diff --git a/2.3-1/tests/unit_tests/float/test_float_min.sci b/2.3-1/tests/unit_tests/float/test_float_min.sci new file mode 100644 index 00000000..3f96abfa --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_min.sci @@ -0,0 +1,19 @@ + +//SCI2C: DEFAULT_PRECISION= FLOAT +function test_float_min() + d0 = %pi + d2 = [1 2 3 4 ; 5 6 7 8 ; 9 10 11 12 ; 13 14 15 16] + d3 = [1 2 9 4 ; 5 6 7 8 ; 9 10 17 12 ; 14 14 15 16] + + disp(min(d0)) + disp(min(d2)) + + disp(min(d0, 8)) + disp(min(d0, d2)) + disp(min(d2, 8)) + disp(min(d3, d2)) + + + +endfunction + diff --git a/2.3-1/tests/unit_tests/float/test_float_ones.sci b/2.3-1/tests/unit_tests/float/test_float_ones.sci new file mode 100644 index 00000000..00e526b0 --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_ones.sci @@ -0,0 +1,15 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT +function test_float_ones() + d0 = %pi + d2 = [1 2 3 4 ; 4 5 1 8 ; 9 1 11 12 ; 13 14 15 16] + z0 = d0 + %i * d0 + z2 = d2 + %i * d2 + + disp(ones(d0)) + disp(ones(z0)) + disp(ones(d2)) + disp(ones(z2)) + //disp(ones(0,0)) // ! sci2c does not manage [] ! + disp(ones(1,1)) + disp(ones(d0,d0)) +endfunction
\ No newline at end of file diff --git a/2.3-1/tests/unit_tests/float/test_float_prod.sci b/2.3-1/tests/unit_tests/float/test_float_prod.sci new file mode 100644 index 00000000..b687a88a --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_prod.sci @@ -0,0 +1,32 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT +function test_float_prod() + d0 = %pi + d2 = [1 2 3 4 ; 4 5 1 8 ; 9 1 11 12 ; 13 14 15 16] + z0 = d0 + %i * d0 + z2 = d2 + %i * d2 + + disp(prod(d0)) + disp(prod(z0)) + disp(prod(d2)) + disp(prod(z2)) + + disp(prod(d0, 1)) + disp(prod(z0, 1)) + disp(prod(d2, 1)) + disp(prod(z2, 1)) + + disp(prod(d0, 2)) + disp(prod(z0, 2)) + disp(prod(d2, 2)) + disp(prod(z2, 2)) + + disp(prod(d0, 'r')) + disp(prod(z0, 'r')) + disp(prod(d2, 'r')) + disp(prod(z2, 'r')) + + disp(prod(d0, 'c')) + disp(prod(z0, 'c')) + disp(prod(d2, 'c')) + disp(prod(z2, 'c')) +endfunction diff --git a/2.3-1/tests/unit_tests/float/test_float_rand.sci b/2.3-1/tests/unit_tests/float/test_float_rand.sci new file mode 100644 index 00000000..9ad2a378 --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_rand.sci @@ -0,0 +1,15 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT +function test_float_rand() + d0 = %pi + d2 = [1 2 3 4 ; 4 5 1 8 ; 9 1 11 12 ; 13 14 15 16] + z0 = d0 + %i * d0 + z2 = d2 + %i * d2 + + disp(rand(d0)) + disp(rand(z0)) + disp(rand(d2)) + disp(rand(z2)) + //disp(rand(0,0)) // ! sci2c does not manage [] ! + disp(rand(1,1)) + disp(rand(d0,d0)) +endfunction
\ No newline at end of file diff --git a/2.3-1/tests/unit_tests/float/test_float_real.sci b/2.3-1/tests/unit_tests/float/test_float_real.sci new file mode 100644 index 00000000..28632f06 --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_real.sci @@ -0,0 +1,12 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT +function test_float_real() + d0 = %pi + d2 = [1 2 3 4 ; 5 6 7 8 ; 9 10 11 12 ; 13 14 15 16] + z0 = d0 + %i * d0 + z2 = d2 + %i * d2 + + disp(real(d0)) + disp(real(z0)) + disp(real(d2)) + disp(real(z2)) +endfunction diff --git a/2.3-1/tests/unit_tests/float/test_float_round.sci b/2.3-1/tests/unit_tests/float/test_float_round.sci new file mode 100644 index 00000000..94fb4f17 --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_round.sci @@ -0,0 +1,12 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT +function test_float_round() + d0 = %pi + d2 = [1 2 3 4 ; 4 5 1 8 ; 9 1 11 12 ; 13 14 15 16] + z0 = d0 + %i * d0 + z2 = d2 + %i * d2 + + disp(round(d0)); + disp(round(d2)); + disp(round(z0)); + disp(round(z2)); +endfunction diff --git a/2.3-1/tests/unit_tests/float/test_float_sign.sci b/2.3-1/tests/unit_tests/float/test_float_sign.sci new file mode 100644 index 00000000..1f7e32a4 --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_sign.sci @@ -0,0 +1,12 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT +function test_float_sign() + d0 = %pi + d2 = [1 2 3 4 ; 4 5 1 8 ; 9 1 11 12 ; 13 14 15 16] + z0 = d0 + %i * d0 + z2 = d2 + %i * d2 + + disp(sign(d0)); + disp(sign(d2)); + disp(sign(z0)); + disp(sign(z2)); +endfunction diff --git a/2.3-1/tests/unit_tests/float/test_float_sin.sci b/2.3-1/tests/unit_tests/float/test_float_sin.sci new file mode 100644 index 00000000..6fe5eb12 --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_sin.sci @@ -0,0 +1,12 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT +function test_float_sin() + d0 = %pi + d2 = [1 2 3 4 ; 4 5 1 8 ; 9 1 11 12 ; 13 14 15 16] + z0 = d0 + %i * d0 + z2 = d2 + %i * d2 + + disp(sin(d0)); + disp(sin(d2)); + disp(sin(z0)); + disp(sin(z2)); +endfunction diff --git a/2.3-1/tests/unit_tests/float/test_float_sinh.sci b/2.3-1/tests/unit_tests/float/test_float_sinh.sci new file mode 100644 index 00000000..0897290b --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_sinh.sci @@ -0,0 +1,12 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT +function test_float_sinh() + d0 = %pi + d2 = [1 2 3 4 ; 4 5 1 8 ; 9 1 11 12 ; 13 14 15 16] + z0 = d0 + %i * d0 + z2 = d2 + %i * d2 + + disp(sinh(d0)); + disp(sinh(d2)); + disp(sinh(z0)); + disp(sinh(z2)); +endfunction diff --git a/2.3-1/tests/unit_tests/float/test_float_sqrt.sci b/2.3-1/tests/unit_tests/float/test_float_sqrt.sci new file mode 100644 index 00000000..52c9dd83 --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_sqrt.sci @@ -0,0 +1,12 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT +function test_float_sqrt() + d0 = %pi + d2 = [2 2 3 4 ; 4 5 6 8 ; 9 10 11 12 ; 13 14 15 16] + z0 = d0 + %i * d0 + z2 = d2 + %i * d2 + + disp(sqrt(d0)); + disp(sqrt(d2)); + disp(sqrt(z0)); + disp(sqrt(z2)); +endfunction
\ No newline at end of file diff --git a/2.3-1/tests/unit_tests/float/test_float_st_deviation.sci b/2.3-1/tests/unit_tests/float/test_float_st_deviation.sci new file mode 100644 index 00000000..568d1a31 --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_st_deviation.sci @@ -0,0 +1,32 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT +function test_float_st_deviation() + d0 = %pi + d2 = [1 2 3 4 ; 4 5 1 8 ; 9 1 11 12 ; 13 14 15 16] + z0 = d0 + %i * d0 + z2 = d2 + %i * d2 + + disp(st_deviation(d0)) + disp(st_deviation(z0)) + disp(st_deviation(d2)) + disp(st_deviation(z2)) + + disp(st_deviation(d0, 1)) + disp(st_deviation(z0, 1)) + disp(st_deviation(d2, 1)) + disp(st_deviation(z2, 1)) + + disp(st_deviation(d0, 2)) + disp(st_deviation(z0, 2)) + disp(st_deviation(d2, 2)) + disp(st_deviation(z2, 2)) + +// disp(st_deviation(d0, 'r')) +// disp(st_deviation(z0, 'r')) +// disp(st_deviation(d2, 'r')) +// disp(st_deviation(z2, 'r')) + +// disp(st_deviation(d0, 'c')) +// disp(st_deviation(z0, 'c')) +// disp(st_deviation(d2, 'c')) +// disp(st_deviation(z2, 'c')) +endfunction diff --git a/2.3-1/tests/unit_tests/float/test_float_sum.sci b/2.3-1/tests/unit_tests/float/test_float_sum.sci new file mode 100644 index 00000000..86ff0fd5 --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_sum.sci @@ -0,0 +1,32 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT +function test_float_sum() + d0 = %pi + d2 = [1 2 3 4 ; 4 5 1 8 ; 9 1 11 12 ; 13 14 15 16] + z0 = d0 + %i * d0 + z2 = d2 + %i * d2 + + disp(sum(d0)) + disp(sum(z0)) + disp(sum(d2)) + disp(sum(z2)) + + disp(sum(d0, 1)) + disp(sum(z0, 1)) + disp(sum(d2, 1)) + disp(sum(z2, 1)) + + disp(sum(d0, 2)) + disp(sum(z0, 2)) + disp(sum(d2, 2)) + disp(sum(z2, 2)) + + disp(sum(d0, 'r')) + disp(sum(z0, 'r')) + disp(sum(d2, 'r')) + disp(sum(z2, 'r')) + + disp(sum(d0, 'c')) + disp(sum(z0, 'c')) + disp(sum(d2, 'c')) + disp(sum(z2, 'c')) +endfunction diff --git a/2.3-1/tests/unit_tests/float/test_float_tanh.sci b/2.3-1/tests/unit_tests/float/test_float_tanh.sci new file mode 100644 index 00000000..af0f12e3 --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_tanh.sci @@ -0,0 +1,12 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT +function test_float_tanh() + d0 = %pi + d2 = [1 2 3 4 ; 4 5 1 8 ; 9 1 11 12 ; 13 14 15 16] + z0 = d0 + %i * d0 + z2 = d2 + %i * d2 + + disp(tanh(d0)); + disp(tanh(d2)); + disp(tanh(z0)); + disp(tanh(z2)); +endfunction diff --git a/2.3-1/tests/unit_tests/float/test_float_variance.sci b/2.3-1/tests/unit_tests/float/test_float_variance.sci new file mode 100644 index 00000000..fae69a1b --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_variance.sci @@ -0,0 +1,32 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT +function test_float_variance() + d0 = 0.2113249 + d2 = [0.2113249 0.0002211 0.6653811;0.7560439 0.4453586 0.6283918] + z0 = d0 + %i * d0 + z2 = d2 + %i * d2 + + //disp(variance(d0)) + //disp(variance(z0)) + disp(variance(d2)) + disp(variance(z2)) + + //disp(variance(d0, 1)) + //disp(variance(z0, 1)) + disp(variance(d2, 1)) + disp(variance(z2, 1)) + + //disp(variance(d0, 2)) + //disp(variance(z0, 2)) + disp(variance(d2, 2)) + disp(variance(z2, 2)) + +//disp(variance(d0, 'r')) +//disp(variance(z0, 'r')) +disp(variance(d2, 'r')) +disp(variance(z2, 'r')) + +//disp(variance(d0, 'c')) +//disp(variance(z0, 'c')) +disp(variance(d2, 'c')) +disp(variance(z2, 'c')) +endfunction diff --git a/2.3-1/tests/unit_tests/float/test_float_zeros.sci b/2.3-1/tests/unit_tests/float/test_float_zeros.sci new file mode 100644 index 00000000..27f4ced0 --- /dev/null +++ b/2.3-1/tests/unit_tests/float/test_float_zeros.sci @@ -0,0 +1,15 @@ +//SCI2C: DEFAULT_PRECISION= FLOAT +function test_float_zeros() + d0 = %pi + d2 = [1 2 3 4 ; 4 5 1 8 ; 9 1 11 12 ; 13 14 15 16] + z0 = d0 + %i * d0 + z2 = d2 + %i * d2 + + disp(zeros(d0)) + disp(zeros(z0)) + disp(zeros(d2)) + disp(zeros(z2)) + //disp(zeros(0,0)) // ! sci2c does not manage [] ! + disp(zeros(1,1)) + disp(zeros(d0,d0)) +endfunction
\ No newline at end of file |