@@ -12,7 +12,7 @@ import pycubool as cb
12
12
# Creation an empty matrix of a known form
13
13
#
14
14
15
- shape = (3 , 3 ) # Adjacency matrices shape
15
+ shape = (3 , 3 ) # Matrix shape
16
16
a = cb.Matrix.empty(shape = shape) # Creating matrix
17
17
18
18
#
@@ -31,7 +31,7 @@ print(a, sep='\n') # Matrix output
31
31
# Creation an empty matrix of known shape and filling with given arrays of indices
32
32
#
33
33
34
- shape = (3 , 3 ) # Adjacency matrices shape
34
+ shape = (3 , 3 ) # Matrix shape
35
35
a = cb.Matrix.empty(shape = shape) # Creating matrix
36
36
rows = [0 , 1 , 1 , 1 ] # Row indices of values
37
37
cols = [0 , 0 , 1 , 2 ] # Column indices of values
@@ -44,7 +44,7 @@ print(a, sep='\n') # Matrix output
44
44
# Creating a matrix via shape and arrays of significant element indices
45
45
#
46
46
47
- shape = (3 , 3 ) # Adjacency matrices shape
47
+ shape = (3 , 3 ) # Matrix shape
48
48
rows = [0 , 1 , 1 , 1 ] # Row indices of values
49
49
cols = [0 , 0 , 1 , 2 ] # Column indices of values
50
50
a = cb.Matrix.from_lists(shape = shape, rows = rows, cols = cols)
@@ -57,7 +57,7 @@ print(a, sep='\n') # Matrix output
57
57
# Generate random matrix by determining the shape and density - the percentage of non-zeros elements
58
58
#
59
59
60
- shape = (4 , 4 ) # Adjacency matrices shape
60
+ shape = (4 , 4 ) # Matrix shape
61
61
density = 0.5 # Matrix filling density
62
62
a = cb.Matrix.generate(shape = shape, density = density)
63
63
@@ -110,12 +110,12 @@ import pycubool as cb
110
110
# Matrix initialization
111
111
#
112
112
113
- shape = (3 , 3 ) # Adjacency matrices shape
113
+ shape = (3 , 3 ) # Matrix shape
114
114
a = cb.Matrix.empty(shape = shape)
115
115
a[0 , 0 ] = True
116
116
a[2 , 0 ] = True
117
117
118
- shape = (3 , 3 ) # Adjacency matrices shape
118
+ shape = (3 , 3 ) # Matrix shape
119
119
b = cb.Matrix.empty(shape = shape)
120
120
b[1 , 1 ] = True
121
121
b[1 , 2 ] = True
@@ -151,21 +151,21 @@ import pycubool as cb
151
151
# Matrix initialization
152
152
#
153
153
154
- a = cb.Matrix.empty(shape = (3 , 3 ))
154
+ a = cb.Matrix.empty(shape = (3 , 3 )) # Creating an empty matrix of a given shape
155
155
a[1 , 0 ] = True
156
156
a[1 , 1 ] = True
157
157
a[1 , 2 ] = True
158
158
a[0 , 0 ] = True
159
159
160
- b = cb.Matrix.empty(shape = (3 , 3 ))
160
+ b = cb.Matrix.empty(shape = (3 , 3 )) # Creating an empty matrix of a given shape
161
161
b[0 , 1 ] = True
162
162
b[0 , 2 ] = True
163
163
164
164
#
165
165
# Simple matrix multiplication
166
166
#
167
167
168
- result = a.mxm(b) # result = a * b
168
+ result = a.mxm(b) # result = a * b
169
169
170
170
print (" Simple matrix multiplication:" )
171
171
print (result, sep = ' \n ' ) # Matrix output
@@ -209,7 +209,7 @@ import pycubool as cb
209
209
# Matrix initialization
210
210
#
211
211
212
- shape = (3 , 3 ) # Adjacency matrices shape
212
+ shape = (3 , 3 ) # Matrix shape
213
213
a = cb.Matrix.empty(shape = shape)
214
214
a[1 , 0 ] = True
215
215
a[1 , 1 ] = True
@@ -248,11 +248,11 @@ import pycubool as cb
248
248
# Matrix initialization
249
249
#
250
250
251
- a = cb.Matrix.empty(shape = (2 , 2 )) # Adjacency matrices shape
251
+ a = cb.Matrix.empty(shape = (2 , 2 )) # Creating an empty matrix of a given shape
252
252
a[0 , 0 ] = True
253
253
a[1 , 0 ] = True
254
254
255
- b = cb.Matrix.empty(shape = (2 , 2 )) # Adjacency matrices shape
255
+ b = cb.Matrix.empty(shape = (2 , 2 )) # Creating an empty matrix of a given shape
256
256
b[1 , 1 ] = True
257
257
b[1 , 0 ] = True
258
258
@@ -289,7 +289,7 @@ import pycubool as cb
289
289
# Matrix initialization
290
290
#
291
291
292
- a = cb.Matrix.empty(shape = (3 , 3 )) # Adjacency matrices shape
292
+ a = cb.Matrix.empty(shape = (3 , 3 )) # Creating an empty matrix of a given shape
293
293
a[1 , 0 ] = True
294
294
a[1 , 1 ] = True
295
295
a[1 , 2 ] = True
@@ -327,7 +327,7 @@ import pycubool as cb
327
327
# Matrix initialization
328
328
#
329
329
330
- shape = (3 , 3 ) # Adjacency matrices shape
330
+ shape = (3 , 3 ) # Matrix shape
331
331
a = cb.Matrix.empty(shape = shape)
332
332
a[1 , 0 ] = True
333
333
a[1 , 1 ] = True
@@ -384,7 +384,7 @@ import pycubool as cb
384
384
# Matrix initialization
385
385
#
386
386
387
- a = cb.Matrix.empty(shape = (3 , 3 )) # Adjacency matrices shape
387
+ a = cb.Matrix.empty(shape = (3 , 3 )) # Creating an empty matrix of a given shape
388
388
a[1 , 0 ] = True
389
389
a[1 , 1 ] = True
390
390
a[1 , 2 ] = True
@@ -422,7 +422,7 @@ import pycubool as cb
422
422
# Creation an empty matrix of a known form
423
423
#
424
424
425
- shape = (3 , 3 ) # Adjacency matrices shape
425
+ shape = (3 , 3 ) # Matrix shape
426
426
a = cb.Matrix.empty(shape = shape) # Creating matrix
427
427
a[1 , 0 ] = True
428
428
a[1 , 1 ] = True
@@ -467,7 +467,7 @@ import pycubool as cb
467
467
# Matrix initialization
468
468
#
469
469
470
- shape = (3 , 3 ) # Adjacency matrices shape
470
+ shape = (3 , 3 ) # Matrix shape
471
471
a = cb.Matrix.empty(shape = shape)
472
472
a[1 , 0 ] = True
473
473
a[1 , 1 ] = True
@@ -502,7 +502,7 @@ import pycubool as cb
502
502
# Matrix initialization
503
503
#
504
504
505
- a = cb.Matrix.empty(shape = (3 , 3 )) # Adjacency matrices shape
505
+ a = cb.Matrix.empty(shape = (3 , 3 )) # Creating an empty matrix of a given shape
506
506
a[1 , 0 ] = True
507
507
a[1 , 1 ] = True
508
508
a[1 , 2 ] = True
@@ -584,15 +584,15 @@ cb.setup_logger(path)
584
584
# Matrix initialization
585
585
#
586
586
587
- a = cb.Matrix.empty(shape = (3 , 3 ))
587
+ a = cb.Matrix.empty(shape = (3 , 3 )) # Creating an empty matrix of a given shape
588
588
a[1 , 0 ] = True
589
589
a[1 , 1 ] = True
590
590
a[1 , 2 ] = True
591
591
a[0 , 0 ] = True
592
592
593
593
a.set_marker(" a-log-example-matrix" ) # Set debug marker for "a" matrix
594
594
595
- b = cb.Matrix.empty(shape = (3 , 3 ))
595
+ b = cb.Matrix.empty(shape = (3 , 3 )) # Creating an empty matrix of a given shape
596
596
b[0 , 1 ] = True
597
597
b[0 , 2 ] = True
598
598
0 commit comments