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

Function zero_vector

linear_algebra/src/lib.py:196–202  ·  view source on GitHub ↗

returns a zero-vector of size 'dimension'

(dimension: int)

Source from the content-addressed store, hash-verified

194
195
196def zero_vector(dimension: int) -> Vector:
197 """
198 returns a zero-vector of size 'dimension'
199 """
200 # precondition
201 assert isinstance(dimension, int)
202 return Vector([0] * dimension)
203
204
205def unit_basis_vector(dimension: int, pos: int) -> Vector:

Callers 2

__mul__Method · 0.85
test_zero_vectorMethod · 0.85

Calls 1

VectorClass · 0.85

Tested by 1

test_zero_vectorMethod · 0.68