Skip to content

Instantly share code, notes, and snippets.

@singularitti
Created November 17, 2022 08:33
Show Gist options
  • Save singularitti/86836ef9050fcdf9f9a5ae317358aa83 to your computer and use it in GitHub Desktop.
Save singularitti/86836ef9050fcdf9f9a5ae317358aa83 to your computer and use it in GitHub Desktop.
Map function `f` at specific indices of an array #Julia #array
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