42 RatioLimits(
double lower,
double upper) : minRatio(lower), maxRatio(upper) {}
44 bool insideLimits(
double ratio)
const {
return minRatio <= ratio && ratio <= maxRatio; }
45 bool isValid()
const {
return minRatio>=0.0 && minRatio<=maxRatio && maxRatio<=1.0; }
52 double outgroup_ratio;
60 static double no_match_penalty() {
return LONG_MAX; }
62 #if defined(ASSERTION_USED)
63 bool isRatio(
double r)
const {
return r>=0.0 && r<=1.0; }
68 penalty(no_match_penalty()),
75 GroupPenalty(
double penalty_,
double ingroup_ratio_,
double outgroup_ratio_,
int unreg_groupsize) :
77 ingroup_ratio(ingroup_ratio_),
78 outgroup_ratio(outgroup_ratio_),
80 groupSize(unreg_groupsize),
88 bool doesMatch()
const {
return penalty != no_match_penalty(); }
124 double ingroupInvRelPen;
125 double outgroupRelPen;
127 bool insideLimits(
double ingroupRatio,
double outgroupRatio)
const {
132 GroupPenalty calcPenalty(
long removed,
long added,
long commonSpecies);
140 ingroupInvRelPen(0.0),
151 ingroup = ingroupLimits;
152 outgroup = outgroupLimits;
155 ingroupPep = ingroup_pep;
156 outgroupPep = outgroup_pep;
157 unfoundPep = unfound_pep;
160 ingroupInvRelPen = ingroup_inv_relpen;
161 outgroupRelPen = outgroup_relpen;
172 #error NT_tree_cmp.h included twice
173 #endif // NT_TREE_CMP_H
bool insideLimits(double ratio) const
double get_outgroup_ratio() const
double get_ingroup_ratio() const
void addPenalty(double p)
bool betterThan(const GroupPenalty &other) const
int get_groupsize() const
bool isPerfectMatch() const
static GroupPenalty NoMatch()
void registerUnfound(const GroupMatchScorer &scorer, const TSpecSet &tset)
void setPerErrorPenalties(double ingroup_pep, double outgroup_pep, double unfound_pep)
bool shouldHaveBeenKeeled() const
void setRelativePenalties(double ingroup_inv_relpen, double outgroup_relpen)
void setLimits(const RatioLimits &ingroupLimits, const RatioLimits &outgroupLimits)
GroupPenalty matchGroups(const TSpecSet &sourceSet, const RSpecSet &targetSet, long commonSpecies, long overallSpecies)
RatioLimits(double lower, double upper)
GroupPenalty(double penalty_, double ingroup_ratio_, double outgroup_ratio_, int unreg_groupsize)
GB_ERROR NTREE_move_tree_info(GBDATA *gb_main, const char *tree_source, const char *tree_dest, const char *log_file, GroupTransferMode mode, GroupsToTransfer what, const GroupMatchScorer &scorer, const char *aci)
double calcUnknownMembersPenalty(const TSpecSet &sourceSet) const
double get_penalty() const
GB_ERROR check_validity() const