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
 
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
 

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 100 of file CT_part.hxx.

References arb_assert, and is_valid().

PART::~PART ( )
inline

Definition at line 110 of file CT_part.hxx.

Member Function Documentation

PART* PART::clone ( ) const
inline

Definition at line 114 of file CT_part.hxx.

Referenced by 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 118 of file CT_part.hxx.

References PartitionSize::get_cutmask().

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

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

set the bit at position 'pos'

Definition at line 130 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 145 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 156 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 160 of file CT_part.hxx.

Referenced by insert_ntree(), and insertionOrder_cmp().

double PART::get_weight ( ) const
inline

Definition at line 168 of file CT_part.hxx.

Referenced by takeMean().

void PART::addWeightAndLength ( const PART other)
inline

Definition at line 170 of file CT_part.hxx.

void PART::takeMean ( double  overall_weight)
inline

Definition at line 175 of file CT_part.hxx.

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

void PART::set_faked_weight ( double  w)
inline

Definition at line 181 of file CT_part.hxx.

Referenced by PartRegistry::put_part_from_partial_tree().

void PART::invert ( )

invert a part

Definition at line 150 of file CT_part.cxx.

References arb_assert, get_cutmask(), get_longs(), get_maxsize(), and is_valid().

Referenced by PartitionSize::create_root(), 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 253 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 265 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 186 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 191 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 200 of file CT_part.hxx.

References differs(), and is_subset_of().

Referenced by ins_ntree().

bool PART::overlaps_with ( const PART other) const

test if two parts overlap (i.e. share common bits)

Definition at line 136 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 203 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 209 of file CT_part.cxx.

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

Referenced by differs(), ins_ntree(), ConsensusTree::insert_tree_weighted(), and topological_cmp().

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

Definition at line 206 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 279 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 223 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 212 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 214 of file CT_part.hxx.

References get_maxsize().

Referenced by index(), and insertionOrder_cmp().

int PART::distance_to_tree_center ( ) const
inline

Definition at line 215 of file CT_part.hxx.

References abs, and get_maxsize().

Referenced by insertionOrder_cmp().

int PART::insertionOrder_cmp ( const PART other) const

Definition at line 305 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 338 of file CT_part.cxx.

References arb_assert, cmp, equals(), get_longs(), is_standardized(), and PELEM_cmp().

Referenced by topological_less().


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