17 #ifndef _GLIBCXX_VECTOR
43 #if defined(ASSERTION_USED)
44 bool is_valid()
const {
45 if (
size()<2)
return false;
46 for (
int i = 0; i<
size(); ++i) {
47 if (!node[i])
return false;
48 if (node[i]->is_root_node())
return false;
60 node(trees.get_tree_count(),
NULp),
61 distance(trees.get_tree_count())
63 for (
int i = 0; i<
size(); ++i) {
64 node[i] = trees.
get_tree(i)->get_leftson();
65 for (
int j = 0; j<i; ++j) {
66 distance.
set(i, j, UNKNOWN_DISTANCE);
73 distance(other.
size())
75 for (
int i = 0; i<
size(); ++i) {
76 for (
int j = 0; j<i; ++j) {
77 distance.
set(i, j, other.distance.
get(i, j));
88 if (idx<0 ||
size_t(idx)>=node.size()) {
105 std::vector<DeconstructedTreePtr> dtree;
107 GB_ERROR deconstructTree(
int treeIdx,
bool provideProgress);
109 bool has_deconstructed_tree(
int idx)
const {
118 int add(SizeAwareTree*&
tree,
const char *treename) {
125 dtree[idx].setNull();
132 return speciesSpacePtr.
isSet();
138 for (
int t = 0; t<treeCount; ++t)
if (!has_deconstructed_tree(t))
return false;
151 return *speciesSpacePtr;
165 return dtree[treeIdx]->find_part(sonOfEdge);
168 int calcEdgeDistance(
int i1,
const SizeAwareTree *n1,
int i2,
const SizeAwareTree *n2)
const;
177 #error SyncRoot.hxx included twice
178 #endif // SYNCROOT_HXX
const PART * get_edge_PART(int treeIdx, const SizeAwareTree *sonOfEdge) const
void beginDeconstructionPhase()
int distanceSum(const RootSynchronizer &rsync) const
static void find_best_matching_PART_in(int &best_dist, int &best_idx, const PART *part, const DeconstructedTree &in, const PART *tree_part, const PART *tree_in, bool provideProgress)
const SpeciesSpace & get_SpeciesSpace() const
const SizeAwareTree * get_tree(int idx) const
void set(size_t i, size_t j, T val)
bool deconstructionPhase() const
Multiroot(const Multiroot &other)
static void find_worst_matching_PART_in(int &worst_dist, int &worst_idx, const PART *part, const DeconstructedTree &in, const PART *tree_part, const PART *tree_in)
int calcEdgeDistance(int i1, const SizeAwareTree *n1, int i2, const SizeAwareTree *n2) const
ErrorOrSizeAwareTreePtr find_best_root_candidate(int inTree, int accordingToTree, int &best_dist, bool provideProgress)
ErrorOrMultirootPtr find_good_roots_for_trees(const int MAX_DEPTH, arb_progress *progress=NULp)
size_t get_tree_count() const
int add(SizeAwareTree *&tree, const char *treename)
int singleTreeDistanceSum(const RootSynchronizer &rsync, int idx)
const PART * get_tree_PART(int treeIdx) const
static HelixNrInfo * start
ErrorOrDeconstructedTreePtr get_DeconstructedTree(int treeIdx)
Multiroot(const TreeContainer &trees)
SmartPtr< DeconstructedTree > DeconstructedTreePtr
int distanceToCenterSum(const RootSynchronizer &rsync) const
int add(SizeAwareTree *&tree, const char *treename)
bool isSet() const
test if SmartPtr is not NULp
static void error(const char *msg)
GB_ERROR deconstruct_all_trees(bool provideProgress)
ErrorOr< MultirootPtr > ErrorOrMultirootPtr
SizeAwareTree * take_tree(int idx)
ErrorOr< ConstSizeAwareTreePtr > ErrorOrSizeAwareTreePtr
RefPtr< const SizeAwareTree > ConstSizeAwareTreePtr
MultirootPtr get_innermost_edges() const
ErrorOrMultirootPtr get_current_roots() const
RefPtr< const DeconstructedTree > ConstDeconstructedTreePtr
std::vector< ConstSizeAwareTreePtr > ConstSizeAwareTreeVector
const PART * get_tree_PART(int idx) const
bool valid_tree_index(int idx) const
bool allTreesDeconstructed() const
ErrorOr< ConstDeconstructedTreePtr > ErrorOrDeconstructedTreePtr
void replace_node(int idx, ConstSizeAwareTreePtr newNode)
int minDistanceSum() const
T get(size_t i, size_t j) const
SmartPtr< Multiroot > MultirootPtr
SizeAwareTree * take_tree(int idx)
static const int UNKNOWN_DISTANCE
ConstSizeAwareTreePtr get_node(int idx) const
int calcTreeDistance(int i1, int i2) const