[arrayfire] 236/248: Moved det to rank test file. Removed rank and det from missing test

Ghislain Vaillant ghisvail-guest at moszumanska.debian.org
Tue Nov 17 15:54:31 UTC 2015


This is an automated email from the git hooks/post-receive script.

ghisvail-guest pushed a commit to branch dfsg-clean
in repository arrayfire.

commit 463f044dcc26791d6b007a179c5dfd1d0552bf90
Author: Shehzan Mohammed <shehzan at arrayfire.com>
Date:   Wed Nov 11 10:52:03 2015 -0500

    Moved det to rank test file. Removed rank and det from missing test
---
 test/data           |  2 +-
 test/missing.cpp    |  2 --
 test/rank_dense.cpp | 30 ++++++++++++++++++++++++++++++
 3 files changed, 31 insertions(+), 3 deletions(-)

diff --git a/test/data b/test/data
index 8a2faf8..db4f6e8 160000
--- a/test/data
+++ b/test/data
@@ -1 +1 @@
-Subproject commit 8a2faf854283e406526223f2797e8736af7a5dcd
+Subproject commit db4f6e80629fb41580ab93208db6b8be958871df
diff --git a/test/missing.cpp b/test/missing.cpp
index ff318ac..c06fdf8 100644
--- a/test/missing.cpp
+++ b/test/missing.cpp
@@ -19,7 +19,6 @@ TEST(MissingFunctionTests, Dummy)
 {
     array A = randu(10,10, f32);
     af_print(A);
-    af_print(rank(A));
     af_print(arg(A));
     af_print(arg(complex(A, A)));
     af_print(trunc(3 * A));
@@ -31,5 +30,4 @@ TEST(MissingFunctionTests, Dummy)
     af_print(minfilt(A, 3, 3) - erode(A, constant(1, 3,3)));
     af_print(maxfilt(A, 3, 3) - dilate(A, constant(1, 3,3)));
     printf("%lf\n", norm(A));
-    printf("%lf\n", det<double>(A));
 }
diff --git a/test/rank_dense.cpp b/test/rank_dense.cpp
index 3ecf497..96b4449 100644
--- a/test/rank_dense.cpp
+++ b/test/rank_dense.cpp
@@ -30,8 +30,14 @@ class Rank : public ::testing::Test
 {
 };
 
+template<typename T>
+class Det : public ::testing::Test
+{
+};
+
 typedef ::testing::Types<float, double, af::cfloat, af::cdouble> TestTypes;
 TYPED_TEST_CASE(Rank, TestTypes);
+TYPED_TEST_CASE(Det, TestTypes);
 
 template<typename T>
 void rankSmall()
@@ -86,3 +92,27 @@ TYPED_TEST(Rank, low)
 {
     rankBig<TypeParam>(512);
 }
+
+template<typename T>
+void detTest()
+{
+    if (noDoubleTests<T>()) return;
+    af::dtype dt = (af::dtype)af::dtype_traits<T>::af_type;
+
+    vector<af::dim4> numDims;
+
+    vector<vector<float> >   in;
+    vector<vector<float> >   tests;
+    readTests<float,float,float>(string(TEST_DIR"/lapack/detSmall.test"),numDims,in,tests);
+    af::dim4 dims       = numDims[0];
+
+    af::array input = af::array(dims, &(in[0].front())).as(dt);
+    T output = af::det<T>(input);
+
+    ASSERT_NEAR(abs((T)tests[0][0]), abs(output), 1e-6);
+}
+
+TYPED_TEST(Det, Small)
+{
+    detTest<TypeParam>();
+}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/arrayfire.git



More information about the debian-science-commits mailing list