#ifndef L1Portion_H #define L1Portion_H #include using std::vector; // class for portions organization template class L1Portion; template <> class L1Portion { public: typedef L1TrackPar T; // typedef vector vType; typedef nsL1::vector::TSimd vType; L1Portion() { dataSize = 0; }; L1Portion(int size) { resize(size); dataSize = 0;}; L1Portion(int size, int size2) { resize(size); // resize2(size2); dataSize = size2; }; vType& operator[] (int i) { return a[i];} void resize(int size) { a.reserve(size); }; void resize2(int size) { for(int i = 0; i < a.size(); i++) a[i].reserve(size); }; void push_back(vType &v) { a.push_back(v); }; void add_void(){ vType v; // v.resize(dataSize); a.push_back(v); a[a.size()-1].reserve(dataSize); }; void add_void(int i) { T t; a[i].push_back(t); }; int CalcSize() { int size = 0; for(int i = 0; i < a.size(); i++) size += a[i].size(); return size*sizeof(T); }; private: vector a; // int mainSize; // size of a int dataSize; // size of vType }; template <> class L1Portion { public: typedef L1FieldRegion T; typedef nsL1::vector::TSimd vType; // typedef std::vector > vType; L1Portion() { dataSize = 0; }; L1Portion(int size) { resize(size); dataSize = 0;}; L1Portion(int size, int size2) { resize(size); // resize2(size2); dataSize = size2; }; vType& operator[] (int i) { return a[i];} void resize(int size) { a.reserve(size); }; void resize2(int size) { for(int i = 0; i < a.size(); i++) a[i].reserve(size); }; void push_back(vType &v) { a.push_back(v); }; void add_void(){ vType v; // v.resize(dataSize); a.push_back(v); a[a.size()-1].reserve(dataSize); }; void add_void(int i) { T t; a[i].push_back(t); }; int CalcSize() { int size = 0; for(int i = 0; i < a.size(); i++) size += a[i].size(); return size*sizeof(T); }; private: vector a; // int mainSize; // size of a int dataSize; // size of vType }; template class L1Portion { public: typedef vector vType; L1Portion() { dataSize = 0; }; L1Portion(int size) { resize(size); dataSize = 0;}; L1Portion(int size, int size2) { resize(size); // resize2(size2); dataSize = size2; }; vType& operator[] (int i) { return a[i];} void resize(int size) { a.reserve(size); }; void resize2(int size) { for(int i = 0; i < a.size(); i++) a[i].reserve(size); }; void push_back(vType &v) { a.push_back(v); }; void add_void(){ vType v; // v.resize(dataSize); a.push_back(v); a[a.size()-1].reserve(dataSize); }; void add_void(int i) { T t; a[i].push_back(t); }; int CalcSize() { int size = 0; for(int i = 0; i < a.size(); i++) size += a[i].size(); return size*sizeof(T); }; private: vector a; // int mainSize; // size of a int dataSize; // size of vType }; #endif // L1Portion_H