">

Rank (computer programming) (original) (raw)

About DBpedia

In computer programming, rank with no further specifications is usually a synonym for (or refers to) "number of dimensions"; thus, a two-dimensional array has rank two, a three-dimensional array has rank three and so on.Strictly, no formal definition can be provided which applies to every programming language, since each of them has its own concepts, semantics and terminology; the term may not even be applicable or, to the contrary, applied with a very specific meaning in the context of a given language. Given the code above the rank of a type T can be calculated at compile time by rank_v

Property Value
dbo:abstract In computer programming, rank with no further specifications is usually a synonym for (or refers to) "number of dimensions"; thus, a two-dimensional array has rank two, a three-dimensional array has rank three and so on.Strictly, no formal definition can be provided which applies to every programming language, since each of them has its own concepts, semantics and terminology; the term may not even be applicable or, to the contrary, applied with a very specific meaning in the context of a given language. In the case of APL the notion applies to every operand; and dyads ("binary functions") have a left rank and a right rank. The box below instead shows how rank of a type and rank of an array expression could be defined (in a semi-formal style) for C++ and illustrates a simple way to calculate them at compile time. #include #include /* Rank of a type * ------------- * * Let the rank of a type T be the number of its dimensions if * it is an array; zero otherwise (which is the usual convention) */template struct rank{ static const std::size_t value = 0;};template<typename T, std::size_t N>struct rank<T[N]>{ static const std::size_t value = 1 + rank::value;};template constexpr auto rank_v = rank::value;/* Rank of an expression * * Let the rank of an expression be the rank of its type */template using unqualified_t = std::remove_cv_t<std::remove_reference_t>; template auto rankof(T&& expr){ return rank_v<unqualified_t>;} Given the code above the rank of a type T can be calculated at compile time by rank::value or the shorter form rank_v Calculating the rank of an expression can be done using rankof(expr) (en)
dbo:wikiPageID 366007 (xsd:integer)
dbo:wikiPageLength 2500 (xsd:nonNegativeInteger)
dbo:wikiPageRevisionID 956141209 (xsd:integer)
dbo:wikiPageWikiLink dbr:Matrix_(mathematics) dbc:Arrays dbr:Computer_programming dbr:Formal_semantics_of_programming_languages dbr:Rank_(J_programming_language) dbr:Rank_(linear_algebra) dbr:APL_programming_language dbr:J_(programming_language) dbc:Programming_language_topics dbr:Binary_function dbr:Programming_language
dbp:wikiPageUsesTemplate dbt:Unreferenced dbt:Compu-lang-stub
dct:subject dbc:Arrays dbc:Programming_language_topics
rdf:type owl:Thing dbo:Language schema:Language wikidata:Q315 wikidata:Q9143 yago:WikicatArrays yago:Abstraction100002137 yago:Arrangement107938773 yago:Array107939382 yago:Communication100033020 yago:Group100031264 yago:Message106598915 dbo:ProgrammingLanguage yago:Subject106599788 yago:WikicatProgrammingLanguageTopics
rdfs:comment In computer programming, rank with no further specifications is usually a synonym for (or refers to) "number of dimensions"; thus, a two-dimensional array has rank two, a three-dimensional array has rank three and so on.Strictly, no formal definition can be provided which applies to every programming language, since each of them has its own concepts, semantics and terminology; the term may not even be applicable or, to the contrary, applied with a very specific meaning in the context of a given language. Given the code above the rank of a type T can be calculated at compile time by rank_v (en)
rdfs:label Rank (computer programming) (en)
owl:sameAs freebase:Rank (computer programming) yago-res:Rank (computer programming) wikidata:Rank (computer programming) https://global.dbpedia.org/id/4tfFW
prov:wasDerivedFrom wikipedia-en:Rank_(computer_programming)?oldid=956141209&ns=0
foaf:isPrimaryTopicOf wikipedia-en:Rank_(computer_programming)
is dbo:wikiPageDisambiguates of dbr:Rank
is dbo:wikiPageRedirects of dbr:Rank_of_an_array
is dbo:wikiPageWikiLink of dbr:Dope_vector dbr:Array_(data_structure) dbr:Array_(data_type) dbr:Fortran_95_language_features dbr:Rank dbr:Rank_of_an_array
is foaf:primaryTopic of wikipedia-en:Rank_(computer_programming)