@@ -492,19 +492,31 @@ haswrapperstructure(_) = false
492
492
# not necessarily the same entries
493
493
#
494
494
# 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
501
507
502
508
:($ func (D:: $Wrap ) = $ func (D. op))
503
509
end
504
510
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
508
520
quote
509
521
$ func (D:: $Wrap ,k:: Integer ) = $ func (D. op,k)
510
522
$ func (A:: $Wrap ,i:: ApproxFunBase.PosInfinity ) = ℵ₀ # $func(A.op,i) | see PR #42
525
537
# use this for wrapper operators that have the same entries but
526
538
# not necessarily the same spaces
527
539
#
528
- macro wrappergetindex (Wrap)
540
+ macro wrappergetindex (Wrap, forwardsize = true )
529
541
v = map ((:(ApproxFunBase. BandedMatrix),:(ApproxFunBase. RaggedMatrix),
530
542
:Matrix ,:Vector ,:AbstractVector )) do TYP
531
543
quote
@@ -602,7 +614,7 @@ macro wrappergetindex(Wrap)
602
614
end
603
615
end
604
616
605
- ApproxFunBase. @wrapperstructure ($ Wrap) # structure is automatically inherited
617
+ ApproxFunBase. @wrapperstructure ($ Wrap, $ forwardsize ) # structure is automatically inherited
606
618
end
607
619
608
620
esc (ret)
0 commit comments