Skip to content

Commit 7000690

Browse files
stevengjararslan
authored andcommitted
at-dot macro for adding dots to function calls (#20321)
1 parent 0c191ee commit 7000690

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

docs/src/index.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,13 +151,14 @@ it can combine arrays and scalars, arrays of the same size (performing
151151
the operation elementwise), and even arrays of different shapes (e.g.
152152
combining row and column vectors to produce a matrix). Moreover, like
153153
all vectorized "dot calls," these "dot operators" are
154-
*fusing*. For example, if you compute `2 .* A.^2 .+ sin.(A)` for an
155-
array `A`, it performs a *single* loop over `A`, computing `2a^2 + sin(a)`
154+
*fusing*. For example, if you compute `2 .* A.^2 .+ sin.(A)` (or
155+
equivalently `@. 2A^2 + sin(A)`, using the [`@.`](@ref @__dot__) macro) for
156+
an array `A`, it performs a *single* loop over `A`, computing `2a^2 + sin(a)`
156157
for each element of `A`. In particular, nested dot calls like `f.(g.(x))`
157158
are fused, and "adjacent" binary operators like `x .+ 3 .* x.^2` are
158159
equivalent to nested dot calls `(+).(x, (*).(3, (^).(x, 2)))`.
159160

160-
Furthermore, "dotted" updating operators like `a .+= b` are parsed
161+
Furthermore, "dotted" updating operators like `a .+= b` (or `@. a += b`) are parsed
161162
as `a .= a .+ b`, where `.=` is a fused *in-place* assignment operation
162163
(see the [dot syntax documentation](@ref man-vectorized)).
163164

0 commit comments

Comments
 (0)