File tree Expand file tree Collapse file tree 3 files changed +14
-2
lines changed Expand file tree Collapse file tree 3 files changed +14
-2
lines changed Original file line number Diff line number Diff line change 1
1
name = " ArrayInterface"
2
2
uuid = " 4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"
3
- version = " 2.3.1 "
3
+ version = " 2.4.0 "
4
4
5
5
[deps ]
6
6
LinearAlgebra = " 37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Original file line number Diff line number Diff line change @@ -16,6 +16,10 @@ and exported in a future Base Julia there will be no issues with the upgrade.
16
16
A trait function for whether ` x ` is a mutable or immutable array. Used for
17
17
dispatching to in-place and out-of-place versions of functions.
18
18
19
+ ## aos_to_soa(x)
20
+
21
+ Converts an array of structs formulation to a struct of arrays.
22
+
19
23
## isstructured(x)
20
24
21
25
A trait function for whether a matrix ` x ` is a sparse structured matrix.
@@ -84,7 +88,7 @@ development.
84
88
85
89
## Breaking Release Notes
86
90
87
- 2.0: Changed the default of ` ismutable(array::AbstractArray) = true ` . We previously defaulted to
91
+ 2.0: Changed the default of ` ismutable(array::AbstractArray) = true ` . We previously defaulted to
88
92
` Base.@pure ismutable(array::AbstractArray) = typeof(array).mutable ` , but there are a lot of cases
89
93
where this tends to not work out in a way one would expect. For example, if you put a normal array
90
94
into an immutable struct that adds more information to it, this is considered immutable, even if
Original file line number Diff line number Diff line change @@ -44,6 +44,13 @@ can_setindex(x) = true
44
44
can_setindex (x:: AbstractArray ) = can_setindex (typeof (x))
45
45
can_setindex (:: Type{<:AbstractRange} ) = false
46
46
47
+ """
48
+ aos_to_soa(x)
49
+
50
+ Converts an array of structs formulation to a struct of array
51
+ """
52
+ aos_to_soa (x) = x
53
+
47
54
"""
48
55
fast_scalar_indexing(x)
49
56
@@ -389,6 +396,7 @@ function __init__()
389
396
ismutable (:: Type{<:Tracker.TrackedArray} ) = false
390
397
can_setindex (:: Type{<:Tracker.TrackedArray} ) = false
391
398
fast_scalar_indexing (:: Type{<:Tracker.TrackedArray} ) = false
399
+ aos_to_soa (x:: AbstractArray{<:Tracker.TrackedArray,N} ) where N = Tracker. collect (x)
392
400
end
393
401
394
402
@require CuArrays= " 3a865a2d-5b23-5a0f-bc46-62713ec82fae" begin
You can’t perform that action at this time.
0 commit comments