Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduction functions with pre-allocated output storage. #6197

Merged
merged 4 commits into from
Mar 18, 2014
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add documentation for sum! and friends
  • Loading branch information
lindahua committed Mar 18, 2014
commit a6c0f618da39c9d9cbcaf3411ca9124eed16c107
48 changes: 36 additions & 12 deletions doc/stdlib/base.rst
Original file line number Diff line number Diff line change
Expand Up @@ -554,19 +554,27 @@ Iterable Collections

.. function:: maximum(itr)

Returns the largest element in a collection
Returns the largest element in a collection.

.. function:: maximum(A, dims)

Compute the maximum value of an array over the given dimensions
Compute the maximum value of an array over the given dimensions.

.. function:: maximum!(r, A)

Compute the maximum value of ``A`` over the singleton dimensions of ``r``, and write results to ``r``.

.. function:: minimum(itr)

Returns the smallest element in a collection
Returns the smallest element in a collection.

.. function:: minimum(A, dims)

Compute the minimum value of an array over the given dimensions
Compute the minimum value of an array over the given dimensions.

.. function:: minimum!(r, A)

Compute the minimum value of ``A`` over the singleton dimensions of ``r``, and write results to ``r``.

.. function:: extrema(itr)

Expand All @@ -575,56 +583,72 @@ Iterable Collections

.. function:: indmax(itr) -> Integer

Returns the index of the maximum element in a collection
Returns the index of the maximum element in a collection.

.. function:: indmin(itr) -> Integer

Returns the index of the minimum element in a collection
Returns the index of the minimum element in a collection.

.. function:: findmax(itr) -> (x, index)

Returns the maximum element and its index
Returns the maximum element and its index.

.. function:: findmin(itr) -> (x, index)

Returns the minimum element and its index
Returns the minimum element and its index.

.. function:: sum(itr)

Returns the sum of all elements in a collection
Returns the sum of all elements in a collection.

.. function:: sum(A, dims)

Sum elements of an array over the given dimensions.

.. function:: sum!(r, A)

Sum elements of ``A`` over the singleton dimensions of ``r``, and write results to ``r``.

.. function:: sum(f, itr)

Sum the results of calling function ``f`` on each element of ``itr``.

.. function:: prod(itr)

Returns the product of all elements of a collection
Returns the product of all elements of a collection.

.. function:: prod(A, dims)

Multiply elements of an array over the given dimensions.

.. function:: prod!(r, A)

Multiply elements of ``A`` over the singleton dimensions of ``r``, and write results to ``r``.

.. function:: any(itr) -> Bool

Test whether any elements of a boolean collection are true
Test whether any elements of a boolean collection are true.

.. function:: any(A, dims)

Test whether any values along the given dimensions of an array are true.

.. function:: any!(r, A)

Test whether any values in ``A`` along the singleton dimensions of ``r`` are true, and write results to ``r``.

.. function:: all(itr) -> Bool

Test whether all elements of a boolean collection are true
Test whether all elements of a boolean collection are true.

.. function:: all(A, dims)

Test whether all values along the given dimensions of an array are true.

.. function:: all!(r, A)

Test whether all values in ``A`` along the singleton dimensions of ``r`` are true, and write results to ``r``.

.. function:: count(p, itr) -> Integer

Count the number of elements in ``itr`` for which predicate ``p`` returns true.
Expand Down