Ejemplo n.º 1
0
 def testVecMatIndexConversion(self):
     """
     Superoperator: Conversion between matrix and vector indices
     """
     N = 10
     for I in range(N * N):
         i, j = vec2mat_index(N, I)
         I2 = mat2vec_index(N, i, j)
         assert_(I == I2)
Ejemplo n.º 2
0
 def testVecMatIndexConversion(self):
     """
     Superoperator: Conversion between matrix and vector indices
     """
     N = 10
     for I in range(N * N):
         i, j = vec2mat_index(N, I)
         I2 = mat2vec_index(N, i, j)
         assert_(I == I2)
Ejemplo n.º 3
0
 def testVecMatIndexCompability(self):
     """
     Superoperator: Compatibility between matrix/vector and
     corresponding index conversions.
     """
     N = 10
     M = scipy.rand(N, N)
     V = mat2vec(M)
     for I in range(N * N):
         i, j = vec2mat_index(N, I)
         assert_(V[I][0] == M[i, j])
Ejemplo n.º 4
0
 def testVecMatIndexCompability(self):
     """
     Superoperator: Compatibility between matrix/vector and
     corresponding index conversions.
     """
     N = 10
     M = scipy.rand(N, N)
     V = mat2vec(M)
     for I in range(N * N):
         i, j = vec2mat_index(N, I)
         assert_(V[I][0] == M[i, j])