|
8 | 8 | # Creation an empty matrix of a known form |
9 | 9 | # |
10 | 10 |
|
11 | | -shape = (3, 3) # Adjacency matrices shape |
| 11 | +shape = (3, 3) # Matrix shape |
12 | 12 | a = cb.Matrix.empty(shape=shape) # Creating matrix |
13 | 13 |
|
14 | 14 | # |
|
27 | 27 | # Creation an empty matrix of known shape and filling with given arrays of indices |
28 | 28 | # |
29 | 29 |
|
30 | | -shape = (3, 3) # Adjacency matrices shape |
| 30 | +shape = (3, 3) # Matrix shape |
31 | 31 | a = cb.Matrix.empty(shape=shape) # Creating matrix |
32 | 32 | rows = [0, 1, 1, 1] # Row indices of values |
33 | 33 | cols = [0, 0, 1, 2] # Column indices of values |
|
40 | 40 | # Creating a matrix via shape and arrays of significant element indices |
41 | 41 | # |
42 | 42 |
|
43 | | -shape = (3, 3) # Adjacency matrices shape |
| 43 | +shape = (3, 3) # Matrix shape |
44 | 44 | rows = [0, 1, 1, 1] # Row indices of values |
45 | 45 | cols = [0, 0, 1, 2] # Column indices of values |
46 | 46 | a = cb.Matrix.from_lists(shape=shape, rows=rows, cols=cols) |
|
53 | 53 | # Generate random matrix by determining the shape and density - the percentage of non-zeros elements |
54 | 54 | # |
55 | 55 |
|
56 | | -shape = (4, 4) # Adjacency matrices shape |
| 56 | +shape = (4, 4) # Matrix shape |
57 | 57 | density = 0.5 # Matrix filling density |
58 | 58 | a = cb.Matrix.generate(shape=shape, density=density) |
59 | 59 |
|
|
0 commit comments