JuliaApproximation / JuliaApproximation/MultivariateOrthogonalPolynomials.jl

Finite sections of JacobiTriangle Jacobi matrices are ApplyArrays instead of BandedBlockBandedMatrices

Open
#216 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
20
Forks
6
Avg merge
2d 17h
Merged PRs (30d)
1

Description

I don't think this used to be the case.

julia> jacobimatrix(Val(1), RectPolynomial(ChebyshevT(), ChebyshevT()))[Block.(1:5), Block.(1:5)]
5×5-blocked 15×15 BandedBlockBandedMatrix{Float64} with block-bandwidths (1, 1) and sub-block-bandwidths block-bandwidths (0, 0) with data 3×5-blocked 3×15 BlockedMatrix{Float64}:
 0.0  │  0.5   ⋅   │   ⋅    ⋅    ⋅   │   ⋅    ⋅    ⋅    ⋅   │   ⋅    ⋅    ⋅    ⋅    ⋅ 
 ─────┼────────────┼─────────────────┼──────────────────────┼─────────────────────────
 1.0  │  0.0   ⋅   │  0.5   ⋅    ⋅   │   ⋅    ⋅    ⋅    ⋅   │   ⋅    ⋅    ⋅    ⋅    ⋅ 
  ⋅   │   ⋅   0.0  │   ⋅   0.5   ⋅   │   ⋅    ⋅    ⋅    ⋅   │   ⋅    ⋅    ⋅    ⋅    ⋅ 
 ─────┼────────────┼─────────────────┼──────────────────────┼─────────────────────────
  ⋅   │  0.5   ⋅   │  0.0   ⋅    ⋅   │  0.5   ⋅    ⋅    ⋅   │   ⋅    ⋅    ⋅    ⋅    ⋅ 
  ⋅   │   ⋅   1.0  │   ⋅   0.0   ⋅   │   ⋅   0.5   ⋅    ⋅   │   ⋅    ⋅    ⋅    ⋅    ⋅ 
  ⋅   │   ⋅    ⋅   │   ⋅    ⋅   0.0  │   ⋅    ⋅   0.5   ⋅   │   ⋅    ⋅    ⋅    ⋅    ⋅ 
 ─────┼────────────┼─────────────────┼──────────────────────┼─────────────────────────
  ⋅   │   ⋅    ⋅   │  0.5   ⋅    ⋅   │  0.0   ⋅    ⋅    ⋅   │  0.5   ⋅    ⋅    ⋅    ⋅ 
  ⋅   │   ⋅    ⋅   │   ⋅   0.5   ⋅   │   ⋅   0.0   ⋅    ⋅   │   ⋅   0.5   ⋅    ⋅    ⋅ 
  ⋅   │   ⋅    ⋅   │   ⋅    ⋅   1.0  │   ⋅    ⋅   0.0   ⋅   │   ⋅    ⋅   0.5   ⋅    ⋅ 
  ⋅   │   ⋅    ⋅   │   ⋅    ⋅    ⋅   │   ⋅    ⋅    ⋅   0.0  │   ⋅    ⋅    ⋅   0.5   ⋅ 
 ─────┼────────────┼─────────────────┼──────────────────────┼─────────────────────────
  ⋅   │   ⋅    ⋅   │   ⋅    ⋅    ⋅   │  0.5   ⋅    ⋅    ⋅   │  0.0   ⋅    ⋅    ⋅    ⋅ 
  ⋅   │   ⋅    ⋅   │   ⋅    ⋅    ⋅   │   ⋅   0.5   ⋅    ⋅   │   ⋅   0.0   ⋅    ⋅    ⋅ 
  ⋅   │   ⋅    ⋅   │   ⋅    ⋅    ⋅   │   ⋅    ⋅   0.5   ⋅   │   ⋅    ⋅   0.0   ⋅    ⋅ 
  ⋅   │   ⋅    ⋅   │   ⋅    ⋅    ⋅   │   ⋅    ⋅    ⋅   1.0  │   ⋅    ⋅    ⋅   0.0   ⋅ 
  ⋅   │   ⋅    ⋅   │   ⋅    ⋅    ⋅   │   ⋅    ⋅    ⋅    ⋅   │   ⋅    ⋅    ⋅    ⋅   0.0

julia> typeof(ans)
BlockBandedMatrices.BandedBlockBandedMatrix{Float64, BlockedMatrix{Float64, Matrix{Float64}, Tuple{BlockedOneTo{Int64, StepRangeLen{Int64, Int64, Int64, Int64}}, BlockedOneTo{Int64, Vector{Int64}}}}, BlockedOneTo{Int64, Vector{Int64}}}

julia> jacobimatrix(Val(1), JacobiTriangle())[Block.(1:5), Block.(1:5)]
(5×5-blocked 15×15 BandedBlockBandedMatrix{Float64} with block-bandwidths (1, 0) and sub-block-bandwidths block-bandwidths (0, 0) with data 2×5-blocked 2×15 BlockVcat{Float64}) * (5×5-blocked 15×15 BandedBlockBandedMatrix{Float64} with block-bandwidths (0, 1) and sub-block-bandwidths block-bandwidths (0, 0) with data 2×5-blocked 2×15 BlockVcat{Float64}) with indices BlockedOneTo([1, 3, 6, 10, 15])×BlockedOneTo([1, 3, 6, 10, 15]):
 0.333333  │  0.166667   ⋅   │   ⋅         ⋅         ⋅        │   ⋅         ⋅         ⋅         ⋅        │   ⋅         ⋅         ⋅         ⋅          ⋅       
 ──────────┼─────────────────┼────────────────────────────────┼──────────────────────────────────────────┼────────────────────────────────────────────────────
 0.333333  │  0.466667   ⋅   │  0.2        ⋅         ⋅        │   ⋅         ⋅         ⋅         ⋅        │   ⋅         ⋅         ⋅         ⋅          ⋅       
  ⋅        │   ⋅        0.2  │   ⋅        0.133333   ⋅        │   ⋅         ⋅         ⋅         ⋅        │   ⋅         ⋅         ⋅         ⋅          ⋅       
 ──────────┼─────────────────┼────────────────────────────────┼──────────────────────────────────────────┼────────────────────────────────────────────────────
  ⋅        │  0.3        ⋅   │  0.485714   ⋅         ⋅        │  0.214286   ⋅         ⋅         ⋅        │   ⋅         ⋅         ⋅         ⋅          ⋅       
  ⋅        │   ⋅        0.2  │   ⋅        0.371429   ⋅        │   ⋅        0.178571   ⋅         ⋅        │   ⋅         ⋅         ⋅         ⋅          ⋅       
  ⋅        │   ⋅         ⋅   │   ⋅         ⋅        0.142857  │   ⋅         ⋅        0.107143   ⋅        │   ⋅         ⋅         ⋅         ⋅          ⋅       
 ──────────┼─────────────────┼────────────────────────────────┼──────────────────────────────────────────┼────────────────────────────────────────────────────
  ⋅        │   ⋅         ⋅   │  0.285714   ⋅         ⋅        │  0.492063   ⋅         ⋅         ⋅        │  0.222222   ⋅         ⋅         ⋅          ⋅       
  ⋅        │   ⋅         ⋅   │   ⋅        0.238095   ⋅        │   ⋅        0.428571   ⋅         ⋅        │   ⋅        0.2        ⋅         ⋅          ⋅       
  ⋅        │   ⋅         ⋅   │   ⋅         ⋅        0.142857  │   ⋅         ⋅        0.301587   ⋅        │   ⋅         ⋅        0.155556   ⋅          ⋅       
  ⋅        │   ⋅         ⋅   │   ⋅         ⋅         ⋅        │   ⋅         ⋅         ⋅        0.111111  │   ⋅         ⋅         ⋅        0.0888889   ⋅       
 ──────────┼─────────────────┼────────────────────────────────┼──────────────────────────────────────────┼────────────────────────────────────────────────────
  ⋅        │   ⋅         ⋅   │   ⋅         ⋅         ⋅        │  0.277778   ⋅         ⋅         ⋅        │  0.494949   ⋅         ⋅         ⋅          ⋅       
  ⋅        │   ⋅         ⋅   │   ⋅         ⋅         ⋅        │   ⋅        0.25       ⋅         ⋅        │   ⋅        0.454545   ⋅         ⋅          ⋅       
  ⋅        │   ⋅         ⋅   │   ⋅         ⋅         ⋅        │   ⋅         ⋅        0.194444   ⋅        │   ⋅         ⋅        0.373737   ⋅          ⋅       
  ⋅        │   ⋅         ⋅   │   ⋅         ⋅         ⋅        │   ⋅         ⋅         ⋅        0.111111  │   ⋅         ⋅         ⋅        0.252525    ⋅       
  ⋅        │   ⋅         ⋅   │   ⋅         ⋅         ⋅        │   ⋅         ⋅         ⋅         ⋅        │   ⋅         ⋅         ⋅         ⋅         0.0909091

julia> typeof(ans)
LazyArrays.ApplyArray{Float64, 2, typeof(*), Tuple{BlockBandedMatrices.BandedBlockBandedMatrix{Float64, LazyBandedMatrices.BlockVcat{Float64, 2, Tuple{Adjoint{Float64, BlockVector{Float64, Vector{Vector{Float64}}, Tuple{BlockedOneTo{Int64, Vector{Int64}}}}}, Adjoint{Float64, BlockVector{Float64, Vector{Vector{Float64}}, Tuple{BlockedOneTo{Int64, Vector{Int64}}}}}}, Tuple{BlockedOneTo{Int64, StaticArraysCore.SVector{2, Int64}}, BlockedOneTo{Int64, Vector{Int64}}}}, BlockedOneTo{Int64, Vector{Int64}}}, BlockBandedMatrices.BandedBlockBandedMatrix{Float64, LazyBandedMatrices.BlockVcat{Float64, 2, Tuple{Adjoint{Float64, BlockVector{Float64, Vector{Vector{Float64}}, Tuple{BlockedOneTo{Int64, Vector{Int64}}}}}, Adjoint{Float64, BlockVector{Float64, Vector{Vector{Float64}}, Tuple{BlockedOneTo{Int64, Vector{Int64}}}}}}, Tuple{BlockedOneTo{Int64, StaticArraysCore.SVector{2, Int64}}, BlockedOneTo{Int64, Vector{Int64}}}}, BlockedOneTo{Int64, Vector{Int64}}}}}

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the two jacobimatrix slicing examples for JacobiTriangle and RectPolynomial. Trace the JacobiTriangle path from the jacobimatrix entry point and compare its finite-section representation with the BandedBlockBandedMatrix result. Done means the JacobiTriangle finite section no longer has an ApplyArray type.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.