Changeset 5303
- Timestamp:
- 08/18/08 12:29:31 (3 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
openmrs-modules/patientmatching/src/org/regenstrief/linkage/analysis/RandomSampleAnalyzer.java
r5244 r5303 76 76 77 77 public void analyzeRecordPair(Record[] pair){ 78 if( sample1[pair_count]){78 if(pair_count < sample1.length && sample1[pair_count]){ 79 79 List<Integer> indexes = left_pair_entry.get(Integer.valueOf(pair_count)); 80 80 for(int i = 0; i < indexes.size(); i++){ … … 92 92 } 93 93 94 if( sample2[pair_count]){94 if(pair_count < sample2.length && sample2[pair_count]){ 95 95 List<Integer> indexes2 = right_pair_entry.get(Integer.valueOf(pair_count)); 96 96 for(int i = 0; i < indexes2.size(); i++){ … … 236 236 237 237 // need to get two sets of random numbers, one for each data source 238 for(int i = 0; i < sampleSize ; i++){238 for(int i = 0; i < sampleSize && max_index > 0; i++){ 239 239 int left_index = rand.nextInt(max_index); 240 240 int right_index = rand.nextInt(max_index);