SET.h 6.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. #if defined EXTERN
  2. #undef EXTERN
  3. #endif
  4. #if defined ___3500
  5. #define EXTERN
  6. #else
  7. #define EXTERN extern
  8. #endif
  9. #ifndef _SET_H_INCLUDED
  10. #define _SET_H_INCLUDED
  11. #include "ThirdPartyHeadersBegin.h"
  12. #include <algorithm>
  13. #include <set>
  14. #include <vector>
  15. #include "ThirdPartyHeadersEnd.h"
  16. #include "RawArray.h"
  17. #include "CodeContract.h"
  18. #define ___2896(X,Y) ((int)(((X)-1)/(Y)+1)*(Y))
  19. #define ___3479 (8*sizeof(___3483))
  20. #define ___3498 (((___3480)1)<<(___3479-1))
  21. #if defined _DEBUG
  22. # define USE_FUNCTIONS_FOR_SETS
  23. #endif
  24. struct ___3502 { ___3493 size; ___3481 data; };
  25. #define ___2056(___3476) ((___3476)==NULL)
  26. inline size_t ___3482(___3501 ___3476) { REQUIRE(VALID_REF(___3476)); return ___3476->size / ___3479 * sizeof(___3483); } EXTERN ___3501 ___29(___372 ___3574); EXTERN void ___939(___3501 *___3476); EXTERN ___372 ___3496(void *___2098, ___90 ___494); EXTERN ___372 ___1201(___3501 ___3476, ___3493 max_val, ___372 ___3574); EXTERN ___372 ___676(___3501 ___1121, ___3501 ___3656, ___372 ___3574); EXTERN ___372 ___83(___3501 ___1121, ___3501 ___3656, ___372 ___3574); EXTERN void ___493(___3501 ___3476);
  27. #if defined USE_FUNCTIONS_FOR_SETS
  28. EXTERN ___372 ___17(___3501 ___3476, ___3493 ___2401, ___372 ___3574);
  29. #else
  30. #if defined __cplusplus
  31. inline ___372 ___17(___3501 ___3476, ___3493 ___2401, ___372 ___3574) { if (___3476 && (___2401 + 1 <= ___3476->size || ___1201(___3476, ___2401 + 1, ___3574))) { ___3493 word = ___2401 / ___3479; ___3480 bit = (___3480)1 << (___2401 % ___3479); ___3476->data[word] |= bit; return ___4226; } else return ___1305; }
  32. #elif defined TECPLOTKERNEL
  33. #define ___17(___3476,___2401,___3574) \
  34. (((___3476) && \
  35. ((___2401)+1 <= (___3476)->size || \
  36. ___1201((___3476), (___2401)+1, (___3574)))) \
  37. ? (((___3476)->data[(___2401) / ___3479].___1346((___3480)1 << ((___2401) % ___3479))), ___4226) \
  38. : ___1305)
  39. #else
  40. #define ___17(___3476,___2401,___3574) \
  41. (((___3476) && \
  42. ((___2401)+1 <= (___3476)->size || \
  43. ___1201((___3476), (___2401)+1, (___3574)))) \
  44. ? (((___3476)->data[(___2401) / ___3479] |= (___3480)1 << ((___2401) % ___3479)), ___4226) \
  45. : ___1305)
  46. #endif
  47. #endif
  48. EXTERN void ___3334(___3501 ___3476, ___3493 ___2401); EXTERN void ___957(___3501 ___3476, ___3493 ___2402); EXTERN ___372 ___1955(___3501 ___3476, ___3493 ___2402, ___372 ___3571);
  49. #if defined USE_FUNCTIONS_FOR_SETS
  50. EXTERN ___372 ___1956(___3501 ___3476, ___3493 ___2401);
  51. #else
  52. #if defined __cplusplus
  53. inline ___372 ___1956(___3501 ___3476, ___3493 ___2401) { if (___3476 && (0 <= ___2401 && ___2401 < ___3476->size)) { ___3493 word = ___2401 / ___3479; ___3480 bit = (___3480)1 << (___2401 % ___3479); return (___3476->data[word]&bit) != 0; } else return ___1305; }
  54. #elif defined TECPLOTKERNEL
  55. #define ___1956(___3476,___2401) ((___3476 && (0<=(___2401) && (___2401)<(___3476)->size)) \
  56. ? ((___3476)->data[(___2401)/___3479].load()&((___3480)1<<((___2401)%___3479)))!=0 \
  57. : ___1305)
  58. #else
  59. #define ___1956(___3476,___2401) ((___3476 && (0<=(___2401) && (___2401)<(___3476)->size)) \
  60. ? ((___3476)->data[(___2401)/___3479]&((___3480)1<<((___2401)%___3479)))!=0 \
  61. : ___1305)
  62. #endif
  63. #endif
  64. EXTERN ___372 ___2015(___3501 ___3476); EXTERN ___372 ___1822(___3501 ___3476); EXTERN ___3493 ___2403(___3501 ___3476); EXTERN ___372 ___2033(___3501 ___3476); EXTERN ___3493 ___1761(___3501 ___3476, ___3493 ___3682); EXTERN ___3493 ___1769(___3501 ___3476, ___3493 ___3682); EXTERN ___372 ___1175(___3501 ___3477, ___3501 ___3478); ___3501 intersection( ___3501 ___3477, ___3501 ___3478); EXTERN ___372 ___2062(___3501 ___486, ___3501 ___2973); EXTERN ___3493 ___2404(___3501 ___3476, ___3493 ___2402); EXTERN ___3493 ___2867(___3501 ___3476, ___3493 ___2866); EXTERN ___372 ___677(___3501 ___1126, ___3493 ___1125, ___3501 ___3663, ___3493 ___3662); EXTERN void ___3560(___3501 ___3476, ___3493 ___3558, ___3493 ___3559, ___3493 ___3556);
  65. #define ___1746(___3476) (___1761((___3476), ___333))
  66. #define ___1751(___3476) (___1769((___3476), ___333))
  67. #define ___1472(___2402, ___3476) \
  68. for (___2402 = ___1746((___3476)); \
  69. ___2402 != ___333; \
  70. ___2402 = ___1761((___3476), (___2402)))
  71. #define ForAllMembersInEntIndexSet(___2402, ___3476) \
  72. for (___2402 = static_cast<___1172>(___1746((___3476))); \
  73. ___2402 != static_cast<___1172>(___333); \
  74. ___2402 = static_cast<___1172>(___1761((___3476), (___2402))))
  75. #define ___1471(___2402, ___3476) \
  76. for (___2402 = ___1751((___3476)); \
  77. ___2402 != ___333; \
  78. ___2402 = ___1769((___3476), (___2402)))
  79. namespace tecplot { template <typename T> std::vector<T> ___4194(___3501 ___2100) { REQUIRE(VALID_REF(___2100) || ___2100 == 0); std::vector<T> ___3358; size_t const count = ___2403(___2100); if (count != 0) { ___3358.reserve(count); ___3493 ___2085; ___1472(___2085,___2100) ___3358.push_back(static_cast<T>(___2085)); } return ___3358; } template <typename T> inline std::set<T> ___4186(___3501 const set) { REQUIRE(VALID_REF_OR_NULL(set)); ___1172 ___4314; std::set<T> ___3358; if (set != NULL) { ___1472(___4314, set) { ___3358.insert(static_cast<T>(___4314)); } } return ___3358; } template <typename CONTAINER> ___3501 ___4186( CONTAINER const& ___2099, bool isSorted = true) { REQUIRE(IMPLICATION(isSorted && !___2099.empty(), ___2099[___2099.size()-1] == ___333 || ___2099[___2099.size()-1] == *std::max_element(&___2099[0], &___2099[0]+___2099.size()))); ___3501 ___3358 = ___29(___1305); if (___3358 == NULL) throw std::bad_alloc(); if (!___2099.empty()) { typename CONTAINER::value_type largestMember = static_cast<typename CONTAINER::value_type>(___333); if (isSorted) { for (typename CONTAINER::value_type const* iter = &___2099[___2099.size()-1]; iter >= &___2099[0]; --iter) if ((largestMember = *iter) != static_cast<typename CONTAINER::value_type>(___333)) break; } else { largestMember = *std::max_element(&___2099[0], &___2099[0]+___2099.size()); } if (largestMember != static_cast<typename CONTAINER::value_type>(___333)) { if (!___1201(___3358, static_cast<___3493>(largestMember + 1), ___1305)) { ___939(&___3358); throw std::bad_alloc(); } typename CONTAINER::value_type const* itemsArray = &___2099[0]; size_t const ___2812 = ___2099.size(); for (size_t ___1992 = 0; ___1992 < ___2812; ++___1992) if (itemsArray[___1992] != static_cast<typename CONTAINER::value_type>(___333)) (void)___17(___3358,static_cast<___3493>(itemsArray[___1992]),___1305); } } ENSURE(VALID_REF(___3358)); return ___3358; } template <typename T> void ___4185( ___3501 ___2100, ___3269<T>& ___3358) { REQUIRE(VALID_REF(___2100) || ___2100 == 0); size_t const count = ___2403(___2100); if (count != 0) { ___3358.reserve(count); ___3358.___3503(count); T* ___3360 = &___3358[0]; size_t ___2865 = 0; ___3493 ___2085; ___1472(___2085,___2100) ___3360[___2865++] = static_cast<T>(___2085); } else { ___3358.___3503(0); } } }
  80. #endif