MCPcopy Create free account
hub / github.com/subbarayudu-j/TheAlgorithms-Python / randomVector

Function randomVector

linear_algebra_python/src/lib.py:179–188  ·  view source on GitHub ↗

input: size (N) of the vector. random range (a,b) output: returns a random vector of size N, with random integer components between 'a' and 'b'.

(N,a,b)

Source from the content-addressed store, hash-verified

177
178
179def randomVector(N,a,b):
180 """
181 input: size (N) of the vector.
182 random range (a,b)
183 output: returns a random vector of size N, with
184 random integer components between 'a' and 'b'.
185 """
186 random.seed(None)
187 ans = [random.randint(a,b) for i in range(N)]
188 return Vector(ans)
189
190
191class Matrix(object):

Callers

nothing calls this directly

Calls 1

VectorClass · 0.85

Tested by

no test coverage detected