ClassicalOrthogonalPolynomials.jl icon indicating copy to clipboard operation
ClassicalOrthogonalPolynomials.jl copied to clipboard

no method matching combine_axes() when indexing a transposed \(A, B)

Open DanielVandH opened this issue 9 months ago • 0 comments

I doubt this is specifically a ClassicalOrthogonalPolynomials.jl issue but I can't seem to find what types are actually leading to the error because my debugger keeps crashing trying to step through. e.g. similar code with just some LazyBandedMatrices works fine...

julia> using ClassicalOrthogonalPolynomials

julia> A = Jacobi(1.0, 1.0); B = Jacobi(0.0, 1.0);

julia> (A \ B)[1:10, 1:10]; # fine

julia> (A \ B)'[1:10, 1:10]; # fine
10×10 BandedMatrix{Float64} with bandwidths (1, 0):
  1.0    ⋅      ⋅          ⋅       ⋅     ⋅          ⋅          ⋅        ⋅         ⋅
 -0.5   0.75    ⋅          ⋅       ⋅     ⋅          ⋅          ⋅        ⋅         ⋅
   ⋅   -0.5    0.666667    ⋅       ⋅     ⋅          ⋅          ⋅        ⋅         ⋅
   ⋅     ⋅    -0.5        0.625    ⋅     ⋅          ⋅          ⋅        ⋅         ⋅
   ⋅     ⋅      ⋅        -0.5     0.6    ⋅          ⋅          ⋅        ⋅         ⋅
   ⋅     ⋅      ⋅          ⋅     -0.5   0.583333    ⋅          ⋅        ⋅         ⋅
   ⋅     ⋅      ⋅          ⋅       ⋅   -0.5        0.571429    ⋅        ⋅         ⋅
   ⋅     ⋅      ⋅          ⋅       ⋅     ⋅        -0.5        0.5625    ⋅         ⋅
   ⋅     ⋅      ⋅          ⋅       ⋅     ⋅          ⋅        -0.5      0.555556   ⋅
   ⋅     ⋅      ⋅          ⋅       ⋅     ⋅          ⋅          ⋅      -0.5       0.55

julia> (Normalized(A) \ B)'[1:10, 1:10]
ERROR: MethodError: no method matching combine_axes()

Closest candidates are:
  combine_axes(::Any)
   @ Base broadcast.jl:525
  combine_axes(::Any, ::Any)
   @ Base broadcast.jl:524
  combine_axes(::Any, ::Any...)
   @ Base broadcast.jl:523

Stacktrace:
  [1] _axes
    @ .\broadcast.jl:236 [inlined]
  [2] axes
    @ .\broadcast.jl:234 [inlined]
  [3] copyto!
    @ .\broadcast.jl:992 [inlined]
  [4] copyto!
    @ .\broadcast.jl:967 [inlined]
  [5] _BandedMatrix(::LazyBandedMatrices.BroadcastBandedLayout{…}, V::SubArray{…})
    @ LazyBandedMatrices C:\Users\User\.julia\packages\LazyBandedMatrices\59umZ\src\LazyBandedMatrices.jl:575
  [6] BandedMatrices.BandedMatrix(A::SubArray{Float64, 2, LinearAlgebra.Adjoint{…}, Tuple{…}, false})
    @ BandedMatrices C:\Users\User\.julia\packages\BandedMatrices\dec3g\src\banded\BandedMatrix.jl:245
  [7] sub_materialize(::LazyBandedMatrices.BroadcastBandedLayout{…}, V::SubArray{…}, ::Tuple{…})
    @ BandedMatrices C:\Users\User\.julia\packages\BandedMatrices\dec3g\src\generic\indexing.jl:28
  [8] sub_materialize
    @ C:\Users\User\.julia\packages\ArrayLayouts\ccyJu\src\ArrayLayouts.jl:127 [inlined]
  [9] sub_materialize
    @ C:\Users\User\.julia\packages\ArrayLayouts\ccyJu\src\ArrayLayouts.jl:128 [inlined]
 [10] layout_getindex
    @ C:\Users\User\.julia\packages\ArrayLayouts\ccyJu\src\ArrayLayouts.jl:134 [inlined]
 [11] getindex(A::LinearAlgebra.Adjoint{Float64, LazyArrays.BroadcastMatrix{…}}, kr::UnitRange{Int64}, jr::UnitRange{Int64})
    @ ArrayLayouts C:\Users\User\.julia\packages\ArrayLayouts\ccyJu\src\ArrayLayouts.jl:149
 [12] top-level scope
    @ REPL[8]:1
Some type information was truncated. Use `show(err)` to see complete types.

julia> (Normalized(A) \ B)[1:10, 1:10] # but this is fine
10×10 BandedMatrix{Float64} with bandwidths (0, 1):
 1.1547  -0.57735     ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅
  ⋅       0.774597  -0.516398    ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅
  ⋅        ⋅         0.617213  -0.46291     ⋅          ⋅          ⋅          ⋅          ⋅          ⋅
  ⋅        ⋅          ⋅         0.527046  -0.421637    ⋅          ⋅          ⋅          ⋅          ⋅
  ⋅        ⋅          ⋅          ⋅         0.467099  -0.389249    ⋅          ⋅          ⋅          ⋅
  ⋅        ⋅          ⋅          ⋅          ⋅         0.423659  -0.363137    ⋅          ⋅          ⋅
  ⋅        ⋅          ⋅          ⋅          ⋅          ⋅         0.39036   -0.341565    ⋅          ⋅
  ⋅        ⋅          ⋅          ⋅          ⋅          ⋅          ⋅         0.363803  -0.323381    ⋅
  ⋅        ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅         0.341993  -0.307794
  ⋅        ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅          ⋅         0.323669

julia> typeof(Normalized(A) \ B)
BroadcastMatrix{Float64, typeof(\), Tuple{Accumulate{Float64, 1, typeof(*), Vector{Float64}, AbstractVector{Float64}}, Bidiagonal{Float64, BroadcastVector{Float64, typeof(/), Tuple{InfStepRange{Float64, Float64}, InfStepRange{Float64, Float64}}}, BroadcastVector{Float64, typeof(/), Tuple{InfStepRange{Float64, Float64}, InfStepRange{Float64, Float64}}}}}} (alias for LazyArrays.BroadcastArray{Float64, 2, typeof(\), Tuple{LazyArrays.Accumulate{Float64, 1, typeof(*), Array{Float64, 1}, AbstractArray{Float64, 1}}, LazyBandedMatrices.Bidiagonal{Float64, LazyArrays.BroadcastArray{Float64, 1, typeof(/), Tuple{InfiniteArrays.InfStepRange{Float64, Float64}, InfiniteArrays.InfStepRange{Float64, Float64}}}, LazyArrays.BroadcastArray{Float64, 1, typeof(/), Tuple{InfiniteArrays.InfStepRange{Float64, Float64}, InfiniteArrays.InfStepRange{Float64, Float64}}}}}})

julia> typeof((Normalized(A) \ B)')
LinearAlgebra.Adjoint{Float64, LazyArrays.BroadcastMatrix{Float64, typeof(\), Tuple{LazyArrays.Accumulate{Float64, 1, typeof(*), Vector{Float64}, AbstractVector{Float64}}, LazyBandedMatrices.Bidiagonal{Float64, LazyArrays.BroadcastVector{Float64, typeof(/), Tuple{InfiniteArrays.InfStepRange{Float64, Float64}, InfiniteArrays.InfStepRange{Float64, Float64}}}, LazyArrays.BroadcastVector{Float64, typeof(/), Tuple{InfiniteArrays.InfStepRange{Float64, Float64}, InfiniteArrays.InfStepRange{Float64, Float64}}}}}}}

DanielVandH avatar May 14 '24 18:05 DanielVandH