ARB
|
#include <CT_part.hxx>
Public Member Functions | |
PART (const PartitionSize *size_info, double weight_) | |
~PART () | |
PART * | clone () const |
int | get_longs () const |
int | get_maxsize () const |
PELEM | get_cutmask () const |
void | set_origin (const TreeNode *node_) |
const TreeNode * | get_origin () const |
bool | is_valid () const |
void | setbit (int pos) |
bool | bit_is_set (int pos) const |
void | set_len (GBT_LEN length) |
GBT_LEN | get_len () const |
double | get_weight () const |
void | addWeightAndLength (const PART *other) |
void | takeMean (double overall_weight) |
void | set_faked_weight (double w) |
void | invert () |
void | invertInSuperset (const PART *superset) |
bool | is_standardized () const |
void | standardize () |
void | add_members_from (const PART *source) |
bool | is_subset_of (const PART *other) const |
bool | is_real_son_of (const PART *father) const |
bool | overlaps_with (const PART *other) const |
bool | disjunct_from (const PART *other) const |
bool | equals (const PART *other) const |
bool | differs (const PART *other) const |
int | index () const |
unsigned | key () const |
int | get_members () const |
int | get_nonmembers () const |
bool | is_leaf_edge () const |
int | distance_to_tree_center () const |
int | insertionOrder_cmp (const PART *other) const |
int | topological_cmp (const PART *other) const |
int | distanceTo (const PART *other, const PART *this_superset, const PART *other_superset) const |
Definition at line 62 of file CT_part.hxx.
|
inline |
Definition at line 103 of file CT_part.hxx.
References arb_assert, and is_valid().
|
inline |
Definition at line 114 of file CT_part.hxx.
|
inline |
Definition at line 118 of file CT_part.hxx.
Referenced by distanceTo(), insert_ntree(), and PartRegistry::put_part_from_partial_tree().
|
inline |
Definition at line 120 of file CT_part.hxx.
References PartitionSize::get_longs().
Referenced by add_members_from(), distanceTo(), equals(), index(), invert(), invertInSuperset(), is_subset_of(), is_valid(), key(), overlaps_with(), and topological_cmp().
|
inline |
Definition at line 121 of file CT_part.hxx.
References PartitionSize::get_bits().
Referenced by distance_to_tree_center(), get_nonmembers(), invert(), is_leaf_edge(), and is_valid().
|
inline |
Definition at line 122 of file CT_part.hxx.
References PartitionSize::get_cutmask().
Referenced by distanceTo(), invert(), invertInSuperset(), and is_valid().
|
inline |
Definition at line 124 of file CT_part.hxx.
References arb_assert.
Referenced by PartRegistry::put_part_from_complete_tree().
|
inline |
Definition at line 129 of file CT_part.hxx.
Referenced by PART_FWD::get_origin().
|
inline |
Definition at line 131 of file CT_part.hxx.
References get_cutmask(), get_longs(), and get_maxsize().
Referenced by add_members_from(), bit_is_set(), PartitionSize::create_root(), equals(), index(), insert_ntree(), invert(), invertInSuperset(), key(), overlaps_with(), PART(), set_len(), setbit(), standardize(), and takeMean().
|
inline |
set the bit at position 'pos'
Definition at line 141 of file CT_part.hxx.
References arb_assert, and is_valid().
|
inline |
return true if the bit at the position 'pos' is set
Definition at line 156 of file CT_part.hxx.
References arb_assert, and is_valid().
Referenced by is_standardized().
|
inline |
Definition at line 167 of file CT_part.hxx.
References arb_assert, and is_valid().
Referenced by insert_ntree().
|
inline |
Definition at line 171 of file CT_part.hxx.
Referenced by insert_ntree(), and insertionOrder_cmp().
|
inline |
Definition at line 179 of file CT_part.hxx.
Referenced by takeMean().
|
inline |
Definition at line 181 of file CT_part.hxx.
References NULp.
|
inline |
Definition at line 189 of file CT_part.hxx.
References arb_assert, get_weight(), and is_valid().
|
inline |
Definition at line 195 of file CT_part.hxx.
Referenced by PartRegistry::put_part_from_partial_tree().
void PART::invert | ( | ) |
invert a part
Definition at line 149 of file CT_part.cxx.
References arb_assert, get_cutmask(), get_longs(), get_maxsize(), and is_valid().
Referenced by PartitionSize::create_root(), distanceTo(), insert_ntree(), and standardize().
void PART::invertInSuperset | ( | const PART * | superset | ) |
Definition at line 168 of file CT_part.cxx.
References arb_assert, get_cutmask(), get_longs(), get_members(), is_subset_of(), and is_valid().
Referenced by PartRegistry::put_part_from_partial_tree().
bool PART::is_standardized | ( | ) | const |
true if PART is in standard representation.
Definition at line 280 of file CT_part.cxx.
References bit_is_set().
Referenced by standardize(), and topological_cmp().
void PART::standardize | ( | ) |
standardize the partition
Generally two PARTs are equivalent, if one is the inverted version of the other. A standardized PART is equal for equivalent PARTs, i.e. may be used as key (as done in PartRegistry)
Definition at line 292 of file CT_part.cxx.
References arb_assert, invert(), is_standardized(), and is_valid().
Referenced by PartRegistry::put_artificial_part(), and PartRegistry::put_part_from_complete_tree().
void PART::add_members_from | ( | const PART * | source | ) |
destination = source or destination
Definition at line 185 of file CT_part.cxx.
References arb_assert, disjunct_from(), get_longs(), and is_valid().
|
inline |
Definition at line 205 of file CT_part.hxx.
References get_longs().
Referenced by ins_ntree(), invertInSuperset(), and is_real_son_of().
|
inline |
Definition at line 214 of file CT_part.hxx.
References differs(), and is_subset_of().
Referenced by distanceTo(), and ins_ntree().
bool PART::overlaps_with | ( | const PART * | other | ) | const |
test if two parts overlap (i.e. share common bits)
Definition at line 135 of file CT_part.cxx.
References arb_assert, get_longs(), and is_valid().
Referenced by disjunct_from(), and ins_ntree().
|
inline |
Definition at line 217 of file CT_part.hxx.
References overlaps_with().
Referenced by add_members_from().
bool PART::equals | ( | const PART * | other | ) | const |
return true if p1 and p2 are equal
Definition at line 208 of file CT_part.cxx.
References arb_assert, get_longs(), and is_valid().
Referenced by DeconstructedTree::deconstruct_weighted(), differs(), ins_ntree(), and topological_cmp().
|
inline |
int PART::index | ( | ) | const |
calculate the first bit set in p,
this is only useful if only one bit is set, this is used to identify leafs in a ntree
ATTENTION: p has to exist
Definition at line 306 of file CT_part.cxx.
References arb_assert, get_longs(), is_leaf_edge(), and is_valid().
unsigned PART::key | ( | ) | const |
calculate a hashkey from part
Definition at line 222 of file CT_part.cxx.
References arb_assert, get_longs(), and is_valid().
|
inline |
Definition at line 225 of file CT_part.hxx.
Referenced by DeconstructedTree::deconstruct_weighted(), PART_FWD::get_members(), get_nonmembers(), invertInSuperset(), and PartRegistry::put_part_from_partial_tree().
|
inline |
Definition at line 226 of file CT_part.hxx.
References get_maxsize(), and get_members().
Referenced by PartRegistry::put_part_from_partial_tree().
|
inline |
Definition at line 228 of file CT_part.hxx.
References get_maxsize().
Referenced by index(), and insertionOrder_cmp().
|
inline |
Definition at line 229 of file CT_part.hxx.
References abs, and get_maxsize().
Referenced by Multiroot::distanceToCenterSum(), DeconstructedTree::find_innermost_part(), and insertionOrder_cmp().
Definition at line 332 of file CT_part.cxx.
References arb_assert, cmp, distance_to_tree_center(), double_cmp(), get_len(), and is_leaf_edge().
Referenced by insertionOrder_less().
Definition at line 365 of file CT_part.cxx.
References arb_assert, cmp, equals(), get_longs(), is_standardized(), and PELEM_cmp().
Referenced by topological_less().
int PART::distanceTo | ( | const PART * | other, |
const PART * | this_superset, | ||
const PART * | other_superset | ||
) | const |
calculate the distance between two PARTs. 'this' is the first part to compare
other | second PART to compare |
this_superset | whole tree (of which 'this' represents one edge) |
other_superset | whole tree (of which 'other' represents one edge) |
The distance D is calculated as follows: D = O + min(d1, d2) where O := number of species present in one superset only d1 := |union(t0, o0)| - |intersection(t0,o0)| + |union(ti, oi)| - |intersection(ti,oi)| d2 := |union(t0, oi)| - |intersection(t0,oi)| + |union(ti, o0)| - |intersection(ti,o0)| where t0 := 'this' ti := inverse of 'this' in this_superset o0 := 'other' oi := inverse of 'other' in this_superset
Definition at line 397 of file CT_part.cxx.
References arb_assert, bitcount(), clone(), DUMPINT, fputs(), get_cutmask(), get_longs(), invert(), is_real_son_of(), min, and arb_test::print().
Referenced by PART_FWD::calcDistance().