{"action":"created","comment":{"url":"https://api.github.com/repos/ufz/ogs/pulls/comments/73097840","id":73097840,"diff_hunk":"@@ -0,0 +1,123 @@\n+/**\n+ * \\copyright\n+ * Copyright (c) 2012-2016, OpenGeoSys Community (http://www.opengeosys.org)\n+ *            Distributed under a Modified BSD License.\n+ *              See accompanying file LICENSE.txt or\n+ *              http://www.opengeosys.org/project/license\n+ *\n+ */\n+\n+#ifndef NUMLIB_NAMED_FUNCTION\n+#define NUMLIB_NAMED_FUNCTION\n+\n+#include <string>\n+#include <vector>\n+#include <functional>\n+#include <memory>\n+#include <cassert>\n+#include <type_traits>\n+\n+namespace detail\n+{\n+//! Checks if all types \\c Ts are the same as \\c TRef.\n+template<typename TRef, typename... Ts>\n+struct AllTypesSameAs;\n+\n+template<typename TRef, typename T1, typename... Ts>\n+struct AllTypesSameAs<TRef, T1, Ts...>\n+{\n+    static const bool value = std::is_same<TRef, T1>::value\n+        && AllTypesSameAs<TRef, Ts...>::value;\n+};\n+\n+template<typename TRef>\n+struct AllTypesSameAs<TRef>\n+{\n+    static const bool value = true;\n+};\n+\n+template<typename TRef, typename T1, typename... Ts>\n+const bool AllTypesSameAs<TRef, T1, Ts...>::value;\n+\n+template<typename TRef>\n+const bool AllTypesSameAs<TRef>::value;\n+\n+} // namespace detail\n+\n+\n+\n+namespace NumLib\n+{\n+//! Maximum number of function arguments supported by NamedFunction.\n+const int MAX_FUNCTION_ARGS = 32;\n+\n+//! Stores a function object along with a name for it and information about its\n+//! arguments.\n+class NamedFunction final\n+{\n+public:\n+    using ArgumentInfo = std::string;\n+\n+    /*! Constructs a new named function.\n+     *\n+     * \\param name the function's name\n+     * \\param arguments names  of arguments of the function\n+     * \\param function the actual function object\n+     */\n+    template <typename ReturnType, typename... Arguments>\n+    NamedFunction(\n+        std::string const& name,\n+        std::vector<ArgumentInfo>&& arguments,","path":"NumLib/NamedFunction.h","position":70,"original_position":70,"commit_id":"2a67131580b556dd5abb709281e7514341b832ab","original_commit_id":"2a67131580b556dd5abb709281e7514341b832ab","user":{"login":"norihiro-w","id":800408,"avatar_url":"https://avatars.githubusercontent.com/u/800408?v=3","gravatar_id":"","url":"https://api.github.com/users/norihiro-w","html_url":"https://github.com/norihiro-w","followers_url":"https://api.github.com/users/norihiro-w/followers","following_url":"https://api.github.com/users/norihiro-w/following{/other_user}","gists_url":"https://api.github.com/users/norihiro-w/gists{/gist_id}","starred_url":"https://api.github.com/users/norihiro-w/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/norihiro-w/subscriptions","organizations_url":"https://api.github.com/users/norihiro-w/orgs","repos_url":"https://api.github.com/users/norihiro-w/repos","events_url":"https://api.github.com/users/norihiro-w/events{/privacy}","received_events_url":"https://api.github.com/users/norihiro-w/received_events","type":"User","site_admin":false},"body":"better to name it `argument_names`","created_at":"2016-08-02T05:53:28Z","updated_at":"2016-08-02T05:53:28Z","html_url":"https://github.com/ufz/ogs/pull/1314#discussion_r73097840","pull_request_url":"https://api.github.com/repos/ufz/ogs/pulls/1314","_links":{"self":{"href":"https://api.github.com/repos/ufz/ogs/pulls/comments/73097840"},"html":{"href":"https://github.com/ufz/ogs/pull/1314#discussion_r73097840"},"pull_request":{"href":"https://api.github.com/repos/ufz/ogs/pulls/1314"}}},"pull_request":{"url":"https://api.github.com/repos/ufz/ogs/pulls/1314","id":76453060,"html_url":"https://github.com/ufz/ogs/pull/1314","diff_url":"https://github.com/ufz/ogs/pull/1314.diff","patch_url":"https://github.com/ufz/ogs/pull/1314.patch","issue_url":"https://api.github.com/repos/ufz/ogs/issues/1314","number":1314,"state":"open","locked":false,"title":"Named Functions","user":{"login":"chleh","id":10530151,"avatar_url":"https://avatars.githubusercontent.com/u/10530151?v=3","gravatar_id":"","url":"https://api.github.com/users/chleh","html_url":"https://github.com/chleh","followers_url":"https://api.github.com/users/chleh/followers","following_url":"https://api.github.com/users/chleh/following{/other_user}","gists_url":"https://api.github.com/users/chleh/gists{/gist_id}","starred_url":"https://api.github.com/users/chleh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chleh/subscriptions","organizations_url":"https://api.github.com/users/chleh/orgs","repos_url":"https://api.github.com/users/chleh/repos","events_url":"https://api.github.com/users/chleh/events{/privacy}","received_events_url":"https://api.github.com/users/chleh/received_events","type":"User","site_admin":false},"body":"Follow-up of #1312.\r\n\r\nThis PR adds classes that enable the construction of expression trees dynamically at runtime.\r\nThat roughly goes into the direction discussed recently in the frame of constitutive relations.\r\nHowever, I want to use the code provided here at first to compute secondary variables.\r\n\r\nFor a usage example, please have a look at the tests. There will be a follow-up PR coupling this PR with FEM processes, soon.","created_at":"2016-07-06T15:35:30Z","updated_at":"2016-08-02T05:53:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ce6a17ebb2ddf08472ba55112238ed805371f3d1","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/ufz/ogs/pulls/1314/commits","review_comments_url":"https://api.github.com/repos/ufz/ogs/pulls/1314/comments","review_comment_url":"https://api.github.com/repos/ufz/ogs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ufz/ogs/issues/1314/comments","statuses_url":"https://api.github.com/repos/ufz/ogs/statuses/2a67131580b556dd5abb709281e7514341b832ab","head":{"label":"chleh:named-functions","ref":"named-functions","sha":"2a67131580b556dd5abb709281e7514341b832ab","user":{"login":"chleh","id":10530151,"avatar_url":"https://avatars.githubusercontent.com/u/10530151?v=3","gravatar_id":"","url":"https://api.github.com/users/chleh","html_url":"https://github.com/chleh","followers_url":"https://api.github.com/users/chleh/followers","following_url":"https://api.github.com/users/chleh/following{/other_user}","gists_url":"https://api.github.com/users/chleh/gists{/gist_id}","starred_url":"https://api.github.com/users/chleh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chleh/subscriptions","organizations_url":"https://api.github.com/users/chleh/orgs","repos_url":"https://api.github.com/users/chleh/repos","events_url":"https://api.github.com/users/chleh/events{/privacy}","received_events_url":"https://api.github.com/users/chleh/received_events","type":"User","site_admin":false},"repo":{"id":40347084,"name":"ogs6","full_name":"chleh/ogs6","owner":{"login":"chleh","id":10530151,"avatar_url":"https://avatars.githubusercontent.com/u/10530151?v=3","gravatar_id":"","url":"https://api.github.com/users/chleh","html_url":"https://github.com/chleh","followers_url":"https://api.github.com/users/chleh/followers","following_url":"https://api.github.com/users/chleh/following{/other_user}","gists_url":"https://api.github.com/users/chleh/gists{/gist_id}","starred_url":"https://api.github.com/users/chleh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chleh/subscriptions","organizations_url":"https://api.github.com/users/chleh/orgs","repos_url":"https://api.github.com/users/chleh/repos","events_url":"https://api.github.com/users/chleh/events{/privacy}","received_events_url":"https://api.github.com/users/chleh/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/chleh/ogs6","description":"Experimental OGS-6 source code","fork":true,"url":"https://api.github.com/repos/chleh/ogs6","forks_url":"https://api.github.com/repos/chleh/ogs6/forks","keys_url":"https://api.github.com/repos/chleh/ogs6/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chleh/ogs6/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chleh/ogs6/teams","hooks_url":"https://api.github.com/repos/chleh/ogs6/hooks","issue_events_url":"https://api.github.com/repos/chleh/ogs6/issues/events{/number}","events_url":"https://api.github.com/repos/chleh/ogs6/events","assignees_url":"https://api.github.com/repos/chleh/ogs6/assignees{/user}","branches_url":"https://api.github.com/repos/chleh/ogs6/branches{/branch}","tags_url":"https://api.github.com/repos/chleh/ogs6/tags","blobs_url":"https://api.github.com/repos/chleh/ogs6/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chleh/ogs6/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chleh/ogs6/git/refs{/sha}","trees_url":"https://api.github.com/repos/chleh/ogs6/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chleh/ogs6/statuses/{sha}","languages_url":"https://api.github.com/repos/chleh/ogs6/languages","stargazers_url":"https://api.github.com/repos/chleh/ogs6/stargazers","contributors_url":"https://api.github.com/repos/chleh/ogs6/contributors","subscribers_url":"https://api.github.com/repos/chleh/ogs6/subscribers","subscription_url":"https://api.github.com/repos/chleh/ogs6/subscription","commits_url":"https://api.github.com/repos/chleh/ogs6/commits{/sha}","git_commits_url":"https://api.github.com/repos/chleh/ogs6/git/commits{/sha}","comments_url":"https://api.github.com/repos/chleh/ogs6/comments{/number}","issue_comment_url":"https://api.github.com/repos/chleh/ogs6/issues/comments{/number}","contents_url":"https://api.github.com/repos/chleh/ogs6/contents/{+path}","compare_url":"https://api.github.com/repos/chleh/ogs6/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chleh/ogs6/merges","archive_url":"https://api.github.com/repos/chleh/ogs6/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chleh/ogs6/downloads","issues_url":"https://api.github.com/repos/chleh/ogs6/issues{/number}","pulls_url":"https://api.github.com/repos/chleh/ogs6/pulls{/number}","milestones_url":"https://api.github.com/repos/chleh/ogs6/milestones{/number}","notifications_url":"https://api.github.com/repos/chleh/ogs6/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chleh/ogs6/labels{/name}","releases_url":"https://api.github.com/repos/chleh/ogs6/releases{/id}","deployments_url":"https://api.github.com/repos/chleh/ogs6/deployments","created_at":"2015-08-07T07:24:24Z","updated_at":"2016-01-14T16:07:04Z","pushed_at":"2016-08-01T15:23:12Z","git_url":"git://github.com/chleh/ogs6.git","ssh_url":"git@github.com:chleh/ogs6.git","clone_url":"https://github.com/chleh/ogs6.git","svn_url":"https://github.com/chleh/ogs6","homepage":"www.opengeosys.org","size":17413,"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":"ufz:master","ref":"master","sha":"8cdb77912ad73761630cb0c15ecbee8784b6bb6c","user":{"login":"ufz","id":767517,"avatar_url":"https://avatars.githubusercontent.com/u/767517?v=3","gravatar_id":"","url":"https://api.github.com/users/ufz","html_url":"https://github.com/ufz","followers_url":"https://api.github.com/users/ufz/followers","following_url":"https://api.github.com/users/ufz/following{/other_user}","gists_url":"https://api.github.com/users/ufz/gists{/gist_id}","starred_url":"https://api.github.com/users/ufz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ufz/subscriptions","organizations_url":"https://api.github.com/users/ufz/orgs","repos_url":"https://api.github.com/users/ufz/repos","events_url":"https://api.github.com/users/ufz/events{/privacy}","received_events_url":"https://api.github.com/users/ufz/received_events","type":"Organization","site_admin":false},"repo":{"id":1701384,"name":"ogs","full_name":"ufz/ogs","owner":{"login":"ufz","id":767517,"avatar_url":"https://avatars.githubusercontent.com/u/767517?v=3","gravatar_id":"","url":"https://api.github.com/users/ufz","html_url":"https://github.com/ufz","followers_url":"https://api.github.com/users/ufz/followers","following_url":"https://api.github.com/users/ufz/following{/other_user}","gists_url":"https://api.github.com/users/ufz/gists{/gist_id}","starred_url":"https://api.github.com/users/ufz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ufz/subscriptions","organizations_url":"https://api.github.com/users/ufz/orgs","repos_url":"https://api.github.com/users/ufz/repos","events_url":"https://api.github.com/users/ufz/events{/privacy}","received_events_url":"https://api.github.com/users/ufz/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ufz/ogs","description":"Experimental OGS-6 source code","fork":false,"url":"https://api.github.com/repos/ufz/ogs","forks_url":"https://api.github.com/repos/ufz/ogs/forks","keys_url":"https://api.github.com/repos/ufz/ogs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ufz/ogs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ufz/ogs/teams","hooks_url":"https://api.github.com/repos/ufz/ogs/hooks","issue_events_url":"https://api.github.com/repos/ufz/ogs/issues/events{/number}","events_url":"https://api.github.com/repos/ufz/ogs/events","assignees_url":"https://api.github.com/repos/ufz/ogs/assignees{/user}","branches_url":"https://api.github.com/repos/ufz/ogs/branches{/branch}","tags_url":"https://api.github.com/repos/ufz/ogs/tags","blobs_url":"https://api.github.com/repos/ufz/ogs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ufz/ogs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ufz/ogs/git/refs{/sha}","trees_url":"https://api.github.com/repos/ufz/ogs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ufz/ogs/statuses/{sha}","languages_url":"https://api.github.com/repos/ufz/ogs/languages","stargazers_url":"https://api.github.com/repos/ufz/ogs/stargazers","contributors_url":"https://api.github.com/repos/ufz/ogs/contributors","subscribers_url":"https://api.github.com/repos/ufz/ogs/subscribers","subscription_url":"https://api.github.com/repos/ufz/ogs/subscription","commits_url":"https://api.github.com/repos/ufz/ogs/commits{/sha}","git_commits_url":"https://api.github.com/repos/ufz/ogs/git/commits{/sha}","comments_url":"https://api.github.com/repos/ufz/ogs/comments{/number}","issue_comment_url":"https://api.github.com/repos/ufz/ogs/issues/comments{/number}","contents_url":"https://api.github.com/repos/ufz/ogs/contents/{+path}","compare_url":"https://api.github.com/repos/ufz/ogs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ufz/ogs/merges","archive_url":"https://api.github.com/repos/ufz/ogs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ufz/ogs/downloads","issues_url":"https://api.github.com/repos/ufz/ogs/issues{/number}","pulls_url":"https://api.github.com/repos/ufz/ogs/pulls{/number}","milestones_url":"https://api.github.com/repos/ufz/ogs/milestones{/number}","notifications_url":"https://api.github.com/repos/ufz/ogs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ufz/ogs/labels{/name}","releases_url":"https://api.github.com/repos/ufz/ogs/releases{/id}","deployments_url":"https://api.github.com/repos/ufz/ogs/deployments","created_at":"2011-05-04T14:09:57Z","updated_at":"2016-04-10T21:29:50Z","pushed_at":"2016-08-01T16:14:55Z","git_url":"git://github.com/ufz/ogs.git","ssh_url":"git@github.com:ufz/ogs.git","clone_url":"https://github.com/ufz/ogs.git","svn_url":"https://github.com/ufz/ogs","homepage":"www.opengeosys.org","size":19195,"stargazers_count":19,"watchers_count":19,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":48,"mirror_url":null,"open_issues_count":108,"forks":48,"open_issues":108,"watchers":19,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ufz/ogs/pulls/1314"},"html":{"href":"https://github.com/ufz/ogs/pull/1314"},"issue":{"href":"https://api.github.com/repos/ufz/ogs/issues/1314"},"comments":{"href":"https://api.github.com/repos/ufz/ogs/issues/1314/comments"},"review_comments":{"href":"https://api.github.com/repos/ufz/ogs/pulls/1314/comments"},"review_comment":{"href":"https://api.github.com/repos/ufz/ogs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ufz/ogs/pulls/1314/commits"},"statuses":{"href":"https://api.github.com/repos/ufz/ogs/statuses/2a67131580b556dd5abb709281e7514341b832ab"}}}}
{"actor":{"display_login":"norihiro-w"}}