mailr9336 - /1.3/test_suite/unit_tests/_maths_fns/test_kronecker_product.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on August 19, 2009 - 10:32:
Author: bugman
Date: Wed Aug 19 10:32:35 2009
New Revision: 9336

URL: http://svn.gna.org/viewcvs/relax?rev=9336&view=rev
Log:
Expanded the test_kron_prod() to check all elements of the matrix.


Modified:
    1.3/test_suite/unit_tests/_maths_fns/test_kronecker_product.py

Modified: 1.3/test_suite/unit_tests/_maths_fns/test_kronecker_product.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/test_suite/unit_tests/_maths_fns/test_kronecker_product.py?rev=9336&r1=9335&r2=9336&view=diff
==============================================================================
--- 1.3/test_suite/unit_tests/_maths_fns/test_kronecker_product.py (original)
+++ 1.3/test_suite/unit_tests/_maths_fns/test_kronecker_product.py Wed Aug 19 
10:32:35 2009
@@ -133,13 +133,29 @@
         # The Kronecker product.
         C = kron_prod(R1, R2)
 
+        # The real Kronecker product!
+        D = array([
+            [ 0,  1,  0,  0,  4,  0,  0,  5,  0],
+            [ 0,  0,  0,  0,  0,  0,  0,  0,  0],
+            [ 0,  0,  0,  0,  0,  0,  0,  0,  0],
+            [ 0, -4,  0,  0,  2,  0,  0,  6,  0],
+            [ 0,  0,  0,  0,  0,  0,  0,  0,  0],
+            [ 0,  0,  0,  0,  0,  0,  0,  0,  0],
+            [ 0, -5,  0,  0, -6,  0,  0,  3,  0],
+            [ 0,  0,  0,  0,  0,  0,  0,  0,  0],
+            [ 0,  0,  0,  0,  0,  0,  0,  0,  0]], float64)
+
         # Print outs.
         print("R1:\n%s" % R1)
         print("R2:\n%s" % R2)
         print("C:\n%s" % C)
+        print("D:\n%s" % D)
 
         # Checks.
         self.assertEqual(C.shape, (9, 9))
+        for i in range(9):
+            for j in range(9):
+                self.assertEqual(C[i, j], D[i, j])
 
 
     def test_transpose_12(self):




Related Messages


Powered by MHonArc, Updated Wed Aug 19 11:00:01 2009