33 template<
typename T,
int Size>
51 for (
int i = 0; i < Size; ++i)
53 this->
Data[i] = scalar;
65 for (
int i = 0; i < Size; ++i)
67 this->
Data[i] = init[i];
95 assert(
"pre: index_in_bounds" && i >= 0 && i < Size);
108 for (
int i = 0; i < Size; ++i)
110 if (std::abs(this->
Data[i] - other.
Data[i]) >= tol)
121 template<
typename TR>
125 for (
int i = 0; i < Size; ++i)
127 result[i] =
static_cast<TR
>(this->
Data[i]);
142 template<
typename A,
int Size>
143 ostream& operator<<(ostream& out, const vtkTuple<A, Size>& t)
147 for (
int i = 0; i < Size; ++i)
164 ostream& operator<<(ostream& out, const vtkTuple<unsigned char, Size>& t)
168 for (
int i = 0; i < Size; ++i)
178 out << static_cast<int>(t[i]);
187 template<
typename A,
int Size>
190 for (
int i = 0; i < Size; ++i)
203 template<
typename A,
int Size>
vtkTuple(const T &scalar)
bool operator==(const vtkTuple< A, Size > &t1, const vtkTuple< A, Size > &t2)
bool operator!=(const vtkTuple< A, Size > &t1, const vtkTuple< A, Size > &t2)
vtkTuple< TR, Size > Cast() const
templated base type for containers of constant size.
T operator()(int i) const
const T & operator[](int i) const
const T * GetData() const
bool Compare(const vtkTuple< T, Size > &other, const T &tol) const