You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+30-30Lines changed: 30 additions & 30 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,11 +5,11 @@
5
5
6
6
Julia has only recently reached v1.0 and the AbstractArray interface is still
7
7
quite new. The purpose of this library is to solidify extensions to the current
8
-
AbstractArray interface which are put to use in package ecosystems like
8
+
AbstractArray interface, which are put to use in package ecosystems like
9
9
DifferentialEquations.jl. Since these libraries are live, this package will
10
-
serve as a staging ground for ideas before they merged into Base Julia. For this
11
-
reason, no functionality is exported so that way if such functions are added
12
-
and exported in a future Base Julia there will be no issues with the upgrade.
10
+
serve as a staging ground for ideas before they are merged into Base Julia. For this
11
+
reason, no functionality is exported so that if such functions are added
12
+
and exported in a future Base Julia, there will be no issues with the upgrade.
13
13
14
14
## parent_type(x)
15
15
@@ -23,14 +23,14 @@ such as `pop!` and `popfirst!` are available for collections of type `T`.
23
23
## indices(x[, d])
24
24
25
25
Given an array `x`, this returns the indices along dimension `d`. If `x` is a tuple
26
-
of arrays then the indices corresponding to dimension `d` of all arrays in `x` are
27
-
returned. If any indices are not equal along dimension `d` an error is thrown. A
26
+
of arrays, then the indices corresponding to dimension `d` of all arrays in `x` are
27
+
returned. If any indices are not equal along dimension `d`, an error is thrown. A
28
28
tuple may be used to specify a different dimension for each array. If `d` is not
29
-
specified then indices for visiting each index of `x`is returned.
29
+
specified, then indices for visiting each index of `x`are returned.
30
30
31
31
## ismutable(x)
32
32
33
-
A trait function for whether `x` is a mutable or immutable array. Used for
33
+
A trait function for whether `x` is a mutable or an immutable array. Used for
34
34
dispatching to in-place and out-of-place versions of functions.
35
35
36
36
## aos_to_soa(x)
@@ -43,16 +43,16 @@ A trait function for whether a matrix `x` is a sparse structured matrix.
43
43
44
44
## can_setindex(x)
45
45
46
-
A trait function for whether an array `x` can use `setindex!`
46
+
A trait function for whether an array `x` can use `setindex!`.
47
47
48
48
## has_sparsestruct(x)
49
49
50
-
Determine whether `findstructralnz` accepts the parameter `x`
50
+
Determine whether `findstructralnz` accepts the parameter `x`.
51
51
52
52
## findstructralnz(x)
53
53
54
54
Returns iterators `(I,J)` of the non-zeros in the structure of the matrix `x`.
55
-
The same as the to first two elements of `findnz(::SparseMatrixCSC)`
55
+
The same as the first two elements of `findnz(::SparseMatrixCSC)`.
56
56
57
57
## fast_matrix_colors(A)
58
58
@@ -61,7 +61,7 @@ A trait function for whether `matrix_colors(A)` is a fast algorithm or a slow
61
61
62
62
## matrix_colors(A)
63
63
64
-
Returns an array of for the sparsity colors of a matrix type `A`. Also includes
64
+
Returns an array for the sparsity colors of a matrix type `A`. Also includes
65
65
an abstract type `ColoringAlgorithm` for `matrix_colors(A,alg::ColoringAlgorithm)`
66
66
of non-structured matrices.
67
67
@@ -79,16 +79,16 @@ A `setindex!` which is always allowed.
79
79
80
80
## lu_instance(A)
81
81
82
-
Return an instance of the LU factorization object with the correct type
82
+
Returns an instance of the LU factorization object with the correct type
83
83
cheaply.
84
84
85
85
## issingular(A)
86
86
87
-
Return an instance of the LU factorization object with the correct type cheaply.
87
+
Returns an instance of the LU factorization object with the correct type cheaply.
88
88
89
89
## safevec(v)
90
90
91
-
Is a form of `vec` which is safe for all values in vector spaces, i.e. if
91
+
Is a form of `vec` which is safe for all values in vector spaces, i.e., if it
92
92
is already a vector, like an AbstractVector or Number, it will return said
93
93
AbstractVector or Number.
94
94
@@ -97,18 +97,18 @@ AbstractVector or Number.
97
97
Creates the zero'd matrix version of `u`. Note that this is unique because
98
98
`similar(u,length(u),length(u))` returns a mutable type, so is not type-matching,
99
99
while `fill(zero(eltype(u)),length(u),length(u))` doesn't match the array type,
100
-
i.e. you'll get a CPU array from a GPU array. The generic fallback is
101
-
`u .* u' .* false` which works on a surprising number of types, but can be broken
102
-
with weird (recursive) broadcast overloads. For higherorder tensors, this
103
-
returns the matrix linear operator type which acts on the `vec` of the array.
100
+
i.e., you'll get a CPU array from a GPU array. The generic fallback is
101
+
`u .* u' .* false`, which works on a surprising number of types, but can be broken
102
+
with weird (recursive) broadcast overloads. For higher-order tensors, this
103
+
returns the matrix linear operator type, which acts on the `vec` of the array.
104
104
105
105
## restructure(x,y)
106
106
107
107
Restructures the object `y` into a shape of `x`, keeping its values intact. For
108
-
simple objects like an `Array`, this simply amounts to a reshape. However, for
108
+
simple objects, like an `Array`, this simply amounts to a reshape. However, for
109
109
more complex objects such as an `ArrayPartition`, not all of the structural
110
110
information is adequately contained in the type for standard tools to work. In
111
-
these cases, `restructure` gives a way to convert for example an `Array` into
111
+
these cases, `restructure` gives a way to convert, for example, an `Array` into
112
112
a matching `ArrayPartition`.
113
113
114
114
## known_first(::Type{T})
@@ -136,8 +136,8 @@ Otherwise, return `nothing`.
136
136
137
137
## device(::Type{T})
138
138
139
-
Indicates the most efficient way to access elements from the collection in lowlevel code.
140
-
For `GPUArrays`, will return`ArrayInterface.GPU()`.
139
+
Indicates the most efficient way to access elements from the collection in low-level code.
140
+
For `GPUArrays`, returns`ArrayInterface.GPU()`.
141
141
For `AbstractArray` supporting a `pointer` method, returns `ArrayInterface.CPUPointer()`.
142
142
For other `AbstractArray`s and `Tuple`s, returns `ArrayInterface.CPUIndex()`.
143
143
Otherwise, returns `nothing`.
@@ -155,21 +155,21 @@ Returns a tuple of boolean `Val`s indicating whether that axis is contiguous.
155
155
## contiguous_batch_size(::Type{T})
156
156
157
157
Returns the size of contiguous batches if `!isone(stride_rank(T, contiguous_axis(T)))`.
158
-
If `isone(stride_rank(T, contiguous_axis(T)))`, then it will return`ContiguousBatch{0}()`.
159
-
If `contiguous_axis(T) == -1`, it will return`ContiguousBatch{-1}()`.
160
-
If unknown, it will return`nothing`.
158
+
If `isone(stride_rank(T, contiguous_axis(T)))`, then returns`ContiguousBatch{0}()`.
159
+
If `contiguous_axis(T) == -1`, returns`ContiguousBatch{-1}()`.
160
+
If unknown, returns`nothing`.
161
161
162
162
## stride_rank(::Type{T})
163
163
164
164
Returns the rank of each stride.
165
165
166
166
## dense_dims(::Type{T})
167
167
Returns a tuple of indicators for whether each axis is dense.
168
-
An axis `i` of array `A` is dense if `stride(A, i) * size(A, i) == stride(A, j)` where `j` is the axis (if it exists) such that `stride_rank(A)[i] + 1 == stride_rank(A)[j]`.
168
+
An axis `i` of array `A` is dense if `stride(A, i) * size(A, i) == stride(A, j)`, where `j` is the axis (if it exists) such that `stride_rank(A)[i] + 1 == stride_rank(A)[j]`.
169
169
170
170
## ArrayInterface.size(A)
171
171
172
-
Returns the size of `A`. If the size of any axes are known at compile time,
172
+
Returns the size of `A`. If the sizes of any axes are known at compile time,
173
173
these should be returned as `StaticInt`s. For example:
174
174
```julia
175
175
julia>using StaticArrays, ArrayInterface
@@ -207,7 +207,7 @@ Is the function `f` whitelisted for `LoopVectorization.@avx`?
207
207
Creates a static integer with value known at compile time. It is a number,
208
208
supporting basic arithmetic. Many operations with two `StaticInt` integers
209
209
will produce another `StaticInt` integer. If one of the arguments to a
210
-
function call isn't static (e.g., `StaticInt(4) + 3`) then the `StaticInt`
210
+
function call isn't static (e.g., `StaticInt(4) + 3`), then the `StaticInt`
211
211
number will promote to a dynamic value.
212
212
213
213
# List of things to add
@@ -242,5 +242,5 @@ development.
242
242
`Base.@pure ismutable(array::AbstractArray) = typeof(array).mutable`, but there are a lot of cases
243
243
where this tends to not work out in a way one would expect. For example, if you put a normal array
244
244
into an immutable struct that adds more information to it, this is considered immutable, even if
245
-
all of the `setindex!` methods work (by forwarding to the mutable array). Thus it seems safer to just
245
+
all of the `setindex!` methods work (by forwarding to the mutable array). Thus, it seems safer to just
246
246
always assume mutability is standard for an array, and allow arrays to opt-out.
0 commit comments