19 #ifndef ARB_STRARRAY_H
22 #ifndef ARB_PROGRESS_H
28 #ifndef _GLIBCXX_VECTOR
31 #ifndef _GLIBCXX_STRING
63 get_leftson()->compute_tree();
64 get_rightson()->compute_tree();
65 leaf_count = get_leftson()->get_leaf_count()+get_rightson()->get_leaf_count();
80 explicit TreeInfo(
const char *Name_,
size_t specCount_)
85 const char *
name()
const {
return Name.c_str(); }
93 typedef std::map<std::string, size_t> OccurCount;
94 OccurCount species_occurred;
96 typedef std::vector<SizeAwareTree*> Trees;
98 std::vector<TreeInfo> tree_info;
102 for (
size_t i = 0; i<trees.size(); ++i) {
115 SizeAwareTree *t = trees[idx];
122 for (OccurCount::const_iterator
s = species_occurred.begin();
s != species_occurred.end(); ++
s) {
123 species_names.
put(
s->first.c_str());
129 int add(SizeAwareTree*&
tree,
const char *treename) {
134 tree->compute_tree();
136 trees.push_back(tree);
137 int added_at_idx = trees.size()-1;
142 for (
size_t n = 0; n<name_count; ++n) {
143 const char *name = names[n];
144 if (species_occurred.find(name) == species_occurred.end()) {
145 species_occurred[name] = 1;
148 species_occurred[name]++;
152 tree_info.push_back(
TreeInfo(treename, name_count));
205 double overall_weight;
210 void deconstruct_full_rootnode(
const TreeNode *tree,
const double& weight,
arb_progress *insertProgress);
211 void deconstruct_partial_rootnode(
const TreeNode *tree,
const double& weight,
const PART *partialTree,
arb_progress *insertProgress);
253 mutable std::vector<PART_Ptr> whole_tree_parts;
257 specSpace(specSpace_),
266 PART_Ptr& wt = whole_tree_parts[idx];
277 #error CT_common.hxx included twice
278 #endif // CT_COMMON_HXX
void compute_tree() OVERRIDE
const PART * peek_part(int idx) const
void put(const char *elem)
return string(buffer, length)
const char * name() const
const TreeNode * get_origin(const PART *part)
const SizeAwareTree * get_tree(int idx) const
#define DEFINE_TREE_RELATIVES_ACCESSORS(TreeType)
size_t get_species_count() const
int get_species_index(const char *name) const
const PART * find_innermost_part() const
size_t species_count() const
size_t get_tree_count() const
int add(SizeAwareTree *&tree, const char *treename)
void start_sorted_retrieval()
int get_members(const PART *part)
DeconstructedTree(const SpeciesSpace &specSpace_)
#define DOWNCAST(totype, expr)
int calcDistance(const PART *e1, const PART *e2, const PART *t1, const PART *t2)
static int weight[maxsites+1]
const TreeInfo & get_tree_info(int idx) const
SpeciesSpace(const CharPtrArray &names_)
const PART * find_part(const TreeNode *node) const
TreeNode * makeNode() const OVERRIDE
const CharPtrArray & get_names() const
__ATTR__USERESULT GB_ERROR deconstruct_weighted(const TreeNode *tree, const PART *wholeTree, int leafs, double weight, bool provideProgress, const PART *allSpecies, DeconstructionMode mode)
const PART * get_allSpecies() const
~SizeAwareTree() OVERRIDE
size_t get_part_count() const
SizeAwareTree * take_tree(int idx)
void destroyNode(TreeNode *node) const OVERRIDE
void get_species_names(ConstStrArray &species_names) const
bool represents_existing_edge(const PART *p)
const PART * get_tree_PART(int idx) const
bool valid_tree_index(int idx) const
#define __ATTR__USERESULT
GB_CSTR * GBT_get_names_of_species_in_tree(const TreeNode *tree, size_t *count)
PART * create_tree_PART(const TreeNode *tree, const double &weight) const
void destroy(TreeNode *that)
const PartitionSize * get_PartitionSize() const
TreeInfo(const char *Name_, size_t specCount_)
TreeParts(const SpeciesSpace &specSpace_, const TreeContainer &trees_)
const char * get_species_name(int idx) const
SizeAwareTree(TreeRoot *root)
void destroy_part(PART *part)
typedef SmartCustomPtr(PART, PART_FWD::destroy_part) PART_Ptr
unsigned get_leaf_count() const OVERRIDE
long GBS_read_hash(const GB_HASH *hs, const char *key)
GB_write_int const char s