summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSandeep Gupta2017-07-07 01:39:22 +0530
committerSandeep Gupta2017-07-07 01:39:22 +0530
commit3f6c53783f04d515c4e63be884709983fa547d18 (patch)
treefa44146a2485fae03d537f3e09c1b72988273576 /tests
parent7a7f685a8436b456b246c49baf76bb8af930b214 (diff)
downloadScilab2C_fossee_old-3f6c53783f04d515c4e63be884709983fa547d18.tar.gz
Scilab2C_fossee_old-3f6c53783f04d515c4e63be884709983fa547d18.tar.bz2
Scilab2C_fossee_old-3f6c53783f04d515c4e63be884709983fa547d18.zip
SVD Function
Diffstat (limited to 'tests')
-rw-r--r--tests/unit_tests/testLinearAlgebra/testsvd/testsvd.sci6
-rw-r--r--tests/unit_tests/testLinearAlgebra/testsvd/testsvdeconomy.sci11
-rw-r--r--tests/unit_tests/testLinearAlgebra/testsvd/testsvdim.sci6
-rw-r--r--tests/unit_tests/testLinearAlgebra/testsvd/testsvdrank.sci13
-rw-r--r--tests/unit_tests/testLinearAlgebra/testsvd/testsvdreal.sci11
5 files changed, 47 insertions, 0 deletions
diff --git a/tests/unit_tests/testLinearAlgebra/testsvd/testsvd.sci b/tests/unit_tests/testLinearAlgebra/testsvd/testsvd.sci
new file mode 100644
index 0000000..9a3a50a
--- /dev/null
+++ b/tests/unit_tests/testLinearAlgebra/testsvd/testsvd.sci
@@ -0,0 +1,6 @@
+function testsvd()
+ disp(" ** SVD Function (Singular Value Decomposition)** ")
+ A = [1,2,3,11;4,5,6,12;7,8,9,13] // Matrix - A
+ [s = svd(A) // Calling Function Sequence
+ disp(s)
+endfunction
diff --git a/tests/unit_tests/testLinearAlgebra/testsvd/testsvdeconomy.sci b/tests/unit_tests/testLinearAlgebra/testsvd/testsvdeconomy.sci
new file mode 100644
index 0000000..0459c79
--- /dev/null
+++ b/tests/unit_tests/testLinearAlgebra/testsvd/testsvdeconomy.sci
@@ -0,0 +1,11 @@
+function testsvdeconomy()
+ disp(" ** SVD Function (Singular Value Decomposition)** ")
+ A = [1,2,3,11;4,5,6,12;7,8,9,13] // Matrix - A
+ [u,s,vt] = svd(A,'e') // Calling Function Sequence
+ disp("U Matrix")
+ disp(u) // A = U*sigma*Vt
+ disp("Sigma Matrix")
+ disp(s)
+ disp(" V transpose ")
+ disp(vt)
+endfunction
diff --git a/tests/unit_tests/testLinearAlgebra/testsvd/testsvdim.sci b/tests/unit_tests/testLinearAlgebra/testsvd/testsvdim.sci
new file mode 100644
index 0000000..16633cc
--- /dev/null
+++ b/tests/unit_tests/testLinearAlgebra/testsvd/testsvdim.sci
@@ -0,0 +1,6 @@
+// Function double_complex - test data.
+function svdim()
+ b = [ (5.91+5.69*%i),(3.15-4.08*%i),(4.89+4.20*%i),(7.09+2.72*%i);(1.89+3.27*%i),(4.10+6.70*%i),(7.78+4.06*%i),(4.57+2.07*%i);(3.28+3.84*%i),(-0.79+7.21*%i),(3.88+3.30*%i),(3.84+1.19*%i)]
+ s = svd(b)
+ disp(s)
+endfunction
diff --git a/tests/unit_tests/testLinearAlgebra/testsvd/testsvdrank.sci b/tests/unit_tests/testLinearAlgebra/testsvd/testsvdrank.sci
new file mode 100644
index 0000000..108acde
--- /dev/null
+++ b/tests/unit_tests/testLinearAlgebra/testsvd/testsvdrank.sci
@@ -0,0 +1,13 @@
+function testsvdrank()
+ disp(" ** SVD Function (Singular Value Decomposition)** ")
+ A = [1,2,3,11;4,5,6,12;7,8,9,13] // Matrix - A
+ [u,s,vt,rk] = svd(A) // Calling Function Sequence
+ disp("U Matrix")
+ disp(u) // A = U*sigma*Vt
+ disp("Sigma Matrix")
+ disp(s)
+ disp(" V transpose ")
+ disp(vt)
+ disp("Rank")
+ disp(rk)
+endfunction
diff --git a/tests/unit_tests/testLinearAlgebra/testsvd/testsvdreal.sci b/tests/unit_tests/testLinearAlgebra/testsvd/testsvdreal.sci
new file mode 100644
index 0000000..0e68e00
--- /dev/null
+++ b/tests/unit_tests/testLinearAlgebra/testsvd/testsvdreal.sci
@@ -0,0 +1,11 @@
+function testsvdreal()
+ disp(" ** SVD Function (Singular Value Decomposition)** ")
+ A = [1,2,3,11;4,5,6,12;7,8,9,13] // Matrix - A
+ [u,s,vt] = svd(A) // Calling Function Sequence
+ disp("U Matrix")
+ disp(u) // A = U*sigma*Vt
+ disp("Sigma Matrix")
+ disp(s)
+ disp(" V transpose ")
+ disp(vt)
+endfunction