MCPcopy
hub / github.com/numpy/numpy / testScale

Method testScale

tools/swig/test/testMatrix.py:124–130  ·  view source on GitHub ↗

Test scale function

(self)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

allMethod · 0.45

Tested by

no test coverage detected