MCPcopy Index your code
hub / github.com/geekcomputers/Python / randomMatrix

Function randomMatrix

linear-algebra-python/src/lib.py:415–427  ·  view source on GitHub ↗

returns a random matrix WxH with integer components between 'a' and 'b'

(W, H, a, b)

Source from the content-addressed store, hash-verified

413
414
415def randomMatrix(W, H, a, b):
416 """
417 returns a random matrix WxH with integer components
418 between 'a' and 'b'
419 """
420 matrix = []
421 random.seed(None)
422 for i in range(H):
423 row = []
424 for j in range(W):
425 row.append(random.randint(a, b))
426 matrix.append(row)
427 return Matrix(matrix, W, H)

Callers

nothing calls this directly

Calls 2

MatrixClass · 0.85
appendMethod · 0.45

Tested by

no test coverage detected