1 | #include <MultiProbe.hxx> |
---|
2 | #include <string.h> |
---|
3 | |
---|
4 | BOOL GenerationDuplicates::insert(probe_combi_statistic *sondenkombi, BOOL &result, int depth) //initial muss result TRUE sein |
---|
5 | { |
---|
6 | int max_depth = mp_gl_awars.no_of_probes; |
---|
7 | |
---|
8 | if (depth == max_depth) |
---|
9 | { |
---|
10 | result = FALSE; |
---|
11 | return FALSE; |
---|
12 | } |
---|
13 | |
---|
14 | if (! next[sondenkombi->get_probe_combi(depth)->probe_index]) //sonde muss auf alle Faelle bis zuletzt eingetragen werden |
---|
15 | { |
---|
16 | if (depth == max_depth-1) |
---|
17 | { |
---|
18 | next[sondenkombi->get_probe_combi(depth)->probe_index] = new GenerationDuplicates(1); |
---|
19 | next_mism[sondenkombi->get_probe_combi(depth)->allowed_mismatches] = 1; |
---|
20 | return TRUE; |
---|
21 | } |
---|
22 | else |
---|
23 | { |
---|
24 | next[sondenkombi->get_probe_combi(depth)->probe_index] = new GenerationDuplicates(intern_size); |
---|
25 | next_mism[sondenkombi->get_probe_combi(depth)->allowed_mismatches] = 1; |
---|
26 | return next[sondenkombi->get_probe_combi(depth)->probe_index]->insert(sondenkombi, result, depth+1); |
---|
27 | } |
---|
28 | } |
---|
29 | |
---|
30 | result = result && next_mism[sondenkombi->get_probe_combi(depth)->allowed_mismatches]; |
---|
31 | next[sondenkombi->get_probe_combi(depth)->probe_index]->insert(sondenkombi, result, depth+1); //man kann erst ganz unten entscheiden, ob doppelt oder nicht |
---|
32 | return result; |
---|
33 | } |
---|
34 | |
---|
35 | GenerationDuplicates::GenerationDuplicates(int size) //size muss die Groesse des Sondenarrays in ProbeValuation enthalten |
---|
36 | { |
---|
37 | intern_size = size; |
---|
38 | next = new GenerationDuplicates*[size]; |
---|
39 | next_mism = new int[MAXMISMATCHES]; |
---|
40 | memset(next_mism, 0, MAXMISMATCHES * sizeof(int)); |
---|
41 | memset(next, 0, size * sizeof(GenerationDuplicates*)); |
---|
42 | } |
---|
43 | |
---|
44 | GenerationDuplicates::~GenerationDuplicates() |
---|
45 | { |
---|
46 | for (int i=0; i<intern_size; i++) |
---|
47 | delete next[i]; |
---|
48 | |
---|
49 | delete next_mism; |
---|
50 | delete next; |
---|
51 | } |
---|