123456789101112131415161718192021222324 |
- include "primitives.alh"
- include "random.alh"
- Element function create_random_matrix(n : Integer):
- Element m
- Integer i
- Integer j
- Element t
- // Construct the matrix first, with as many rows as there are variables
- // Number of columns is 1 higher
- i = 0
- m = create_node()
- while (i < n):
- j = 0
- t = create_node()
- while (j < (n + 1)):
- list_append(t, random())
- j = j + 1
- list_append(m, t)
- i = i + 1
- return m!
|