Skip to content

Commit

Permalink
Fix vector valued functions
Browse files Browse the repository at this point in the history
  • Loading branch information
tansongchen committed Aug 26, 2023
1 parent e19cfe4 commit 41c99f4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
]
}
},
"postCreateCommand": "julia -e 'using Pkg; Pkg.add([\"Revise\", \"TestEnv\"])'",
"postCreateCommand": "julia -e 'using Pkg; Pkg.add([\"Revise\", \"TestEnv\", \"JuliaFormatter\"])'",
"hostRequirements": {
"cpus": 4
}
Expand Down
4 changes: 4 additions & 0 deletions src/scalar.jl
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ end

@inline value(t::TaylorScalar) = t.value
@inline extract_derivative(t::TaylorScalar, i::Integer) = t.value[i]
@inline function extract_derivative(v::AbstractArray{T},
i::Integer) where {T <: TaylorScalar}
map(t -> extract_derivative(t, i), v)
end
@inline extract_derivative(r, i::Integer) = false
@inline primal(t::TaylorScalar) = extract_derivative(t, 1)

Expand Down

0 comments on commit 41c99f4

Please sign in to comment.