Test luSplit function
(self)
| 251 | |
| 252 | # Test (type ARGOUT_ARRAY3[ANY][ANY][ANY]) typemap |
| 253 | def testLUSplit(self): |
| 254 | "Test luSplit function" |
| 255 | print(self.typeStr, "... ", file=sys.stderr) |
| 256 | luSplit = SuperTensor.__dict__[self.typeStr + "LUSplit"] |
| 257 | supertensor = np.ones(2 * 2 * 2 * 2, dtype=self.typeCode).reshape((2, 2, 2, 2)) |
| 258 | answer_upper = [[[[0, 0], [0, 1]], [[0, 1], [1, 1]]], [[[0, 1], [1, 1]], [[1, 1], [1, 1]]]] # noqa: E501 |
| 259 | answer_lower = [[[[1, 1], [1, 0]], [[1, 0], [0, 0]]], [[[1, 0], [0, 0]], [[0, 0], [0, 0]]]] # noqa: E501 |
| 260 | lower, upper = luSplit(supertensor) |
| 261 | self.assertEqual((lower == answer_lower).all(), True) |
| 262 | self.assertEqual((upper == answer_upper).all(), True) |
| 263 | |
| 264 | ###################################################################### |
| 265 |