@@ -19,7 +19,7 @@ Returns tuple where each field corresponds to the field type of `T` modified by
1919
2020# Examples
2121
22- ```julia
22+ ```julia-repl
2323julia> ArrayInterface.map_tuple_type(sqrt, Tuple{1,4,16})
2424(1.0, 2.0, 4.0)
2525
@@ -37,7 +37,7 @@ Flattens any field of `t` that is a tuple. Only direct fields of `t` may be flat
3737
3838# Examples
3939
40- ```julia
40+ ```julia-repl
4141julia> ArrayInterface.flatten_tuples((1, ()))
4242(1,)
4343
@@ -138,15 +138,13 @@ See also [`SetIndex!`](@ref)
138138
139139# Examples
140140
141- ```julia
141+ ```julia-repl
142142julia> ArrayInterface.GetIndex(1:10)(3)
1431433
144144
145145julia> ArrayInterface.GetIndex{false}(1:10)(11) # shouldn't be in-bounds
14614611
147-
148147```
149-
150148"""
151149struct GetIndex{CB, B} <: Function
152150 buffer:: B
@@ -175,15 +173,13 @@ See also [`GetIndex`](@ref)
175173
176174# Examples
177175
178- ```julia
179-
176+ ```julia-repl
180177julia> x = [1, 2, 3, 4];
181178
182179julia> ArrayInterface.SetIndex!(x)(10, 2);
183180
184181julia> x[2]
18518210
186-
187183```
188184"""
189185struct SetIndex!{CB, B} <: Function
@@ -224,7 +220,7 @@ function ismutable end
224220 ismutable(::Type{T}) -> Bool
225221
226222Query whether instances of type `T` are mutable or not, see
227- https://github.com/JuliaDiffEq/RecursiveArrayTools.jl/issues/19.
223+ < https://github.com/JuliaDiffEq/RecursiveArrayTools.jl/issues/19> .
228224"""
229225ismutable (x) = ismutable (typeof (x))
230226function ismutable (:: Type{T} ) where {T <: AbstractArray }
@@ -319,7 +315,7 @@ diaganyzero(A) = any(iszero, view(A, diagind(A)))
319315 findstructralnz(x::AbstractArray)
320316
321317Return: (I,J) #indexable objects
322- Find sparsity pattern of special matrices, the same as the first two elements of findnz(::SparseMatrixCSC).
318+ Find sparsity pattern of special matrices, the same as the first two elements of ` findnz(::SparseMatrixCSC)` .
323319"""
324320function findstructralnz (x:: Diagonal )
325321 n = Base. size (x, 1 )
@@ -416,7 +412,7 @@ matrix_colors(A::Union{Tridiagonal, SymTridiagonal}) = _cycle(1:3, Base.size(A,
416412_cycle (repetend, len) = repeat (repetend, div (len, length (repetend)) + 1 )[1 : len]
417413
418414"""
419- bunchkaufman_instance(A, pivot = LinearAlgebra.RowMaximum()) -> bunchkaufman_factorization_instance
415+ bunchkaufman_instance(A, pivot = LinearAlgebra.RowMaximum()) -> bunchkaufman_factorization_instance
420416
421417Returns an instance of the Bunch-Kaufman factorization object with the correct type
422418cheaply.
@@ -426,14 +422,14 @@ function bunchkaufman_instance(A::Matrix{T}) where T
426422end
427423
428424"""
429- bunchkaufman_instance(a::Number) -> a
425+ bunchkaufman_instance(a::Number) -> a
430426
431427Returns the number.
432428"""
433429bunchkaufman_instance (a:: Number ) = a
434430
435431"""
436- bunchkaufman_instance(a::Any) -> cholesky(a, check=false)
432+ bunchkaufman_instance(a::Any) -> cholesky(a, check=false)
437433
438434Returns the number.
439435"""
@@ -442,7 +438,7 @@ bunchkaufman_instance(a::Any) = bunchkaufman(a, check = false)
442438const DEFAULT_CHOLESKY_PIVOT = LinearAlgebra. NoPivot ()
443439
444440"""
445- cholesky_instance(A, pivot = LinearAlgebra.NoPivot()) -> cholesky_factorization_instance
441+ cholesky_instance(A, pivot = LinearAlgebra.NoPivot()) -> cholesky_factorization_instance
446442
447443Returns an instance of the Cholesky factorization object with the correct type
448444cheaply.
@@ -452,22 +448,22 @@ function cholesky_instance(A::Matrix{T}, pivot = DEFAULT_CHOLESKY_PIVOT) where {
452448end
453449
454450"""
455- cholesky_instance(a::Number, pivot = LinearAlgebra.NoPivot()) -> a
451+ cholesky_instance(a::Number, pivot = LinearAlgebra.NoPivot()) -> a
456452
457453Returns the number.
458454"""
459455cholesky_instance (a:: Number , pivot = DEFAULT_CHOLESKY_PIVOT) = a
460456
461457"""
462- cholesky_instance(a::Any, pivot = LinearAlgebra.NoPivot()) -> cholesky(a, check=false)
458+ cholesky_instance(a::Any, pivot = LinearAlgebra.NoPivot()) -> cholesky(a, check=false)
463459
464460Slow fallback which gets the instance via factorization. Should get
465461specialized for new matrix types.
466462"""
467463cholesky_instance (a:: Any , pivot = DEFAULT_CHOLESKY_PIVOT) = cholesky (a, pivot, check = false )
468464
469465"""
470- ldlt_instance(A) -> ldlt_factorization_instance
466+ ldlt_instance(A) -> ldlt_factorization_instance
471467
472468Returns an instance of the LDLT factorization object with the correct type
473469cheaply.
@@ -481,22 +477,22 @@ function ldlt_instance(A::SymTridiagonal{T,V}) where {T,V}
481477end
482478
483479"""
484- ldlt_instance(a::Number) -> a
480+ ldlt_instance(a::Number) -> a
485481
486482Returns the number.
487483"""
488484ldlt_instance (a:: Number ) = a
489485
490486"""
491- ldlt_instance(a::Any) -> ldlt(a, check=false)
487+ ldlt_instance(a::Any) -> ldlt(a, check=false)
492488
493489Slow fallback which gets the instance via factorization. Should get
494490specialized for new matrix types.
495491"""
496492ldlt_instance (a:: Any ) = ldlt (a)
497493
498494"""
499- lu_instance(A) -> lu_factorization_instance
495+ lu_instance(A) -> lu_factorization_instance
500496
501497Returns an instance of the LU factorization object with the correct type
502498cheaply.
@@ -532,22 +528,22 @@ function lu_instance(A::Union{Tridiagonal{T},Diagonal{T},SymTridiagonal{T}}) whe
532528end
533529
534530"""
535- lu_instance(a::Number) -> a
531+ lu_instance(a::Number) -> a
536532
537533Returns the number.
538534"""
539535lu_instance (a:: Number ) = a
540536
541537"""
542- lu_instance(a::Any) -> lu(a, check= false)
538+ lu_instance(a::Any) -> lu(a, check = false)
543539
544540Slow fallback which gets the instance via factorization. Should get
545541specialized for new matrix types.
546542"""
547543lu_instance (a:: Any ) = lu (a, check = false )
548544
549545"""
550- qr_instance(A, pivot = NoPivot()) -> qr_factorization_instance
546+ qr_instance(A, pivot = NoPivot()) -> qr_factorization_instance
551547
552548Returns an instance of the QR factorization object with the correct type
553549cheaply.
@@ -565,7 +561,7 @@ function qr_instance(A::Matrix{BigFloat},pivot = DEFAULT_CHOLESKY_PIVOT)
565561end
566562
567563"""
568- qr_instance(a::Number) -> a
564+ qr_instance(a::Number) -> a
569565
570566Returns the number.
571567"""
@@ -580,7 +576,7 @@ specialized for new matrix types.
580576qr_instance (a:: Any , pivot = DEFAULT_CHOLESKY_PIVOT) = qr (a)# check = false)
581577
582578"""
583- svd_instance(A) -> qr_factorization_instance
579+ svd_instance(A) -> qr_factorization_instance
584580
585581Returns an instance of the SVD factorization object with the correct type
586582cheaply.
@@ -590,7 +586,7 @@ function svd_instance(A::Matrix{T}) where {T}
590586end
591587
592588"""
593- svd_instance(a::Number) -> a
589+ svd_instance(a::Number) -> a
594590
595591Returns the number.
596592"""
@@ -747,14 +743,14 @@ fast_scalar_indexing(::Type{<:LinearAlgebra.AbstractQ}) = false
747743fast_scalar_indexing (:: Type{<:LinearAlgebra.LQPackedQ} ) = false
748744
749745"""
750- allowed_getindex(x,i...)
746+ allowed_getindex(x, i...)
751747
752748A scalar `getindex` which is always allowed.
753749"""
754750allowed_getindex (x, i... ) = x[i... ]
755751
756752"""
757- allowed_setindex!(x,v, i...)
753+ allowed_setindex!(x, v, i...)
758754
759755A scalar `setindex!` which is always allowed.
760756"""
@@ -828,7 +824,7 @@ See also [`ndims_shape`](@ref)
828824
829825# Examples
830826
831- ```julia
827+ ```julia-repl
832828julia> ArrayInterface.ndims_index(Int)
8338291
834830
@@ -859,13 +855,13 @@ See also [`ndims_index`](@ref)
859855
860856# Examples
861857
862- ```julia
858+ ```julia-repl
863859julia> ArrayInterface.ndims_shape([CartesianIndex(1, 1), CartesianIndex(1, 2)])
8648601
865861
866862julia> ndims(CartesianIndices((2,2))[[CartesianIndex(1, 1), CartesianIndex(1, 2)]])
8678631
868-
864+ ```
869865"""
870866ndims_shape (T:: DataType ) = ndims_index (T)
871867ndims_shape (:: Type{Colon} ) = 1
@@ -876,7 +872,6 @@ ndims_shape(@nospecialize T::Type{<:AbstractArray}) = ndims(T)
876872ndims_shape (x) = ndims_shape (typeof (x))
877873
878874
879-
880875"""
881876 instances_do_not_alias(::Type{T}) -> Bool
882877
920915"""
921916 defines_strides(::Type{T}) -> Bool
922917
923- Is strides(::T) defined? It is assumed that types returning `true` also return a valid
918+ Is ` strides(::T)` defined? It is assumed that types returning `true` also return a valid
924919pointer on `pointer(::T)`.
925920"""
926921defines_strides (x) = defines_strides (typeof (x))
@@ -965,7 +960,7 @@ interface.
965960
966961# Examples
967962
968- ```julia
963+ ```julia-repl
969964julia> ArrayInterface.ensures_all_unique(BitSet())
970965true
971966
@@ -994,7 +989,7 @@ Returns `true` if all instances of `T` are sorted.
994989
995990# Examples
996991
997- ```julia
992+ ```julia-repl
998993julia> ArrayInterface.ensures_sorted(BitSet())
999994true
1000995
@@ -1019,8 +1014,8 @@ Note: This checks if a compatible `convert` methood exists between `T` and `args
10191014
10201015# Examples:
10211016
1022- ```julia
1023- julia> ca = ComponentVector((x = rand(3), y = rand(4), ))
1017+ ```julia-repl
1018+ julia> ca = ComponentVector((x = rand(3), y = rand(4)))
10241019ComponentVector{Float64}(x = [0.6549137106381634, 0.37555505280294565, 0.8521039568665254], y = [0.40314196291239024, 0.35484725607638834, 0.6580528978034597, 0.10055508457632167])
10251020
10261021julia> ArrayInterface.has_trivial_array_constructor(typeof(ca), ones(6))
0 commit comments