1 #ifndef NPSTAT_ALLOCATORS_HH_
2 #define NPSTAT_ALLOCATORS_HH_
23 unsigned sizeofStackBuffer)
25 if (sizeNeeded > sizeofStackBuffer || stackBuffer == 0)
26 return new T[sizeNeeded];
35 if (thisBuffer != stackBuffer)
40 template <
typename T1,
typename T2>
47 for (
unsigned long i=0;
i<len; ++
i)
48 *dest++ = static_cast<T1>(*source++);
56 template <
typename T1,
typename T2>
58 const unsigned long dim)
64 for (
unsigned long i=0;
i<dim; ++
i)
66 for (
unsigned long j=0;
j<dim; ++
j)
67 dest[
j*dim] = static_cast<T1>(*source++);
77 template <
typename T1,
typename T2>
79 const unsigned long M,
80 const unsigned long N)
86 for (
unsigned long i=0;
i<M; ++
i)
88 for (
unsigned long j=0;
j<
N; ++
j)
89 dest[
j*M] = static_cast<T1>(*source++);
106 for (
unsigned long i=0;
i<len; ++
i)
112 #endif // NPSTAT_ALLOCATORS_HH_
void copyBuffer(T1 *dest, const T2 *source, const unsigned long len)
T * makeBuffer(unsigned sizeNeeded, T *stackBuffer, unsigned sizeofStackBuffer)
void transposeBuffer(T1 *dest, const T2 *source, const unsigned long dim)
void clearBuffer(T *buf, const unsigned long len)
static std::string const source
void destroyBuffer(T *thisBuffer, const T *stackBuffer)