void* genlthreadfunc(void* thearg){ genlstruct* arg=(genlstruct*)thearg; int datacount; arg->c->support=0; for(datacount=0;datacount<arg->data->num;datacount++){ if(issubset(&arg->data->valuelist[datacount], arg->c)){ arg->c->support++; } } return NULL; }
void getassociationrule(aprioriassstruct* dest, aprioristruct* list){ aprioriset* right, *left; int i, j, k; pthread_t thread[GEM5_NUMPROCS]; associationstruct assstruct[GEM5_NUMPROCS]; int proccount=0; int threadrun[GEM5_NUMPROCS]={0,}; for(i=0;i<list->num;i++){ right=&list->valuelist[i]; if(right->length<2) continue; for(j=0;j<list->num;j++){ left=&list->valuelist[j]; if(right->length==left->length) break; if(issubset(right, left)){ if(proccount!=GEM5_NUMPROCS-1){ for(k=0;k<proccount;k++){ pthread_join(thread[k], NULL); threadrun[k]=0; } proccount=0; } assstruct[proccount].dest=&dest->aprioriasslist[dest->num]; assstruct[proccount].left=left; assstruct[proccount].right=right; pthread_create(&thread[proccount], NULL, getassociationrulefunc, (void*)&assstruct[proccount]); threadrun[proccount]=1; dest->num++; proccount++; } } } for(i=0;i<proccount;i++){ pthread_join(thread[i], NULL); } }
bool set<T>::operator<=(set<U> const &other) const { // Every element in *this is in other return issubset(other); }