Skip to content

Central Finite Difference Method returns value of type Any #88

@rvignolo

Description

@rvignolo

Hi!

I was wondering if the following is or is not an issue. This is a MWE:

julia> using FiniteDifferences
julia> const _fdm = FiniteDifferences.central_fdm(5, 1)
julia> @code_warntype _fdm(sin, 1)
Variables
  d::FiniteDifferences.Central{UnitRange{Int64},Array{Float64,1}}
  f::Core.Compiler.Const(sin, false)
  x::Int64

Body::Any
1%1 = Core.NamedTuple()::Core.Compiler.Const(NamedTuple(), false)
│   %2 = Base.pairs(%1)::Core.Compiler.Const(Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}(), false)
│   %3 = FiniteDifferences.:(var"#_#7")(%2, d, f, x)::Any
└──      return %3

This returns a value of type Any and sometimes I am afraid if this is potentially a performant killer for code where FiniteDifferences is used.

I would appreciate any insight you can give me!

Thanks!

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