Skip to content

Commit 693928d

Browse files
committed
doc updates
1 parent db01f88 commit 693928d

File tree

1 file changed

+23
-13
lines changed

1 file changed

+23
-13
lines changed

shared-bindings/ulab/__init__.rst

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -79,26 +79,30 @@ ulab.array -- 1- and 2- dimensional array
7979
.. method:: __add__()
8080

8181
Adds corresponding elements of the two arrays, or adds a number to all
82-
elements of the array. A number must be on the right hand side. If
83-
both arguments are arrays, their sizes must match.
82+
elements of the array. If both arguments are arrays, their sizes must match.
8483

8584
.. method:: __sub__()
8685

87-
Subtracts corresponding elements of the two arrays, or subtracts a
88-
number from all elements of the array. A number must be on the right
89-
hand side. If both arguments are arrays, their sizes must match.
86+
Subtracts corresponding elements of the two arrays, or adds a number to all
87+
elements of the array. If both arguments are arrays, their sizes must match.
9088

9189
.. method:: __mul__()
9290

9391
Multiplies corresponding elements of the two arrays, or multiplies
94-
all elements of the array by a number. A number must be on the right
95-
hand side. If both arguments are arrays, their sizes must match.
92+
all elements of the array by a number. If both arguments are arrays,
93+
their sizes must match.
9694

9795
.. method:: __div__()
9896

9997
Multiplies corresponding elements of the two arrays, or divides
100-
all elements of the array by a number. A number must be on the right
101-
hand side. If both arguments are arrays, their sizes must match.
98+
all elements of the array by a number. If both arguments are arrays,
99+
their sizes must match.
100+
101+
.. method:: __pow__()
102+
103+
Computes the power (x**y) of corresponding elements of the the two arrays,
104+
or one number and one array. If both arguments are arrays, their sizes
105+
must match.
102106

103107
.. method:: __getitem__()
104108

@@ -348,6 +352,12 @@ much more efficient than expressing the same operation as a Python loop.
348352

349353
Return the total number of elements in the array, as an integer.
350354

355+
.. method:: trace(m)
356+
357+
:param m: a square matrix
358+
359+
Compute the trace of the matrix, the sum of its diagonal elements.
360+
351361
:mod:`ulab.filter` --- Filtering functions
352362
==========================================
353363

@@ -404,11 +414,11 @@ operate over the flattened array (None), rows (0), or columns (1).
404414

405415
.. method:: argmax(array, \*, axis=None)
406416

407-
Return the index of the maximum element of the 1D array, as an array with 1 element
417+
Return the index of the maximum element of the 1D array
408418

409419
.. method:: argmin(array, \*, axis=None)
410420

411-
Return the index of the minimum element of the 1D array, as an array with 1 element
421+
Return the index of the minimum element of the 1D array
412422

413423
.. method:: argsort(array, \*, axis=None)
414424

@@ -426,15 +436,15 @@ operate over the flattened array (None), rows (0), or columns (1).
426436

427437
.. method:: max(array, \*, axis=None)
428438

429-
Return the maximum element of the 1D array, as an array with 1 element
439+
Return the maximum element of the 1D array
430440

431441
.. method:: mean(array, \*, axis=None)
432442

433443
Return the mean element of the 1D array, as a number if axis is None, otherwise as an array.
434444

435445
.. method:: min(array, \*, axis=None)
436446

437-
Return the minimum element of the 1D array, as an array with 1 element
447+
Return the minimum element of the 1D array
438448

439449
.. method:: roll(array, distance, \*, axis=None)
440450

0 commit comments

Comments
 (0)