Ultrametric Tree Structure

Functions

template<typename NodeType>
void set_parents(std::shared_ptr<NodeType> root)
template<typename NodeType>
void assign_node_sizes(std::shared_ptr<NodeType> root)
template<typename NodeType>
bool check_tree_validity(std::shared_ptr<NodeType> root)
struct UltrametricTreeNode : public std::enable_shared_from_this<UltrametricTreeNode>
#include <ultrametric_tree_structure.hpp>

Public Functions

inline UltrametricTreeNode(long long id, double cost, std::vector<std::shared_ptr<UltrametricTreeNode>> children = {})
std::string to_json()
bool from_json(std::string &json)
bool from_json(simdjson::dom::element root_elem)

Public Members

long long id
double cost
std::vector<std::shared_ptr<UltrametricTreeNode>> children
std::weak_ptr<UltrametricTreeNode> parent
unsigned long long size
struct UltrametricTree
#include <ultrametric_tree_structure.hpp>

Public Functions

UltrametricTree(std::shared_ptr<UltrametricTreeNode> root, UltrametricTreeType tree_type, const std::unordered_map<std::string, std::string> &config = {})
void move_childs_with_same_cost_as_parent()
void increase_parent_cost_if_too_small()
std::string to_json()
bool from_json(std::string &json)
bool from_json(simdjson::dom::element elem)

Public Members

std::shared_ptr<UltrametricTreeNode> root
UltrametricTreeType tree_type
std::unordered_map<std::string, std::string> config