{"action":"created","comment":{"url":"https://api.github.com/repos/dealii/dealii/pulls/comments/34792817","id":34792817,"diff_hunk":"@@ -79,6 +89,188 @@ class IndexSet\n   typedef signed int value_type;\n \n   /**\n+   * Dereferencing an IntervalIterator will return a reference to an object of this type.\n+   */\n+  class IntervalAccessor\n+  {\n+  public:\n+    IntervalAccessor(const IndexSet &idxset, size_type range_idx);\n+    size_type n_elements() const;\n+    bool is_valid() const;\n+    ElementIterator begin() const;\n+    ElementIterator end() const;\n+  private:\n+    bool operator == (const IntervalAccessor &other) const;\n+    bool operator < (const IntervalAccessor &other) const;\n+    void advance ();\n+    const IndexSet &index_set;\n+    size_type range_idx;\n+\n+    friend class IntervalIterator;\n+  };\n+\n+  /**\n+   * Class that represents an iterator pointing to a contiguous interval [a,b[ as returned by IndexSet::begin_interval().\n+   */\n+  class IntervalIterator\n+  {\n+  public:\n+    /**\n+     * Construct a valid iterator pointing to the interval with index @p range_idx.\n+     */\n+    IntervalIterator(const IndexSet &idxset, size_type range_idx);\n+\n+    /**\n+     * Construct an invalid iterator (used as end())\n+     */\n+    IntervalIterator(const IndexSet &idxset);\n+\n+    /**\n+     * Prefix increment.\n+     */\n+    IntervalIterator &operator++ ();\n+\n+    /**\n+     * Postfix increment.\n+     */\n+    IntervalIterator operator++ (int);\n+\n+    /**\n+     * Dereferencing operator, returns an IntervalAccessor.\n+     */\n+    const IntervalAccessor &operator* () const;\n+\n+    /**\n+     * Dereferencing operator, returns a pointer to an IntervalAccessor.\n+     */\n+    const IntervalAccessor *operator-> () const;\n+\n+    /**\n+     * Comparison.\n+     */\n+    bool operator == (const IntervalIterator &) const;\n+\n+    /**\n+     * Inverse of <tt>==</tt>.\n+     */\n+    bool operator != (const IntervalIterator &) const;\n+\n+    /**\n+     * Comparison operator.\n+     */\n+    bool operator < (const IntervalIterator &) const;\n+\n+    /**\n+     * Return the distance between the current iterator and the argument. The\n+     * distance is given by how many times one has to apply operator++ to the\n+     * current iterator to get the argument (for a positive return value), or\n+     * operator-- (for a negative return value).\n+     */\n+    std::ptrdiff_t operator - (const IntervalIterator &p) const;\n+\n+  private:\n+    IntervalAccessor accessor;\n+  };\n+\n+  /**\n+   * Class that represents an iterator pointing to a single element in the IndexSet as returned by IndexSet::begin().\n+   */\n+  class ElementIterator\n+  {\n+  public:\n+    /**\n+     * Construct an iterator pointing to the global index @p index in the interval @p range_idx\n+     */\n+    ElementIterator(const IndexSet &idxset, size_type range_idx, size_type index);\n+    /**\n+     * Construct an iterator pointing to the end of the IndexSet.\n+     */\n+    ElementIterator(const IndexSet &idxset);\n+\n+    /**\n+     * Dereferencing operator. The returned value is the index of the element inside the IndexSet.\n+     */\n+    const size_type &operator* () const;\n+\n+    /**\n+     * Does this iterator point to an existing element?\n+     */\n+    bool is_valid () const;\n+\n+    /**\n+     * Prefix increment.\n+     */\n+    ElementIterator &operator++ ();\n+\n+    /**\n+     * Postfix increment.\n+     */\n+    ElementIterator operator++ (int);\n+\n+\n+    /**\n+     * Comparison.\n+     */\n+    bool operator == (const ElementIterator &) const;\n+\n+    /**\n+     * Inverse of <tt>==</tt>.\n+     */\n+    bool operator != (const ElementIterator &) const;\n+\n+    /**\n+     * Comparison operator.\n+     */\n+    bool operator < (const ElementIterator &) const;\n+\n+    /**\n+     * Return the distance between the current iterator and the argument. The\n+     * distance is given by how many times one has to apply operator++ to the\n+     * current iterator to get the argument (for a positive return value), or\n+     * operator-- (for a negative return value).","path":"include/deal.II/base/index_set.h","position":159,"original_position":159,"commit_id":"9a5b9f383e5771023a8c9c594c90c1cef62dc3eb","original_commit_id":"9a5b9f383e5771023a8c9c594c90c1cef62dc3eb","user":{"login":"tjhei","id":1531285,"avatar_url":"https://avatars.githubusercontent.com/u/1531285?v=3","gravatar_id":"","url":"https://api.github.com/users/tjhei","html_url":"https://github.com/tjhei","followers_url":"https://api.github.com/users/tjhei/followers","following_url":"https://api.github.com/users/tjhei/following{/other_user}","gists_url":"https://api.github.com/users/tjhei/gists{/gist_id}","starred_url":"https://api.github.com/users/tjhei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tjhei/subscriptions","organizations_url":"https://api.github.com/users/tjhei/orgs","repos_url":"https://api.github.com/users/tjhei/repos","events_url":"https://api.github.com/users/tjhei/events{/privacy}","received_events_url":"https://api.github.com/users/tjhei/received_events","type":"User","site_admin":false},"body":"Only that this was stolen from SparsityPattern iterators and has the sign exactly opposite: If I have b-a, a positive value represents the number of applications of operator++ to a.","created_at":"2015-07-16T14:28:47Z","updated_at":"2015-07-16T14:28:47Z","html_url":"https://github.com/dealii/dealii/pull/1122#discussion_r34792817","pull_request_url":"https://api.github.com/repos/dealii/dealii/pulls/1122","_links":{"self":{"href":"https://api.github.com/repos/dealii/dealii/pulls/comments/34792817"},"html":{"href":"https://github.com/dealii/dealii/pull/1122#discussion_r34792817"},"pull_request":{"href":"https://api.github.com/repos/dealii/dealii/pulls/1122"}}},"pull_request":{"url":"https://api.github.com/repos/dealii/dealii/pulls/1122","id":39752247,"html_url":"https://github.com/dealii/dealii/pull/1122","diff_url":"https://github.com/dealii/dealii/pull/1122.diff","patch_url":"https://github.com/dealii/dealii/pull/1122.patch","issue_url":"https://api.github.com/repos/dealii/dealii/issues/1122","number":1122,"state":"open","locked":false,"title":"new IndexSet iterators","user":{"login":"tjhei","id":1531285,"avatar_url":"https://avatars.githubusercontent.com/u/1531285?v=3","gravatar_id":"","url":"https://api.github.com/users/tjhei","html_url":"https://github.com/tjhei","followers_url":"https://api.github.com/users/tjhei/followers","following_url":"https://api.github.com/users/tjhei/following{/other_user}","gists_url":"https://api.github.com/users/tjhei/gists{/gist_id}","starred_url":"https://api.github.com/users/tjhei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tjhei/subscriptions","organizations_url":"https://api.github.com/users/tjhei/orgs","repos_url":"https://api.github.com/users/tjhei/repos","events_url":"https://api.github.com/users/tjhei/events{/privacy}","received_events_url":"https://api.github.com/users/tjhei/received_events","type":"User","site_admin":false},"body":"- add IndexSet::ElementIterator and IndexSet::IntervalIterator","created_at":"2015-07-11T21:03:06Z","updated_at":"2015-07-16T14:28:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"210e9b65cf6090a025d481e104a654dcf313c05a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dealii/dealii/pulls/1122/commits","review_comments_url":"https://api.github.com/repos/dealii/dealii/pulls/1122/comments","review_comment_url":"https://api.github.com/repos/dealii/dealii/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dealii/dealii/issues/1122/comments","statuses_url":"https://api.github.com/repos/dealii/dealii/statuses/9a5b9f383e5771023a8c9c594c90c1cef62dc3eb","head":{"label":"tjhei:iterate_index_sets","ref":"iterate_index_sets","sha":"9a5b9f383e5771023a8c9c594c90c1cef62dc3eb","user":{"login":"tjhei","id":1531285,"avatar_url":"https://avatars.githubusercontent.com/u/1531285?v=3","gravatar_id":"","url":"https://api.github.com/users/tjhei","html_url":"https://github.com/tjhei","followers_url":"https://api.github.com/users/tjhei/followers","following_url":"https://api.github.com/users/tjhei/following{/other_user}","gists_url":"https://api.github.com/users/tjhei/gists{/gist_id}","starred_url":"https://api.github.com/users/tjhei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tjhei/subscriptions","organizations_url":"https://api.github.com/users/tjhei/orgs","repos_url":"https://api.github.com/users/tjhei/repos","events_url":"https://api.github.com/users/tjhei/events{/privacy}","received_events_url":"https://api.github.com/users/tjhei/received_events","type":"User","site_admin":false},"repo":{"id":22073053,"name":"dealii","full_name":"tjhei/dealii","owner":{"login":"tjhei","id":1531285,"avatar_url":"https://avatars.githubusercontent.com/u/1531285?v=3","gravatar_id":"","url":"https://api.github.com/users/tjhei","html_url":"https://github.com/tjhei","followers_url":"https://api.github.com/users/tjhei/followers","following_url":"https://api.github.com/users/tjhei/following{/other_user}","gists_url":"https://api.github.com/users/tjhei/gists{/gist_id}","starred_url":"https://api.github.com/users/tjhei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tjhei/subscriptions","organizations_url":"https://api.github.com/users/tjhei/orgs","repos_url":"https://api.github.com/users/tjhei/repos","events_url":"https://api.github.com/users/tjhei/events{/privacy}","received_events_url":"https://api.github.com/users/tjhei/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tjhei/dealii","description":"","fork":true,"url":"https://api.github.com/repos/tjhei/dealii","forks_url":"https://api.github.com/repos/tjhei/dealii/forks","keys_url":"https://api.github.com/repos/tjhei/dealii/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tjhei/dealii/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tjhei/dealii/teams","hooks_url":"https://api.github.com/repos/tjhei/dealii/hooks","issue_events_url":"https://api.github.com/repos/tjhei/dealii/issues/events{/number}","events_url":"https://api.github.com/repos/tjhei/dealii/events","assignees_url":"https://api.github.com/repos/tjhei/dealii/assignees{/user}","branches_url":"https://api.github.com/repos/tjhei/dealii/branches{/branch}","tags_url":"https://api.github.com/repos/tjhei/dealii/tags","blobs_url":"https://api.github.com/repos/tjhei/dealii/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tjhei/dealii/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tjhei/dealii/git/refs{/sha}","trees_url":"https://api.github.com/repos/tjhei/dealii/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tjhei/dealii/statuses/{sha}","languages_url":"https://api.github.com/repos/tjhei/dealii/languages","stargazers_url":"https://api.github.com/repos/tjhei/dealii/stargazers","contributors_url":"https://api.github.com/repos/tjhei/dealii/contributors","subscribers_url":"https://api.github.com/repos/tjhei/dealii/subscribers","subscription_url":"https://api.github.com/repos/tjhei/dealii/subscription","commits_url":"https://api.github.com/repos/tjhei/dealii/commits{/sha}","git_commits_url":"https://api.github.com/repos/tjhei/dealii/git/commits{/sha}","comments_url":"https://api.github.com/repos/tjhei/dealii/comments{/number}","issue_comment_url":"https://api.github.com/repos/tjhei/dealii/issues/comments{/number}","contents_url":"https://api.github.com/repos/tjhei/dealii/contents/{+path}","compare_url":"https://api.github.com/repos/tjhei/dealii/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tjhei/dealii/merges","archive_url":"https://api.github.com/repos/tjhei/dealii/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tjhei/dealii/downloads","issues_url":"https://api.github.com/repos/tjhei/dealii/issues{/number}","pulls_url":"https://api.github.com/repos/tjhei/dealii/pulls{/number}","milestones_url":"https://api.github.com/repos/tjhei/dealii/milestones{/number}","notifications_url":"https://api.github.com/repos/tjhei/dealii/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tjhei/dealii/labels{/name}","releases_url":"https://api.github.com/repos/tjhei/dealii/releases{/id}","created_at":"2014-07-21T17:16:17Z","updated_at":"2014-12-19T14:48:54Z","pushed_at":"2015-07-15T17:40:35Z","git_url":"git://github.com/tjhei/dealii.git","ssh_url":"git@github.com:tjhei/dealii.git","clone_url":"https://github.com/tjhei/dealii.git","svn_url":"https://github.com/tjhei/dealii","homepage":null,"size":119073,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"dealii:master","ref":"master","sha":"a13c48f5456934e100e3027e3977a5b21484f118","user":{"login":"dealii","id":7506070,"avatar_url":"https://avatars.githubusercontent.com/u/7506070?v=3","gravatar_id":"","url":"https://api.github.com/users/dealii","html_url":"https://github.com/dealii","followers_url":"https://api.github.com/users/dealii/followers","following_url":"https://api.github.com/users/dealii/following{/other_user}","gists_url":"https://api.github.com/users/dealii/gists{/gist_id}","starred_url":"https://api.github.com/users/dealii/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dealii/subscriptions","organizations_url":"https://api.github.com/users/dealii/orgs","repos_url":"https://api.github.com/users/dealii/repos","events_url":"https://api.github.com/users/dealii/events{/privacy}","received_events_url":"https://api.github.com/users/dealii/received_events","type":"Organization","site_admin":false},"repo":{"id":21943980,"name":"dealii","full_name":"dealii/dealii","owner":{"login":"dealii","id":7506070,"avatar_url":"https://avatars.githubusercontent.com/u/7506070?v=3","gravatar_id":"","url":"https://api.github.com/users/dealii","html_url":"https://github.com/dealii","followers_url":"https://api.github.com/users/dealii/followers","following_url":"https://api.github.com/users/dealii/following{/other_user}","gists_url":"https://api.github.com/users/dealii/gists{/gist_id}","starred_url":"https://api.github.com/users/dealii/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dealii/subscriptions","organizations_url":"https://api.github.com/users/dealii/orgs","repos_url":"https://api.github.com/users/dealii/repos","events_url":"https://api.github.com/users/dealii/events{/privacy}","received_events_url":"https://api.github.com/users/dealii/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dealii/dealii","description":"The development repository for the deal.II finite element library.","fork":false,"url":"https://api.github.com/repos/dealii/dealii","forks_url":"https://api.github.com/repos/dealii/dealii/forks","keys_url":"https://api.github.com/repos/dealii/dealii/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dealii/dealii/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dealii/dealii/teams","hooks_url":"https://api.github.com/repos/dealii/dealii/hooks","issue_events_url":"https://api.github.com/repos/dealii/dealii/issues/events{/number}","events_url":"https://api.github.com/repos/dealii/dealii/events","assignees_url":"https://api.github.com/repos/dealii/dealii/assignees{/user}","branches_url":"https://api.github.com/repos/dealii/dealii/branches{/branch}","tags_url":"https://api.github.com/repos/dealii/dealii/tags","blobs_url":"https://api.github.com/repos/dealii/dealii/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dealii/dealii/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dealii/dealii/git/refs{/sha}","trees_url":"https://api.github.com/repos/dealii/dealii/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dealii/dealii/statuses/{sha}","languages_url":"https://api.github.com/repos/dealii/dealii/languages","stargazers_url":"https://api.github.com/repos/dealii/dealii/stargazers","contributors_url":"https://api.github.com/repos/dealii/dealii/contributors","subscribers_url":"https://api.github.com/repos/dealii/dealii/subscribers","subscription_url":"https://api.github.com/repos/dealii/dealii/subscription","commits_url":"https://api.github.com/repos/dealii/dealii/commits{/sha}","git_commits_url":"https://api.github.com/repos/dealii/dealii/git/commits{/sha}","comments_url":"https://api.github.com/repos/dealii/dealii/comments{/number}","issue_comment_url":"https://api.github.com/repos/dealii/dealii/issues/comments{/number}","contents_url":"https://api.github.com/repos/dealii/dealii/contents/{+path}","compare_url":"https://api.github.com/repos/dealii/dealii/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dealii/dealii/merges","archive_url":"https://api.github.com/repos/dealii/dealii/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dealii/dealii/downloads","issues_url":"https://api.github.com/repos/dealii/dealii/issues{/number}","pulls_url":"https://api.github.com/repos/dealii/dealii/pulls{/number}","milestones_url":"https://api.github.com/repos/dealii/dealii/milestones{/number}","notifications_url":"https://api.github.com/repos/dealii/dealii/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dealii/dealii/labels{/name}","releases_url":"https://api.github.com/repos/dealii/dealii/releases{/id}","created_at":"2014-07-17T14:00:26Z","updated_at":"2015-07-11T14:07:56Z","pushed_at":"2015-07-16T13:03:16Z","git_url":"git://github.com/dealii/dealii.git","ssh_url":"git@github.com:dealii/dealii.git","clone_url":"https://github.com/dealii/dealii.git","svn_url":"https://github.com/dealii/dealii","homepage":"http://www.dealii.org/","size":151799,"stargazers_count":71,"watchers_count":71,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":84,"mirror_url":null,"open_issues_count":96,"forks":84,"open_issues":96,"watchers":71,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dealii/dealii/pulls/1122"},"html":{"href":"https://github.com/dealii/dealii/pull/1122"},"issue":{"href":"https://api.github.com/repos/dealii/dealii/issues/1122"},"comments":{"href":"https://api.github.com/repos/dealii/dealii/issues/1122/comments"},"review_comments":{"href":"https://api.github.com/repos/dealii/dealii/pulls/1122/comments"},"review_comment":{"href":"https://api.github.com/repos/dealii/dealii/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dealii/dealii/pulls/1122/commits"},"statuses":{"href":"https://api.github.com/repos/dealii/dealii/statuses/9a5b9f383e5771023a8c9c594c90c1cef62dc3eb"}}}}