MCPcopy Create free account
hub / github.com/numpy/numpy / testScale

Method testScale

tools/swig/test/testMatrix.py:123–129  ·  view source on GitHub ↗

Test scale function

(self)

Source from the content-addressed store, hash-verified

121
122 # Test (type INPLACE_ARRAY2[ANY][ANY]) typemap
123 def testScale(self):
124 "Test scale function"
125 print(self.typeStr, "... ", end=' ', file=sys.stderr)
126 scale = Matrix.__dict__[self.typeStr + "Scale"]
127 matrix = np.array([[1, 2, 3], [2, 1, 2], [3, 2, 1]], self.typeCode)
128 scale(matrix, 4)
129 self.assertEqual((matrix == [[4, 8, 12], [8, 4, 8], [12, 8, 4]]).all(), True)
130
131 # Test (type INPLACE_ARRAY2[ANY][ANY]) typemap
132 def testScaleWrongDim(self):

Callers

nothing calls this directly

Calls 2

printFunction · 0.85
allMethod · 0.45

Tested by

no test coverage detected