|
1 |
| -module AbstractAxisArrays |
| 1 | +module QuasiArrays |
2 | 2 | using Base, LinearAlgebra, LazyArrays
|
3 | 3 | import Base: getindex, size, axes, length, ==, isequal, iterate, CartesianIndices, LinearIndices,
|
4 | 4 | Indices, IndexStyle, getindex, setindex!, parent, vec, convert, similar, zero,
|
5 | 5 | map, eachindex, eltype
|
6 | 6 | import Base: @_inline_meta, DimOrInd, OneTo, @_propagate_inbounds_meta, @_noinline_meta,
|
7 | 7 | DimsInteger, error_if_canonical_getindex, @propagate_inbounds, _return_type, _default_type,
|
8 | 8 | _maybetail, tail, _getindex, _maybe_reshape, index_ndims, _unsafe_getindex,
|
9 |
| - index_shape, to_shape, unsafe_length, @nloops, @ncall |
| 9 | + index_shape, to_shape, unsafe_length, @nloops, @ncall, Slice |
10 | 10 | import Base: ViewIndex, Slice, ScalarIndex, RangeIndex
|
11 | 11 | import Base: *, /, \, +, -, inv
|
12 | 12 |
|
| 13 | +import Base.Broadcast: materialize |
| 14 | + |
13 | 15 | import LinearAlgebra: transpose, adjoint, checkeltype_adjoint, checkeltype_transpose
|
14 | 16 |
|
15 | 17 | import LazyArrays: MemoryLayout, UnknownLayout
|
16 | 18 |
|
17 |
| -export AbstractAxisArray, AbstractAxisMatrix, AbstractAxisVector, materialize |
| 19 | +export AbstractQuasiArray, AbstractQuasiMatrix, AbstractQuasiVector, materialize |
18 | 20 |
|
19 |
| -abstract type AbstractAxisArray{T,N} end |
20 |
| -AbstractAxisVector{T} = AbstractAxisArray{T,1} |
21 |
| -AbstractAxisMatrix{T} = AbstractAxisArray{T,2} |
22 |
| -AbstractAxisVecOrMat{T} = Union{AbstractAxisVector{T}, AbstractAxisMatrix{T}} |
| 21 | +abstract type AbstractQuasiArray{T,N} end |
| 22 | +AbstractQuasiVector{T} = AbstractQuasiArray{T,1} |
| 23 | +AbstractQuasiMatrix{T} = AbstractQuasiArray{T,2} |
| 24 | +AbstractQuasiVecOrMat{T} = Union{AbstractQuasiVector{T}, AbstractQuasiMatrix{T}} |
23 | 25 |
|
24 | 26 |
|
25 | 27 | _length(d) = length(d)
|
26 | 28 |
|
27 |
| -size(A::AbstractAxisArray) = _length.(axes(A)) |
28 |
| -axes(A::AbstractAxisArray) = error("Override axes for $(typeof(A))") |
| 29 | +size(A::AbstractQuasiArray) = _length.(axes(A)) |
| 30 | +axes(A::AbstractQuasiArray) = error("Override axes for $(typeof(A))") |
29 | 31 |
|
30 | 32 | include("indices.jl")
|
31 |
| -include("abstractaxisarray.jl") |
| 33 | +include("abstractquasiarray.jl") |
32 | 34 | include("multidimensional.jl")
|
33 | 35 | include("subarray.jl")
|
34 | 36 | include("matmul.jl")
|
|
0 commit comments