5 #include "_workerIFdd.h" 6 #include "indexedFddStorageExtern.cpp" 9 template <
typename K,
typename T>
10 template <
typename L,
typename U>
12 T ** d = this->localData->getData();
13 size_t s = this->localData->getSize();
14 size_t * ls = this->localData->getLineSizes();
15 K * ik = this->localData->getKeys();
16 L * ok = (L*) dest->getKeys();
17 U * od = (U*) dest->getData();
21 #pragma omp parallel for 22 for (
size_t i = 0; i < s; ++i){
23 std::pair<L,U> r = mapFunc(ik[i], d[i], ls[i]);
29 template <
typename K,
typename T>
30 template <
typename L,
typename U>
32 T ** d = this->localData->getData();
33 size_t s = this->localData->getSize();
34 size_t * ls = this->localData->getLineSizes();
35 size_t * dls = dest->getLineSizes();
36 K * ik = this->localData->getKeys();
37 L * ok = (L*) dest->getKeys();
38 U * od = (U*) dest->getData();
41 #pragma omp parallel for 42 for (
size_t i = 0; i < s; ++i){
43 std::tuple<L,U,size_t> r = mapFunc(ik[i], d[i], ls[i]);
44 ok[i] = std::get<0>(r);
45 od[i] = std::get<1>(r);
46 dls[i] = std::get<2>(r);
50 template <
typename K,
typename T>
53 T ** d = this->localData->getData();
54 size_t s = this->localData->getSize();
55 K * ik = this->localData->getKeys();
56 size_t * ls = this->localData->getLineSizes();
57 U * od = (U*) dest->getData();
61 #pragma omp parallel for 62 for (
size_t i = 0; i < s; ++i){
63 od[i] = mapFunc(ik[i], d[i], ls[i]);
67 template <
typename K,
typename T>
70 T ** d = this->localData->getData();
71 size_t s = this->localData->getSize();
72 K * ik = this->localData->getKeys();
73 size_t * ls = this->localData->getLineSizes();
74 size_t * dls = dest->getLineSizes();
75 U * od = (U*) dest->getData();
78 #pragma omp parallel for 79 for (
size_t i = 0; i < s; ++i){
80 std::pair<U,size_t> r = mapFunc(ik[i], d[i], ls[i]);
91 template <
typename K,
typename T>
92 template <
typename L,
typename U>
94 size_t s = this->localData->getSize();
95 size_t * ls = this->localData->getLineSizes();
96 K * ik = this->localData->getKeys();
97 L * ok = (L*) dest->getKeys();
99 bulkMapFunc(ok, (U*) dest->getData(), ik, (T **)this->localData->getData(), ls, s);
101 template <
typename K,
typename T>
102 template <
typename L,
typename U>
104 size_t s = this->localData->getSize();
105 size_t * ls = this->localData->getLineSizes();
106 K * ik = this->localData->getKeys();
107 L * ok = (L*) dest->getKeys();
109 bulkMapFunc(ok, (U*) dest->getData(), dest->getLineSizes(), ik, (T **)this->localData->getData(), ls, s);
111 template <
typename K,
typename T>
112 template <
typename U>
114 size_t s = this->localData->getSize();
115 size_t * ls = this->localData->getLineSizes();
116 K * ik = this->localData->getKeys();
118 bulkMapFunc((U*) dest->getData(), ik, (T **)this->localData->getData(), ls, s);
120 template <
typename K,
typename T>
121 template <
typename U>
123 size_t s = this->localData->getSize();
124 size_t * ls = this->localData->getLineSizes();
125 K * ik = this->localData->getKeys();
127 bulkMapFunc((U*) dest->getData(), dest->getLineSizes(), ik, (T **)this->localData->getData(), ls, s);
131 template <
typename K,
typename T>
132 template <
typename L,
typename U>
134 T ** d = this->localData->getData();
135 size_t s = this->localData->getSize();
136 std::deque<std::pair<L,U>> resultList;
140 std::deque<std::pair<L,U>> partResultList;
142 for (
size_t i = 0; i < s; ++i){
143 std::deque<std::pair<L,U>> r = flatMapFunc(d[i], this->localData->getLineSizes()[i]);
145 partResultList.insert(partResultList.end(), r.begin(), r.end() );
150 resultList.insert(resultList.end(), partResultList.begin(), partResultList.end() );
152 dest->insertl(&resultList);
154 template <
typename K,
typename T>
155 template <
typename L,
typename U>
157 T ** d = this->localData->getData();
158 size_t s = this->localData->getSize();
159 std::deque<std::tuple<L, U, size_t>> resultList;
163 std::deque<std::tuple<L, U, size_t>> partResultList;
165 for (
size_t i = 0; i < s; ++i){
166 std::deque<std::tuple<L, U, size_t>>r = flatMapFunc(d[i], this->localData->getLineSizes()[i]);
168 partResultList.insert(partResultList.end(), r.begin(), r.end() );
173 resultList.insert(resultList.end(), partResultList.begin(), partResultList.end() );
175 dest->insertl(&resultList);
177 template <
typename K,
typename T>
178 template <
typename U>
180 T ** d = this->localData->getData();
181 size_t s = this->localData->getSize();
182 std::deque<U> resultList;
186 std::deque<U> partResultList;
188 for (
size_t i = 0; i < s; ++i){
189 std::deque<U> r = flatMapFunc(d[i], this->localData->getLineSizes()[i]);
191 partResultList.insert(partResultList.end(), r.begin(), r.end() );
196 resultList.insert(resultList.end(), partResultList.begin(), partResultList.end() );
198 dest->insertl(&resultList);
200 template <
typename K,
typename T>
201 template <
typename U>
203 T ** d = this->localData->getData();
204 size_t s = this->localData->getSize();
205 std::deque<std::pair<U, size_t>> resultList;
209 std::deque<std::pair<U, size_t>> partResultList;
211 for (
size_t i = 0; i < s; ++i){
212 std::deque<std::pair<U, size_t>>r = flatMapFunc(d[i], this->localData->getLineSizes()[i]);
214 partResultList.insert(partResultList.end(), r.begin(), r.end() );
219 resultList.insert(resultList.end(), partResultList.begin(), partResultList.end() );
221 dest->insertl(&resultList);
227 template <
typename K,
typename T>
228 template <
typename L,
typename U>
233 K * ik = this->localData->getKeys();
235 bulkFlatMapFunc( ok, result, rSize, ik, (T**) this->localData->getData(), this->localData->getLineSizes(), this->localData->getSize());
236 dest->setData(ok, result, rSize);
238 template <
typename K,
typename T>
239 template <
typename L,
typename U>
243 size_t * rDataSizes = NULL;
245 K * ik = this->localData->getKeys();
247 bulkFlatMapFunc( ok, result, rDataSizes, rSize, ik, (T**) this->localData->getData(), this->localData->getLineSizes(), this->localData->getSize());
248 dest->setData(ok, result, rDataSizes, rSize);
250 template <
typename K,
typename T>
251 template <
typename U>
255 K * ik = this->localData->getKeys();
257 bulkFlatMapFunc( result, rSize, ik, (T**) this->localData->getData(), this->localData->getLineSizes(), this->localData->getSize());
258 dest->setData(result, rSize);
260 template <
typename K,
typename T>
261 template <
typename U>
264 size_t * rDataSizes = NULL;
266 K * ik = this->localData->getKeys();
268 bulkFlatMapFunc( result, rDataSizes, rSize, ik, (T**) this->localData->getData(), this->localData->getLineSizes(), this->localData->getSize());
269 dest->setData(result, rDataSizes, rSize);
276 template <
typename K,
typename T>
277 template <
typename L,
typename U>
281 map<L,U>(dest, (ImapIPFunctionP<K,T,L,U>) func);
285 bulkMap<L,U>(dest, ( IbulkMapIPFunctionP<K,T,L,U> ) func);
289 flatMap<L,U>(dest, ( IflatMapIPFunctionP<K,T,L,U> ) func);
293 bulkFlatMap<L,U>(dest, ( IbulkFlatMapIPFunctionP<K,T,L,U> ) func);
300 template <
typename K,
typename T>
301 template <
typename L,
typename U>
305 map<L,U>(dest, (IPmapIPFunctionP<K,T,L,U>) func);
309 bulkMap<L,U>(dest, ( IPbulkMapIPFunctionP<K,T,L,U> ) func);
313 flatMap<L,U>(dest, ( IPflatMapIPFunctionP<K,T,L,U> ) func);
317 bulkFlatMap<L,U>(dest, ( IPbulkFlatMapIPFunctionP<K,T,L,U> ) func);
323 template <
typename K,
typename T>
324 template <
typename U>
328 map<U>(dest, (mapIPFunctionP<K,T,U>) func);
332 bulkMap<U>(dest, ( bulkMapIPFunctionP<K,T,U> ) func);
336 flatMap<U>(dest, ( flatMapIPFunctionP<K,T,U> ) func);
340 bulkFlatMap<U>(dest, ( bulkFlatMapIPFunctionP<K,T,U> ) func);
347 template <
typename K,
typename T>
348 template <
typename U>
352 map<U>(dest, (PmapIPFunctionP<K,T,U>) func);
356 bulkMap<U>(dest, ( PbulkMapIPFunctionP<K,T,U> ) func);
360 flatMap<U>(dest, ( PflatMapIPFunctionP<K,T,U> ) func);
364 bulkFlatMap<U>(dest, ( PbulkFlatMapIPFunctionP<K,T,U> ) func);
371 template <
typename K,
typename T>
372 template <
typename L>
374 switch (dest->getType()){
376 case Char: _applyI<L,char> (func, op, dest);
break;
377 case Int: _applyI<L,int> (func, op, dest);
break;
378 case LongInt: _applyI<L,long int>(func, op, dest);
break;
379 case Float: _applyI<L,float> (func, op, dest);
break;
380 case Double: _applyI<L,double> (func, op, dest);
break;
381 case CharP: _applyIP<L,char *> (func, op, dest);
break;
382 case IntP: _applyIP<L,int *> (func, op, dest);
break;
383 case LongIntP: _applyIP<L,long int *> (func, op, dest);
break;
384 case FloatP: _applyIP<L,float *> (func, op, dest);
break;
385 case DoubleP: _applyIP<L,double *> (func, op, dest);
break;
386 case String: _applyI<L,std::string>(func, op, dest);
break;
388 case CharV: _applyI<L,std::vector<char>> (func, op, dest);
break;
389 case IntV: _applyI<L,std::vector<int>> (func, op, dest);
break;
390 case LongIntV: _applyI<L,std::vector<long int>>(func, op, dest);
break;
391 case FloatV: _applyI<L,std::vector<float>> (func, op, dest);
break;
392 case DoubleV: _applyI<L,std::vector<double>> (func, op, dest);
break;
398 template <
typename K,
typename T>
400 switch (dest->getType()){
403 case Char: _apply<char> (func, op, dest);
break;
404 case Int: _apply<int> (func, op, dest);
break;
405 case LongInt: _apply<long int> (func, op, dest);
break;
406 case Float: _apply<float> (func, op, dest);
break;
407 case Double: _apply<double> (func, op, dest);
break;
408 case CharP: _applyP<char *> (func, op, dest);
break;
409 case IntP: _applyP<int *> (func, op, dest);
break;
410 case LongIntP: _applyP<long int *> (func, op, dest);
break;
411 case FloatP: _applyP<float *> (func, op, dest);
break;
412 case DoubleP: _applyP<double *> (func, op, dest);
break;
413 case String: _apply<std::string>(func, op, dest);
break;
415 case CharV: _apply<std::vector<char>> (func, op, dest);
break;
416 case IntV: _apply<std::vector<int>> (func, op, dest);
break;
417 case LongIntV:_apply<std::vector<long int>>(func, op, dest);
break;
418 case FloatV: _apply<std::vector<float>> (func, op, dest);
break;
419 case DoubleV: _apply<std::vector<double>> (func, op, dest);
break;
426 template <
typename K,
typename T>
428 switch (dest->getKeyType()){
429 case Null: _preApply(func, op, dest);
break;
430 case Char: _preApplyI<char>(func, op, dest);
break;
431 case Int: _preApplyI<int>(func, op, dest);
break;
432 case LongInt: _preApplyI<long int>(func, op, dest);
break;
433 case Float: _preApplyI<float>(func, op, dest);
break;
434 case Double: _preApplyI<double>(func, op, dest);
break;
435 case String: _preApplyI<std::string>(func, op, dest);
break;
unsigned int fddOpType
Dataset operation type.