Skip to content

Commit a7786a0

Browse files
authored
Add sub_materialize_axes to dispatch on axes (#143)
1 parent bbaa0df commit a7786a0

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Project.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "ArrayLayouts"
22
uuid = "4c555306-a7a7-4459-81d9-ec55ddd5c99a"
33
authors = ["Sheehan Olver <solver@mac.com>"]
4-
version = "1.0.7"
4+
version = "1.0.8"
55

66
[deps]
77
FillArrays = "1a297f60-69ca-5386-bcde-b61e274b549b"

src/ArrayLayouts.jl

+3-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,9 @@ include("diagonal.jl")
109109
include("triangular.jl")
110110
include("factorizations.jl")
111111

112-
@inline sub_materialize(_, V, _) = Array(V)
112+
# Extend this function if you're only looking to dispatch on the axes
113+
@inline sub_materialize_axes(V, _) = Array(V)
114+
@inline sub_materialize(_, V, ax) = sub_materialize_axes(V, ax)
113115
@inline sub_materialize(L, V) = sub_materialize(L, V, axes(V))
114116
@inline sub_materialize(V::SubArray) = sub_materialize(MemoryLayout(V), V)
115117
@inline sub_materialize(V) = V # Anything not a SubArray is already materialized

0 commit comments

Comments
 (0)