StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
AliHLTArray.h
Go to the documentation of this file.
1 /****************************************************************************
2  * This file is property of and copyright by the ALICE HLT Project *
3  * ALICE Experiment at CERN, All rights reserved. *
4  * *
5  * Copyright (C) 2009 Matthias Kretz <kretz@kde.org> *
6  * for The ALICE HLT Project. *
7  * *
8  * Permission to use, copy, modify and distribute this software and its *
9  * documentation strictly for non-commercial purposes is hereby granted *
10  * without fee, provided that the above copyright notice appears in all *
11  * copies and that both the copyright notice and this permission notice *
12  * appear in the supporting documentation. The authors make no claims *
13  * about the suitability of this software for any purpose. It is *
14  * provided "as is" without express or implied warranty. *
15  ***************************************************************************/
16 
27 #ifndef ALIHLTARRAY_H
28 #define ALIHLTARRAY_H
29 #include <cstring>
30 
31 #ifndef assert
32 #include <assert.h>
33 #endif
34 
35 #if 1//(defined(__MMX__) || defined(__SSE__))
36 
37 #if defined(__GNUC__)
38 
39 #if __GNUC__ > 3
40 #define USE_MM_MALLOC
41 #endif // if __GNUC__ > 3
42 
43 #else // if defined(__GNUC__) // not gcc, assume it can use _mm_malloc since it supports MMX/SSE
44 
45 #define USE_MM_MALLOC
46 
47 #endif // if defined(__GNUC__)
48 #endif // if (defined(__MMX__) || defined(__SSE__))
49 
50 #ifdef USE_MM_MALLOC
51 
52 #if defined(__INTEL_COMPILER)
53 #include <malloc.h>
54 #else
55 #include <mm_malloc.h>
56 #endif // defined(__GNUC__)
57 
58 #else
59 #include <cstdlib>
60 #endif
61 #include <cstring>
62 
63 enum {
64  AliHLTFullyCacheLineAligned = -1
65 };
66 
67 namespace AliHLTArrayInternal
68 {
69  template<bool> class STATIC_ASSERT_FAILURE;
70  template<> class STATIC_ASSERT_FAILURE<true> {};
71 }
72 
73 #define ALIHLTARRAY_STATIC_ASSERT_CONCAT_HELPER(a, b) a##b
74 #define ALIHLTARRAY_STATIC_ASSERT_CONCAT(a, b) ALIHLTARRAY_STATIC_ASSERT_CONCAT_HELPER(a, b)
75 #define ALIHLTARRAY_STATIC_ASSERT_NC(cond, msg) \
76  typedef AliHLTArrayInternal::STATIC_ASSERT_FAILURE<cond> ALIHLTARRAY_STATIC_ASSERT_CONCAT(_STATIC_ASSERTION_FAILED_##msg, __LINE__); \
77  ALIHLTARRAY_STATIC_ASSERT_CONCAT(_STATIC_ASSERTION_FAILED_##msg, __LINE__) Error_##msg
78 #define ALIHLTARRAY_STATIC_ASSERT(cond, msg) ALIHLTARRAY_STATIC_ASSERT_NC(cond, msg); (void) Error_##msg
79 
80 template<typename T, int Dim> class AliHLTArray;
81 
82 namespace AliHLTInternal
83 {
84  template<unsigned int Size> struct Padding { char fPadding[Size]; };
85  template<> struct Padding<0> {};
86  template<typename T> struct CacheLineSizeHelperData { T fData; };
87  template<typename T> struct CacheLineSizeHelperEnums {
88  enum {
89  CacheLineSize = 64,
90  MaskedSize = sizeof( T ) & ( CacheLineSize - 1 ),
91  RequiredSize = MaskedSize == 0 ? sizeof( T ) : sizeof( T ) + CacheLineSize - MaskedSize,
92  PaddingSize = RequiredSize - sizeof( T )
93  };
94  };
95  template<typename T> class CacheLineSizeHelper : private CacheLineSizeHelperData<T>, private Padding<CacheLineSizeHelperEnums<T>::PaddingSize>
96  {
97  public:
98  operator T &() { return CacheLineSizeHelperData<T>::fData; }
99  operator const T &() const { return CacheLineSizeHelperData<T>::fData; }
100  //const T &operator=( const T &rhs ) { CacheLineSizeHelperData<T>::fData = rhs; }
101 
102  private:
103  };
104  template<typename T, int alignment> struct TypeForAlignmentHelper { typedef T Type; };
105  template<typename T> struct TypeForAlignmentHelper<T, AliHLTFullyCacheLineAligned> { typedef CacheLineSizeHelper<T> Type; };
106 
107  // XXX
108  // The ArrayBoundsCheck and Allocator classes implement a virtual destructor only in order to
109  // silence the -Weffc++ warning. It really is not required for these classes to have a virtual
110  // dtor since polymorphism is not used (AliHLTResizableArray and AliHLTFixedArray are allocated on
111  // the stack only). The virtual dtor only adds an unnecessary vtable to the code.
112 #ifndef ENABLE_ARRAY_BOUNDS_CHECKING
113 
117  {
118  protected:
119  virtual inline ~ArrayBoundsCheck() {}
120  inline bool IsInBounds( int ) const { return true; }
121  inline void SetBounds( int, int ) {}
122  inline void MoveBounds( int ) {}
123  inline void ReinterpretCast( const ArrayBoundsCheck &, int, int ) {}
124  };
125 #define BOUNDS_CHECK(x, y)
126 #else
127 
130  class ArrayBoundsCheck
131  {
132  protected:
133  virtual inline ~ArrayBoundsCheck() {}
137  inline bool IsInBounds( int x ) const;
141  inline void SetBounds( int start, int end ) { fStart = start; fEnd = end; }
145  inline void MoveBounds( int d ) { fStart += d; fEnd += d; }
146 
147  inline void ReinterpretCast( const ArrayBoundsCheck &other, int sizeofOld, int sizeofNew ) {
148  fStart = other.fStart * sizeofNew / sizeofOld;
149  fEnd = other.fEnd * sizeofNew / sizeofOld;
150  }
151 
152  private:
153  int fStart;
154  int fEnd;
155  };
156 #define BOUNDS_CHECK(x, y) if (AliHLTInternal::ArrayBoundsCheck::IsInBounds(x)) {} else return y
157 #endif
158  template<typename T, int alignment> class Allocator
159  {
160  public:
161 #ifdef USE_MM_MALLOC
162  static inline T *Alloc( int s ) { T *p = reinterpret_cast<T *>( _mm_malloc( s * sizeof( T ), alignment ) ); return new( p ) T[s]; }
163  static inline void Free( T *const p, int size ) {
164  for ( int i = 0; i < size; ++i ) {
165  p[i].~T();
166  }
167  _mm_free( p );
168  }
169 #else
170  static inline T *Alloc( int s ) { T *p; posix_memalign( &p, alignment, s * sizeof( T ) ); return new( p ) T[s]; }
171  static inline void Free( T *const p, int size ) {
172  for ( int i = 0; i < size; ++i ) {
173  p[i].~T();
174  }
175  std::free( p );
176  }
177 #endif
178  };
179  template<typename T> class Allocator<T, AliHLTFullyCacheLineAligned>
180  {
181  public:
182  typedef CacheLineSizeHelper<T> T2;
183 #ifdef USE_MM_MALLOC
184  static inline T2 *Alloc( int s ) { T2 *p = reinterpret_cast<T2 *>( _mm_malloc( s * sizeof( T2 ), 128 ) ); return new( p ) T2[s]; }
185  static inline void Free( T2 *const p, int size ) {
186  for ( int i = 0; i < size; ++i ) {
187  p[i].~T2();
188  }
189  _mm_free( p );
190  }
191 #else
192  static inline T2 *Alloc( int s ) { T2 *p; posix_memalign( &p, 128, s * sizeof( T2 ) ); return new( p ) T2[s]; }
193  static inline void Free( T2 *const p, int size ) {
194  for ( int i = 0; i < size; ++i ) {
195  p[i].~T2();
196  }
197  std::free( p );
198  }
199 #endif
200  };
201  template<typename T> class Allocator<T, 0>
202  {
203  public:
204 #ifdef USE_MM_MALLOC
205  static inline T *Alloc( int s ) { T *p = reinterpret_cast<T *>( _mm_malloc( s * sizeof( T ), 128 ) ); return new( p ) T[s]; }
206  static inline void Free( T *const p, int size ) {
207  for ( int i = 0; i < size; ++i ) {
208  p[i].~T();
209  }
210  _mm_free( p );
211  }
212 #else
213  static inline T *Alloc( int s ) { T *p; posix_memalign( &p, 128, s * sizeof( T ) ); return new( p ) T[s]; }
214  static inline void Free( T *const p, int size ) {
215  for ( int i = 0; i < size; ++i ) {
216  p[i].~T();
217  }
218  std::free( p );
219  }
220 #endif
221 
222 // public:
223 // static inline T *Alloc( int s ) { return new T[s]; }
224 // static inline void Free( const T *const p, int ) { delete[] p; }
225  };
226 
227  template<typename T> struct ReturnTypeHelper { typedef T Type; };
228  template<typename T> struct ReturnTypeHelper<CacheLineSizeHelper<T> > { typedef T Type; };
232  template<typename T, int Dim> class ArrayBase;
233 
237  template<typename T>
238  class ArrayBase<T, 1> : public ArrayBoundsCheck
239  {
240  friend class ArrayBase<T, 2>;
241  public:
242  ArrayBase() : ArrayBoundsCheck(), fData( 0 ), fSize(0) {} // XXX really shouldn't be done. But -Weffc++ wants it so
243  ArrayBase( const ArrayBase &rhs ) : ArrayBoundsCheck( rhs ), fData( rhs.fData ), fSize( rhs.fSize ) {} // XXX
244  ArrayBase &operator=( const ArrayBase &rhs ) { ArrayBoundsCheck::operator=( rhs ); fData = rhs.fData; fSize = rhs.fSize; return *this; } // XXX
245  typedef typename ReturnTypeHelper<T>::Type R;
249  inline R &operator[]( int x ) { BOUNDS_CHECK( x, fData[0] ); return fData[x]; }
253  inline const R &operator[]( int x ) const { BOUNDS_CHECK( x, fData[0] ); return fData[x]; }
254 
255  protected:
256  T *fData;
257  int fSize;
258  inline void SetSize( int x, int, int ) { fSize = x; }
259  };
260 
265  template<typename T>
266  class ArrayBase<T, 2> : public ArrayBoundsCheck
267  {
268  friend class ArrayBase<T, 3>;
269  public:
270  ArrayBase() : fData( 0 ), fSize( 0 ), fStride( 0 ) {} // XXX really shouldn't be done. But -Weffc++ wants it so
271  ArrayBase( const ArrayBase &rhs ) : ArrayBoundsCheck( rhs ), fData( rhs.fData ), fSize( rhs.fSize ), fStride( rhs.fStride ) {} // XXX
272  ArrayBase &operator=( const ArrayBase &rhs ) { ArrayBoundsCheck::operator=( rhs ); fData = rhs.fData; fSize = rhs.fSize; fStride = rhs.fStride; return *this; } // XXX
273  typedef typename ReturnTypeHelper<T>::Type R;
277  inline R &operator()( int x, int y ) { BOUNDS_CHECK( x * fStride + y, fData[0] ); return fData[x * fStride + y]; }
281  inline const R &operator()( int x, int y ) const { BOUNDS_CHECK( x * fStride + y, fData[0] ); return fData[x * fStride + y]; }
285  inline AliHLTArray<T, 1> operator[]( int x );
289  inline const AliHLTArray<T, 1> operator[]( int x ) const;
290 
291  protected:
292  T *fData;
293  int fSize;
294  int fStride;
295  inline void SetSize( int x, int y, int ) { fStride = y; fSize = x * y; }
296  };
297 
302  template<typename T>
303  class ArrayBase<T, 3> : public ArrayBoundsCheck
304  {
305  public:
306  ArrayBase() : fData( 0 ), fSize( 0 ), fStrideX( 0 ), fStrideY( 0 ) {} // XXX really shouldn't be done. But -Weffc++ wants it so
307  ArrayBase( const ArrayBase &rhs ) : ArrayBoundsCheck( rhs ), fData( rhs.fData ), fSize( rhs.fSize ), fStrideX( rhs.fStrideX ), fStrideY( rhs.fStrideY ) {} // XXX
308  ArrayBase &operator=( const ArrayBase &rhs ) { ArrayBoundsCheck::operator=( rhs ); fData = rhs.fData; fSize = rhs.fSize; fStrideX = rhs.fStrideX; fStrideY = rhs.fStrideY; return *this; } // XXX
309  typedef typename ReturnTypeHelper<T>::Type R;
313  inline R &operator()( int x, int y, int z );
317  inline const R &operator()( int x, int y, int z ) const;
321  inline AliHLTArray<T, 2> operator[]( int x );
325  inline const AliHLTArray<T, 2> operator[]( int x ) const;
326 
327  protected:
328  T *fData;
329  int fSize;
330  int fStrideX;
331  int fStrideY;
332  inline void SetSize( int x, int y, int z ) { fStrideX = y * z; fStrideY = z; fSize = fStrideX * x; }
333  };
334 
335  template<typename T, unsigned int Size, int _alignment> class AlignedData
336  {
337  public:
338  T *ConstructAlignedData() {
339  const int offset = reinterpret_cast<unsigned long>( &fUnalignedArray[0] ) & ( Alignment - 1 );
340  void *mem = &fUnalignedArray[0] + ( Alignment - offset );
341  return new( mem ) T[Size];
342  }
343  ~AlignedData() {
344  const int offset = reinterpret_cast<unsigned long>( &fUnalignedArray[0] ) & ( Alignment - 1 );
345  T *mem = reinterpret_cast<T *>( &fUnalignedArray[0] + ( Alignment - offset ) );
346  for ( unsigned int i = 0; i < Size; ++i ) {
347  mem[i].~T();
348  }
349  }
350  private:
351  enum {
352  Alignment = _alignment == AliHLTFullyCacheLineAligned ? 128 : _alignment,
353  PaddedSize = Size * sizeof( T ) + Alignment
354  };
355  ALIHLTARRAY_STATIC_ASSERT_NC( ( Alignment & ( Alignment - 1 ) ) == 0, alignment_needs_to_be_a_multiple_of_2 );
356 
357  char fUnalignedArray[PaddedSize];
358  };
359  template<typename T, unsigned int Size> class AlignedData<T, Size, 0>
360  {
361  public:
362  T *ConstructAlignedData() { return &fArray[0]; }
363  private:
364  T fArray[Size];
365  };
366 } // namespace AliHLTInternal
367 
371 template < typename T, int Dim = 1 >
372 class AliHLTArray : public AliHLTInternal::ArrayBase<T, Dim>
373 {
374  public:
375  typedef AliHLTInternal::ArrayBase<T, Dim> Parent;
376 
381  inline int Size() const { return Parent::fSize; }
382 
386  inline operator bool() const { return Parent::fData != 0; }
390  inline bool IsValid() const { return Parent::fData != 0; }
391 
395  inline T &operator*() { BOUNDS_CHECK( 0, Parent::fData[0] ); return *Parent::fData; }
399  inline const T &operator*() const { BOUNDS_CHECK( 0, Parent::fData[0] ); return *Parent::fData; }
400 
405  inline T *Data() { return Parent::fData; }
410  inline const T *Data() const { return Parent::fData; }
411 
415  inline AliHLTArray operator+( int x ) const;
419  inline AliHLTArray operator-( int x ) const;
420 
421  template<typename Other> inline AliHLTArray<Other, Dim> ReinterpretCast() const {
423  r.fData = reinterpret_cast<Other *>( Parent::fData );
424  r.ReinterpretCast( *this, sizeof( T ), sizeof( Other ) );
425  }
426 };
427 
461 template < typename T, int Dim = 1, int alignment = 0 >
462 class AliHLTResizableArray : public AliHLTArray<typename AliHLTInternal::TypeForAlignmentHelper<T, alignment>::Type, Dim>
463 {
464  public:
465  typedef typename AliHLTInternal::TypeForAlignmentHelper<T, alignment>::Type T2;
470  inline AliHLTResizableArray();
474  inline AliHLTResizableArray( int x );
478  inline AliHLTResizableArray( int x, int y );
482  inline AliHLTResizableArray( int x, int y, int z );
483 
487  inline ~AliHLTResizableArray() { AliHLTInternal::Allocator<T, alignment>::Free( Parent::fData, Parent::fSize ); }
488 
495  inline void Resize( int x );
502  inline void Resize( int x, int y );
509  inline void Resize( int x, int y, int z );
510 
511  private:
512  // disable allocation on the heap
513  void *operator new( size_t );
514 
515  // disable copy
517  AliHLTResizableArray &operator=( const AliHLTResizableArray & );
518 };
519 
520 template<unsigned int x, unsigned int y = 0, unsigned int z = 0> class AliHLTArraySize
521 {
522  public:
523  enum {
524  Size = y == 0 ? x : ( z == 0 ? x * y : x * y * z ),
525  Dim = y == 0 ? 1 : ( z == 0 ? 2 : 3 ),
526  X = x, Y = y, Z = z
527  };
528 };
529 
542 template<typename T, typename Size, int alignment = 0>
543 class AliHLTFixedArray : public AliHLTArray<typename AliHLTInternal::TypeForAlignmentHelper<T, alignment>::Type, Size::Dim>
544 {
545  public:
546  typedef typename AliHLTInternal::TypeForAlignmentHelper<T, alignment>::Type T2;
548  inline AliHLTFixedArray() {
549  fData = fFixedArray.ConstructAlignedData();
550  Parent::SetBounds( 0, Size::Size - 1 );
551  AliHLTArray<typename AliHLTInternal::TypeForAlignmentHelper<T, alignment>::Type, Size::Dim>::SetSize( Size::X, Size::Y, Size::Z );
552  }
553  AliHLTFixedArray( const AliHLTFixedArray &rhs ) {
554  fData = fFixedArray.ConstructAlignedData();
555  Parent::SetBounds( 0, Size::Size - 1 );
556  SetSize( Size::X, Size::Y, Size::Z );
557  std::memcpy( fData, rhs.fData, Size::Size * sizeof( T ) );
558  }
559 
560  private:
562 
563  // disable allocation on the heap
564  void *operator new( size_t );
565 
566  using Parent::fData;
567 
568  // disable copy
569  AliHLTFixedArray &operator=( const AliHLTFixedArray & );
570 };
571 
572 
573 
574 
578 
579 
580 
581 
582 namespace AliHLTInternal
583 {
584 #ifdef ENABLE_ARRAY_BOUNDS_CHECKING
585  inline bool ArrayBoundsCheck::IsInBounds( int x ) const
586  {
587  assert( x >= fStart );
588  assert( x <= fEnd );
589  return ( x >= fStart && x <= fEnd );
590  }
591 #endif
592 
593  template<typename T>
595  {
596  x *= fStride;
597 #ifdef ENABLE_ARRAY_BOUNDS_CHECKING
598  typedef AliHLTArray<T, 1> AT1;
599  BOUNDS_CHECK( x, AT1() );
600 #endif
602  a.fData = &fData[x];
603  a.ArrayBoundsCheck::operator=( *this );
604  a.MoveBounds( -x );
605  return a;
606  }
607 
608  template<typename T>
609  inline const AliHLTArray<T, 1> ArrayBase<T, 2>::operator[]( int x ) const
610  {
611  x *= fStride;
612 #ifdef ENABLE_ARRAY_BOUNDS_CHECKING
613  typedef AliHLTArray<T, 1> AT1;
614  BOUNDS_CHECK( x, AT1() );
615 #endif
617  a.fData = &fData[x];
618  a.ArrayBoundsCheck::operator=( *this );
619  a.MoveBounds( -x );
620  return a;
621  }
622 
623  template<typename T>
624  inline typename AliHLTInternal::ArrayBase<T, 3>::R &ArrayBase<T, 3>::operator()( int x, int y, int z )
625  {
626  BOUNDS_CHECK( x * fStrideX + y + fStrideY + z, fData[0] );
627  return fData[x * fStrideX + y + fStrideY + z];
628  }
629  template<typename T>
630  inline const typename AliHLTInternal::ArrayBase<T, 3>::R &ArrayBase<T, 3>::operator()( int x, int y, int z ) const
631  {
632  BOUNDS_CHECK( x * fStrideX + y + fStrideY + z, fData[0] );
633  return fData[x * fStrideX + y + fStrideY + z];
634  }
635  template<typename T>
637  {
638  x *= fStrideX;
639 #ifdef ENABLE_ARRAY_BOUNDS_CHECKING
640  typedef AliHLTArray<T, 2> AT2;
641  BOUNDS_CHECK( x, AT2() );
642 #endif
644  a.fData = &fData[x];
645  a.fStride = fStrideY;
646  a.ArrayBoundsCheck::operator=( *this );
647  a.MoveBounds( -x );
648  return a;
649  }
650  template<typename T>
651  inline const AliHLTArray<T, 2> ArrayBase<T, 3>::operator[]( int x ) const
652  {
653  x *= fStrideX;
654 #ifdef ENABLE_ARRAY_BOUNDS_CHECKING
655  typedef AliHLTArray<T, 2> AT2;
656  BOUNDS_CHECK( x, AT2() );
657 #endif
659  a.fData = &fData[x];
660  a.fStride = fStrideY;
661  a.ArrayBoundsCheck::operator=( *this );
662  a.MoveBounds( -x );
663  return a;
664  }
665 } // namespace AliHLTInternal
666 
667 
668 template<typename T, int Dim>
670 {
671  AliHLTArray<T, Dim> r( *this );
672  r.fData += x;
673  r.MoveBounds( -x );
674  return r;
675 }
676 template<typename T, int Dim>
678 {
679  AliHLTArray<T, Dim> r( *this );
680  r.fData -= x;
681  r.MoveBounds( x );
682  return r;
683 }
684 
685 template<typename T, int Dim, int alignment>
687 {
688  Parent::fData = 0;
689  Parent::SetSize( 0, 0, 0 );
690  Parent::SetBounds( 0, -1 );
691 }
692 template<typename T, int Dim, int alignment>
694 {
695  ALIHLTARRAY_STATIC_ASSERT( Dim == 1, AliHLTResizableArray1_used_with_incorrect_dimension );
697  Parent::SetSize( x, 0, 0 );
698  Parent::SetBounds( 0, x - 1 );
699 }
700 template<typename T, int Dim, int alignment>
702 {
703  ALIHLTARRAY_STATIC_ASSERT( Dim == 2, AliHLTResizableArray2_used_with_incorrect_dimension );
704  Parent::fData = AliHLTInternal::Allocator<T, alignment>::Alloc( x * y );
705  Parent::SetSize( x, y, 0 );
706  Parent::SetBounds( 0, x * y - 1 );
707 }
708 template<typename T, int Dim, int alignment>
710 {
711  ALIHLTARRAY_STATIC_ASSERT( Dim == 3, AliHLTResizableArray3_used_with_incorrect_dimension );
712  Parent::fData = AliHLTInternal::Allocator<T, alignment>::Alloc( x * y * z );
713  Parent::SetSize( x, y, z );
714  Parent::SetBounds( 0, x * y * z - 1 );
715 }
716 // #include <iostream>
717 template<typename T, int Dim, int alignment>
719 {
720  ALIHLTARRAY_STATIC_ASSERT( Dim == 1, AliHLTResizableArray1_resize_used_with_incorrect_dimension );
721  AliHLTInternal::Allocator<T, alignment>::Free( Parent::fData, Parent::fSize );
722  Parent::fData = ( x == 0 ) ? 0 : AliHLTInternal::Allocator<T, alignment>::Alloc( x );
723  Parent::SetSize( x, 0, 0 );
724  Parent::SetBounds( 0, x - 1 );
725 }
726 template<typename T, int Dim, int alignment>
728 {
729  ALIHLTARRAY_STATIC_ASSERT( Dim == 2, AliHLTResizableArray2_resize_used_with_incorrect_dimension );
730  AliHLTInternal::Allocator<T, alignment>::Free( Parent::fData, Parent::fSize );
731  Parent::fData = ( x == 0 ) ? 0 : AliHLTInternal::Allocator<T, alignment>::Alloc( x * y );
732  Parent::SetSize( x, y, 0 );
733  Parent::SetBounds( 0, x * y - 1 );
734 }
735 template<typename T, int Dim, int alignment>
736 inline void AliHLTResizableArray<T, Dim, alignment>::Resize( int x, int y, int z )
737 {
738  ALIHLTARRAY_STATIC_ASSERT( Dim == 3, AliHLTResizableArray3_resize_used_with_incorrect_dimension );
739  AliHLTInternal::Allocator<T, alignment>::Free( Parent::fData, Parent::fSize );
740  Parent::fData = ( x == 0 ) ? 0 : AliHLTInternal::Allocator<T, alignment>::Alloc( x * y * z );
741  Parent::SetSize( x, y, z );
742  Parent::SetBounds( 0, x * y * z - 1 );
743 }
744 
745 #undef BOUNDS_CHECK
746 
747 #endif // ALIHLTARRAY_H
AliHLTArray operator+(int x) const
Definition: AliHLTArray.h:669
const T & operator*() const
Definition: AliHLTArray.h:399
const R & operator[](int x) const
Definition: AliHLTArray.h:253
void Resize(int x)
Definition: AliHLTArray.h:718
T & operator*()
Definition: AliHLTArray.h:395
const T * Data() const
Definition: AliHLTArray.h:410
bool IsValid() const
Definition: AliHLTArray.h:390
const R & operator()(int x, int y) const
Definition: AliHLTArray.h:281
int Size() const
Definition: AliHLTArray.h:381
AliHLTArray operator-(int x) const
Definition: AliHLTArray.h:677