ARB
Public Member Functions | List of all members
PART Class Reference

#include <CT_part.hxx>

Public Member Functions

 PART (const PartitionSize *size_info, double weight_)
 
 ~PART ()
 
PARTclone () const
 
int get_longs () const
 
int get_maxsize () const
 
PELEM get_cutmask () const
 
void set_origin (const TreeNode *node_)
 
const TreeNodeget_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
 

Detailed Description

Definition at line 62 of file CT_part.hxx.

Constructor & Destructor Documentation

PART::PART ( const PartitionSize size_info,
double  weight_ 
)
inline

Definition at line 103 of file CT_part.hxx.

References arb_assert, and is_valid().

PART::~PART ( )
inline

Definition at line 114 of file CT_part.hxx.

Member Function Documentation

PART* PART::clone ( ) const
inline

Definition at line 118 of file CT_part.hxx.

Referenced by distanceTo(), insert_ntree(), and PartRegistry::put_part_from_partial_tree().

int PART::get_longs ( ) const
inline
int PART::get_maxsize ( ) const
inline
PELEM PART::get_cutmask ( ) const
inline

Definition at line 122 of file CT_part.hxx.

References PartitionSize::get_cutmask().

Referenced by distanceTo(), invert(), invertInSuperset(), and is_valid().

void PART::set_origin ( const TreeNode node_)
inline

Definition at line 124 of file CT_part.hxx.

References arb_assert.

Referenced by PartRegistry::put_part_from_complete_tree().

const TreeNode* PART::get_origin ( ) const
inline

Definition at line 129 of file CT_part.hxx.

Referenced by PART_FWD::get_origin().

bool PART::is_valid ( ) const
inline
void PART::setbit ( int  pos)
inline

set the bit at position 'pos'

Definition at line 141 of file CT_part.hxx.

References arb_assert, and is_valid().

bool PART::bit_is_set ( int  pos) const
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().

void PART::set_len ( GBT_LEN  length)
inline

Definition at line 167 of file CT_part.hxx.

References arb_assert, and is_valid().

Referenced by insert_ntree().

GBT_LEN PART::get_len ( ) const
inline

Definition at line 171 of file CT_part.hxx.

Referenced by insert_ntree(), and insertionOrder_cmp().

double PART::get_weight ( ) const
inline

Definition at line 179 of file CT_part.hxx.

Referenced by takeMean().

void PART::addWeightAndLength ( const PART other)
inline

Definition at line 181 of file CT_part.hxx.

References NULp.

void PART::takeMean ( double  overall_weight)
inline

Definition at line 189 of file CT_part.hxx.

References arb_assert, get_weight(), and is_valid().

void PART::set_faked_weight ( double  w)
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)
bool PART::is_standardized ( ) const

true if PART is in standard representation.

See also
standardize()

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().

bool PART::is_subset_of ( const PART other) const
inline

Definition at line 205 of file CT_part.hxx.

References get_longs().

Referenced by ins_ntree(), invertInSuperset(), and is_real_son_of().

bool PART::is_real_son_of ( const PART father) const
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().

bool PART::disjunct_from ( const PART other) const
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().

bool PART::differs ( const PART other) const
inline

Definition at line 220 of file CT_part.hxx.

References equals().

Referenced by is_real_son_of().

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().

int PART::get_members ( ) const
inline
int PART::get_nonmembers ( ) const
inline

Definition at line 226 of file CT_part.hxx.

References get_maxsize(), and get_members().

Referenced by PartRegistry::put_part_from_partial_tree().

bool PART::is_leaf_edge ( ) const
inline

Definition at line 228 of file CT_part.hxx.

References get_maxsize().

Referenced by index(), and insertionOrder_cmp().

int PART::distance_to_tree_center ( ) const
inline
int PART::insertionOrder_cmp ( const PART other) const

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().

int PART::topological_cmp ( const PART other) const

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

Parameters
othersecond PART to compare
this_supersetwhole tree (of which 'this' represents one edge)
other_supersetwhole 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().


The documentation for this class was generated from the following files: