Skip to content

Duals and ranges #275

@ChrisRackauckas

Description

@ChrisRackauckas
a = ForwardDiff.Dual(1.0,1.0)
b = ForwardDiff.Dual(0.0,1.0)
c = ForwardDiff.Dual(10.0,1.0)
b:a:c

MethodError: Cannot `convert` an object of type ForwardDiff.Dual{Void,Float64,1} to an object of type Signed
This may have arisen from a call to the constructor Signed(...),
since type constructors fall back to convert methods.
unsafe_length(::StepRange{ForwardDiff.Dual{Void,Float64,1},ForwardDiff.Dual{Void,Float64,1}}) at range.jl:369
vcat(::StepRange{ForwardDiff.Dual{Void,Float64,1},ForwardDiff.Dual{Void,Float64,1}}) at range.jl:819
collect(::StepRange{ForwardDiff.Dual{Void,Float64,1},ForwardDiff.Dual{Void,Float64,1}}) at range.jl:831
include_string(::String, ::String) at loading.jl:515
eval(::Module, ::Any) at boot.jl:235
(::Atom.##63#66)() at eval.jl:104
withpath(::Atom.##63#66, ::Void) at utils.jl:30
withpath(::Function, ::Void) at eval.jl:38
macro expansion at eval.jl:103 [inlined]
(::Atom.##62#65{Dict{String,Any}})() at task.jl:80

I don't know if it's even possible to make that work, but I wanted to document it for SciML/OrdinaryDiffEq.jl#202

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions