42 return (
MInt)inputSize;
47 return (
MInt)inputSize;
100 for(
MInt i = 0; i < (inputMaxSize + 1); i++) {
101 a[i].allocateElements((
void*)(m_rawMemory + m_rawMemoryCounter));
102 m_rawMemoryCounter += m_staticElementSize;
115 T::init(dimension, dummy, inputMaxSize);
116 allocMemoryAndInitElements();
124 T::init(dimension, distributions, distributions1, inputMaxSize + 1);
125 allocMemoryAndInitElements();
132 T::init(dimension, distributions, distributions1, inputMaxSize + 1, dummy2);
133 allocMemoryAndInitElements();
141 T::init(dimension, distributions, distributions1, inputMaxSize + 1, maxNoSurfaces);
142 allocMemoryAndInitElements();
148 T::init(dimension, flameSpeed, inputMaxSize, maxNoSets);
149 allocMemoryAndInitElements();
154 if(m_size < m_maxSize) {
157 std::stringstream errorMessage;
158 errorMessage <<
" Error in collector, maxSize reached ( " << m_maxSize <<
" elements ).";
159 mTerm(1, AT_, errorMessage.str());
178namespace collector_memory {
186template <
class T,
class U>
188 const MLong N =
sizeof(T);
189 const MLong padding =
reinterpret_cast<MLong>(
static_cast<void*
>(p)) % N;
193 return reinterpret_cast<U*
>(
reinterpret_cast<char*
>(p) + padding);
276 to[i][j] = from[i][j];
284namespace unaligned_cell_wise {
309 p =
reinterpret_cast<T*
>(
base);
310 base =
reinterpret_cast<void*
>(
reinterpret_cast<T*
>(
base) +
Nrows);
321 p[i] =
reinterpret_cast<T*
>(
base) +
static_cast<MLong>(1) * i *
Ncols;
T * operator[](MInt index)
Collector(MLong maxSize, MInt dimension, MInt distributions)
MInt resetSize(MInt inputSize)
void allocMemoryAndInitElements()
Allocates collector memory and initializes elements.
Collector(MLong maxSize=1052000)
MInt setSize(MInt inputSize)
void init(const MLong maxSize_)
Collector(MLong maxSize, MInt dimension, MInt distributions, MInt dummy, MInt dummy2)
void allocMemory()
Allocates collector memory.
Collector(MLong maxSize, MInt dimension, MFloat dummy, MInt maxNoSets)
Collector(MLong maxSize, MInt dimension)
Collector(MLong maxSize, MInt dimension, MInt distributions, MInt distributions1, MInt maxNoSurfaces, MInt dummy1)
Collector(MLong maxSize, MInt dimension, MInt distributions, MInt distributions1)
void mTerm(const MInt errorCode, const MString &location, const MString &message)
void rowMajor1D(T *&p, void *&base, const MInt Nrows)
Store 1D variables in row-majow order relative to the start of each cell's memory solver.
void const MInt const MInt Ncols
ATTRIBUTES1(ATTRIBUTE_NO_AUTOVEC) inline void rowMajor2D(T **&p
void const MInt const MInt const MInt const MInt maxNoCells
void copyElements1D(T *to, T *from, const MInt Nrows)
Copies 1D cell elements.
ATTRIBUTES1(ATTRIBUTE_NO_AUTOVEC) inline void rowMajor2D(T **&p
Stores 2D variables in row-major order.
void rowMajor1D(T *&p, void *&base, const MInt cellId, const MInt Nrows, const MInt maxNoCells)
Stores 1D variables in row-major order.
void copyElements2D(T *to, T *from, const MInt Nrows, const MInt Ncols)
Copies 2D cell elements.
U * align(U *p)
Aligns pointer p such that a T stored at its adress is aligned.
void const MInt const MInt const MInt Ncols
void const MInt const MInt Nrows
Namespace for auxiliary functions/classes.