@@ -30,14 +30,14 @@ import QuasiArrays: cardinality, checkindex, QuasiAdjoint, QuasiTranspose, Inclu
30
30
ApplyQuasiArray, ApplyQuasiMatrix, LazyQuasiArrayApplyStyle, AbstractQuasiArrayApplyStyle,
31
31
LazyQuasiArray, LazyQuasiVector, LazyQuasiMatrix, LazyLayout, LazyQuasiArrayStyle,
32
32
_getindex, layout_getindex, _factorize, AbstractQuasiArray, AbstractQuasiMatrix, AbstractQuasiVector,
33
- AbstractQuasiFill, _equals , QuasiArrayLayout, PolynomialLayout, diff_layout
33
+ AbstractQuasiFill, equals_layout , QuasiArrayLayout, PolynomialLayout, diff_layout
34
34
35
35
import InfiniteArrays: OneToInf, InfAxes, Infinity, AbstractInfUnitRange, InfiniteCardinal, InfRanges
36
36
import InfiniteLinearAlgebra: chop!, chop, pad, choplength, compatible_resize!
37
37
import ContinuumArrays: Basis, Weight, basis_axes, @simplify , Identity, AbstractAffineQuasiVector, ProjectionFactorization,
38
- grid, plotgrid, _plotgrid, _grid , transform_ldiv, TransformFactorization, QInfAxes, broadcastbasis, ExpansionLayout, basismap,
38
+ grid, plotgrid, plotgrid_layout, plotvalues_layout, grid_layout , transform_ldiv, TransformFactorization, QInfAxes, broadcastbasis, ExpansionLayout, basismap,
39
39
AffineQuasiVector, AffineMap, AbstractWeightLayout, AbstractWeightedBasisLayout, WeightedBasisLayout, WeightedBasisLayouts, demap, AbstractBasisLayout, BasisLayout,
40
- checkpoints, weight, unweighted, MappedBasisLayouts, sum_layout, invmap, plan_ldiv, layout_broadcasted, MappedBasisLayout, SubBasisLayout, _broadcastbasis ,
40
+ checkpoints, weight, unweighted, MappedBasisLayouts, sum_layout, invmap, plan_ldiv, layout_broadcasted, MappedBasisLayout, SubBasisLayout, broadcastbasis_layout ,
41
41
plan_transform, plan_grid_transform, MAX_PLOT_POINTS, MulPlan, grammatrix, AdjointBasisLayout, grammatrix_layout
42
42
import FastTransforms: Λ, forwardrecurrence, forwardrecurrence!, _forwardrecurrence!, clenshaw, clenshaw!,
43
43
_forwardrecurrence_next, _clenshaw_next, check_clenshaw_recurrences, ChebyshevGrid, chebyshevpoints, Plan, ScaledPlan, th_cheb2leg
87
87
isorthogonalityweighted (wS) = isorthogonalityweighted (MemoryLayout (wS), wS)
88
88
89
89
90
- _equals (:: MappedOPLayout , :: MappedOPLayout , P, Q) = demap (P) == demap (Q) && basismap (P) == basismap (Q)
91
- _equals (:: MappedOPLayout , :: MappedBasisLayouts , P, Q) = demap (P) == demap (Q) && basismap (P) == basismap (Q)
92
- _equals (:: MappedBasisLayouts , :: MappedOPLayout , P, Q) = demap (P) == demap (Q) && basismap (P) == basismap (Q)
90
+ equals_layout (:: MappedOPLayout , :: MappedOPLayout , P, Q) = demap (P) == demap (Q) && basismap (P) == basismap (Q)
91
+ equals_layout (:: MappedOPLayout , :: MappedBasisLayouts , P, Q) = demap (P) == demap (Q) && basismap (P) == basismap (Q)
92
+ equals_layout (:: MappedBasisLayouts , :: MappedOPLayout , P, Q) = demap (P) == demap (Q) && basismap (P) == basismap (Q)
93
93
94
- _broadcastbasis (:: typeof (+ ), :: MappedOPLayout , :: MappedOPLayout , P, Q) = _broadcastbasis (+ , MappedBasisLayout (), MappedBasisLayout (), P, Q)
95
- _broadcastbasis (:: typeof (+ ), :: MappedOPLayout , M:: MappedBasisLayout , P, Q) = _broadcastbasis (+ , MappedBasisLayout (), M, P, Q)
96
- _broadcastbasis (:: typeof (+ ), L:: MappedBasisLayout , :: MappedOPLayout , P, Q) = _broadcastbasis (+ , L, MappedBasisLayout (), P, Q)
94
+ broadcastbasis_layout (:: typeof (+ ), :: MappedOPLayout , :: MappedOPLayout , P, Q) = broadcastbasis_layout (+ , MappedBasisLayout (), MappedBasisLayout (), P, Q)
95
+ broadcastbasis_layout (:: typeof (+ ), :: MappedOPLayout , M:: MappedBasisLayout , P, Q) = broadcastbasis_layout (+ , MappedBasisLayout (), M, P, Q)
96
+ broadcastbasis_layout (:: typeof (+ ), L:: MappedBasisLayout , :: MappedOPLayout , P, Q) = broadcastbasis_layout (+ , L, MappedBasisLayout (), P, Q)
97
97
sum_layout (:: MappedOPLayout , A, dims) = sum_layout (MappedBasisLayout (), A, dims)
98
98
99
99
# demap to avoid Golub-Welsch fallback
100
100
ContinuumArrays. transform_ldiv_if_columns (L:: Ldiv{MappedOPLayout,Lay} , ax:: OneTo ) where Lay = ContinuumArrays. transform_ldiv_if_columns (Ldiv {MappedBasisLayout,Lay} (L. A,L. B), ax)
101
101
ContinuumArrays. transform_ldiv_if_columns (L:: Ldiv{MappedOPLayout,ApplyLayout{typeof(hcat)}} , ax:: OneTo ) = ContinuumArrays. transform_ldiv_if_columns (Ldiv {MappedBasisLayout,UnknownLayout} (L. A,L. B), ax)
102
102
103
- _equals (:: AbstractOPLayout , :: AbstractWeightedBasisLayout , _, _) = false # Weighted-Legendre doesn't exist
104
- _equals (:: AbstractWeightedBasisLayout , :: AbstractOPLayout , _, _) = false # Weighted-Legendre doesn't exist
103
+ equals_layout (:: AbstractOPLayout , :: AbstractWeightedBasisLayout , _, _) = false # Weighted-Legendre doesn't exist
104
+ equals_layout (:: AbstractWeightedBasisLayout , :: AbstractOPLayout , _, _) = false # Weighted-Legendre doesn't exist
105
105
106
- _equals (:: WeightedOPLayout , :: WeightedOPLayout , wP, wQ) = unweighted (wP) == unweighted (wQ)
107
- _equals (:: WeightedOPLayout , :: WeightedBasisLayout , wP, wQ) = unweighted (wP) == unweighted (wQ) && weight (wP) == weight (wQ)
108
- _equals (:: WeightedBasisLayout , :: WeightedOPLayout , wP, wQ) = unweighted (wP) == unweighted (wQ) && weight (wP) == weight (wQ)
109
- _equals (:: WeightedBasisLayout{<:AbstractOPLayout} , :: WeightedBasisLayout{<:AbstractOPLayout} , wP, wQ) = unweighted (wP) == unweighted (wQ) && weight (wP) == weight (wQ)
106
+ equals_layout (:: WeightedOPLayout , :: WeightedOPLayout , wP, wQ) = unweighted (wP) == unweighted (wQ)
107
+ equals_layout (:: WeightedOPLayout , :: WeightedBasisLayout , wP, wQ) = unweighted (wP) == unweighted (wQ) && weight (wP) == weight (wQ)
108
+ equals_layout (:: WeightedBasisLayout , :: WeightedOPLayout , wP, wQ) = unweighted (wP) == unweighted (wQ) && weight (wP) == weight (wQ)
109
+ equals_layout (:: WeightedBasisLayout{<:AbstractOPLayout} , :: WeightedBasisLayout{<:AbstractOPLayout} , wP, wQ) = unweighted (wP) == unweighted (wQ) && weight (wP) == weight (wQ)
110
110
111
111
112
112
copy (L:: Ldiv{MappedOPLayout,Lay} ) where Lay<: MappedBasisLayouts = copy (Ldiv {MappedBasisLayout,Lay} (L. A,L. B))
@@ -255,10 +255,11 @@ _tritrunc(X, n) = _tritrunc(MemoryLayout(X), X, n)
255
255
jacobimatrix (V:: SubQuasiArray{<:Any,2,<:Any,<:Tuple{Inclusion,OneTo}} ) =
256
256
_tritrunc (jacobimatrix (parent (V)), maximum (parentindices (V)[2 ]))
257
257
258
- _grid (:: AbstractOPLayout , P, n:: Integer ) = eigvals (symtridiagonalize (jacobimatrix (P[:,OneTo (n)])))
259
- _grid (:: MappedOPLayout , P, n:: Integer ) = _grid (MappedBasisLayout (), P, n)
260
- _plotgrid (:: AbstractOPLayout , P, n:: Integer ) = grid (P, min (40 n, MAX_PLOT_POINTS))
261
- _plotgrid (:: MappedOPLayout , P, n:: Integer ) = _plotgrid (MappedBasisLayout (), P, n)
258
+ grid_layout (:: AbstractOPLayout , P, n:: Integer ) = eigvals (symtridiagonalize (jacobimatrix (P[:,OneTo (n)])))
259
+ grid_layout (:: MappedOPLayout , P, n:: Integer ) = grid_layout (MappedBasisLayout (), P, n)
260
+ plotgrid_layout (:: AbstractOPLayout , P, n:: Integer ) = grid (P, min (40 n, MAX_PLOT_POINTS))
261
+ plotgrid_layout (:: MappedOPLayout , P, n:: Integer ) = plotgrid_layout (MappedBasisLayout (), P, n)
262
+ plotvalues_layout (:: ExpansionLayout{MappedOPLayout} , f, x... ) = plotvalues_layout (ExpansionLayout {MappedBasisLayout} (), f, x... )
262
263
263
264
function golubwelsch (X)
264
265
D, V = eigen (symtridiagonalize (X)) # Eigenvalue decomposition
0 commit comments