ARB
Main Page
Namespaces
Classes
Files
File List
File Members
MULTI_PROBE
MP_GenerationDuplicates.cxx
Go to the documentation of this file.
1
// ============================================================= //
2
// //
3
// File : MP_GenerationDuplicates.cxx //
4
// Purpose : //
5
// //
6
// Institute of Microbiology (Technical University Munich) //
7
// http://www.arb-home.de/ //
8
// //
9
// ============================================================= //
10
11
#include "
MP_probe.hxx
"
12
#include "
MultiProbe.hxx
"
13
14
bool
GenerationDuplicates::insert
(
probe_combi_statistic
*sondenkombi,
bool
&
result
,
int
depth) {
// initial muss result true sein
15
int
max_depth =
mp_gl_awars
.
no_of_probes
;
16
17
if
(depth == max_depth) {
18
result =
false
;
19
return
false
;
20
}
21
22
if
(! next[sondenkombi->
get_probe_combi
(depth)->
probe_index
]) {
// sonde muss auf alle Faelle bis zuletzt eingetragen werden
23
if
(depth == max_depth-1) {
24
next[sondenkombi->
get_probe_combi
(depth)->
probe_index
] =
new
GenerationDuplicates
(1);
25
next_mism[sondenkombi->
get_probe_combi
(depth)->
allowed_mismatches
] = 1;
26
return
true
;
27
}
28
else
{
29
next[sondenkombi->
get_probe_combi
(depth)->
probe_index
] =
new
GenerationDuplicates
(intern_size);
30
next_mism[sondenkombi->
get_probe_combi
(depth)->
allowed_mismatches
] = 1;
31
return
next[sondenkombi->
get_probe_combi
(depth)->
probe_index
]->
insert
(sondenkombi, result, depth+1);
32
}
33
}
34
35
result = result && next_mism[sondenkombi->
get_probe_combi
(depth)->
allowed_mismatches
];
36
next[sondenkombi->
get_probe_combi
(depth)->
probe_index
]->
insert
(sondenkombi, result, depth+1);
// man kann erst ganz unten entscheiden, ob doppelt oder nicht
37
return
result
;
38
}
39
40
GenerationDuplicates::GenerationDuplicates
(
int
size) {
// size muss die Groesse des Sondenarrays in ProbeValuation enthalten
41
intern_size = size;
42
next =
new
GenerationDuplicates
*[size];
43
next_mism =
new
int
[
MAXMISMATCHES
];
44
memset(next_mism, 0,
MAXMISMATCHES
*
sizeof
(
int
));
45
memset(next, 0, size *
sizeof
(
GenerationDuplicates
*));
46
}
47
48
GenerationDuplicates::~GenerationDuplicates
() {
49
for
(
int
i=0; i<intern_size; i++)
50
delete
next[i];
51
52
delete
[] next_mism;
53
delete
next;
54
}
result
string result
Definition:
arb_help2xml.cxx:111
MP_probe.hxx
GenerationDuplicates
Definition:
MP_probe.hxx:187
probe::probe_index
int probe_index
Definition:
MP_probe.hxx:16
GenerationDuplicates::~GenerationDuplicates
~GenerationDuplicates()
Definition:
MP_GenerationDuplicates.cxx:48
probe::allowed_mismatches
int allowed_mismatches
Definition:
MP_probe.hxx:17
GenerationDuplicates::GenerationDuplicates
GenerationDuplicates(int size)
Definition:
MP_GenerationDuplicates.cxx:40
MultiProbe.hxx
GenerationDuplicates::insert
bool insert(probe_combi_statistic *sondenkombi, bool &result, int depth=0)
Definition:
MP_GenerationDuplicates.cxx:14
MAXMISMATCHES
#define MAXMISMATCHES
Definition:
MultiProbe.hxx:66
probe_combi_statistic::get_probe_combi
probe * get_probe_combi(int j)
Definition:
MP_probe.hxx:64
probe_combi_statistic
Definition:
MP_probe.hxx:45
awar_vars::no_of_probes
long no_of_probes
Definition:
MultiProbe.hxx:96
mp_gl_awars
awar_vars mp_gl_awars
Definition:
MP_main.cxx:23
Generated by
1.8.8