@@ -243,11 +243,12 @@ function show(io::IO, A::Applied)
243
243
print (io, ' )' )
244
244
end
245
245
246
- applybroadcaststyle (_1, _2) = DefaultArrayStyle {2} ()
246
+ applybroadcaststyle (:: Type{<:AbstractArray{<:Any,N}} , _2) where N = DefaultArrayStyle {N} ()
247
+ applybroadcaststyle (:: Type{<:AbstractArray{<:Any,N}} , :: LazyLayout ) where N = LazyArrayStyle {N} ()
247
248
BroadcastStyle (M:: Type{<:ApplyArray} ) = applybroadcaststyle (M, MemoryLayout (M))
248
249
249
- Base . replace_in_print_matrix (A:: LazyMatrix , i:: Integer , j:: Integer , s:: AbstractString ) =
250
- i in colsupport (A,j) ? s : Base . replace_with_centered_mark (s)
250
+ replace_in_print_matrix (A:: LazyMatrix , i:: Integer , j:: Integer , s:: AbstractString ) =
251
+ i in colsupport (A,j) ? s : replace_with_centered_mark (s)
251
252
252
253
# ##
253
254
# Number special cases
@@ -300,4 +301,15 @@ for tri in (:tril, :triu)
300
301
ndims (:: Applied{<:Any,typeof($tri)} ) = 2
301
302
eltype (A:: Applied{<:Any,typeof($tri)} ) = eltype (first (A. args))
302
303
end
303
- end
304
+ end
305
+
306
+ getindex (A:: ApplyMatrix{T,typeof(triu),<:Tuple{<:AbstractMatrix}} , k:: Integer , j:: Integer ) where T =
307
+ j ≥ k ? A. args[1 ][k,j] : zero (T)
308
+
309
+ getindex (A:: ApplyMatrix{T,typeof(triu),<:Tuple{<:AbstractMatrix,<:Integer}} , k:: Integer , j:: Integer ) where T =
310
+ j ≥ k+ A. args[2 ] ? A. args[1 ][k,j] : zero (T)
311
+
312
+ replace_in_print_matrix (A:: ApplyMatrix{<:Any,typeof(triu),<:Tuple{<:AbstractMatrix}} , i:: Integer , j:: Integer , s:: AbstractString ) =
313
+ j ≥ i ? replace_in_print_matrix (A. args[1 ], i, j, s) : replace_with_centered_mark (s)
314
+ replace_in_print_matrix (A:: ApplyMatrix{<:Any,typeof(triu),<:Tuple{<:AbstractMatrix,<:Integer}} , i:: Integer , j:: Integer , s:: AbstractString ) =
315
+ j ≥ i+ A. args[2 ] ? replace_in_print_matrix (A. args[1 ], i, j, s) : replace_with_centered_mark (s)
0 commit comments