Skip to content

Commit e59f8e0

Browse files
authored
[docs] Update python_example.md
1 parent edeb33f commit e59f8e0

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

docs/examples/python_examples.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import pycubool as cb
1212
# Creation an empty matrix of a known form
1313
#
1414

15-
shape = (3, 3) # Adjacency matrices shape
15+
shape = (3, 3) # Matrix shape
1616
a = cb.Matrix.empty(shape=shape) # Creating matrix
1717

1818
#
@@ -31,7 +31,7 @@ print(a, sep='\n') # Matrix output
3131
# Creation an empty matrix of known shape and filling with given arrays of indices
3232
#
3333

34-
shape = (3, 3) # Adjacency matrices shape
34+
shape = (3, 3) # Matrix shape
3535
a = cb.Matrix.empty(shape=shape) # Creating matrix
3636
rows = [0, 1, 1, 1] # Row indices of values
3737
cols = [0, 0, 1, 2] # Column indices of values
@@ -44,7 +44,7 @@ print(a, sep='\n') # Matrix output
4444
# Creating a matrix via shape and arrays of significant element indices
4545
#
4646

47-
shape = (3, 3) # Adjacency matrices shape
47+
shape = (3, 3) # Matrix shape
4848
rows = [0, 1, 1, 1] # Row indices of values
4949
cols = [0, 0, 1, 2] # Column indices of values
5050
a = cb.Matrix.from_lists(shape=shape, rows=rows, cols=cols)
@@ -57,7 +57,7 @@ print(a, sep='\n') # Matrix output
5757
# Generate random matrix by determining the shape and density - the percentage of non-zeros elements
5858
#
5959

60-
shape = (4, 4) # Adjacency matrices shape
60+
shape = (4, 4) # Matrix shape
6161
density = 0.5 # Matrix filling density
6262
a = cb.Matrix.generate(shape=shape, density=density)
6363

@@ -110,12 +110,12 @@ import pycubool as cb
110110
# Matrix initialization
111111
#
112112

113-
shape = (3, 3) # Adjacency matrices shape
113+
shape = (3, 3) # Matrix shape
114114
a = cb.Matrix.empty(shape=shape)
115115
a[0, 0] = True
116116
a[2, 0] = True
117117

118-
shape = (3, 3) # Adjacency matrices shape
118+
shape = (3, 3) # Matrix shape
119119
b = cb.Matrix.empty(shape=shape)
120120
b[1, 1] = True
121121
b[1, 2] = True
@@ -151,21 +151,21 @@ import pycubool as cb
151151
# Matrix initialization
152152
#
153153

154-
a = cb.Matrix.empty(shape=(3, 3))
154+
a = cb.Matrix.empty(shape=(3, 3)) # Creating an empty matrix of a given shape
155155
a[1, 0] = True
156156
a[1, 1] = True
157157
a[1, 2] = True
158158
a[0, 0] = True
159159

160-
b = cb.Matrix.empty(shape=(3, 3))
160+
b = cb.Matrix.empty(shape=(3, 3)) # Creating an empty matrix of a given shape
161161
b[0, 1] = True
162162
b[0, 2] = True
163163

164164
#
165165
# Simple matrix multiplication
166166
#
167167

168-
result = a.mxm(b) # result = a * b
168+
result = a.mxm(b) # result = a * b
169169

170170
print("Simple matrix multiplication:")
171171
print(result, sep='\n') # Matrix output
@@ -209,7 +209,7 @@ import pycubool as cb
209209
# Matrix initialization
210210
#
211211

212-
shape = (3, 3) # Adjacency matrices shape
212+
shape = (3, 3) # Matrix shape
213213
a = cb.Matrix.empty(shape=shape)
214214
a[1, 0] = True
215215
a[1, 1] = True
@@ -248,11 +248,11 @@ import pycubool as cb
248248
# Matrix initialization
249249
#
250250

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
252252
a[0, 0] = True
253253
a[1, 0] = True
254254

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
256256
b[1, 1] = True
257257
b[1, 0] = True
258258

@@ -289,7 +289,7 @@ import pycubool as cb
289289
# Matrix initialization
290290
#
291291

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
293293
a[1, 0] = True
294294
a[1, 1] = True
295295
a[1, 2] = True
@@ -327,7 +327,7 @@ import pycubool as cb
327327
# Matrix initialization
328328
#
329329

330-
shape = (3, 3) # Adjacency matrices shape
330+
shape = (3, 3) # Matrix shape
331331
a = cb.Matrix.empty(shape=shape)
332332
a[1, 0] = True
333333
a[1, 1] = True
@@ -384,7 +384,7 @@ import pycubool as cb
384384
# Matrix initialization
385385
#
386386

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
388388
a[1, 0] = True
389389
a[1, 1] = True
390390
a[1, 2] = True
@@ -422,7 +422,7 @@ import pycubool as cb
422422
# Creation an empty matrix of a known form
423423
#
424424

425-
shape = (3, 3) # Adjacency matrices shape
425+
shape = (3, 3) # Matrix shape
426426
a = cb.Matrix.empty(shape=shape) # Creating matrix
427427
a[1, 0] = True
428428
a[1, 1] = True
@@ -467,7 +467,7 @@ import pycubool as cb
467467
# Matrix initialization
468468
#
469469

470-
shape = (3, 3) # Adjacency matrices shape
470+
shape = (3, 3) # Matrix shape
471471
a = cb.Matrix.empty(shape=shape)
472472
a[1, 0] = True
473473
a[1, 1] = True
@@ -502,7 +502,7 @@ import pycubool as cb
502502
# Matrix initialization
503503
#
504504

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
506506
a[1, 0] = True
507507
a[1, 1] = True
508508
a[1, 2] = True
@@ -584,15 +584,15 @@ cb.setup_logger(path)
584584
# Matrix initialization
585585
#
586586

587-
a = cb.Matrix.empty(shape=(3, 3))
587+
a = cb.Matrix.empty(shape=(3, 3)) # Creating an empty matrix of a given shape
588588
a[1, 0] = True
589589
a[1, 1] = True
590590
a[1, 2] = True
591591
a[0, 0] = True
592592

593593
a.set_marker("a-log-example-matrix") # Set debug marker for "a" matrix
594594

595-
b = cb.Matrix.empty(shape=(3, 3))
595+
b = cb.Matrix.empty(shape=(3, 3)) # Creating an empty matrix of a given shape
596596
b[0, 1] = True
597597
b[0, 2] = True
598598

0 commit comments

Comments
 (0)