数组

构造函数与类型

  1. Core.AbstractArray
  2. Base.AbstractVector
  3. Base.AbstractMatrix
  4. Base.AbstractVecOrMat
  5. Core.Array
  6. Core.Array(::UndefInitializer, ::Any)
  7. Core.Array(::Nothing, ::Any)
  8. Core.Array(::Missing, ::Any)
  9. Core.UndefInitializer
  10. Core.undef
  11. Base.Vector
  12. Base.Vector(::UndefInitializer, ::Any)
  13. Base.Vector(::Nothing, ::Any)
  14. Base.Vector(::Missing, ::Any)
  15. Base.Matrix
  16. Base.Matrix(::UndefInitializer, ::Any, ::Any)
  17. Base.Matrix(::Nothing, ::Any, ::Any)
  18. Base.Matrix(::Missing, ::Any, ::Any)
  19. Base.VecOrMat
  20. Core.DenseArray
  21. Base.DenseVector
  22. Base.DenseMatrix
  23. Base.DenseVecOrMat
  24. Base.StridedArray
  25. Base.StridedVector
  26. Base.StridedMatrix
  27. Base.StridedVecOrMat
  28. Base.getindex(::Type, ::Any...)
  29. Base.zeros
  30. Base.ones
  31. Base.BitArray
  32. Base.BitArray(::UndefInitializer, ::Integer...)
  33. Base.BitArray(::Any)
  34. Base.trues
  35. Base.falses
  36. Base.fill
  37. Base.fill!
  38. Base.empty
  39. Base.similar

基础函数

  1. Base.ndims
  2. Base.size
  3. Base.axes(::Any)
  4. Base.axes(::AbstractArray, ::Any)
  5. Base.length(::AbstractArray)
  6. Base.keys(::AbstractArray)
  7. Base.eachindex
  8. Base.IndexStyle
  9. Base.IndexLinear
  10. Base.IndexCartesian
  11. Base.conj!
  12. Base.stride
  13. Base.strides

广播与矢量化

也可参照 dot syntax for vectorizing functions; 例如,f.(args...) 隐式调用 broadcast(f, args...)。 与其依赖如 sin 函数的“已矢量化”方法,你应该使用 sin.(a) 来使用broadcast来矢量化。

  1. Base.broadcast
  2. Base.Broadcast.broadcast!
  3. Base.@__dot__

自定义类型的广播,请参照

  1. Base.BroadcastStyle
  2. Base.Broadcast.AbstractArrayStyle
  3. Base.Broadcast.ArrayStyle
  4. Base.Broadcast.DefaultArrayStyle
  5. Base.Broadcast.broadcastable
  6. Base.Broadcast.combine_axes
  7. Base.Broadcast.combine_styles
  8. Base.Broadcast.result_style

索引与赋值

  1. Base.getindex(::AbstractArray, ::Any...)
  2. Base.setindex!(::AbstractArray, ::Any, ::Any...)
  3. Base.copyto!(::AbstractArray, ::CartesianIndices, ::AbstractArray, ::CartesianIndices)
  4. Base.copy!
  5. Base.isassigned
  6. Base.Colon
  7. Base.CartesianIndex
  8. Base.CartesianIndices
  9. Base.Dims
  10. Base.LinearIndices
  11. Base.to_indices
  12. Base.checkbounds
  13. Base.checkindex
  14. Base.elsize

Views (SubArrays 以及其它 view 类型)

“视图”是一种表现和数组相似的数据结构(它是 AbstractArray 的子类型),但是它的底层数据实际上是另一个数组的一部分。

例如,x 是一个数组,v = @view x[1:10],则 v 表现得就像一个含有 10 个元素的数组,但是它的数据实际上是访问 x 的前 10 个元素。对视图的写入,如 v[3] = 2,直接写入了底层的数组 x (这里是修改 x[3])。

在 Julia 中,像 x[1:10] 这样的切片操作会创建一个副本。@view x[1:10] 将它变成创建一个视图。 @views 宏可以用于整个代码块(如 @views function foo() .... end@views begin ... end)来将整个代码块中的切片操作变为使用视图。 如性能建议所描述的,有时候使用数据的副本更快,而有时候使用视图会更快。

  1. Base.view
  2. Base.@view
  3. Base.@views
  4. Base.parent
  5. Base.parentindices
  6. Base.selectdim
  7. Base.reinterpret
  8. Base.reshape
  9. Base.dropdims
  10. Base.vec
  11. Base.SubArray

拼接与排列

  1. Base.cat
  2. Base.vcat
  3. Base.hcat
  4. Base.hvcat
  5. Base.hvncat
  6. Base.vect
  7. Base.circshift
  8. Base.circshift!
  9. Base.circcopy!
  10. Base.findall(::Any)
  11. Base.findall(::Function, ::Any)
  12. Base.findfirst(::Any)
  13. Base.findfirst(::Function, ::Any)
  14. Base.findlast(::Any)
  15. Base.findlast(::Function, ::Any)
  16. Base.findnext(::Any, ::Integer)
  17. Base.findnext(::Function, ::Any, ::Integer)
  18. Base.findprev(::Any, ::Integer)
  19. Base.findprev(::Function, ::Any, ::Integer)
  20. Base.permutedims
  21. Base.permutedims!
  22. Base.PermutedDimsArray
  23. Base.promote_shape

数组函数

  1. Base.accumulate
  2. Base.accumulate!
  3. Base.cumprod
  4. Base.cumprod!
  5. Base.cumsum
  6. Base.cumsum!
  7. Base.diff
  8. Base.repeat
  9. Base.rot180
  10. Base.rotl90
  11. Base.rotr90
  12. Base.mapslices
  13. Base.eachrow
  14. Base.eachcol
  15. Base.eachslice

组合学

  1. Base.invperm
  2. Base.isperm
  3. Base.permute!(::Any, ::AbstractVector)
  4. Base.invpermute!
  5. Base.reverse(::AbstractVector; kwargs...)
  6. Base.reverseind
  7. Base.reverse!