Skip to content

Commit

Permalink
Export circcopy! and add it to the RST manual
Browse files Browse the repository at this point in the history
  • Loading branch information
timholy authored and mfasi committed Sep 5, 2016
1 parent 67d881b commit f218351
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
1 change: 1 addition & 0 deletions base/exports.jl
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,7 @@ export
cat,
checkbounds,
checkindex,
circcopy!,
circshift,
circshift!,
clamp!,
Expand Down
27 changes: 27 additions & 0 deletions doc/stdlib/arrays.rst
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,33 @@ Indexing, Assignment, and Concatenation

See also ``circshift``\ .

.. function:: circcopy!(dest, src)

.. Docstring generated from Julia source
Copy ``src`` to ``dest``\ , indexing each dimension modulo its length. ``src`` and ``dest`` must have the same size, but can be offset in their indices; any offset results in a (circular) wraparound. If the arrays have overlapping indices, then on the domain of the overlap ``dest`` agrees with ``src``\ .

.. code-block:: julia
julia> src = reshape(collect(1:16), (4,4))
4×4 Array{Int64,2}:
1 5 9 13
2 6 10 14
3 7 11 15
4 8 12 16
julia> dest = OffsetArray{Int}((0:3,2:5))
julia> circcopy!(dest, src)
OffsetArrays.OffsetArray{Int64,2,Array{Int64,2}} with indices 0:3×2:5:
8 12 16 4
5 9 13 1
6 10 14 2
7 11 15 3
julia> dest[1:3,2:4] == src[1:3,2:4]
true
.. function:: find(A)

.. Docstring generated from Julia source
Expand Down

0 comments on commit f218351

Please sign in to comment.