Created
November 17, 2022 08:33
-
-
Save singularitti/86836ef9050fcdf9f9a5ae317358aa83 to your computer and use it in GitHub Desktop.
Map function `f` at specific indices of an array #Julia #array
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function mapat!(f, array, indices...) # Map function `f` at specific indices of an array | |
area = view(array, indices...) | |
map!(f, area, area) | |
return array | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment