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

Proposal for function uniqueslices #14142

Closed
wants to merge 7 commits into from
Closed

Proposal for function uniqueslices #14142

wants to merge 7 commits into from

Commits on Nov 25, 2015

  1. Proposal for function uniqueind

    This commit introduces a function `uniqueind` that is a slight modification of the existing `unique` function accepting a `dim` argument but returns an additional three index vectors.
    
    The outputs, as described in the docstring, are as follows:
    
    `C` - an array of the unique elements/rows/columns/hyperplanes of the input AbstractArray `itr` along the dimension `dim`
    `ia` - a vector of index values such that slice indexing into `itr`along dimension `dim` re-produces `C`.  
            For example, if `itr` is a vector, `itr[ia] == C` returns `true`
    `ib` - a vector of vectors of integers, where each vector of integers contains the index positions of the unique elements/rows/columns/planes within `C`
    `ic` - a vector of index values such that slice indexing into `C` along dimension `dim` re-rproduces `itr`
            For example, if `itr` is a vector, `C[ic] == itr` returns `true`
    
    The presence of `ia`, `ib`, and `ic` are meant to mimic the behaviors (but with potentially different output order) of various unique and group functions found in a few other technical computing languages.  This function provides all three of those outputs from a single function, while some other languages might only produce one or two arrays of index vectors from a given function.
    
    It might be decided upon review that instead of a single function returning all four outputs, there should be multiple functions that return separate output arguments and more closely mimic similar functions from other languages.
    
    This PR is in relation to issue #1845.
    AndyGreenwell committed Nov 25, 2015
    Configuration menu
    Copy the full SHA
    6873024 View commit details
    Browse the repository at this point in the history
  2. Remove trailing whitespace

    Removing a trailing whitespace that caused a build failure.
    AndyGreenwell committed Nov 25, 2015
    Configuration menu
    Copy the full SHA
    4d0a8c1 View commit details
    Browse the repository at this point in the history

Commits on Nov 26, 2015

  1. Rest of the trailing whitespaces

    Missed a few last time.
    AndyGreenwell committed Nov 26, 2015
    Configuration menu
    Copy the full SHA
    d0b09ab View commit details
    Browse the repository at this point in the history
  2. Last one...hopefully.

    One more trailing whitespace.
    AndyGreenwell committed Nov 26, 2015
    Configuration menu
    Copy the full SHA
    cdfd617 View commit details
    Browse the repository at this point in the history

Commits on Nov 30, 2015

  1. Simple doc updates

    This commit makes the simple doc updates suggested in #14142 to change `itr` to `A` and use a fixed set of integers, instead of random integers, when constructing the multidimensional array examples.
    AndyGreenwell committed Nov 30, 2015
    Configuration menu
    Copy the full SHA
    547600a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    0779baf View commit details
    Browse the repository at this point in the history

Commits on Dec 3, 2015

  1. Changing function name to uniqueslices

    Updating function name to `uniqueslices` primarily just to kick off a new round of Travis and AppVeyor tests, because the Travis tests failed last time for reasons seemingly unrelated to the contents of this file.
    AndyGreenwell committed Dec 3, 2015
    Configuration menu
    Copy the full SHA
    7fe7997 View commit details
    Browse the repository at this point in the history