Skip to content

Conversation

nikolai3d
Copy link
Collaborator

  • Sort and unique an index_set if it's not guaranteed to be strictly increasing.
  • If index_set is known to be strictly increasing already, strictly_increasing_index_set_to_selection() function may be used to skip std::sort and std::unique calls.

…ndex_set. Sort and unique an index_set if it's not guaranteed to be so
return result;
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should add a comment here about what this algorithm does.

\ingroup selection_algorithms

OLD VERSION (before September 2016) Takes a set of indices and converts them to a boundary-based Selection
*/
template <typename Selection, typename ForwardRange>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just remove the old version - it is quadratic and of no use anymore.

}

/****************************************************************************************************/
/*!
\ingroup selection_algorithms

Takes a set of indices and converts them to a boundary-based Selection
Takes a boundary-based Selection and converts them to a set of indices
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the function description + added example usage.

@fosterbrereton
Copy link
Member

Looks good to me - definitely an improvement over what we have now. @sean-parent?

@nikolai3d
Copy link
Collaborator Author

@sean-parent @fosterbrereton Ping. Using it in our code, works great.

@sean-parent sean-parent merged commit b932810 into master Sep 19, 2016
@nikolai3d nikolai3d deleted the nikolai/new-optimized-index-set-to-selection branch September 19, 2016 22:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants