Skip to content
This repository was archived by the owner on Aug 22, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion src/differentiation/vecjac_products.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,17 @@ function _numargs(f)
return (numparam-1) #-1 in v0.5 since it adds f as the first parameter
end


#Get the number of parameters of a Tuple type, i.e. the number of fields.

function num_types_in_tuple(sig)
length(sig.parameters)
end

function num_types_in_tuple(sig::UnionAll)
length(Base.unwrap_unionall(sig).parameters)
end

function num_vecjac!(
du,
f,
Expand Down Expand Up @@ -50,4 +61,4 @@ function num_vecjac(f, x, v, f0 = nothing)
du[i] = (((f0 .- _f0) ./ ϵ)'*vv)[1]
end
return vec(du)
end
end