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)
| 239 | |
| 240 | |
| 241 | def randomVector(N, a, b): |
| 242 | """ |
| 243 | input: size (N) of the vector. |
| 244 | random range (a,b) |
| 245 | output: returns a random vector of size N, with |
| 246 | random integer components between 'a' and 'b'. |
| 247 | """ |
| 248 | ans = zeroVector(N) |
| 249 | random.seed(None) |
| 250 | for i in range(N): |
| 251 | ans.changeComponent(i, random.randint(a, b)) |
| 252 | return ans |
| 253 | |
| 254 | |
| 255 | class Matrix(object): |
nothing calls this directly
no test coverage detected