@@ -569,7 +569,7 @@ macro wrappergetindex(Wrap, forwardsize = true)
569
569
ApproxFunBase. mul_coefficients (A:: ApproxFunBase.SubOperator{T,OP} ,b) where {T,OP<: $Wrap } =
570
570
ApproxFunBase. mul_coefficients (view (parent (A). op,A. indexes[1 ],A. indexes[2 ]),b)
571
571
572
- LinearAlgebra. isdiag (W:: $Wrap ) = isdiag (W. op)
572
+ LinearAlgebra. isdiag (W:: $Wrap ) = LinearAlgebra . isdiag (W. op)
573
573
574
574
# fast converts to banded matrices would be based on indices, not blocks
575
575
function ApproxFunBase. BandedMatrix (S:: ApproxFunBase.SubOperator{T,OP,NTuple{2,ApproxFunBase.BlockRange1}} ) where {T,OP<: $Wrap }
@@ -585,33 +585,21 @@ macro wrappergetindex(Wrap, forwardsize = true)
585
585
586
586
# if the spaces change, then we need to be smarter
587
587
function ApproxFunBase. BlockBandedMatrix (S:: ApproxFunBase.SubOperator{T,OP} ) where {T,OP<: $Wrap }
588
- P = parent (S)
589
- if ApproxFunBase. blocklengths (domainspace (P)) === ApproxFunBase. blocklengths (domainspace (P. op)) &&
590
- ApproxFunBase. blocklengths (rangespace (P)) === ApproxFunBase. blocklengths (rangespace (P. op))
591
- ApproxFunBase. BlockBandedMatrix (view (parent (S). op,S. indexes[1 ],S. indexes[2 ]))
592
- else
593
- ApproxFunBase. default_BlockBandedMatrix (S)
594
- end
588
+ ApproxFunBase. _blockmaybebandedmatrix (S,
589
+ ApproxFunBase. BlockBandedMatrix,
590
+ ApproxFunBase. default_BlockBandedMatrix)
595
591
end
596
592
597
593
function ApproxFunBase. PseudoBlockMatrix (S:: ApproxFunBase.SubOperator{T,OP} ) where {T,OP<: $Wrap }
598
- P = parent (S)
599
- if ApproxFunBase. blocklengths (domainspace (P)) === ApproxFunBase. blocklengths (domainspace (P. op)) &&
600
- ApproxFunBase. blocklengths (rangespace (P)) === ApproxFunBase. blocklengths (rangespace (P. op))
601
- ApproxFunBase. PseudoBlockMatrix (view (parent (S). op,S. indexes[1 ],S. indexes[2 ]))
602
- else
603
- ApproxFunBase. default_blockmatrix (S)
604
- end
594
+ ApproxFunBase. _blockmaybebandedmatrix (S,
595
+ ApproxFunBase. PseudoBlockMatrix,
596
+ ApproxFunBase. default_BlockMatrix)
605
597
end
606
598
607
599
function ApproxFunBase. BandedBlockBandedMatrix (S:: ApproxFunBase.SubOperator{T,OP} ) where {T,OP<: $Wrap }
608
- P = parent (S)
609
- if ApproxFunBase. blocklengths (domainspace (P)) === ApproxFunBase. blocklengths (domainspace (P. op)) &&
610
- ApproxFunBase. blocklengths (rangespace (P)) === ApproxFunBase. blocklengths (rangespace (P. op))
611
- ApproxFunBase. BandedBlockBandedMatrix (view (parent (S). op,S. indexes[1 ],S. indexes[2 ]))
612
- else
613
- ApproxFunBase. default_BandedBlockBandedMatrix (S)
614
- end
600
+ ApproxFunBase. _blockmaybebandedmatrix (S,
601
+ ApproxFunBase. BandedBlockBandedMatrix,
602
+ ApproxFunBase. default_BandedBlockBandedMatrix)
615
603
end
616
604
617
605
ApproxFunBase. @wrapperstructure ($ Wrap, $ forwardsize) # structure is automatically inherited
@@ -620,6 +608,16 @@ macro wrappergetindex(Wrap, forwardsize = true)
620
608
esc (ret)
621
609
end
622
610
611
+ function _blockmaybebandedmatrix (S, f:: T , fdef:: D ) where {T,D}
612
+ P = parent (S)
613
+ if ApproxFunBase. blocklengths (domainspace (P)) === ApproxFunBase. blocklengths (domainspace (P. op)) &&
614
+ ApproxFunBase. blocklengths (rangespace (P)) === ApproxFunBase. blocklengths (rangespace (P. op))
615
+ f (view (parent (S). op,S. indexes[1 ],S. indexes[2 ]))
616
+ else
617
+ fdef (S)
618
+ end
619
+ end
620
+
623
621
# use this for wrapper operators that have the same spaces but
624
622
# not necessarily the same entries or structure
625
623
#
0 commit comments