Skip to content

A*v with A SymTridiagonal{Float64,Array{Float64,1}} and v Vector{Real} infers as Array{Any,1} #37960

@Seelengrab

Description

@Seelengrab
julia> using LinearAlgebra

julia> A = SymTridiagonal([1., 2., 3.], [4., 5.])
3×3 SymTridiagonal{Float64,Array{Float64,1}}:
 1.0  4.0   ⋅
 4.0  2.0  5.0
  ⋅   5.0  3.0

julia> v = Vector{Real}(undef, 3)
3-element Array{Real,1}:
 #undef
 #undef
 #undef

julia> for n = 1:length(v)
           v[n] = rand(Float64)
       end

julia> A*v |> typeof
Array{Any,1}

julia> versioninfo()
Julia Version 1.5.2
Commit 539f3ce943 (2020-09-23 23:17 UTC)
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: Intel(R) Core(TM) i7-6600U CPU @ 2.60GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-9.0.1 (ORCJIT, skylake)
Environment:
  JULIA_NUM_THREADS = 4

First found here - I'm not too familiar with the internals, but it feels like it should be possible to at least infer Array{Real,1}.

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