{"id":4208,"date":"2014-03-30T09:16:17","date_gmt":"2014-03-30T09:16:17","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/resolving-same-generic-name-functions-via-size-of-argument-collection-of-common-programming-errors\/"},"modified":"2014-03-30T09:16:17","modified_gmt":"2014-03-30T09:16:17","slug":"resolving-same-generic-name-functions-via-size-of-argument-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/resolving-same-generic-name-functions-via-size-of-argument-collection-of-common-programming-errors\/","title":{"rendered":"resolving same generic-name functions via size of argument-Collection of common programming errors"},"content":{"rendered":"<p>I&#8217;d like to have a function interface that resolves which specific procedure is to be used depending on the size of an array argument. I could then, for example, have a program that handles vectors with less than or exactly N elements with one procedure and longer vectors with another one. As far as I know, Fortran only resolves using types, ranks and keywords of the arguments. Why is that? Aren&#8217;t compilers intelligent enough to differentiate between arrays of different sizes or is it intrinsically impossible to write a compiler that does that?<\/p>\n<p>Is there a workaround to achieve the desired functionality? I know of course that I could write a subroutine with an if-clause to sort out which procedure to use for which array size. Wouldn&#8217;t that cost more CPU time though?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;d like to have a function interface that resolves which specific procedure is to be used depending on the size of an array argument. I could then, for example, have a program that handles vectors with less than or exactly N elements with one procedure and longer vectors with another one. As far as I [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-4208","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4208","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=4208"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4208\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=4208"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=4208"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=4208"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}