@@ -492,19 +492,31 @@ haswrapperstructure(_) = false
492492# not necessarily the same entries
493493#
494494# Ex: c*op or real(op)
495- macro wrapperstructure (Wrap)
496- v1 = map ((:(ApproxFunBase. bandwidths),:(LinearAlgebra. stride),
497- :(ApproxFunBase. isbandedblockbanded),:(ApproxFunBase. isblockbanded),
498- :(ApproxFunBase. israggedbelow),:(Base. size),:(ApproxFunBase. isbanded),
499- :(ApproxFunBase. blockbandwidths),:(ApproxFunBase. subblockbandwidths),
500- :(LinearAlgebra. issymmetric))) do func
495+ macro wrapperstructure (Wrap, forwardsize = true )
496+ fns = [:(ApproxFunBase. bandwidths),:(LinearAlgebra. stride),
497+ :(ApproxFunBase. isbandedblockbanded),:(ApproxFunBase. isblockbanded),
498+ :(ApproxFunBase. israggedbelow),:(ApproxFunBase. isbanded),
499+ :(ApproxFunBase. blockbandwidths),:(ApproxFunBase. subblockbandwidths),
500+ :(LinearAlgebra. issymmetric)]
501+
502+ if forwardsize
503+ fns = [fns; :(Base. size)]
504+ end
505+
506+ v1 = map (fns) do func
501507
502508 :($ func (D:: $Wrap ) = $ func (D. op))
503509 end
504510
505- v2 = map ((:(ApproxFunBase. bandwidth),:(ApproxFunBase. colstart),:(ApproxFunBase. colstop),
506- :(ApproxFunBase. rowstart),:(ApproxFunBase. rowstop),:(ApproxFunBase. blockbandwidth),
507- :(Base. size),:(ApproxFunBase. subblockbandwidth))) do func
511+ fns2 = [:(ApproxFunBase. bandwidth),:(ApproxFunBase. colstart),:(ApproxFunBase. colstop),
512+ :(ApproxFunBase. rowstart),:(ApproxFunBase. rowstop),:(ApproxFunBase. blockbandwidth),
513+ :(ApproxFunBase. subblockbandwidth)]
514+
515+ if forwardsize
516+ fns2 = [fns2; :(Base. size)]
517+ end
518+
519+ v2 = map (fns2) do func
508520 quote
509521 $ func (D:: $Wrap ,k:: Integer ) = $ func (D. op,k)
510522 $ func (A:: $Wrap ,i:: ApproxFunBase.PosInfinity ) = ℵ₀ # $func(A.op,i) | see PR #42
525537# use this for wrapper operators that have the same entries but
526538# not necessarily the same spaces
527539#
528- macro wrappergetindex (Wrap)
540+ macro wrappergetindex (Wrap, forwardsize = true )
529541 v = map ((:(ApproxFunBase. BandedMatrix),:(ApproxFunBase. RaggedMatrix),
530542 :Matrix ,:Vector ,:AbstractVector )) do TYP
531543 quote
@@ -602,7 +614,7 @@ macro wrappergetindex(Wrap)
602614 end
603615 end
604616
605- ApproxFunBase. @wrapperstructure ($ Wrap) # structure is automatically inherited
617+ ApproxFunBase. @wrapperstructure ($ Wrap, $ forwardsize ) # structure is automatically inherited
606618 end
607619
608620 esc (ret)
0 commit comments