![]() |
Google OR-Tools v9.15
a fast and portable software suite for combinatorial optimization
|
Definition at line 87 of file rooted_tree.h.
#include <rooted_tree.h>
Public Member Functions | |
| RootedTree (NodeType root, std::vector< NodeType > parents) | |
| NodeType | root () const |
| NodeType | num_nodes () const |
| absl::Span< const NodeType > | parents () const |
| std::vector< NodeType > | PathToRoot (NodeType node) const |
| std::vector< NodeType > | PathFromRoot (NodeType node) const |
| double | DistanceToRoot (NodeType start, absl::Span< const double > arc_lengths) const |
| std::pair< double, std::vector< NodeType > > | DistanceAndPathToRoot (NodeType start, absl::Span< const double > arc_lengths) const |
| std::vector< NodeType > | Path (NodeType start, NodeType end, NodeType lca) const |
| double | Distance (NodeType start, NodeType end, NodeType lca, absl::Span< const double > arc_lengths) const |
| std::pair< double, std::vector< NodeType > > | DistanceAndPath (NodeType start, NodeType end, NodeType lca, absl::Span< const double > arc_lengths) const |
| double | DistanceOfPath (absl::Span< const NodeType > path, absl::Span< const double > arc_lengths) const |
| std::vector< NodeType > | TopologicalSort () const |
| template<typename T> | |
| std::vector< T > | AllDistancesToRoot (absl::Span< const T > arc_lengths) const |
| template<typename T> | |
| std::vector< T > | AllDistancesToRoot (absl::Span< const T > arc_lengths, absl::Span< const NodeType > topological_order) const |
| std::vector< NodeType > | AllDepths () const |
| std::vector< NodeType > | AllDepths (absl::Span< const NodeType > topological_order) const |
| NodeType | LowestCommonAncestorByDepth (NodeType n1, NodeType n2, absl::Span< const NodeType > depths) const |
| NodeType | LowestCommonAncestorBySearch (NodeType n1, NodeType n2, std::vector< bool > &visited_workspace) const |
| void | Evert (NodeType new_root) |
Static Public Member Functions | |
| static absl::StatusOr< RootedTree > | Create (NodeType root, std::vector< NodeType > parents, std::vector< NodeType > *error_cycle=nullptr, std::vector< NodeType > *topological_order=nullptr) |
Static Public Attributes | |
| static constexpr NodeType | kNullParent = static_cast<NodeType>(-1) |
|
inlineexplicit |
Definition at line 104 of file rooted_tree.h.
|
inline |
Definition at line 231 of file rooted_tree.h.
| std::vector< NodeType > operations_research::RootedTree< NodeType >::AllDepths | ( | absl::Span< const NodeType > | topological_order | ) | const |
Definition at line 720 of file rooted_tree.h.
| std::vector< T > operations_research::RootedTree< NodeType >::AllDistancesToRoot | ( | absl::Span< const T > | arc_lengths | ) | const |
Definition at line 730 of file rooted_tree.h.
| std::vector< T > operations_research::RootedTree< NodeType >::AllDistancesToRoot | ( | absl::Span< const T > | arc_lengths, |
| absl::Span< const NodeType > | topological_order ) const |
Definition at line 737 of file rooted_tree.h.
|
static |
Definition at line 465 of file rooted_tree.h.
| double operations_research::RootedTree< NodeType >::Distance | ( | NodeType | start, |
| NodeType | end, | ||
| NodeType | lca, | ||
| absl::Span< const double > | arc_lengths ) const |
Definition at line 570 of file rooted_tree.h.
| std::pair< double, std::vector< NodeType > > operations_research::RootedTree< NodeType >::DistanceAndPath | ( | NodeType | start, |
| NodeType | end, | ||
| NodeType | lca, | ||
| absl::Span< const double > | arc_lengths ) const |
Definition at line 578 of file rooted_tree.h.
| std::pair< double, std::vector< NodeType > > operations_research::RootedTree< NodeType >::DistanceAndPathToRoot | ( | NodeType | start, |
| absl::Span< const double > | arc_lengths ) const |
Definition at line 533 of file rooted_tree.h.
| double operations_research::RootedTree< NodeType >::DistanceOfPath | ( | absl::Span< const NodeType > | path, |
| absl::Span< const double > | arc_lengths ) const |
Definition at line 587 of file rooted_tree.h.
| double operations_research::RootedTree< NodeType >::DistanceToRoot | ( | NodeType | start, |
| absl::Span< const double > | arc_lengths ) const |
Definition at line 526 of file rooted_tree.h.
| void operations_research::RootedTree< NodeType >::Evert | ( | NodeType | new_root | ) |
Definition at line 688 of file rooted_tree.h.
| NodeType operations_research::RootedTree< NodeType >::LowestCommonAncestorByDepth | ( | NodeType | n1, |
| NodeType | n2, | ||
| absl::Span< const NodeType > | depths ) const |
Definition at line 606 of file rooted_tree.h.
| NodeType operations_research::RootedTree< NodeType >::LowestCommonAncestorBySearch | ( | NodeType | n1, |
| NodeType | n2, | ||
| std::vector< bool > & | visited_workspace ) const |
Definition at line 636 of file rooted_tree.h.
|
inline |
Definition at line 111 of file rooted_tree.h.
|
inline |
Definition at line 115 of file rooted_tree.h.
| std::vector< NodeType > operations_research::RootedTree< NodeType >::Path | ( | NodeType | start, |
| NodeType | end, | ||
| NodeType | lca ) const |
Definition at line 547 of file rooted_tree.h.
| std::vector< NodeType > operations_research::RootedTree< NodeType >::PathFromRoot | ( | NodeType | node | ) | const |
Definition at line 508 of file rooted_tree.h.
| std::vector< NodeType > operations_research::RootedTree< NodeType >::PathToRoot | ( | NodeType | node | ) | const |
Definition at line 497 of file rooted_tree.h.
|
inline |
Definition at line 108 of file rooted_tree.h.
| std::vector< NodeType > operations_research::RootedTree< NodeType >::TopologicalSort | ( | ) | const |
Definition at line 516 of file rooted_tree.h.
|
staticconstexpr |
Definition at line 89 of file rooted_tree.h.