@@ -79,26 +79,30 @@ ulab.array -- 1- and 2- dimensional array
79
79
.. method :: __add__()
80
80
81
81
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.
84
83
85
84
.. method :: __sub__()
86
85
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.
90
88
91
89
.. method :: __mul__()
92
90
93
91
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.
96
94
97
95
.. method :: __div__()
98
96
99
97
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.
102
106
103
107
.. method :: __getitem__()
104
108
@@ -348,6 +352,12 @@ much more efficient than expressing the same operation as a Python loop.
348
352
349
353
Return the total number of elements in the array, as an integer.
350
354
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
+
351
361
:mod: `ulab.filter ` --- Filtering functions
352
362
==========================================
353
363
@@ -404,11 +414,11 @@ operate over the flattened array (None), rows (0), or columns (1).
404
414
405
415
.. method :: argmax(array, \*, axis=None)
406
416
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
408
418
409
419
.. method :: argmin(array, \*, axis=None)
410
420
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
412
422
413
423
.. method :: argsort(array, \*, axis=None)
414
424
@@ -426,15 +436,15 @@ operate over the flattened array (None), rows (0), or columns (1).
426
436
427
437
.. method :: max(array, \*, axis=None)
428
438
429
- Return the maximum element of the 1D array, as an array with 1 element
439
+ Return the maximum element of the 1D array
430
440
431
441
.. method :: mean(array, \*, axis=None)
432
442
433
443
Return the mean element of the 1D array, as a number if axis is None, otherwise as an array.
434
444
435
445
.. method :: min(array, \*, axis=None)
436
446
437
- Return the minimum element of the 1D array, as an array with 1 element
447
+ Return the minimum element of the 1D array
438
448
439
449
.. method :: roll(array, distance, \*, axis=None)
440
450
0 commit comments