IJK.h 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. #pragma once
  2. #include "basicTypes.h"
  3. #include "TASSERT.h"
  4. #include "LightweightVector.h"
  5. namespace tecplot
  6. {
  7. namespace ___3933
  8. {
  9. class ___1844
  10. {
  11. private:
  12. static ___81 const BAD_VALUE = BAD_ANY_INDEX;
  13. union
  14. {
  15. ___81 m_iValue;
  16. ___81 m_numFENodes;
  17. };
  18. union
  19. {
  20. ___81 m_jValue;
  21. ___81 m_numFECells;
  22. };
  23. union
  24. {
  25. ___81 m_kValue;
  26. ___81 m_numFECorners;
  27. };
  28. ___81 m_ijValue;
  29. public:
  30. ___1844(___81 ___1841, ___81 ___2113, ___81 ___2158) : m_iValue(___1841), m_jValue(___2113), m_kValue(___2158), m_ijValue(___1841 * ___2113) {}
  31. ___1844(___1844 const &___1843) : m_iValue(___1843.m_iValue), m_jValue(___1843.m_jValue), m_kValue(___1843.m_kValue), m_ijValue(___1843.m_ijValue) {}
  32. ___1844() : m_iValue(BAD_VALUE), m_jValue(BAD_VALUE), m_kValue(BAD_VALUE) {}
  33. bool ___2067(void) const
  34. {
  35. REQUIRE(IMPLICATION(m_iValue == BAD_VALUE, *this == BAD_VALUE));
  36. REQUIRE(IMPLICATION(m_iValue != BAD_VALUE, m_iValue * m_jValue == m_ijValue));
  37. return m_iValue != BAD_VALUE;
  38. }
  39. void invalidate(void) { m_iValue = m_jValue = m_kValue = m_ijValue = BAD_VALUE; }
  40. ___81 i(void) const { return m_iValue; }
  41. ___81 ___2105(void) const { return m_jValue; }
  42. ___81 ___2134(void) const { return m_kValue; }
  43. void setI(___81 ___1841)
  44. {
  45. m_iValue = ___1841;
  46. m_ijValue = m_jValue * m_iValue;
  47. }
  48. void setJ(___81 ___2113)
  49. {
  50. m_jValue = ___2113;
  51. m_ijValue = m_jValue * m_iValue;
  52. }
  53. void ___3497(___81 ___2158) { m_kValue = ___2158; }
  54. ___465 ___1668(void) const
  55. {
  56. REQUIRE(m_numFECells <= MAX_NUM_CELLS);
  57. return ___465(m_numFECells);
  58. }
  59. ___682 ___1669(void) const
  60. {
  61. REQUIRE(m_numFECorners <= MAX_NUM_CELL_CORNERS);
  62. return ___682(m_numFECorners);
  63. }
  64. ___2718 ___1670(void) const
  65. {
  66. REQUIRE(m_numFENodes <= MAX_NUM_NODES);
  67. return ___2718(m_numFENodes);
  68. }
  69. void setFENumCells(___81 ___2781) { m_numFECells = ___2781; }
  70. void ___3485(___682 ___2789) { m_numFECorners = ___2789; }
  71. void setFENumNodes(___81 ___2821) { m_numFENodes = ___2821; }
  72. void setIJK(___1844 const &___1843)
  73. {
  74. REQUIRE(___1843 >= 0);
  75. m_iValue = ___1843.i();
  76. m_jValue = ___1843.___2105();
  77. m_kValue = ___1843.___2134();
  78. }
  79. void operator=(___81 const ___4298)
  80. {
  81. m_iValue = ___4298;
  82. m_jValue = ___4298;
  83. m_kValue = ___4298;
  84. m_ijValue = ___4298 * ___4298;
  85. }
  86. bool operator==(___81 const ___4298) const { return m_iValue == ___4298 && m_jValue == ___4298 && m_kValue == ___4298; }
  87. bool operator==(___1844 const &___1843) const { return m_iValue == ___1843.m_iValue && m_jValue == ___1843.m_jValue && m_kValue == ___1843.m_kValue; }
  88. bool operator!=(___81 const ___4298) const { return m_iValue != ___4298 || m_jValue != ___4298 || m_kValue != ___4298; }
  89. bool operator!=(___1844 const &___1843) const { return m_iValue != ___1843.m_iValue || m_jValue != ___1843.m_jValue || m_kValue != ___1843.m_kValue; }
  90. bool operator>(___81 const ___4298) const { return m_iValue > ___4298 && m_jValue > ___4298 && m_kValue > ___4298; }
  91. bool operator>(___1844 const &___1843) const { return m_iValue > ___1843.m_iValue && m_jValue > ___1843.m_jValue && m_kValue > ___1843.m_kValue; }
  92. bool operator>=(___81 const ___4298) const { return m_iValue >= ___4298 && m_jValue >= ___4298 && m_kValue >= ___4298; }
  93. bool operator>=(___1844 const &___1843) const { return m_iValue >= ___1843.m_iValue && m_jValue >= ___1843.m_jValue && m_kValue >= ___1843.m_kValue; }
  94. bool operator<(___81 const ___4298) const { return m_iValue < ___4298 && m_jValue < ___4298 && m_kValue < ___4298; }
  95. bool operator<(___1844 const &___1843) const { return m_iValue < ___1843.m_iValue && m_jValue < ___1843.m_jValue && m_kValue < ___1843.m_kValue; }
  96. bool operator<=(___81 const ___4298) const { return m_iValue <= ___4298 && m_jValue <= ___4298 && m_kValue <= ___4298; }
  97. bool operator<=(___1844 const &___1843) const { return m_iValue <= ___1843.m_iValue && m_jValue <= ___1843.m_jValue && m_kValue <= ___1843.m_kValue; }
  98. ___1844 operator+(___81 const ___4298) const { return ___1844(m_iValue + ___4298, m_jValue + ___4298, m_kValue + ___4298); }
  99. ___1844 operator+(___1844 const &___1843) const { return ___1844(m_iValue + ___1843.m_iValue, m_jValue + ___1843.m_jValue, m_kValue + ___1843.m_kValue); }
  100. ___1844 operator-(___81 const ___4298) const
  101. {
  102. ___1844 ___3358(m_iValue - ___4298, m_jValue - ___4298, m_kValue - ___4298);
  103. ENSURE(___3358 <= *this);
  104. return ___3358;
  105. }
  106. ___1844 operator-(___1844 const &___1843) const
  107. {
  108. ___1844 ___3358(m_iValue - ___1843.m_iValue, m_jValue - ___1843.m_jValue, m_kValue - ___1843.m_kValue);
  109. ENSURE(___3358 <= *this);
  110. return ___3358;
  111. }
  112. ___1844 operator*(___81 const ___4298) const { return ___1844(m_iValue * ___4298, m_jValue * ___4298, m_kValue * ___4298); }
  113. ___1844 operator*(___1844 const &___1843) const { return ___1844(m_iValue * ___1843.m_iValue, m_jValue * ___1843.m_jValue, m_kValue * ___1843.m_kValue); }
  114. ___1844 operator/(___81 const ___4298) const { return ___1844(m_iValue / ___4298, m_jValue / ___4298, m_kValue / ___4298); }
  115. ___1844 operator/(___1844 const &___1843) const { return ___1844(m_iValue / ___1843.m_iValue, m_jValue / ___1843.m_jValue, m_kValue / ___1843.m_kValue); }
  116. ___1844 operator%(___81 const ___4298) const { return ___1844(m_iValue % ___4298, m_jValue % ___4298, m_kValue % ___4298); }
  117. ___1844 operator%(___1844 const &___1843) const { return ___1844(m_iValue % ___1843.m_iValue, m_jValue % ___1843.m_jValue, m_kValue % ___1843.m_kValue); }
  118. ___1844 &operator+=(___1844 const &___1843)
  119. {
  120. m_iValue += ___1843.m_iValue;
  121. m_jValue += ___1843.m_jValue;
  122. m_kValue += ___1843.m_kValue;
  123. m_ijValue = m_iValue * m_jValue;
  124. return *this;
  125. }
  126. ___1844 &operator-=(___1844 const &___1843)
  127. {
  128. m_iValue -= ___1843.m_iValue;
  129. m_jValue -= ___1843.m_jValue;
  130. m_kValue -= ___1843.m_kValue;
  131. m_ijValue = m_iValue * m_jValue;
  132. return *this;
  133. }
  134. ___1844 minOp(___81 const ___4298) const { return ___1844(std::min(m_iValue, ___4298), std::min(m_jValue, ___4298), std::min(m_kValue, ___4298)); }
  135. ___1844 minOp(___1844 const &___1843) const { return ___1844(std::min(m_iValue, ___1843.m_iValue), std::min(m_jValue, ___1843.m_jValue), std::min(m_kValue, ___1843.m_kValue)); }
  136. ___1844 maxOp(___81 const ___4298) const { return ___1844(std::max(m_iValue, ___4298), std::max(m_jValue, ___4298), std::max(m_kValue, ___4298)); }
  137. ___1844 maxOp(___1844 const &___1843) const { return ___1844(std::max(m_iValue, ___1843.m_iValue), std::max(m_jValue, ___1843.m_jValue), std::max(m_kValue, ___1843.m_kValue)); }
  138. ___1844 getCellIJK(void) const
  139. {
  140. ___1844 const ___3358 = maxOp(2) - 1;
  141. return ___3358;
  142. }
  143. ___81 ___461(void) const { return std::max(m_iValue, ___81(2)) - 1; }
  144. ___81 ___466(void) const { return std::max(m_jValue, ___81(2)) - 1; }
  145. ___81 ___467(void) const { return std::max(m_kValue, ___81(2)) - 1; }
  146. ___81 blockSize(void) const { return m_ijValue * m_kValue; }
  147. ___2718 ___1768(void) const { return ___2718(blockSize()); }
  148. ___465 getNumContiguousCells(void) const { return ___465(getCellIJK().blockSize()); }
  149. ___465 getNumPaddedCells(void) const { return ___465(i() * ___2105() * ___467()); }
  150. inline ___81 iFromOffset(___81 itemOffset) const
  151. {
  152. REQUIRE(itemOffset < blockSize());
  153. return itemOffset % m_iValue;
  154. }
  155. inline ___81 jFromOffset(___81 itemOffset) const
  156. {
  157. REQUIRE(itemOffset < blockSize());
  158. return (itemOffset / m_iValue) % m_jValue;
  159. }
  160. inline ___81 kFromOffset(___81 itemOffset) const
  161. {
  162. REQUIRE(itemOffset < blockSize());
  163. return (itemOffset / m_iValue) / m_jValue;
  164. }
  165. ___1844 ijkAtOffset(___81 itemOffset) const
  166. {
  167. REQUIRE(itemOffset < blockSize());
  168. if (itemOffset < ___2182 && m_ijValue < ___2182)
  169. {
  170. int32_t const ijValue32 = static_cast<int32_t>(m_ijValue);
  171. int32_t const iValue32 = static_cast<int32_t>(m_iValue);
  172. int32_t itemOffset32 = static_cast<int32_t>(itemOffset);
  173. int32_t const kk32 = itemOffset32 / ijValue32;
  174. itemOffset32 -= kk32 * ijValue32;
  175. int32_t const jj32 = itemOffset32 / iValue32;
  176. ___81 const ___2113 = jj32;
  177. ___81 const ___1841 = itemOffset32 - jj32 * iValue32;
  178. ___81 const ___2158 = kk32;
  179. return ___1844(___1841, ___2113, ___2158);
  180. }
  181. else
  182. {
  183. ___81 const ___1841 = iFromOffset(itemOffset);
  184. ___81 const ___2113 = jFromOffset(itemOffset);
  185. ___81 const ___2158 = kFromOffset(itemOffset);
  186. return ___1844(___1841, ___2113, ___2158);
  187. }
  188. }
  189. ___81 offsetAtIJK(___1844 const &___1843) const
  190. {
  191. REQUIRE(___1843 >= 0 && ___1843 < *this);
  192. ___81 ___2865 = ___1843.m_iValue + m_iValue * (___1843.m_jValue + m_jValue * ___1843.m_kValue);
  193. ENSURE(___2865 < blockSize());
  194. return ___2865;
  195. }
  196. };
  197. inline bool operator!=(___81 const ___4298, ___1844 const &___1843) { return ___1843 != ___4298; }
  198. inline bool operator==(___81 const ___4298, ___1844 const &___1843) { return ___1843 == ___4298; }
  199. inline bool operator>(___81 const ___4298, ___1844 const &___1843) { return ___1843 < ___4298; }
  200. inline bool operator>=(___81 const ___4298, ___1844 const &___1843) { return ___1843 <= ___4298; }
  201. inline bool operator<(___81 const ___4298, ___1844 const &___1843) { return ___1843 > ___4298; }
  202. inline bool operator<=(___81 const ___4298, ___1844 const &___1843) { return ___1843 >= ___4298; }
  203. inline ___81 ___1877(___1844 const &___1880, ___1844 const &___1852)
  204. {
  205. REQUIRE(0 <= ___1880 && ___1880 <= ___1852);
  206. ___1844 ijkSpan = ___1852 - ___1880 + 1;
  207. return ijkSpan.___1768();
  208. }
  209. inline ___81 maxComponent(___1844 const &___1843)
  210. {
  211. ___81 maxComp = std::max(___1843.i(), ___1843.___2105());
  212. if (maxComp < ___1843.___2134())
  213. maxComp = ___1843.___2134();
  214. return maxComp;
  215. }
  216. #ifdef LWV_SPECIALIZE_PLAIN_DATA_VECTORS
  217. template <>
  218. class ___2240<___1844> : public ___3094<___1844>
  219. {
  220. };
  221. #endif
  222. }
  223. }