MCPcopy Index your code
hub / github.com/TheAlgorithms/Python / square_zero_matrix

Function square_zero_matrix

linear_algebra/src/lib.py:427–432  ·  view source on GitHub ↗

returns a square zero-matrix of dimension NxN

(n: int)

Source from the content-addressed store, hash-verified

425
426
427def square_zero_matrix(n: int) -> Matrix:
428 """
429 returns a square zero-matrix of dimension NxN
430 """
431 ans: list[list[float]] = [[0] * n for _ in range(n)]
432 return Matrix(ans, n, n)
433
434
435def random_matrix(width: int, height: int, a: int, b: int) -> Matrix:

Callers 1

Calls 1

MatrixClass · 0.70

Tested by 1