You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/specs/stdlib_intrinsics.md
+7-3Lines changed: 7 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -48,7 +48,7 @@ If `dim` is absent, the output is a scalar of the same `type` and `kind` as to t
48
48
49
49
#### Description
50
50
51
-
The `stdlib_sum_kahan` function can replace the intrinsic `sum` for 1D `real` or `complex` arrays. It follows a chunked implementation which maximizes vectorization potential, complemented by an `elemental` kernel based on the [kahan summation](https://en.wikipedia.org/wiki/Kahan_summation_algorithm) strategy to reduce the round-off error:
51
+
The `stdlib_sum_kahan` function can replace the intrinsic `sum` for `real` or `complex` arrays. It follows a chunked implementation which maximizes vectorization potential complemented by an `elemental` kernel based on the [kahan summation](https://en.wikipedia.org/wiki/Kahan_summation_algorithm) strategy to reduce the round-off error:
`res = `[[stdlib_intrinsics(module):stdlib_sum_kahan(interface)]]` (x, dim [,mask] )`
71
+
70
72
#### Status
71
73
72
74
Experimental
@@ -79,11 +81,13 @@ Pure function.
79
81
80
82
`x`: 1D array of either `real` or `complex` type. This argument is `intent(in)`.
81
83
82
-
`mask` (optional): 1D array of `logical` values. This argument is `intent(in)`.
84
+
`dim` (optional): scalar of type `integer` with a value in the range from 1 to n, where n equals the rank of `x`.
85
+
86
+
`mask` (optional): N-D array of `logical` values, with the same shape as `x`. This argument is `intent(in)`.
83
87
84
88
#### Output value or Result value
85
89
86
-
The output is a scalar of `type` and `kind`same as to that of `x`.
90
+
If `dim` is absent, the output is a scalar of the same `type` and `kind` as to that of `x`. Otherwise, an array of rank n-1, where n equals the rank of `x`, and a shape similar to that of `x` with dimension `dim` dropped is returned.
0 commit comments