Skip to content

Some operations like inv don't work on certain matrices #5

@DanielVandH

Description

@DanielVandH

These are downstream issues, but will get them here for now while I think about where the issues actually go.

julia> using InfiniteRandomArrays

julia> inv(InfRandTridiagonal())
ERROR: MethodError: no method matching Matrix{Float64}(::LinearAlgebra.UniformScaling{Bool}, ::Infinities.Infinity, ::Infinities.Infinity)

Closest candidates are:
  Array{T, N}(::Missing, ::Any...) where {T, N}
   @ Base baseext.jl:43
  Array{T, N}(::Nothing, ::Any...) where {T, N}
   @ Base baseext.jl:42
  Matrix{T}(::UndefInitializer, ::Union{Infinities.InfiniteCardinal{0}, Infinities.Infinity}, ::Union{Infinities.InfiniteCardinal{0}, Infinities.Infinity}) where T
   @ InfiniteArrays C:\Users\djv23\.julia\packages\InfiniteArrays\orKsz\src\infarrays.jl:15
  ...

Stacktrace:
 [1] inv(A::LinearAlgebra.Tridiagonal{Float64, InfRandVector{Float64, Type{Float64}, Random.Xoshiro}})
   @ LinearAlgebra C:\Users\djv23\.julia\juliaup\julia-1.10.4+0.x64.w64.mingw32\share\julia\stdlib\v1.10\LinearAlgebra\src\generic.jl:1052
 [2] top-level scope
   @ REPL[3]:1

julia> inv(InfRandBidiagonal())
ERROR: MethodError: no method matching (LinearAlgebra.Bidiagonal{T, <:InfRandVector{T}} where T)()

Closest candidates are:
  (LinearAlgebra.Bidiagonal{T, <:InfRandVector{T}} where T)(::Type{T}, ::Union{AbstractChar, Symbol}) where T
   @ InfiniteRandomArrays C:\Users\djv23\.julia\packages\InfiniteRandomArrays\sXtDk\src\named.jl:15
  (LinearAlgebra.Bidiagonal{T, <:InfRandVector{T}} where T)(::Union{AbstractChar, Symbol})
   @ InfiniteRandomArrays C:\Users\djv23\.julia\packages\InfiniteRandomArrays\sXtDk\src\named.jl:16

Stacktrace:
 [1] top-level scope
   @ REPL[4]:1

julia> using BandedMatrices

julia> inv(brand(∞, 0, 2))
inv(ℵ₀×ℵ₀ BandedMatrix{Float64} with bandwidths (0, 2) with data 3×ℵ₀ InfRandMatrix{Float64, InfRandVector{Float64, Type{Float64}, Random.Xoshiro}, Int64, Infinities.Infinity} with indices Base.OneTo(3)×OneToInf() with indices 1:×OneToInf()) with indices OneToInf()×1:∞:
Error showing value of type LazyArrays.ApplyArray{Float64, 2, typeof(inv), Tuple{BandedMatrix{Float64, InfRandMatrix{Float64, InfRandVector{Float64, Type{Float64}, Random.Xoshiro}, Int64, Infinities.Infinity}, InfiniteArrays.InfUnitRange{Int64}}}}:
ERROR: MethodError: no method matching (BandedMatrix{})(::UndefInitializer, ::Tuple{…}, ::Tuple{…})

Closest candidates are:
  (BandedMatrix{T, C})(::UndefInitializer, ::Tuple{Integer, Integer}, ::Tuple{Integer, Integer}) where {T<:Union{Float32, Float64, ComplexF64, ComplexF32}, C<:AbstractMatrix{T}}
   @ BandedMatrices C:\Users\djv23\.julia\packages\BandedMatrices\d4g9c\src\banded\BandedMatrix.jl:57
  (BandedMatrix{T, C})(::UndefInitializer, ::Tuple{Integer, Integer}, ::Tuple{Integer, Integer}) where {T<:Number, C<:AbstractMatrix{T}}
   @ BandedMatrices C:\Users\djv23\.julia\packages\BandedMatrices\d4g9c\src\banded\BandedMatrix.jl:61
  (BandedMatrix{T, C})(::UndefInitializer, ::Integer, ::Colon, ::Integer, ::Integer) where {T, C<:AbstractMatrix{T}}
   @ BandedMatrices deprecated.jl:103
  ...

Stacktrace:
  [1] (BandedMatrix{})(A::BandedMatrix{…}, bnds::Tuple{…})
    @ BandedMatrices C:\Users\djv23\.julia\packages\BandedMatrices\d4g9c\src\banded\BandedMatrix.jl:212
  [2] (BandedMatrix{})(A::BandedMatrix{…}, bnds::Tuple{…})
    @ BandedMatrices C:\Users\djv23\.julia\packages\BandedMatrices\d4g9c\src\banded\BandedMatrix.jl:207
  [3] lu_layout(::BandedMatrices.BandedColumns{…}, axes::Tuple{…}, A::BandedMatrix{…}, pivot::Val{…}; check::Bool)
    @ BandedMatrices C:\Users\djv23\.julia\packages\BandedMatrices\d4g9c\src\banded\BandedLU.jl:102
  [4] lu_layout(::BandedMatrices.BandedColumns{…}, axes::Tuple{…}, A::BandedMatrix{…}, pivot::Val{…})
    @ BandedMatrices C:\Users\djv23\.julia\packages\BandedMatrices\d4g9c\src\banded\BandedLU.jl:100
  [5] lu(A::BandedMatrix{Float64, InfRandMatrix{…}, InfiniteArrays.InfUnitRange{…}}; kwds::@Kwargs{})
    @ ArrayLayouts C:\Users\djv23\.julia\packages\ArrayLayouts\70nvu\src\factorizations.jl:428
  [6] lu(A::BandedMatrix{Float64, InfRandMatrix{…}, InfiniteArrays.InfUnitRange{…}})
    @ ArrayLayouts C:\Users\djv23\.julia\packages\ArrayLayouts\70nvu\src\factorizations.jl:428
  [7] factorize_layout(::BandedMatrices.BandedColumns{…}, ::Tuple{…}, A::BandedMatrix{…})
    @ BandedMatrices C:\Users\djv23\.julia\packages\BandedMatrices\d4g9c\src\banded\linalg.jl:75
  [8] factorize(A::BandedMatrix{Float64, InfRandMatrix{…}, InfiniteArrays.InfUnitRange{…}})
    @ ArrayLayouts C:\Users\djv23\.julia\packages\ArrayLayouts\70nvu\src\factorizations.jl:430
  [9] _ldiv!
    @ C:\Users\djv23\.julia\packages\ArrayLayouts\70nvu\src\ldiv.jl:83 [inlined]
 [10] copyto!
    @ C:\Users\djv23\.julia\packages\ArrayLayouts\70nvu\src\ldiv.jl:113 [inlined]
 [11] copy
    @ C:\Users\djv23\.julia\packages\ArrayLayouts\70nvu\src\ldiv.jl:21 [inlined]
 [12] copy(L::ArrayLayouts.Ldiv{…})
    @ LazyArraysBandedMatricesExt C:\Users\djv23\.julia\packages\LazyArrays\44w6E\ext\LazyArraysBandedMatricesExt.jl:588
 [13] materialize
    @ C:\Users\djv23\.julia\packages\ArrayLayouts\70nvu\src\ldiv.jl:22 [inlined]
 [14] ldiv
    @ C:\Users\djv23\.julia\packages\ArrayLayouts\70nvu\src\ldiv.jl:98 [inlined]
 [15] \(A::BandedMatrix{…}, x::LazyArrays.CachedArray{…}; kwds::@Kwargs{})
    @ ArrayLayouts C:\Users\djv23\.julia\packages\ArrayLayouts\70nvu\src\ldiv.jl:199
 [16] sub_materialize(::LazyArrays.InvColumnLayout, v::SubArray{…}, ::Tuple{…})
    @ LazyArrays C:\Users\djv23\.julia\packages\LazyArrays\44w6E\src\linalg\inv.jl:174
 [17] sub_materialize(lay::LazyArrays.InvColumnLayout, v::SubArray{…}, ax::Tuple{…})
    @ InfiniteArrays C:\Users\djv23\.julia\packages\InfiniteArrays\orKsz\src\infarrays.jl:399
 [18] sub_materialize
    @ C:\Users\djv23\.julia\packages\ArrayLayouts\70nvu\src\ArrayLayouts.jl:131 [inlined]
 [19] sub_materialize
    @ C:\Users\djv23\.julia\packages\ArrayLayouts\70nvu\src\ArrayLayouts.jl:132 [inlined]
 [20] layout_getindex
    @ C:\Users\djv23\.julia\packages\ArrayLayouts\70nvu\src\ArrayLayouts.jl:138 [inlined]
 [21] getindex
    @ C:\Users\djv23\.julia\packages\ArrayLayouts\70nvu\src\ArrayLayouts.jl:156 [inlined]
 [22] getindex
    @ C:\Users\djv23\.julia\packages\LazyArrays\44w6E\src\linalg\inv.jl:178 [inlined]
 [23] isassigned(::LazyArrays.ApplyArray{Float64, 2, typeof(inv), Tuple{BandedMatrix{…}}}, ::Int64, ::Int64)
    @ Base .\multidimensional.jl:1578
 [24] alignment(io::IOContext{…}, X::AbstractVecOrMat, rows::Vector{…}, cols::Vector{…}, cols_if_complete::Int64, cols_otherwise::Int64, sep::Int64, ncols::Infinities.InfiniteCardinal{…})
    @ Base .\arrayshow.jl:68
 [25] _print_matrix(io::IOContext{…}, X::AbstractVecOrMat, pre::String, sep::String, post::String, hdots::String, vdots::String, ddots::String, hmod::Int64, vmod::Int64, rowsA::InfiniteArrays.InfUnitRange{…}, colsA::InfiniteArrays.InfUnitRange{…})
    @ Base .\arrayshow.jl:207
 [26] print_matrix(io::IOContext{…}, X::LazyArrays.ApplyArray{…}, pre::String, sep::String, post::String, hdots::String, vdots::String, ddots::String, hmod::Int64, vmod::Int64)
    @ Base .\arrayshow.jl:171
 [27] print_matrix
    @ .\arrayshow.jl:171 [inlined]
 [28] print_array
    @ .\arrayshow.jl:358 [inlined]
 [29] show(io::IOContext{Base.TTY}, ::MIME{Symbol("text/plain")}, X::LazyArrays.ApplyArray{Float64, 2, typeof(inv), Tuple{…}})
    @ Base .\arrayshow.jl:399
 [30] (::REPL.var"#55#56"{REPL.REPLDisplay{REPL.LineEditREPL}, MIME{Symbol("text/plain")}, Base.RefValue{Any}})(io::Any)
    @ REPL C:\Users\djv23\.julia\juliaup\julia-1.10.4+0.x64.w64.mingw32\share\julia\stdlib\v1.10\REPL\src\REPL.jl:273
 [31] with_repl_linfo(f::Any, repl::REPL.LineEditREPL)
    @ REPL C:\Users\djv23\.julia\juliaup\julia-1.10.4+0.x64.w64.mingw32\share\julia\stdlib\v1.10\REPL\src\REPL.jl:569
 [32] display(d::REPL.REPLDisplay, mime::MIME{Symbol("text/plain")}, x::Any)
    @ REPL C:\Users\djv23\.julia\juliaup\julia-1.10.4+0.x64.w64.mingw32\share\julia\stdlib\v1.10\REPL\src\REPL.jl:259
 [33] display
    @ C:\Users\djv23\.julia\juliaup\julia-1.10.4+0.x64.w64.mingw32\share\julia\stdlib\v1.10\REPL\src\REPL.jl:278 [inlined]
 [34] display(x::Any)
    @ Base.Multimedia .\multimedia.jl:340
 [35] #invokelatest#2
    @ .\essentials.jl:892 [inlined]
 [36] invokelatest
    @ .\essentials.jl:889 [inlined]
 [37] print_response(errio::IO, response::Any, show_value::Bool, have_color::Bool, specialdisplay::Union{…})
    @ REPL C:\Users\djv23\.julia\juliaup\julia-1.10.4+0.x64.w64.mingw32\share\julia\stdlib\v1.10\REPL\src\REPL.jl:315
 [38] (::REPL.var"#57#58"{REPL.LineEditREPL, Pair{Any, Bool}, Bool, Bool})(io::Any)
    @ REPL C:\Users\djv23\.julia\juliaup\julia-1.10.4+0.x64.w64.mingw32\share\julia\stdlib\v1.10\REPL\src\REPL.jl:284
 [39] with_repl_linfo(f::Any, repl::REPL.LineEditREPL)
    @ REPL C:\Users\djv23\.julia\juliaup\julia-1.10.4+0.x64.w64.mingw32\share\julia\stdlib\v1.10\REPL\src\REPL.jl:569
 [40] print_response(repl::REPL.AbstractREPL, response::Any, show_value::Bool, have_color::Bool)
    @ REPL C:\Users\djv23\.julia\juliaup\julia-1.10.4+0.x64.w64.mingw32\share\julia\stdlib\v1.10\REPL\src\REPL.jl:282
 [41] (::REPL.var"#do_respond#80"{})(s::REPL.LineEdit.MIState, buf::Any, ok::Bool)
    @ REPL C:\Users\djv23\.julia\juliaup\julia-1.10.4+0.x64.w64.mingw32\share\julia\stdlib\v1.10\REPL\src\REPL.jl:911
 [42] #invokelatest#2
    @ .\essentials.jl:892 [inlined]
 [43] invokelatest
    @ .\essentials.jl:889 [inlined]
 [44] run_interface(terminal::REPL.Terminals.TextTerminal, m::REPL.LineEdit.ModalInterface, s::REPL.LineEdit.MIState)
    @ REPL.LineEdit C:\Users\djv23\.julia\juliaup\julia-1.10.4+0.x64.w64.mingw32\share\julia\stdlib\v1.10\REPL\src\LineEdit.jl:2656
 [45] run_frontend(repl::REPL.LineEditREPL, backend::REPL.REPLBackendRef)
    @ REPL C:\Users\djv23\.julia\juliaup\julia-1.10.4+0.x64.w64.mingw32\share\julia\stdlib\v1.10\REPL\src\REPL.jl:1312
 [46] (::REPL.var"#62#68"{REPL.LineEditREPL, REPL.REPLBackendRef})()
    @ REPL C:\Users\djv23\.julia\juliaup\julia-1.10.4+0.x64.w64.mingw32\share\julia\stdlib\v1.10\REPL\src\REPL.jl:386
Some type information was truncated. Use `show(err)` to see complete types.

julia> InfRandTridiagonal() - InfRandBidiagonal('L')
ERROR: MethodError: no method matching LazyArrays.BroadcastVector{Float64, typeof(-), Tuple{…}}(::InfRandVector{Float64, Type{…}, Random.Xoshiro})

Closest candidates are:
  (::Type{LazyArrays.BroadcastArray{T, N, F, Args}} where {T, N, F, Args})(::Any, ::Any)
   @ LazyArrays C:\Users\djv23\.julia\packages\LazyArrays\44w6E\src\lazybroadcasting.jl:29
  LazyArrays.BroadcastArray{T, N, F, Args}(::Base.Broadcast.Broadcasted) where {T, N, F, Args}
   @ LazyArrays C:\Users\djv23\.julia\packages\LazyArrays\44w6E\src\lazybroadcasting.jl:38

Stacktrace:
 [1] -(A::LinearAlgebra.Tridiagonal{Float64, InfRandVector{…}}, B::LinearAlgebra.Bidiagonal{Float64, InfRandVector{…}})
   @ LinearAlgebra C:\Users\djv23\.julia\juliaup\julia-1.10.4+0.x64.w64.mingw32\share\julia\stdlib\v1.10\LinearAlgebra\src\special.jl:214
 [2] top-level scope
   @ REPL[8]:1
Some type information was truncated. Use `show(err)` to see complete types.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions