7 #include "TStopwatch.h"
12 #include "vectors/P4_F32vec4.h"
22 return std::isfinite(
x);
27 #define L1_NO_ASSERT // use with asserts, etc.
28 #define L1_DYNAMIC_CAST static_cast
32 #define L1_DYNAMIC_CAST dynamic_cast
36 #if 1 && defined(__GNUC__) && __GNUC__ - 0 >= 3 // for speed up conditions
37 #define ISLIKELY(x) __builtin_expect(!!(x), 1)
38 #define ISUNLIKELY(x) __builtin_expect(!!(x), 0)
40 #define ISLIKELY(x) (x)
41 #define ISUNLIKELY(x) (x)
44 #if defined(NDEBUG) || defined(L1_NO_ASSERT)
45 #define L1_ASSERT(v, msg)
48 #define L1_ASSERT(v, msg) \
51 std::cerr << __FILE__ << ":" << __LINE__ << " assertion failed: " << #v \
52 << " = " << (v) << "\n" \
53 << msg << std::endl; \
56 #define L1_assert(v) assert(v)
69 L1Vector(
const unsigned int n) : std::vector<T>(n), fSize(0) {};
70 L1Vector(
const unsigned int n,
const unsigned int value)
71 : std::vector<T>(n, value), fSize(0) {};
74 unsigned int Size()
const {
return fSize; }
78 if (n > std::vector<T>::size()) {
82 std::vector<T>::resize(n);
89 if (fSize >= std::vector<T>::size()) {
93 std::vector<T>::push_back(element);
95 std::vector<T>::at(fSize) = element;
102 if (index >= std::vector<T>::size()) {
106 std::vector<T>::resize(index + 1);
107 std::cout << index <<
" index " << std::endl;
109 if (index >= fSize) fSize = index + 1;