summaryrefslogtreecommitdiff
path: root/src/Scilab2C/SCI2CTests/Mes_tests/matrixOperations
diff options
context:
space:
mode:
authorSiddhesh Wani2015-05-25 14:46:31 +0530
committerSiddhesh Wani2015-05-25 14:46:31 +0530
commitdb464f35f5a10b58d9ed1085e0b462689adee583 (patch)
treede5cdbc71a54765d9fec33414630ae2c8904c9b8 /src/Scilab2C/SCI2CTests/Mes_tests/matrixOperations
downloadScilab2C_fossee_old-db464f35f5a10b58d9ed1085e0b462689adee583.tar.gz
Scilab2C_fossee_old-db464f35f5a10b58d9ed1085e0b462689adee583.tar.bz2
Scilab2C_fossee_old-db464f35f5a10b58d9ed1085e0b462689adee583.zip
Original Version
Diffstat (limited to 'src/Scilab2C/SCI2CTests/Mes_tests/matrixOperations')
-rw-r--r--src/Scilab2C/SCI2CTests/Mes_tests/matrixOperations/mainfunctionChol.sci24
-rw-r--r--src/Scilab2C/SCI2CTests/Mes_tests/matrixOperations/mainfunctionDet.sci28
-rw-r--r--src/Scilab2C/SCI2CTests/Mes_tests/matrixOperations/mainfunctionEye.sci37
-rw-r--r--src/Scilab2C/SCI2CTests/Mes_tests/matrixOperations/mainfunctionInversion.sci21
-rw-r--r--src/Scilab2C/SCI2CTests/Mes_tests/matrixOperations/mainfunctionOnes.sci37
-rw-r--r--src/Scilab2C/SCI2CTests/Mes_tests/matrixOperations/mainfunctionOpApex_OpDotApex.sci29
-rw-r--r--src/Scilab2C/SCI2CTests/Mes_tests/matrixOperations/mainfunctionSpec_Spec2.sci66
-rw-r--r--src/Scilab2C/SCI2CTests/Mes_tests/matrixOperations/mainfunctionZeros.sci37
8 files changed, 279 insertions, 0 deletions
diff --git a/src/Scilab2C/SCI2CTests/Mes_tests/matrixOperations/mainfunctionChol.sci b/src/Scilab2C/SCI2CTests/Mes_tests/matrixOperations/mainfunctionChol.sci
new file mode 100644
index 0000000..46f8c40
--- /dev/null
+++ b/src/Scilab2C/SCI2CTests/Mes_tests/matrixOperations/mainfunctionChol.sci
@@ -0,0 +1,24 @@
+//SCI2C: DEFAULT_PRECISION= DOUBLE
+
+function mainfunction()
+
+//test chol
+
+//real
+disp (chol(4))
+
+a=[1 0 5; -2 4 0 ; -4 -2 -1]
+a2=a*a'
+disp (chol(a2))
+
+
+//complex
+disp (chol(4-2*%i))
+
+
+b=[1+%i 0+0*%i; 5-2*%i 4+0*%i]
+b2=b*b'
+disp (chol(b2))
+
+
+endfunction
diff --git a/src/Scilab2C/SCI2CTests/Mes_tests/matrixOperations/mainfunctionDet.sci b/src/Scilab2C/SCI2CTests/Mes_tests/matrixOperations/mainfunctionDet.sci
new file mode 100644
index 0000000..fbd5964
--- /dev/null
+++ b/src/Scilab2C/SCI2CTests/Mes_tests/matrixOperations/mainfunctionDet.sci
@@ -0,0 +1,28 @@
+//SCI2C: DEFAULT_PRECISION= DOUBLE
+function mainfunction()
+
+//test det
+
+//d0
+disp (det(3))
+
+//z0
+disp (det(3+%i*4))
+
+
+c=[4 2 3 ;8 8 4; 3 4 5]
+e=[4 2 3 1;8 8 4 4; 3 4 5 7; 12 2 3 4]
+d=[4 2 3 ;8 8-1*%i 4; 3+4*%i 4 5]
+f=[4+%i 2 3 1*%i ;3+4*%i 8-2*%i 8+4*%i 4+2*%i ; 3 4+2*%i 5 7; 12+2*%i 2 3 4]
+
+//d2
+disp (det(c))
+disp (det(e))
+
+//z2
+disp (det(d))
+disp (det(f))
+
+
+
+endfunction
diff --git a/src/Scilab2C/SCI2CTests/Mes_tests/matrixOperations/mainfunctionEye.sci b/src/Scilab2C/SCI2CTests/Mes_tests/matrixOperations/mainfunctionEye.sci
new file mode 100644
index 0000000..b077c9f
--- /dev/null
+++ b/src/Scilab2C/SCI2CTests/Mes_tests/matrixOperations/mainfunctionEye.sci
@@ -0,0 +1,37 @@
+//SCI2C: DEFAULT_PRECISION= DOUBLE
+
+function mainfunction()
+
+//test eye
+
+//reals
+
+
+disp(eye())
+
+disp(eye(1))
+
+disp(eye(4))
+
+disp(eye(1,1))
+
+disp(eye(1,4))
+
+disp(eye(4,4))
+
+disp(eye(4,1))
+
+a=[1 2 3; 4 5 6; 7 8 9]
+
+disp(eye(a))
+
+//complexe
+
+disp(eye(2+%i))
+
+b=a+%i
+
+disp(eye(b))
+
+
+endfunction
diff --git a/src/Scilab2C/SCI2CTests/Mes_tests/matrixOperations/mainfunctionInversion.sci b/src/Scilab2C/SCI2CTests/Mes_tests/matrixOperations/mainfunctionInversion.sci
new file mode 100644
index 0000000..7164590
--- /dev/null
+++ b/src/Scilab2C/SCI2CTests/Mes_tests/matrixOperations/mainfunctionInversion.sci
@@ -0,0 +1,21 @@
+//SCI2C: DEFAULT_PRECISION= DOUBLE
+
+function mainfunction()
+
+//test inversion
+
+
+disp (inv(3))
+
+
+disp (inv(3+2*%i))
+
+c=[4 2 3 ;8 8 4; 3 4 5]
+d=[4 2 3 ;8 8-1*%i 4; 3+4*%i 4 5]
+
+
+disp (inv(c))
+
+disp (inv(d))
+
+endfunction
diff --git a/src/Scilab2C/SCI2CTests/Mes_tests/matrixOperations/mainfunctionOnes.sci b/src/Scilab2C/SCI2CTests/Mes_tests/matrixOperations/mainfunctionOnes.sci
new file mode 100644
index 0000000..15b57b6
--- /dev/null
+++ b/src/Scilab2C/SCI2CTests/Mes_tests/matrixOperations/mainfunctionOnes.sci
@@ -0,0 +1,37 @@
+//SCI2C: DEFAULT_PRECISION= DOUBLE
+
+function mainfunction()
+
+//test ones
+
+//reals
+
+
+//disp(ones())
+
+disp(ones(1))
+
+disp(ones(4))
+
+disp(ones(1,1))
+
+disp(ones(1,4))
+
+disp(ones(4,4))
+
+disp(ones(4,1))
+
+a=[1 2 3; 4 5 6; 7 8 9]
+
+disp(ones(a))
+
+//complexe
+
+disp(ones(2+%i))
+
+b=a+%i
+
+disp(ones(b))
+
+
+endfunction
diff --git a/src/Scilab2C/SCI2CTests/Mes_tests/matrixOperations/mainfunctionOpApex_OpDotApex.sci b/src/Scilab2C/SCI2CTests/Mes_tests/matrixOperations/mainfunctionOpApex_OpDotApex.sci
new file mode 100644
index 0000000..3f3822e
--- /dev/null
+++ b/src/Scilab2C/SCI2CTests/Mes_tests/matrixOperations/mainfunctionOpApex_OpDotApex.sci
@@ -0,0 +1,29 @@
+//SCI2C: DEFAULT_PRECISION= DOUBLE
+
+function mainfunction()
+
+//test OpApex(transpose&conj) & OpDotApex(transpose)
+
+//reals
+
+disp(3')
+
+disp(3.')
+
+a=[4 2 4 8;3 4 5 1;1 4 5 6; 7 4 5 3]
+
+disp(a')
+disp(a.')
+
+//complexes
+
+disp((3+%i)')
+
+disp((3+%i).')
+
+b=2.5*a+a*%i;
+
+disp(b')
+disp(b.')
+
+endfunction
diff --git a/src/Scilab2C/SCI2CTests/Mes_tests/matrixOperations/mainfunctionSpec_Spec2.sci b/src/Scilab2C/SCI2CTests/Mes_tests/matrixOperations/mainfunctionSpec_Spec2.sci
new file mode 100644
index 0000000..36b63d7
--- /dev/null
+++ b/src/Scilab2C/SCI2CTests/Mes_tests/matrixOperations/mainfunctionSpec_Spec2.sci
@@ -0,0 +1,66 @@
+//SCI2C: DEFAULT_PRECISION= DOUBLE
+
+function mainfunction()
+
+//test spec
+
+//reals
+
+disp(spec(4))
+
+[u,v]=spec(4)
+disp(u)
+disp(v)
+
+a=[4 2 4 8;3 4 5 1;1 4 5 6; 7 4 5 3]
+
+disp(spec(a))
+
+[x,y]=spec(a)
+disp(x)
+disp(y)
+
+b=[1 1;1 3]
+disp(spec(b))
+
+[s,t]=spec(b)
+disp(s)
+disp(t)
+
+c=[1 -2;1 3]
+disp(spec(c))
+
+[m,n]=spec(c)
+disp(m)
+disp(n)
+
+
+//complexes
+
+disp(spec(3-%i))
+
+[i,j]=spec(3-%i)
+disp(i)
+disp(j)
+
+d=[1 4 2 5; 2 5 4 7; 3 4 2 4;1 4 7 5]+[1 4 5 7;2 3 6 9;2 4 1 5; 7 8 5 4]*%i;
+
+disp(spec(d))
+
+[k,l]=spec(d)
+disp(k)
+disp(l)
+
+e=[1 2; 2 7]+[0 4;-4 0]*%i
+disp(spec(e))
+
+[o,p]=spec(e)
+disp(o)
+disp(p)
+
+disp(spec(a+0*%i))
+[q,qq]=spec(a+0*%i)
+disp(q)
+disp(qq)
+
+endfunction
diff --git a/src/Scilab2C/SCI2CTests/Mes_tests/matrixOperations/mainfunctionZeros.sci b/src/Scilab2C/SCI2CTests/Mes_tests/matrixOperations/mainfunctionZeros.sci
new file mode 100644
index 0000000..7b4b0f9
--- /dev/null
+++ b/src/Scilab2C/SCI2CTests/Mes_tests/matrixOperations/mainfunctionZeros.sci
@@ -0,0 +1,37 @@
+//SCI2C: DEFAULT_PRECISION= DOUBLE
+
+function mainfunction()
+
+//test zeros
+
+//reals
+
+
+//disp(zeros())
+
+disp(zeros(1))
+
+disp(zeros(4))
+
+disp(zeros(1,1))
+
+disp(zeros(1,4))
+
+disp(zeros(4,4))
+
+disp(zeros(4,1))
+
+a=[1 2 3; 4 5 6; 7 8 9]
+
+disp(zeros(a))
+
+//complexe
+
+disp(zeros(2+%i))
+
+b=a+%i
+
+disp(zeros(b))
+
+
+endfunction