63 template <
class InputIterator>
70 static_cast<std::vector<optint64_t>*
>(
this)->
operator=(v);
75 static_cast<std::vector<optint64_t>*
>(
this)->
operator=(v);
105 :
std::vector<int64_t>(dim_sizes) {}
108 :
std::vector<int64_t>(dim_sizes) {}
113 :
std::vector<int64_t>(n, initial_value) {}
115 template <
class InputIterator>
117 :
std::vector<int64_t>(first, last) {}
122 static_cast<std::vector<int64_t>*
>(
this)->
operator=(v);
127 static_cast<std::vector<int64_t>*
>(
this)->
operator=(v);
132 if (this->
size() == 0) {
135 return std::accumulate(
136 this->begin(), this->end(), 1LL,
137 [
this](
const int64_t& lhs,
const int64_t& rhs) -> int64_t {
138 if (lhs < 0 || rhs < 0) {
140 "Shape {} cannot contain negative dimensions.",
143 return std::multiplies<int64_t>()(lhs, rhs);
151 return operator[](0);
158 const std::string msg =
"")
const {
159 if (!IsCompatible(dsv)) {
171 if (
size() != dsv.size()) {
174 for (
size_t i = 0; i <
size(); ++i) {
175 if (dsv[i].has_value() && dsv[i].value() != at(i)) {
SizeVector()
Definition: SizeVector.h:119
DynamicSizeVector()
Definition: SizeVector.h:67
Definition: SizeVector.h:47
SizeVector & operator=(SizeVector &&v)
Definition: SizeVector.h:126
void LogError(const char *format, const Args &... args)
Definition: Console.h:176
SizeVector(int64_t n, int64_t initial_value=0)
Definition: SizeVector.h:112
Definition: Optional.h:912
DynamicSizeVector(const std::vector< optint64_t > &dim_sizes)
Definition: SizeVector.h:54
int64_t GetLength() const
Definition: SizeVector.h:147
DynamicSizeVector & operator=(const DynamicSizeVector &v)
Definition: SizeVector.h:69
SizeVector(const SizeVector &other)
Definition: SizeVector.h:110
DynamicSizeVector(InputIterator first, InputIterator last)
Definition: SizeVector.h:64
Definition: SizeVector.h:102
int size
Definition: FilePCD.cpp:59
constexpr bool has_value() const noexcept
Definition: Optional.h:447
std::string ToString() const
Definition: SizeVector.h:155
DynamicSizeVector(const std::initializer_list< optint64_t > &dim_sizes)
Definition: SizeVector.h:51
bool IsCompatible(const DynamicSizeVector &dsv) const
Definition: SizeVector.h:170
TR2_OPTIONAL_HOST_CONSTEXPR T const & value() const &
Definition: Optional.h:472
DynamicSizeVector & operator=(DynamicSizeVector &&v)
Definition: SizeVector.h:74
Definition: Optional.h:54
int64_t NumElements() const
Definition: SizeVector.h:131
SizeVector(const std::vector< int64_t > &dim_sizes)
Definition: SizeVector.h:107
SizeVector(InputIterator first, InputIterator last)
Definition: SizeVector.h:116
Definition: PinholeCameraIntrinsic.cpp:35
DynamicSizeVector(int64_t n, int64_t initial_value=0)
Definition: SizeVector.h:60
filament::Texture::InternalFormat format
Definition: FilamentResourceManager.cpp:191
DynamicSizeVector(const DynamicSizeVector &other)
Definition: SizeVector.h:57
SizeVector & operator=(const SizeVector &v)
Definition: SizeVector.h:121
SizeVector(const std::initializer_list< int64_t > &dim_sizes)
Definition: SizeVector.h:104
std::string ToString() const
Definition: SizeVector.h:79
void AssertCompatible(const DynamicSizeVector &dsv, const std::string msg="") const
Definition: SizeVector.h:157