Test luSplit function
(self)
| 240 | |
| 241 | # Test (type ARGOUT_ARRAY3[ANY][ANY][ANY]) typemap |
| 242 | def testLUSplit(self): |
| 243 | "Test luSplit function" |
| 244 | print(self.typeStr, "... ", file=sys.stderr) |
| 245 | luSplit = SuperTensor.__dict__[self.typeStr + "LUSplit"] |
| 246 | supertensor = np.ones(2*2*2*2, dtype=self.typeCode).reshape((2, 2, 2, 2)) |
| 247 | answer_upper = [[[[0, 0], [0, 1]], [[0, 1], [1, 1]]], [[[0, 1], [1, 1]], [[1, 1], [1, 1]]]] |
| 248 | answer_lower = [[[[1, 1], [1, 0]], [[1, 0], [0, 0]]], [[[1, 0], [0, 0]], [[0, 0], [0, 0]]]] |
| 249 | lower, upper = luSplit(supertensor) |
| 250 | self.assertEqual((lower == answer_lower).all(), True) |
| 251 | self.assertEqual((upper == answer_upper).all(), True) |
| 252 | |
| 253 | ###################################################################### |
| 254 |