24 #ifndef PDCOM5_SIZETYPEINFO_H 25 #define PDCOM5_SIZETYPEINFO_H 56 size_t element_size) noexcept :
57 type(type), ctype(ctype), element_size(element_size)
64 using UnderlyingType = std::vector<unsigned int>;
65 UnderlyingType size_info;
67 SizeInfo(UnderlyingType size_info) : size_info(std::move(size_info)) {}
73 return size_info.size() == 1 and size_info[0] == 1;
75 bool isVector()
const {
return size_info.size() == 1 and size_info[0] > 1; }
76 std::size_t dimension()
const noexcept {
return size_info.size(); }
77 unsigned int operator[](std::size_t index)
const 79 return size_info[index];
81 typename UnderlyingType::const_iterator begin()
const 83 return size_info.begin();
86 typename UnderlyingType::const_iterator end()
const 88 return size_info.end();
90 std::size_t totalElements()
const 93 for (
auto i : size_info)
97 static SizeInfo RowVector(
unsigned int rows) {
return {{1, rows}}; }
98 static SizeInfo Matrix(
unsigned int rows,
unsigned int cols)
100 UnderlyingType u {2, 0};
109 #endif // PDCOM5_SIZETYPEINFO_H Size of a Variable.
Definition: SizeTypeInfo.h:62
Type of a Variable.
Definition: SizeTypeInfo.h:33
library version string as "major.minor.patch"
Definition: details.h:37