Changes between Version 2 and Version 3 of Details


Ignore:
Timestamp:
Jan 18, 2010, 8:47:18 PM (14 years ago)
Author:
andrei.minca
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Details

    v2 v3  
    4040{{{
    4141                                nrThreads = omp_get_max_threads();
    42                                 Freq_discr = (ItemCount***) calloc (nrThreads, sizeof(ItemCount**));[[BR]]
    43                                 ValFreq_discr = (ItemCount**) calloc (nrThreads, sizeof(ItemCount*));[[BR]]
    44                                 UnknownRate_discr = (float**) calloc (nrThreads, sizeof(float*));[[BR]]
    45                                 for(i = 0; i < nrThreads; i++){[[BR]]
    46                                         Freq_discr[i] = (ItemCount **) calloc(MaxDiscrVal + 1, sizeof(ItemCount *));[[BR]]
    47                                         ForEach(v, 0, MaxDiscrVal) {[[BR]]
    48                                                 Freq_discr[i][v] = (ItemCount *) calloc(MaxClass + 1, sizeof(ItemCount));[[BR]]
    49                                         }[[BR]]
     42                                Freq_discr = (ItemCount***) calloc (nrThreads, sizeof(ItemCount**));
     43                                ValFreq_discr = (ItemCount**) calloc (nrThreads, sizeof(ItemCount*));
     44                                UnknownRate_discr = (float**) calloc (nrThreads, sizeof(float*));
     45                                for(i = 0; i < nrThreads; i++)
     46                                {
     47                                        Freq_discr[i] = (ItemCount **) calloc(MaxDiscrVal + 1, sizeof(ItemCount *));
     48                                        ForEach(v, 0, MaxDiscrVal)
     49                                        {
     50                                                Freq_discr[i][v] = (ItemCount *) calloc(MaxClass + 1, sizeof(ItemCount));
     51                                        }
    5052
    5153                                        ValFreq_discr[i] = (ItemCount *) calloc(MaxDiscrVal + 1, sizeof(ItemCount));
     
    5860                                  whithout entering any race conditions (these structures need to be private to every thread).
    5961
    60         - in build.c - the `FormTree_discr()` function contains the #pragma omp parallel for construct that computes attribute gains in parllel.[[BR]]
    61                        The directive also has a reduction clause on two variables: `AvGain`, `Possible`. The variables are necessary to compute the average gain of the attribute.[[BR]]
    62                        The `FormTree_discr()` function calls `EvalAttributeDisc_discr()` for every attribute in the for loop.[[BR]]
     62        - in build.c - the `FormTree_discr()` function contains the #pragma omp parallel for construct that computes attribute gains in parllel.
     63                       The directive also has a reduction clause on two variables: `AvGain`, `Possible`. The variables are necessary to compute the average gain of the attribute.
     64                       The `FormTree_discr()` function calls `EvalAttributeDisc_discr()` for every attribute in the for loop.
    6365                       This method is similar to the Synchronous Tree Construction approach described in theory, where the team of threads cooperates to expand (compute the best attribute) the tree at each step.
    6466