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: advent/blog/2024/12/25/jwst/index.html
+2-1Lines changed: 2 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -181,7 +181,8 @@ <h2>Broadcasting</h2>
181
181
182
182
<p>This trick is known as 'broadcasting' and is one of the most powerful PDL features.
183
183
You can see we have written some highly complex code to apply mathematical operations to the image as a function of x,y without writing a single loop!
184
-
Broadcasting is powerful because it can be applied along any axis with suitable dimension tricks using functions such as <code>mv()</code> and <code>clump()</code>.
184
+
Broadcasting is powerful because it can be applied along any axis with suitable dimension tricks using functions such as <ahref="https://metacpan.org/pod/PDL::Slices#mv"><code>mv()</code></a> and <ahref="https://metacpan.org/pod/PDL::Core#dummy"><code>dummy()</code></a>.
185
+
One can also use <ahref="https://metacpan.org/pod/PDL::Core#clump"><code>clump()</code></a> to aggregate dimensions.
185
186
It is also extremely fast as it operates at speeds close to what would happen if the loops were written in C or FORTRAN.
186
187
When using it, I tend to need to experiment a bit to achieve what I want and look at the resulting dimensions.
187
188
The main rule to remember is dimensions need to <em>match</em>, this happens when they are either the same size, or when one of them is of size unity.
0 commit comments