Test floor function
(self)
| 178 | |
| 179 | # Test (type* INPLACE_ARRAY3, int DIM1, int DIM2, int DIM3) typemap |
| 180 | def testFloor(self): |
| 181 | "Test floor function" |
| 182 | print(self.typeStr, "... ", file=sys.stderr) |
| 183 | supertensor = np.arange(2 * 2 * 2 * 2, |
| 184 | dtype=self.typeCode).reshape((2, 2, 2, 2)) |
| 185 | answer = supertensor.copy() |
| 186 | answer[answer < 4] = 4 |
| 187 | |
| 188 | floor = SuperTensor.__dict__[self.typeStr + "Floor"] |
| 189 | floor(supertensor, 4) |
| 190 | np.testing.assert_array_equal(supertensor, answer) |
| 191 | |
| 192 | # Test (type* INPLACE_ARRAY3, int DIM1, int DIM2, int DIM3) typemap |
| 193 | def testFloorWrongType(self): |