/[eiffelstudio]/branches/eth/eve/benchmarks/scoop/scoop_thresh/main.e
ViewVC logotype

Diff of /branches/eth/eve/benchmarks/scoop/scoop_thresh/main.e

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 93414 by jasonw, Fri Jun 28 04:42:18 2013 UTC revision 93415 by wests, Sun Nov 17 16:05:44 2013 UTC
# Line 23  feature Line 23  feature
23        file_name := separate_character_option_value ('i')        file_name := separate_character_option_value ('i')
24        is_bench := index_of_word_option ("bench") > 0        is_bench := index_of_word_option ("bench") > 0
25    
26        create in.make_open_read (file_name)              create in.make_open_read (file_name)
27        in.read_integer        in.read_integer
28        nrows := in.last_integer        nrows := in.last_integer
29    
30        in.read_integer        in.read_integer
31        ncols := in.last_integer        ncols := in.last_integer
32    
33        create matrix.make_filled (0, nrows, ncols)        create matrix.make_with_content (nrows, ncols, is_bench)
34        create histogram.make_filled(0, 0, 100)        create histogram.make_filled(0, 0, 100)
35        create accum.make_filled (0, 1, 1)        create accum.make_filled (0, 1, 1)
36    
       read_matrix (nrows, ncols, matrix, in)  
   
37        in.read_integer        in.read_integer
38        percent := in.last_integer        percent := in.last_integer
39    
# Line 106  feature Line 104  feature
104        -- join workers        -- join workers
105        workers_reduce_join (workers)        workers_reduce_join (workers)
106      end      end
107      
108    calculate_threshold (nrows, ncols, percent: INTEGER;    calculate_threshold (nrows, ncols, percent: INTEGER;
109                         a_accum: separate ARRAY [INTEGER];                         a_accum: separate ARRAY [INTEGER];
110                         a_histogram: separate ARRAY [INTEGER]): INTEGER                         a_histogram: separate ARRAY [INTEGER]): INTEGER
# Line 207  feature Line 205  feature
205        end        end
206      end      end
207    
208      
209    fetch_matrix (nrows, ncols: INTEGER;    fetch_matrix (nrows, ncols: INTEGER;
210                  a_array: separate ARRAY2[INTEGER]): ARRAY2 [INTEGER]                  a_array: separate ARRAY2[INTEGER]): ARRAY2 [INTEGER]
211      local      local
# Line 228  feature Line 226  feature
226        end        end
227      end      end
228    
   read_matrix(nrows, ncols: INTEGER;  
               a_matrix: separate ARRAY2[INTEGER];  
               in: PLAIN_TEXT_FILE)  
     require  
       a_matrix.generator /= Void  
     local  
       i, j: INTEGER  
       v: INTEGER  
     do  
       from i := 1  
       until i > nrows  
       loop  
         from j := 1  
         until j > ncols  
         loop  
           if is_bench then  
             v := (i * j) \\ 100  
           else  
             in.read_integer  
             v := in.last_integer              
           end  
           a_matrix.put (v, i, j)  
           j := j + 1  
         end  
         i := i + 1  
       end  
     end  
   
   
229  feature {NONE}  feature {NONE}
230    is_bench: BOOLEAN    is_bench: BOOLEAN
231      
232    matrix: separate ARRAY2[INTEGER]    matrix: separate MATRIX_ARRAY
233    shared: separate ARRAY2[INTEGER]    shared: separate ARRAY2[INTEGER]
234    accum: separate ARRAY [INTEGER]    accum: separate ARRAY [INTEGER]
235    histogram: separate ARRAY[INTEGER]    histogram: separate ARRAY[INTEGER]
# Line 329  feature {NONE} Line 298  feature {NONE}
298          workers.forth          workers.forth
299        end        end
300      end      end
301      
302    end -- class MAIN    end -- class MAIN

Legend:
Removed from v.93414  
changed lines
  Added in v.93415

  ViewVC Help
Powered by ViewVC 1.1.23