Skip to content

Commit

Permalink
Convert ev to a generated ntuple
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeingold committed Oct 1, 2024
1 parent 1587085 commit c2e6233
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/differentiation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ function jacobian(
# Get the partial derivative along the n'th axis via finite difference
# approximation, where ts is the current parametric position
function ∂ₙr(ts, n)
εv = zeros(T, length(ts))
εv[n] = ε
# Construct a tuple with ε in the n'th element and zeros otherwise
εv = ntuple(i -> i == n ? T(ε) : zero(T), length(ts))

# Select orientation of finite-diff
if ts[n] < T(0.01)
Expand Down

0 comments on commit c2e6233

Please sign in to comment.