MCPcopy Index your code
hub / github.com/subbarayudu-j/TheAlgorithms-Python / randomMatrix

Function randomMatrix

linear_algebra_python/src/lib.py:314–321  ·  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

312
313
314def randomMatrix(W,H,a,b):
315 """
316 returns a random matrix WxH with integer components
317 between 'a' and 'b'
318 """
319 random.seed(None)
320 matrix = [[random.randint(a,b) for j in range(W)] for i in range(H)]
321 return Matrix(matrix,W,H)
322
323

Callers

nothing calls this directly

Calls 1

MatrixClass · 0.85

Tested by

no test coverage detected